Hi,
I'm having trouble with the BLE_GAP_EVT_DISCONNECTED event. I have an nRF 52832 running the SDK 15.2 as peripheral and have tried several devices as centrals (not simultaneously): W10 PC with BLE 4.0 dongle, android phone with BLE 4.x running nRF connect, DK 52840 running from a W10 PC with nRF connect and a W10 laptop with native BLE 5.0. What I've found is that if I attempt to disconnect from the peripheral nRF running the following code
for ( uint32_t i = 0; i < handle_list.len; ++i ) { ( void ) sd_ble_gap_disconnect( handle_list.conn_handles[i], BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION ); }
most of the time, the event BLE_GAP_EVT_DISCONNECTED comes about very fast, like 100-400 ms. But some times, it takes much more time, around 10s. It's almost exactly 10s, which makes me think that it's probably a timeout and the nRF never got the confirmation of the disconnection from the central device. This behavior only happens with the W10 laptop that has native BLE 5.0. All other devices seem to disconnect right away.
This behavior causes all sorts of problems for the peripheral device, because it has to notify to other uCs that the disconnection occurred and 10s is way too long. The other uCs have already assumed an error has occurred. I'm kind of at a loss here, I'm not sure where to start looking for the problem. Any ideas?
Thanks
Federico