lemmingDev / ESP32-BLE-Gamepad

Bluetooth LE Gamepad library for the ESP32
Other
1.03k stars 172 forks source link

Obtain list of connected devices #202

Open ChrGri opened 8 months ago

ChrGri commented 8 months ago

Awesome project. Thanks a lot.

For debug purposes it would be great to obtain information about the bluetooth device to which the ESP is connected, e.g. the mac address. Is that possible?

Perhaps the "NimBLEConnInfo NimBLEServer::getPeerInfo(size_t index)" function is correct. https://github.com/h2zero/NimBLE-Arduino/blob/e46123a084e0aa336e4cbdd52bf001dac71e5afb/src/NimBLEServer.cpp#L287

BR Chris

LeeNX commented 5 months ago

I did a bit of hacking and have a little bit of working code, if you want to poke at it some more and get it working - https://github.com/LeeNX/ESP32-BLE-Gamepad/commit/51d67dedb114ddbe915b903905807264170c86fd#diff-e0dc9cb579362b38ea3fe22181e36952e3c4206fa5f695f200eac8294c2a9c01R8