espressif / esp-nimble

A fork of NimBLE stack, for use with ESP32 and ESP-IDF
Apache License 2.0
79 stars 51 forks source link

Get the address of bonded devices #71

Closed Steven35700 closed 2 months ago

Steven35700 commented 2 months ago

Hi,

I would like to recover all the addresses of the bonded devices in order to integrate them into the whitelist. The objective of this is that only whitelisted, and therefore bonded, devices can scan and connect to the advertise. I haven't found any associated functions to do this, do you potentially have another approach to do this ?

Thanks

rahult-github commented 2 months ago

ble_store_util_bonded_peers API exists which gives the list of devices which are bonded. You can have a wrapper function, where you first get the list of bonded peers and then perform action on it as per your use case.

Steven35700 commented 2 months ago

It works, thank you !