I need to implement 2 functions for externally controlled GPIO (P0_6):
1) advertise ONLY once when P0_6 is asserted high
2) stop advertising when P0_6 is deasserted low
Could you please provide some sample codes for these 2 functions.
Device:
Hi sandeep,
You can have a look at the smart tag reference design in the functions app_button_press_cb and app_button_release_cb. The reference design uses the button interrupts (different polarity each time) in order to wake up, if sleeping, and start advertising. Also if you dont want to use interrupts you can poll the status of the pin with the GPIO_GetPinStatus() function in the app_on_ble_powered callback for example and send either to start or stopadvertising,but in case you use sleep you have to periodically wake up and poll the status of the pin.
Thanks MT_dialog