Hello everyone,
I have an ESP32 set up as secure GATT server with bonding and encryption. The bonding procedure works flawlessly and from then the device remembers my smartphone for future connections.
I need to allow only one bonded device at any time: if someone else completes the bonding procedure the ESP32 should forget any previous connection. What would be the best way to do it?
For instance, I could retrieve all the bonded device with esp_ble_get_bond_device_list, but is the list ordered? If I always remove all the devices but the first (or the last), am I sure to keep the last one?
Keep only one bonded device as GATT server
Re: Keep only one bonded device as GATT server
Like you said, you can retrieve list of bonded devices, it is array. Then you can iterate thru that array and if mac address is not the same as currently connected/bonded device then remove it from list. Easy code and since you allow only one device to be bond at the time you will have 2 devices at most.
Who is online
Users browsing this forum: Baidu [Spider], Google [Bot] and 98 guests