-
Notifications
You must be signed in to change notification settings - Fork 7.7k
-
I successfully built a simple dualRole BLEuart simple sketch allowing me to connect as Client to a server and simultaneously be connected from a Client to my esp32-s3 as server as the one from Nordic on the nrf52 devices.
There is but a little glitch.
I use these callbacks for connection state:'
//BLE Peripheral Class
class MyServerCallbacks : public BLEServerCallbacks {
void onConnect(BLEServer* pServer) {
Serial.println("Server connected to device!");
deviceConnected = true;
};
//BLE Central Class
class MyClientCallback : public BLEClientCallbacks {
void onConnect(BLEClient* pclient) {
}
void onDisconnect(BLEClient* pclient) {
connected = false;
Serial.println("onDisconnect");
}
};
But the code don't take any difference between both. which means, if the Client connect/disconnect, the server is "seen" as connected/disconnected too and start/stop its tasks.
in short onConnect() doesn't differentiate which server is targeted.
Is it "normal"? I was in the expectation that they would be both differently handled.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment