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
Dear H2zero,
During the process of updating some code from NimBLE-Arduino version 1.x to 2.x I came across the following (consistent and reproducible) behavior, that should get your attention because of the underlying problem.
In 1.x the following snippet is working perfectly and the client confirms the "indicate", and the check never returns false!
.
uint8_t Server_authResponse[6] = {0x03, 0x12, 0x00, 0x00, 0x00, 0x00};
.
.
// Server replies with a packet: 03 12 ## ## ## ## containing (4 byte --> 32 bit unsigned int) Response (TxChar 32)if(!pServer_SteeringDEVCharTx->indicate(Server_authResponse, 6)) { // Array of 6 bytesDEBUG_PRINTLN("Indicate authResponse Failed!");
}
However, in 2.x the very same code snippet is no longer working!
No compiler complains (like undefined use of indicate(...) )
the check never returns false
the client does not get the Indicate and as a consequence never confirms "indicate"
As if pServer_SteeringDEVCharTx->indicate(Server_authResponse, 6) is never executed!
The following workaround is working perfectly in 2.x:
// Server replies with a packet: 03 12 ## ## ## ## containing (4 byte --> 32 bit unsigned int) Response (TxChar 32)
pServer_SteeringDEVCharTx->setValue(Server_authResponse, 6); // Array of 6 bytesif(!pServer_SteeringDEVCharTx->indicate()) {
DEBUG_PRINTLN("Indicate authResponse Failed!");
}
I could not find in the (migration or code) documentation that indicate() has changed this way in version 2.x
indicate() [4/5]
bool NimBLECharacteristic::indicate(constuint8_t * value, size_t length, uint16_t connHandle = BLE_HS_CONN_HANDLE_NONE) const
Send an indication.
Parameters
[in] value A pointer to the data to send.
[in] length The length of the data to send.
[in] connHandle Connection handle to send an individual indication, or BLE_HS_CONN_HANDLE_NONE to send the indication to all subscribed clients.
Returns
True if the indication was sent successfully, false otherwise.
The workaround is simple again, but it has possibly a serious underlying cause.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Dear H2zero,
During the process of updating some code from NimBLE-Arduino version 1.x to 2.x I came across the following (consistent and reproducible) behavior, that should get your attention because of the underlying problem.
In 1.x the following snippet is working perfectly and the client confirms the "indicate", and the check never returns false!
However, in 2.x the very same code snippet is no longer working!
No compiler complains (like undefined use of indicate(...) )
As if pServer_SteeringDEVCharTx->indicate(Server_authResponse, 6) is never executed!
The following workaround is working perfectly in 2.x:
I could not find in the (migration or code) documentation that indicate() has changed this way in version 2.x
The workaround is simple again, but it has possibly a serious underlying cause.
Thanks in advance!
The text was updated successfully, but these errors were encountered: