data_length_update error in pc-ble-driver-py

Hi,

I have met an error which occurs in:

self.adapter.data_length_update(new_conn, 251)

The error code is as followed:

pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gap_data_length_update. Error code: NRF_ERROR_RESOURCES

Has anyone experienced similar problems?

  • Hi,

    You will get NRF_ERROR_RESOURCES returned from the call to sd_ble_gap_data_length_update() if the connection event length is not long enough. So you must increase the event length first. See API doc snippet for sd_ble_gap_data_length_update():

     * @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.

    pc-ble-driver-py example snippet:

                gap_cfg = BLEConfigConnGap()
                gap_cfg.conn_count = 1
                gap_cfg.event_length = 5
    
                self.adapter.driver.ble_cfg_set(BLEConfig.conn_gap, gap_cfg)

Related