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

NRF_ERROR_INVALID_PARAMS with sd_ble_gap_data_length_update

I'm using nRF5_SDK_14.0.0_3bcc1f7 and SD132 v5.0.0. In response a DATA_LENGTH_UPDATE_REQUEST event, I'm calling sd_ble_gap_data_length_update as follows:

ble_gap_data_length_params_t response = {
    .max_tx_octets = 73,
    .max_rx_octets = 73,
    .max_tx_time_us = BLE_GAP_DATA_LENGTH_AUTO,
    .max_rx_time_us = BLE_GAP_DATA_LENGTH_AUTO
};
ble_gap_data_length_limitation_t lims;
uint32_t err
    = sd_ble_gap_data_length_update(m_conn_handle, &response, &lims);

and getting NRF_ERROR_INVALID_PARAMS. I'm not entirely sure what's invalid about this request, since i'm specifying auto for the time fields and 73 is lower than 251.

Edit: This also occurs if I specify both octets fields with BLE_GAP_DATA_LENGTH_AUTO. The only way I can call this function and get NRF_SUCCESS in response is with NULL as the p_dl_params parameter.

Related