I want to advertise only when GPIO pin is High. It should not Advertise when GPIO pin is Low.
I want to advertise only when GPIO pin is High. It should not Advertise when GPIO pin is Low.
You can do this by triggering an interrupt on a pin change, and call sd_ble_gap_adv_start()
or sd_ble_gap_adv_stop()
as appropriate in the interrupt handler.
You could probably make a simple demonstration by basing your code on for example the Beacon Transmitter Sample Application and looking at the Pin Change Interrupt Example.
On sd_ble_gap_adv_stop() device is getting restart. Following steps i am doing
If the device is getting reset, it is likely due to an error that is caught by a APP_ERROR_CHECK()
. If DEBUG
is not defined for your project, the default error handler will trigger a reset. If you define DEBUG
for your project and disable optimization, you can use a debugger to see where the error occurred and with what error code. This blog post describes the process in detail.