2024-06-20 05:10 AM
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
2024-06-21 12:24 AM
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.
2024-06-22 11:58 PM
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?
2024-06-23 12:09 AM
Using the connection info might help, but is sounds like a solution that can go wrong!
I am already rebonded , and looking for active bonding key used for security.
Support on this one from you will help!
A solution(?) :
For private: trying to resolve the connection address, than looking it in the bonding list, if it fails, move to next type.
For static random: I can search the bond list for that exact address, with type random . if failed move to next type
For public: again , try to look for that address in the bonding, but this time with type public. if failed move to next type
Is there another possibility?
2024-06-24 04:46 AM
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.
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);
2024-06-29 11:17 PM
thanks , will give it a try