I have an NRF51 board running as a GATT server. Using an iOS application (LightBlue) I connect to the NRF51. If I quit the iOS application then I get a disconnect event and the NRF51 starts to automatically begin advertising again. I do not want the NRF51 to begin advertising again after a disconnection--I intend to put my system to sleep after displaying a little shutdown LED animation. I don't want someone connecting while I am doing this shutdown.
I think I have a workaround where I call sd_ble_gap_adv_stop() in my advertising event handler if the system is shutting down, but is there a way to prevent it from trying to automatically advertising after being disconnected?