Simple version of COM_MNG_TMTC_CODE for IITMSAT.

Dependencies:   mbed-rtos mbed FreescaleIAP SimpleDMA

Revision:
170:286ef9dad36a
Parent:
164:be3b4b760d0c
Child:
171:31bdf83591a1
--- a/COM_MNG_TMTC.h	Mon Apr 18 12:18:53 2016 +0000
+++ b/COM_MNG_TMTC.h	Tue Apr 19 23:00:31 2016 +0000
@@ -208,12 +208,7 @@
             gPC.printf("Telecommand is for BAE\r\n");
             //printf("Sending TC to BAE...\r\n"); //interrupt to be sent to the bae
 
-            if(GETshort_or_long_tc(tc_ptr) == LONG_TC_CODE)
-                FCTN_I2C_WRITE((char*)tc_ptr->TC_string,TC_LONG_SIZE);
-            else 
-            {
                 FCTN_I2C_WRITE((char*)tc_ptr->TC_string,TC_SHORT_SIZE);
-            }
             
             while(1)
             {
@@ -222,10 +217,9 @@
                 {
                     
                     //printf("receiving...\r\n");
-                    FCTN_I2C_READ((char*)tm_pointer->TM_string,TM_LONG_SIZE);
+                    FCTN_I2C_READ((char*)tm_pointer->TM_string,135);
                     //printf("%s", tm_pointer->TM_string);
                     received+=1;
-                    tm_pointer = tm_pointer->next_TM;
                     break; //only for testing purpose
                 }
                 else
@@ -233,7 +227,7 @@
                     break;
                 }
             }
-            if(received >= 1 )
+            if(received < 1 )
             {
                 //printf("Telemetry is not received from BAE\r\n");
                 //tm_pointer = new Short_tm;
@@ -251,7 +245,10 @@
                 tm_pointer->TM_string[12] = (uint8_t)(crc16&0x00FF);
                 tm_pointer->next_TM = NULL;                 return tm_ptr;
             }
-            break;
+            else
+            {
+                tm_pointer->next_TM = NULL; return tm_ptr;
+                }
         }
         case 2:
         {