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

NRF_ERROR_DATA_SIZE on disconnect

Hello all,

I am getting an error when my device disconnects from the client. The error occurs while bond storage due to data limit exceeds.

err_code = ble_bondmngr_bonded_centrals_store();
APP_ERROR_CHECK(err_code);<br/>

Does anyone has any Idea how bond storage works? I didn't find any details in nrf51 SDK doc. How can I limit bonded-centrals data so that my device remains in bonded state?

Parents
  • As you say; this is an error indicating that the bond manager has exceeded its storage space.

    Proposed way to handle this in your application:

    First set BLE_BONDMNGR_MAX_BONDED_CENTRALS to one higher than they plan to support in their application (eg: set to 3 if you plan to support 2 bonds).

    Then on every disconnect and power on reset use ble_bondmngr_central_ids_get() to count the number of bonded masters in the list.

    If the count equal BLE_BONDMNGR_MAX_BONDED_CENTRALS, then they should use ble_bondmngr_bonded_central_delete() to delete the first entry in the list, which always will be the oldest bond.

    Afterwards do ble_bondmngr_init() to re-init the RAM database.

Reply
  • As you say; this is an error indicating that the bond manager has exceeded its storage space.

    Proposed way to handle this in your application:

    First set BLE_BONDMNGR_MAX_BONDED_CENTRALS to one higher than they plan to support in their application (eg: set to 3 if you plan to support 2 bonds).

    Then on every disconnect and power on reset use ble_bondmngr_central_ids_get() to count the number of bonded masters in the list.

    If the count equal BLE_BONDMNGR_MAX_BONDED_CENTRALS, then they should use ble_bondmngr_bonded_central_delete() to delete the first entry in the list, which always will be the oldest bond.

    Afterwards do ble_bondmngr_init() to re-init the RAM database.

Children
No Data
Related