This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SD132 sd_ble_gap_disconnect - missing event

Dear Nordic, 

we are using s132_nrf52_3.0.0_softdevice.hex on nRF52832, nRF5_SDK_12.2.0_f012efa

We have noticed, that sometimes after issuing sd_ble_gap_disconnect(m_device_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION) we do not get disconnect event (BLE_GAP_EVT_DISCONNECTED). It is happening 1 out of 40 cases. What can we actually expect that will happen for sure/probably after this command?

We have designed our application, that it relates on that signal to be emitted (when in connection state), like clearing connection handles and so. And it usually happen, but as I wrote we documented cases when this fails. In both cases we get no error from the command. Our test case is to run continuous connections/disconnections in rounds for several hours.

Is this something that sounds familiar?

Our workaround is to wait limited time after and if the event won't happen, we will do the action manually. 

Thank you for any advice, Jan

Parents Reply
  • Dear Jan,

    There is no "clean" way to force an instant timeout or disconnect that I'm aware of. The specification requires the device to wait for the central to acknowledge the disconnect request. A system reset is probably the quickest way to force a disconnect. You could probably disable the Softdevice as well, but you would still need to re-initialize everything related to Softdevice and BLE again.

Children
Related