add 2 exemples for communication between to esp32#16
add 2 exemples for communication between to esp32#16techno94 wants to merge 2 commits intonkolban:masterfrom
Conversation
|
Hello @techno94 thank you for sharing your example. I am using it for a project and it is working pretty fine. [E][BLERemoteCharacteristic.cpp:438] readValue(): Disconnected So I was wondering if it is possible that the Client can check if it is still connected to the server before it tries to read a value from it? |
|
@wuzipu123 You can do it in your code. |
|
@chegewara Thank you could you please tell me how? |
|
may be change the : if (deviceConnected) { by : if (doConnect == true) { or put the code of the : readValue when you find solution show me the soluion you find actualy i don't have the time to try. |
|
I made it work by adding following lines to the void loop() therefore BLEDevice* pClient needs to be initialized outside the bool ConnectToServer(....) function It's not perfect because reconnecting doesn't always work but it's something |
|
Alright so the reconnecting problem is solved by adding pClient->disconnect(); after realizing that you are not connected to the server anymore. |
Hello,
i've add 2 exemples for client and server to send and receive data to each other.
tested and working well