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

sd_ble_gap_disconnect return 3002 error.

Hello, all.

I'm using nRF52833, pca10100.

I want to disconnect BLE manually when I press button. (my own device's touch pad)

My project is modified reffering to Multi-link Central example.

So this is my code,

void disconnect_scan()
{
    ret_code_t err_code;
    
    err_code = sd_ble_gap_disconnect(m_c_conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
    if (err_code != NRF_ERROR_INVALID_STATE)
    {
        APP_ERROR_CHECK(err_code);
    }

    NRF_LOG_INFO("Disconnect!!!!!!!!!!!!");
}

but why 3002 error return?

I checked the log,

[picture 1] is disconnected directly from the Bluetooth device. In other words, it is a good disconnect.

 [picture1]

[picture 2] is is when I disconnect by pressing the touch pad on my board.

[picture 2]

It seems that disconnect occurs many times. What is the problem? Thank you.

BR,

lyrics

Related