Hi world.
My question is how I get the adress of my device if this is connected to my ESP 32 , my ESP 32 is working like a server and my phone is a client, when you do a sacan you get the adress of the BLE devices around of the ESP 32, I want to get this adress and then when my device was disconnected try to find it to activate a led.
Get BLE adress of a device that is already connected
Re: Get BLE adress of a device that is already connected
Thank you, another question, if I want to do this but I’m programming with Arduino IDE using the ESP32 libraries, how I can do it using this?
Re: Get BLE adress of a device that is already connected
Sorry, i missed that you are asking about arduino.
If you are using BLE library from arduino-esp32 latest version then you can make it very easy:
If you are using BLE library from arduino-esp32 latest version then you can make it very easy:
Code: Select all
class MyCallbacks : public BLEServerCallbacks{
void onConnect(BLEServer *pServer, esp_ble_gatts_cb_param_t *param)
{
param->connect.remote_bda; // <-- its your address
}
};
Who is online
Users browsing this forum: No registered users and 54 guests