Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: sensor_main.cpp
- Revision:
- 11:4c3876be77b1
- Parent:
- 7:e51d0fbb1a25
--- a/sensor_main.cpp Thu Jan 05 13:56:25 2017 +0000
+++ b/sensor_main.cpp Thu Jan 05 14:11:31 2017 +0000
@@ -57,7 +57,8 @@
pc.printf("string data '%s', len %d\r\n", serialized_data.c_str(), serialized_data.size());
char message[TRANSFER_SIZE];
- memcpy(message, serialized_data.c_str(), 2);
+ memset(message, 0, sizeof(message));
+ memcpy(message, serialized_data.c_str(), serialized_data.length());
int tx_bytes = radio.write(NRF24L01P_PIPE_P0, message, TRANSFER_SIZE);
if (tx_bytes > 0) {