So I'm working on a personal project using bluetooth abilities to start a BLE server and want to automatically retrieve a client's information after it's connected: ID so I can keep track of clients, but brand/make, serial.. and other information would be good as well.
My ServerCallback
class looks like this
class ServerCallbacks: public BLEServerCallbacks
{
void onConnect(BLEServer* pServer)
{
deviceConnected = true;
BLEDevice::startAdvertising();
String deviceID = "XXXXX";
Serial.print("new device ");
Serial.print(deviceID);
Serial.println(" connected");
};
void onDisconnect(BLEServer* pServer)
{
deviceConnected = false;
String deviceID = "XXXXX";
Serial.print("device ");
Serial.print(deviceID);
Serial.println(" disconnected");
pServer->startAdvertising(); // restart advertising
}
};