Skip to main content
DS.4
Senior
June 20, 2024
Question

How to read the active bond list entry from stack?

  • June 20, 2024
  • 5 replies
  • 1506 views

I need to add a method to the on pairing event  that will return the active bond list entry.

 

In case of rebond -> the correct entry that is used ( not the last )

 

Thanks

This topic has been closed for replies.

5 replies

EPASZ.1
ST Employee
June 21, 2024

You can check the bonding table using the command like this (replace the [2] with the maximum number of entries you have the memory configured for / expect to get):

uint8_t Num_of_Addresses;
Bonded_Device_Entry_t Bonded_Device_Entry[2];
tBleStatus ret = aci_gap_get_bonded_devices(&Num_of_Addresses, &Bonded_Device_Entry);

I'm not 100% sure what you mean by 'active entry' - the stack does not handle deletion of entries by itself and so all the entries are valid until you delete them. The stack only overwrites older entries when it runs out of the allocated memory.

When rebonding, the entry should still be the same as the original as the address shouldn't change. If it changes, then it is considered to be a new device.

DS.4
DS.4Author
Senior
June 23, 2024

got rebonded - no new entry was added,

now connected and paired,  which bonding entry was used for that ? the "active" one?

I got a long list of bonded devices.. can you tell me how I find the one being used?

EPASZ.1
ST Employee
June 24, 2024

I think I see what you want to achieve. I'd suggest taking a look here https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WB-WBA_BLE_Privacy#First_example-_connection_between_a_smartphone_and_a_STM32WB-WBA.

You might succeed by using the event HCI_LE_ENHANCED_CONNECTION_COMPLETE_EVENT.

EPASZ1_2-1719229586495.png

If you already have the device bonded, this should provide both the resolvable address and the resolved one (if you have the bonding info stored, of course). To register this event, you can put this e.g. at the end of BLE init

hci_set_le_event_mask(0xC7FFF7F85F | 0x200);

 

EPASZ1_1-1719229534053.png

 

DS.4
DS.4Author
Senior
June 30, 2024

thanks , will give it a try