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

How do I achieve maximum data length?

Is achieving a data length of 251 possible in SDK 14.0.0, SoftDevicve S132 5.0.0 ? I tried updating my GATT table to 6000 bytes and my NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 251, but I get the following errors: 

<debug> ble_gatt: Requesting to update ATT MTU to 251 bytes on connection 0x0.
<debug> ble_gatt: Requesting to update data length to 255 on connection 0x0.
<error> ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned unexpected value 0x7.
<info> app: Reset challenge status on conn_handle 0x0
<info> app: Connected
<info> app: connection interval: min 15, max: 15
<debug> ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
<info> app: ATT MTU exchange completed. MTU set to 185 bytes.
<info> app: Data length is 185 bytes.
<debug> ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
<debug> ble_gatt: Updating data length to 251 bytes on connection 0x0.
<error> ble_gatt: p_dl_limitation: 101, 101, 1612
<error> ble_gatt: sd_ble_gap_data_length_update() (reply) returned unexpected value 0x13.
<info> app: Slow advertising.
<info> app: stop_motion_updates
<info> app: Disconnected

  • In the request of sd_ble_gap_data_length_update it seems that something is wrong with the parameters as 0x7 is NRF_ERROR_INVALID_PARAM. Also 

     

    <error> ble_gatt: sd_ble_gap_data_length_update() (reply) returned unexpected value 0x13.

    This is explained in the documentation of the API

    * @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the requested parameters.Use @ref sd_ble_cfg_set with @ref BLE_CONN_CFG_GAP to increase the connection event length. Inspect p_dl_limitation to see where the limitation is.

Related