Dear sir/madame
Start & stop of advertising and how to prevent automatically restart of advertising in case of a random disconnection or disconnection initiated from the application.
Setup:
One peripheral unit (nRF52840) and one central unit (nRF52840), SDK 17.02.1 and Softdevice 7.2.0
Starting point of our central and peripheral app was the example ble_app_uart (peripheral and central) where we have stripped it down to a NUS service only app. This one is tested and used as foundation of our apps.
Most of our functionalities are added and verified but there is one feature I’m struggling with and that is automatically restart of advertising.
Have used hour on reading this forum but not been able to figure out how to, even there is tons of post regarding automatically restart of advertising.
There are situations when we get a disconnect by some reason and that we want to restart advertising with a different DEVICE_NAME.
I have a working function that stop advertising, set a new DEVICE_NAME, and reinitiate advertising, but in some situations the advertising is not restarted automatically by some reason at disconnect, hence my function for re-initiate advertising will end in an fatal error since I’m sending stop advertising (sd_ble_gap_adv_stop(m_advertising.adv_handle).
So, my question is: How can I completely stop automatically restart of advertising or ensure that SD sends an event if advertising is not automatically restarted?
Kind regards
Svein