Fixes BLE data printing (#7699)
* Fixes BLE data printing BLE data has no '\0' terminator, therefore it can't be printed as a regular C string. This fix just prints the BLE data based on its length. * Simplify printing to a single call
This commit is contained in:
parent
ff4bbc22a5
commit
03e9e07f1a
1 changed files with 2 additions and 1 deletions
|
|
@ -29,7 +29,8 @@ static void notifyCallback(
|
||||||
Serial.print(" of data length ");
|
Serial.print(" of data length ");
|
||||||
Serial.println(length);
|
Serial.println(length);
|
||||||
Serial.print("data: ");
|
Serial.print("data: ");
|
||||||
Serial.println((char*)pData);
|
Serial.write(pData, length);
|
||||||
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyClientCallback : public BLEClientCallbacks {
|
class MyClientCallback : public BLEClientCallbacks {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue