You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feat: Implement clearAllBondings using iterative gap_delete_bonding
This commit introduces a functional implementation for `BLESecureClass::clearAllBondings()`, designed to remove all LE bonding information stored by BTstack.
The method now performs the following:
1. **Initial State Logging**: Dumps the LE Device Database using `le_device_db_dump()` and logs the count of bonded devices reported by `le_device_db_count()` before any deletion attempts.
2. **Iterative Deletion**:
* Loops through all potential physical slots in the LE Device Database (up to `NVM_NUM_DEVICE_DB_ENTRIES`).
* For each slot, it calls `le_device_db_info()` to retrieve the address and address type of any stored bond.
* If a valid LE device (public or random address type) is found in a slot, `gap_delete_bonding(addr_type, addr)` is invoked for that specific device. This is the recommended high-level API to request bond removal.
* `le_device_db_dump()` is called after each `gap_delete_bonding` call to provide insight into the immediate effect on the database (though flash changes might have backend latencies).
3. **Final State Logging**: After iterating through all slots, `le_device_db_dump()` is called again, and the final count from `le_device_db_count()` is logged to assess the outcome.
4. **Informational Messages**: Includes detailed serial logging throughout the process to aid in debugging and understanding the function's behavior.
This approach aims to systematically request the deletion of each stored bond via the GAP layer, which should then instruct the LE Device DB (TLV on flash) and the Security Manager to remove the associated security information.
Also added a test example `ClearBondingTest`` for the new function.
0 commit comments