now I want to transfer some data between PC and the client of mesh,I have read this case and try to add the light switch client example to the uart example.but I don't know how to exchange the codes of main.c.Can you tell me how to do it?
now I want to transfer some data between PC and the client of mesh,I have read this case and try to add the light switch client example to the uart example.but I don't know how to exchange the codes of main.c.Can you tell me how to do it?
You can also take a look at this infocenter link. In the link you provided, there is a zip file with the whole example code. I would suggest to download it & see how the main.c code is implemented.
Hi Bjorn,
I have solved it and I can build the program successfully if I remove three NRF_MODULE_ENABLED functions.
They are
1://#if NRF_MODULE_ENABLED(UART)
//#endif //NRF_MODULE_ENABLED(UART)
2://#if NRF_MODULE_ENABLED(APP_FIFO)
//#endif //NRF_MODULE_ENABLED(APP_FIFO)
3://#if NRF_MODULE_ENABLED(APP_UART)
//#endif //NRF_MODULE_ENABLED(APP_UART)
If I don't remove them I can't use the functions defined in them ( the codes are gray between the #if and #endif ). I tried it when I just use the demo of peripheral uart in sdk v14.2 and the program worked successfully.
After built it successfully , I can see the nrf_log doesn't work and the program stopped in ERROR_CHECK(sd_softdevice_enable(&lfc_cfg, softdevice_assert_handler));.
The mesh is not work.
Hi Bjorn,
I have solved it and I can build the program successfully if I remove three NRF_MODULE_ENABLED functions.
They are
1://#if NRF_MODULE_ENABLED(UART)
//#endif //NRF_MODULE_ENABLED(UART)
2://#if NRF_MODULE_ENABLED(APP_FIFO)
//#endif //NRF_MODULE_ENABLED(APP_FIFO)
3://#if NRF_MODULE_ENABLED(APP_UART)
//#endif //NRF_MODULE_ENABLED(APP_UART)
If I don't remove them I can't use the functions defined in them ( the codes are gray between the #if and #endif ). I tried it when I just use the demo of peripheral uart in sdk v14.2 and the program worked successfully.
After built it successfully , I can see the nrf_log doesn't work and the program stopped in ERROR_CHECK(sd_softdevice_enable(&lfc_cfg, softdevice_assert_handler));.
The mesh is not work.
The code is gray because the UART, APP_FIFO & APP_UART are not enabled in NRF_MODULE__ENABLED. You will have to enable these to stop the conditional preprocessor macros from being gray. It seems that the mesh does not work because the softdevice has not been enabled. I think you need to enable the modules first & then take it from there.
Yes you are right. But how to enable the softdevice and UART etc,I can't find the codes to enable them .
Go to sdk_config.h configuration wizard, open the nRF_Libraries tab & make sure APP_FIFO_ENABLED is true, APP_UART_ENABLED is true, etc. Then recompile & the conditional preprocessor macros should not be grey anymore.
I've solved it , thank you.
can u write a blog , how u did it?