It seems to be a straightforward BLE app but I cannot make it work.
I start fresh from the “ble_app_template” in nRF51 SDK 8.0.0, and try to add two service data (battery level and temperature) in advertising packet. I make those following changes
- Change the clock source to the internal RC oscillator
- Add two custom functions “battery_level_get()” and “temperature_data_get()”. I can confirm those two functions work in my other BLE beacon app.
- Modify the advertising packet in “advertising_init()” to include battery level and temperature information.
However, it is not quite working. If I just add one service data (battery level), things are fine. If I add two service data (battery level and temperature), the code can compile but I cannot see the BLE device advertising from my BLE client (Nordic Master Control Panel).
The main.c is attached here main.c. What do I miss?