esp32 ble multiconnection server
Posted: Sun May 10, 2020 3:04 pm
Hi,
I wrote a ble multiconnection server using esp32 arduino.
In the code below, i can see connected or disconnected device connection id.
But, i can not see which connected device sended data to the ble server.
In short, i want to know which ble client sended data to the server and i want to send data to the specific ble client.
Is anyone know how can it be done?
Thanks in advance.
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.