nkolban / esp32-snippets

Sample ESP32 snippets and code fragments
https://leanpub.com/kolban-ESP32
Apache License 2.0
2.37k stars 710 forks source link

add part of BLE MAC address to BLEServer device name in init() #1109

Open marcel-bluestone opened 2 years ago

marcel-bluestone commented 2 years ago

Hi, I had been searching for days now, but can't find an answer to this one. Is it possible to add the BLE MAC address to a server's device name on init() ? I realize that the BLE stack needs to be initialized prior to obtaining the address. If so, is it possible to update the device name after that?

I know I can advertise the MAC address as manufacturerData but this is not what I am searching for. I need to set a unique device name, as there might be multiple BLE-Servers on different esp32 in the same room. Somehow I do need to distinguish them, without patching and recompiling the code for each and every one individually.

Thanks