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

Delete a single central from the bonded centrals database

Hi, I would like to delete a single bonded central from the bonded centrals database.

I'm looking at the documentation for the function

ble_bondmngr_bonded_central_delete ( uint16_t central_id )

and think that I should get the parameter central_id by calling the function

ble_bondmngr_central_ids_get ( uint16_t * p_central_ids, uint16_t * p_length )

and then find the right central_id inside the central_ids array.

My question is, how can I make an association, at application level, between the values in the central_ids array and the connected centrals? In other words, how can I retrieve the current bonded central id when a central is pairing to my peripheral?

Hope to have explained the problem...

Thanks for any suggestion.

Samuele.

Parents
  • Hi Samuele,

    The central id is provided by the bond manager whenever it raises an event. (See central_id inside the ble_bondmngr_evt_t structure.) Whenever the application receives an event from the bond manager, (eg. BLE_BONDMNGR_EVT_NEW_BOND or BLE_BONDMNGR_EVT_CONN_TO_BONDED_CENTRAL.. ), the app can extract the central_id from the bond manager event. That way the app will know the ID of the currently bonded central.

    Hope this explains.

    Cheers, Balaji

Reply
  • Hi Samuele,

    The central id is provided by the bond manager whenever it raises an event. (See central_id inside the ble_bondmngr_evt_t structure.) Whenever the application receives an event from the bond manager, (eg. BLE_BONDMNGR_EVT_NEW_BOND or BLE_BONDMNGR_EVT_CONN_TO_BONDED_CENTRAL.. ), the app can extract the central_id from the bond manager event. That way the app will know the ID of the currently bonded central.

    Hope this explains.

    Cheers, Balaji

Children
No Data
Related