I would like to be able to manually disconnect from a device and then begin advertising.
However, I have discovered that on disconnect, ble_advertising_on_ble_evt handler restarts the (direct) advertising process to reconnect to a previously started device (assuming due to loss of connection). This leads to my start advertising call to return a INVALID_STATE error (already advertising).
Now, if I am intentionally disconnecting with the HCI code BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION or BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION then surely ble_advertising_on_ble_evt should check for this, see that the disconnect was intentional and that no reconnect is needed and, therefore, not start direct advertising? This would allow me to start my own advertising at will.
Currently, I'm having to stop this advertising (if I initiated disconnect) and start my own.