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

softreset after call sd_ble_gap_disconnect()

Hi support team,

In my case, i want to auto disconnect to ble central after some minutes with no message transfered, so i create an timmer and set event compare and clear timmer insite event nus_data_handler(). It's working, but my device was reset after execute function sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION). I use NRF connect tool to check connection handle and i got reason BLE_HCI_CONNECTION_TIMEOUT (maybe my device was disconnected but it not send any message to ble central so that after 4s event timeout triggered). Could you show me how to safety disconnect to ble central.
Thanks.

Parents
  • For more detail, i have funcion app_error_fault_handler(), i set breakpoint there and call APP_ERROR_CHECK(err_code) to know NRF_ERROR. Because i have only one m_conn_handle and it handle in orther function so i'm sure it's a valid. In addition i set m_conn_handle = BLE_CONN_HANDLE_INVALID before call sd_ble_gap_disconnect() but it not working. when debuger run into event timmer_compare (as I described above) my device was reset exactly when call sd_ble_gap_disconnect() with no err_code response (it's not run out of function disconnect) 

  • Hi,

    I see. It could be that the SoftDevice asserted for some reason, though that may be a long shot, and in that case, you should hit the breakpoint you set in the app_error_fault_handler(). I have no other suggestions then to dig deeper into this with a debugger. If you get stuck, I can also try this on my side it if you can upload a piece of code that reproduces the issue on a DK?

Reply Children
Related