Is race condition possible when stopping advertising?
I need to disable BLE for some time to perform critical tasks. I need to stop advertising and be disconnected.
Let's consider simple code snippet that runs with the lowest priority:
if (m_conn_handle == BLE_CONN_HANDLE_INVALID) { sd_ble_gap_adv_stop(); }
Is it possible that after checking connection handle and before stopping advertising some device might connect to my device and in the end I will be in connection while performing critical tasks?