Andriy Makukha / Mbed 2 deprecated football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
38:76e49d045a3b
Parent:
33:0fa936c5a098
Child:
44:4ad6133987ed
--- 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;
         }