0

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
  }
};
  • so, what is your actual problem and what is your question? – jsotola Sep 3 at 1:15
  • @jsotola How to retrieve client information after it's connected to the server. Multiple central devices will be querying this information and so I want to track who did and who did not – Alucard Sep 3 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.