Closed Fredovsky closed 1 year ago
Issue fixed using the following :
for(uint8_t i = 0; i<length; i++)
{
Serial.print(" ");
Serial.printf("%02x", pData[i]); // Prints 2 digits hex value
}
Variable length
is correct, just the std::string((char*)pData, length)
returns a truncated string if it contains 0d
Actually this is the problematic line
Serial.println(str.c_str());
A BLE device sends through indications or notifications a message of the following type :
76 40 0d 33 43 33 34 36 34 20
Because the message contains "0d", the callback parameter length is wrong (2 instead of 10 in this example), and I am unable to display the full message using :
I am using the code from the NimBLE_Client example.
Any help appreciated.