How to unpair a HID device?

37 views
Skip to first unread message

Richard Evans

unread,
Dec 15, 2023, 7:14:53 AM12/15/23
to btstack-dev
I'm playing with the hid_host_demo with a bluetooth gamepad. All works fine, I can connect and see the pairing done automatically. 

But how to I remove the pairing for future use?  I'm using a Raspberry pi Pico W and can get the pairing cleared if I erase the flash area used for TLV storage, but I like to remove the pairing for this device only using an official API.  Just can't find it in the docs though.

Thanks

Richard

Matthias Ringwald

unread,
Dec 15, 2023, 11:08:37 AM12/15/23
to btsta...@googlegroups.com
HI Richard

Sorry, we do have an example to list the Classic link keys, but it's not so obvious how to delete all bonding information for LE.

You can use the le_device_db.h API.

First, get the max number of devices via le_device_db_max_count
Then, for each 0..max devices-1, call le_device_db_info
if the addr type differs from BD_ADDR_TYPE_UNKNOWN, call le_device_db_remove

Cheers
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/4b0b9975-7f05-4222-9269-167091b48541n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages