I wrote a ble multiconnection server using esp32 arduino.
In the code below, i can see connected or disconnected device connection id.
Code: Select all
class BleServerCallbacksClass: public BLEServerCallbacks
{
void onConnect(BLEServer* p_server)
{
Serial.printf("on connect, conn id: %u\n", p_server->getConnId());
p_ble_adv->start();
}
void onDisconnect(BLEServer* p_server)
{
Serial.printf("on disconnect, conn id: %u\n", p_server->getConnId());
}
};
Code: Select all
class BleReadCallbacksClass: public BLECharacteristicCallbacks
{
void onWrite(BLECharacteristic *pCharacteristic)
{
Serial.printf("on write, handle: %u\n", pCharacteristic->getHandle());
}
};
Is anyone know how can it be done?
Thanks in advance.