Michael Ling / ExoController

Dependents:   Data-Management-Honka

Revision:
13:67492109a66d
Parent:
12:50f6f9ed5cc6
Child:
14:ac9949a0aff5
--- a/BluetoothComm.cpp	Wed Mar 11 19:39:05 2015 +0000
+++ b/BluetoothComm.cpp	Thu Mar 12 20:59:57 2015 +0000
@@ -250,20 +250,25 @@
     msg[len+2] = checksum[2];
     len += 3;
     for (int j = 0; j < len; j++) {
-        //printf("Sending char %x \r\n", msg[j]);
+        printf("Sending char %x \r\n", msg[j]);
         _rn42.putc(msg[j]);
         
     }
     if (dataOut != NULL) {
+        int ind = 0;
         int j;
         for (j = 0; j < len-1; j+=2) {
-            dataOut[j] = (msg[j]<<8)|msg[j+1];
+            dataOut[ind] = (msg[j]<<8)|msg[j+1];
+            printf("Index %d is %x\r\n", ind, dataOut[ind]);
+            ind += 1;
         }
         if (j < len) {
-            dataOut[j] = msg[j] << 8;
+            dataOut[ind] = msg[j] << 8;
+            printf("Index %d is %x\r\n", ind, dataOut[ind]);
         } 
         
     }
+    printf("Placed in dataOut\r\n");
     memcpy(_lastCmd, msg, 50);
     free(checksum);
     return ;
@@ -572,7 +577,7 @@
 */
 void BluetoothComm::attachment(short* dataOut)
 {
-    boardLed1 = !boardLed1;
+     
    // pc.printf("Entered attachment\r\n");
     if (_rn42.readable()) {
         _data=_rn42.getc();
@@ -585,6 +590,7 @@
         }
         //This marks the START of a message
         if (_inMsg == false and b == START) {
+            boardLed4 = 1;
         //    printf("Msg START received \r\n");
             _inMsg = true;
             _counter = 3;