I want to make application for BLE peripheral with advertising interval at 1second. WHich Power management APIs I need to use for this? Is there any documentation for how to use in nRF52840?
I want to make application for BLE peripheral with advertising interval at 1second. WHich Power management APIs I need to use for this? Is there any documentation for how to use in nRF52840?
Are you asking how to set the advertising interval to 1 second?
If so, then you need to set your APP_ADV_INTERVAL to 1600 (in main.c).
This is because advertising interval is given in units of 0.625ms. 1600*0.625ms = 1000ms = 1 second.
Best regards,
Edvin
Hello Edvin,
The information I am looking for is how to put the BLE in power save mode. I know how to configure advertise interval, but the information I want is which function I need to use to put BLE in power save mode.
Is there any user guide or API list to put a module in low power in BLE advertising as well as after connection with BLE master. Here BLE master I am gonna use is android phone.
Any help on this will be helpful.
Thanks
Keyur
Hello Keyur,
All of the examples in the SDK use low power mode. If you look at e.g. ble_app_uart, there is a call to: idle_state_handle() in the main-loop. They may be called a bit different things in the different examples, but in the end, all the BLE examples eventually call sd_app_evt_wait(), which allows the device to go to sleep, and save power until the next BLE event.
This is called even if you are in a connection or advertising. The softdevice will wake up the nRF the next time it needs to use the radio.
Best regards,
Edvin
Hello Keyur,
All of the examples in the SDK use low power mode. If you look at e.g. ble_app_uart, there is a call to: idle_state_handle() in the main-loop. They may be called a bit different things in the different examples, but in the end, all the BLE examples eventually call sd_app_evt_wait(), which allows the device to go to sleep, and save power until the next BLE event.
This is called even if you are in a connection or advertising. The softdevice will wake up the nRF the next time it needs to use the radio.
Best regards,
Edvin
Hello Edwin,
On this reply, I have some more questions, If softdevice goes in sleep mode,
1. How BLE will advertise?
2. Does my mobile phone able to detect the BLE device?
3. When softdevice will wake up the module?
Thanks
Keyur
I suggest that you take a look at one of our tutorials. I can recommend:
and BLE Characteristics.
Also, you should look into our SDK examples. You can find the SDK here.
Hello Edwin,
I know how module will advertise in normal mode, But I want to know is how module will advertise in Sleep mode and when soft device is wake up when it is only advertising?
Thanks
Keyur
Keyur said:But I want to know is how module will advertise in Sleep mode and when soft device is wake up when it is only advertising?
Yes it will wake up, and then go back to sleep again, as long as you use sd_app_evt_wait() in your main loop.