Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BLE dualRole Server/Client OnConnect() method overlapp. - Arduino #7922

doh38 started this conversation in General
Discussion options

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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /