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.
Fork of football_project by
Diff: Radio.cpp
- Revision:
- 38:76e49d045a3b
- Parent:
- 33:0fa936c5a098
- Child:
- 44:4ad6133987ed
diff -r 8f15b14d6994 -r 76e49d045a3b Radio.cpp
--- a/Radio.cpp Wed Jan 06 22:19:10 2016 +0000
+++ b/Radio.cpp Fri Jan 08 19:13:02 2016 +0000
@@ -47,7 +47,7 @@
return;
}
- writeToPhone("SM: %c 2: %d frm: %d\r\n", m->command, m->cone, NODE_ID); /// DEBUG-only message
+ //writeToPhone("SM: %c to: %d frm: %d (%d)\r\n", m->command, m->cone, NODE_ID, m->value); /// DEBUG-only message
payload[0] = (byte)m->command;
payload[4] = (byte)m->value & 255;
@@ -79,12 +79,17 @@
return false;
}
- writeToPhone("GM: %d\r\n", radio.SENDERID); /// DEBUG-only message
+ //writeToPhone("GM: %d\r\n", radio.SENDERID); /// DEBUG-only message
if (radio.TARGETID == NODE_ID)
{
- m->cone = radio.SENDERID;
- m->command = radio.DATA[0];
- m->value = radio.DATA[1];
+ m->cone = radio.SENDERID;
+ m->command = radio.DATA[0];
+ m->value = (radio.DATA[1] >> 24);
+ m->value |= (radio.DATA[2] >> 16);
+ m->value |= (radio.DATA[3] >> 8);
+ m->value |= (radio.DATA[4]);
+
+ writeToPhone("GM: %d %c %d\r\n", radio.SENDERID, m->command, m->value); /// DEBUG-only message
return true;
}
