You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My program (esp32 Arduino IDE 2) kind of get stuck in the following scenario:
An ESP32 device is starting as a server and advertising until it is being connected by a central (host )
Upon connection estabishment, it retreives a client from the server object by calling: pClient=pServer->getClient(pServer->getPeerInfo(0));
and acting as a dual role device.
and then use this client to retreive a charecteristic value from a service that the central is offering (CTS).
Specifically by calling pSvc = pClient->getService("1805"); // CTS SErvice
and then pChr = pSvc->getCharacteristic("2A2B"); //Current Time characteristic
and NimBLEAttValue pv=pChr->readValue(pTime); // the actual value
All functioning butiffuly*
*However, in case the central is an IPhone or other IOS device (All IOS devices have a builtin CTS service),
if the devices are not paired/bonded the IOS device will not allow the value to be read.
The problem is that the call to NimBLEAttValue pv=pChr->readValue(pTime); never returned.
The rest of the BLE stack seems to function the Onconnect and OnDisconnect and start advertising if disconnecte.
Also the bonding being complete, but the main task (Arduino loop()) never get the chance to run again, and the device must be reset externally.
It all happend only on the first connetion because next time the bonding is already created.
I tested it with android device with CTS service running and it run as it should.
I also tested it with another chip (CC2340) and I just get en error if the bonding is not completed yet,
because of the IOS restriction.
I tried to check pChr->canRead()) as a guard but this returns true.
A workaround can be to check if the devices are bonded before reading the CTS. however an erro instead of getting stuck will be more elegant.
I also can use (not tested) the onAuthenticationComplete event to signal that the pairing is established.
Thanks for a great library and the dual role capability.
The text was updated successfully, but these errors were encountered:
My program (esp32 Arduino IDE 2) kind of get stuck in the following scenario:
An ESP32 device is starting as a server and advertising until it is being connected by a central (host )
Upon connection estabishment, it retreives a client from the server object by calling:
pClient=pServer->getClient(pServer->getPeerInfo(0));
and acting as a dual role device.
and then use this client to retreive a charecteristic value from a service that the central is offering (CTS).
Specifically by calling
pSvc = pClient->getService("1805"); // CTS SErvice
and then
pChr = pSvc->getCharacteristic("2A2B"); //Current Time characteristic
and
NimBLEAttValue pv=pChr->readValue(pTime); // the actual value
All functioning butiffuly*
*However, in case the central is an IPhone or other IOS device (All IOS devices have a builtin CTS service),
if the devices are not paired/bonded the IOS device will not allow the value to be read.
The problem is that the call to
NimBLEAttValue pv=pChr->readValue(pTime);
never returned.The rest of the BLE stack seems to function the Onconnect and OnDisconnect and start advertising if disconnecte.
Also the bonding being complete, but the main task (Arduino loop()) never get the chance to run again, and the device must be reset externally.
It all happend only on the first connetion because next time the bonding is already created.
I tested it with android device with CTS service running and it run as it should.
I also tested it with another chip (CC2340) and I just get en error if the bonding is not completed yet,
because of the IOS restriction.
I tried to check
pChr->canRead())
as a guard but this returns true.A workaround can be to check if the devices are bonded before reading the CTS. however an erro instead of getting stuck will be more elegant.
I also can use (not tested) the
onAuthenticationComplete
event to signal that the pairing is established.Thanks for a great library and the dual role capability.
The text was updated successfully, but these errors were encountered: