Dear Nordic expert,
I'm using nRF52840 as central with SDK 16.0.0.
I establish a connection with a peripheral (phone) and then I need to drop the connection. I set a timer to drop the connection after a certain time.Once I call sd_ble_gap_disconnect, it returns success but I never receive the disconnect event and the CPU gets frozen with absolutely no report.
Here's my code. It actually prints out NRF_LOG_INFO("disconnect") and then gets frozen. I'd appreciate any help.
static void Disconnect_Timer_handler(void * p_context)
{
ret_code_t err_code;
if (mylist[new_id].conn_handle != BLE_CONN_HANDLE_INVALID)
{
err_code = sd_ble_gap_disconnect(mylist[new_id].conn_handle,
BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
APP_ERROR_CHECK(err_code);
}
pairing_in_progress = 0;
pairing_status = PAIRING_IDLE;
NRF_LOG_INFO("disconnect");
}
Thanks