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

<error> ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned unexpected value 0x13.

Working on migrating my application from sdk 12.2 to sdk 14 except for some flash issues most of it seems to be working as before, except I notice this message in jlink:

 0> <info> app: Connected
 0> <error> ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned unexpected value 0x13.
 0> <info> app: Data len is set to 0x3D(61)

what does this mean?

Edit: using the BLE NUS peripheral example

It seems it comes from this function in #75 nrf_ble_gatt.c:

/**@brief   Start a data length update request.
 * @details This function is called to request a data length update upon connection.
 *          When the peer requests a data length update, sd_ble_gap_data_length_update()
 *          is called directly in response to the BLE_GAP_EVT_DATA_LENGTH_UPDATE event in
 *          on_data_length_update_evt().
 */
static void data_length_update(uint16_t conn_handle, nrf_ble_gatt_t const * p_gatt)
{
    NRF_LOG_DEBUG("Requesting to update data length to %u on connection 0x%x.",
                  p_gatt->links[conn_handle].data_length_desired, conn_handle);

    ble_gap_data_length_params_t const dlp =
    {
        .max_rx_octets  = p_gatt->links[conn_handle].data_length_desired,
        .max_tx_octets  = p_gatt->links[conn_handle].data_length_desired,
        .max_rx_time_us = BLE_GAP_DATA_LENGTH_AUTO,
        .max_tx_time_us = BLE_GAP_DATA_LENGTH_AUTO,
    };

    ret_code_t err_code = sd_ble_gap_data_length_update(conn_handle, &dlp, NULL);
    if (err_code != NRF_SUCCESS)
    {
        NRF_LOG_ERROR("sd_ble_gap_data_length_update() (request)"
                      " on connection 0x%x returned unexpected value 0x%x.",
                      conn_handle, err_code);
    }
}
Related