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

Cannot disconnect the device once it is connected

Hello guys,

I have problem, I activate the BLE and connect it to my tablet application until then nothing wrong happens. But when I use sd_ble_gap_disconnect() to disconnect, I got error_code 0x3002 which prevent me to disconnect.

what I do to disconnect:

check = softdevice_handler_isEnabled();
if (check == true && m_conn_handle != BLE_CONN_HANDLE_INVALID)
{
	u32_err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
	m_conn_handle = BLE_CONN_HANDLE_INVALID;
    APP_ERROR_CHECK(u32_err_code); //err_code returned before check 0x3002
}
u32_err_code = sd_ble_gap_adv_stop();
APP_ERROR_CHECK(u32_err_code);  //err_code returned before check 0x0008

I use nrf52832, s132 softdevice with uart. I want to be disconnected and stop advertising, can any one please let me know how to correct this.

Thanks in advance for your time!

PS: The device is a peripheral one

Parents Reply Children
No Data
Related