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

Why am I get BLE_CONN_PARAMS_EVT_FAILED event?

static void on_conn_params_evt(ble_conn_params_evt_t * p_evt) { uint32_t err_code;

if(p_evt->evt_type == BLE_CONN_PARAMS_EVT_FAILED)
{
    err_code = sd_ble_gap_disconnect(m_conn_handle,     BLE_HCI_CONN_INTERVAL_UNACCEPTABLE);
}
	APP_ERROR_CHECK(err_code);

}

Hi,

When I use notify every 3 seconds to send 8bytes data to phone(Like heart rate service). About 10 minutes,I will get a "on_conn_params_evt" ,event type is BLE_CONN_PARAMS_EVT_FAILED

I have two questions

  1. Why am I receive this event?

  2. When I get this event, it will do "sd_ble_gap_disconnect" function and error_code is not successful,then device will reset because APP_ERROR_CHECK function. Why error_code is not successful?

Thank you.

Elliot.

  • Hello Elliot,

    1. You get BLE_CONN_PARAMS_EVT_FAILED because the phone is not accepting the connection parameters requested by your nRF51822 application. You may choose to keep the connection alive even though you received this event. The side effect of that could be a battery drain in your nRF51822 if the phone is using very short connection interval.

    2. Is it possible for you to provide the error code returned by the sd_ble_gap_disconnect API? Please note that this API can return 3 error codes (as mentioned in the API documentation) as follows.

    [i] - NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.

    • BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
    • NRF_ERROR_INVALID_STATE Invalid state to perform operation (disconnection is already in progress or not connected at all).[/i]

    Cheers, Balaji

  • Hi,Balaji

    I print error message from my app_error_handler function. error_code = (20002530) line_num = (8d) p_file_name = (..\ble_f.c)

    The error code number is 0x20002530, what is mean?

    Thank you.

  • Hi Elliot,

    This does not look like an error raised by SDK or the SoftDevice. The file ble_f.c is neither part of SDK nor the SoftDevice. Also the error code 0x20002530 does not look like an error that the SDK or the SoftDevice would return. Is my understanding correct that ble_f.c is part of the module you (or someone in your company) have written? In that case, I request you to take at look at line number 141 (hex 0x8d) of that file to see why it is returning an error.

    Cheers, Balaji

  • ok,I fixed this issue. Because I make a big mistake and I don't set a error to a initial value, so error_code is not 0. Then device will reset.

    Thank you.

Related