Skip to content

Commit 53e3f98

Browse files
SuGliderme-no-dev
authored andcommitted
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
1 parent 490f1d6 commit 53e3f98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: libraries/BLE/examples/BLE_client/BLE_client.ino

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ static void notifyCallback(
2929
Serial.print(" of data length ");
3030
Serial.println(length);
3131
Serial.print("data: ");
32-
Serial.println((char*)pData);
32+
Serial.write(pData, length);
33+
Serial.println();
3334
}
3435

3536
class MyClientCallback : public BLEClientCallbacks {

0 commit comments

Comments
 (0)