publishing to check changes in cdms code

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE_samp_23SEP_DMA_flag by samp Srinivasan

Revision:
162:48fda0b8d573
Parent:
161:a63672bf4423
Child:
164:be3b4b760d0c
diff -r a63672bf4423 -r 48fda0b8d573 COM_MNG_TMTC.h
--- a/COM_MNG_TMTC.h	Thu Apr 14 04:14:21 2016 +0000
+++ b/COM_MNG_TMTC.h	Thu Apr 14 04:34:58 2016 +0000
@@ -202,14 +202,22 @@
         {
             gPC.printf("Telecommand is for BAE\r\n");
             //printf("Sending TC to BAE...\r\n"); //interrupt to be sent to the bae
-            /*FCTN_I2C_WRITE((char*)tc_ptr->TC_string);
+
+            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)
             {
                 wait(1); //TimeOut instead of wait
-                if(tm_status_4m_slv == 1)
+                if(BAE_I2C_GPIO == 1)
                 {
+                    
                     //printf("receiving...\r\n");
-                    FCTN_I2C_READ((char*)tm_pointer->TM_string,134);
+                    FCTN_I2C_READ((char*)tm_pointer->TM_string,TM_LONG_SIZE);
                     //printf("%s", tm_pointer->TM_string);
                     received+=1;
                     tm_pointer = tm_pointer->next_TM;
@@ -222,25 +230,13 @@
             }
             if(received >= 1 )
             {
-                //printf("Telemetry is received from BAE\r\n");
-                Base_tm *tm_print = tm_ptr;
-                for(uint8_t i=0;i<received;i++)
-                {  
-                    //printf("%s", tm_print->TM_string);
-                    tm_print = tm_print->next_TM; //for check
-                }
-                received  = 0;
-                tm_pointer->next_TM = NULL;                 return tm_ptr;
-            }
-            else
-            {
                 //printf("Telemetry is not received from BAE\r\n");
                 //tm_pointer = new Short_tm;
                 tm_pointer->TM_string[0] = 0xB0;
                 tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);
-                tm_pointer->TM_string[2] = 0x01;
-                tm_pointer->TM_string[3] = ACKCODE; //ackcode to be decided
-                tm_pointer->TM_string[4] = 0x01;
+                tm_pointer->TM_string[2] = 0x00;
+                tm_pointer->TM_string[3] = 0x00; //ackcode to be decided
+                tm_pointer->TM_string[4] = 0x00;
                 for(uint8_t i=0;i<6;i++)
                 {
                     tm_pointer->TM_string[i+5] = 0;
@@ -250,7 +246,7 @@
                 tm_pointer->TM_string[12] = (uint8_t)(crc16&0x00FF);
                 tm_pointer->next_TM = NULL;                 return tm_ptr;
             }
-            break;*/
+            break;
         }
         case 2:
         {