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

when I use sd_ble_gap_disconnect() in button evt handle it appear error_code 0x3002

app_error_handler, L:188] error_code=0x3002

So how can I avoid this error?

I just want to disconnect from peripheral device

Parents
  • 0x3002 is BLE_ERROR_INVALID_CONN_HANDLE.

    As for my code, first init m_conn_handle was in device_manager_evt_handler DM_EVT_CONNECTION as:

    m_conn_handle = p_event->event_param.p_gap_param->conn_handle;

    but in next event DM_EVT_DEVICE_CONTEXT_STORED, p_event->event_param.p_gap_param->conn_handle stay another, and this another handler was a parameter in sd_ble_gap_disconnect.

    I do not know, why conn_handler is changed, but when I remove this string from event DM_EVT_DEVICE_CONTEXT_STORED, function sd_ble_gap_disconnect return OK.

Reply
  • 0x3002 is BLE_ERROR_INVALID_CONN_HANDLE.

    As for my code, first init m_conn_handle was in device_manager_evt_handler DM_EVT_CONNECTION as:

    m_conn_handle = p_event->event_param.p_gap_param->conn_handle;

    but in next event DM_EVT_DEVICE_CONTEXT_STORED, p_event->event_param.p_gap_param->conn_handle stay another, and this another handler was a parameter in sd_ble_gap_disconnect.

    I do not know, why conn_handler is changed, but when I remove this string from event DM_EVT_DEVICE_CONTEXT_STORED, function sd_ble_gap_disconnect return OK.

Children
No Data
Related