I am working on an nRF52-based BLE peripheral (beacon) using the Nordic SDK. I want to implement functionality where the advertising interval can be updated dynamically from a central (mobile) app.
The beacon operates in two modes:
-
Non-connectable advertising (default)
-
Connectable advertising (activated by a button press)
My goal is to:
-
Allow the central app to send a new advertising interval value to the beacon.
-
Store the new interval in flash so it persists across reboots.
-
Apply the updated interval to both advertising modes (connectable and non-connectable).
-
Automatically switch back to non-connectable mode 5 seconds after a disconnect from central (mobile) app.
Questions:
-
What is the recommended approach to change the advertising interval dynamically from the central app?
-
How can I make sure the updated interval is applied to both advertising modes (connectable and non-connectable)?
-
Are there any limitations in applying different advertising intervals to connectable vs non-connectable advertising in the SDK?
-
Can I safely restart advertising with the new advertising interval without affecting ongoing BLE operations?
Any code examples or references to SDK functions would be greatly appreciated.