Skip to content

Commit 03e9e07

Browse files
authored
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 ff4bbc2 commit 03e9e07

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)