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:
92:bce22b38c440
Parent:
91:05cf9d71a665
Child:
95:42d6747900cb
diff -r 05cf9d71a665 -r bce22b38c440 OBSRS.h
--- a/OBSRS.h	Sat Jan 23 12:20:56 2016 +0000
+++ b/OBSRS.h	Sat Jan 23 12:59:06 2016 +0000
@@ -46,7 +46,7 @@
 
 uint8_t SID ;
 unsigned char buffer_112[112];
-uint8_t FSC;
+uint32_t FSC;
 uint16_t read_success = false;
 uint16_t counter_buffer_112=0, counter_EoS=0,T_frames_sent=0;
 uint16_t counter_call_sign_buffer=0;
@@ -236,7 +236,7 @@
             }\
             else{\
                 valid_SID=false;\
-                gPC.printf("invalid SID");\
+                /*gPC.printf("invalid SID");*/\
                 enable_ackandcallsign = true;\
                 create_Ack_andcallsign = true;\
                 ack_code = 0x02;\
@@ -333,7 +333,7 @@
                                 if(segments_sent + 1>= max_segments){
                                     adf_limit = true;
                                     segments_sent = 0;
-                                    gPC.printf("adf limit reached here");
+//                                    gPC.printf("adf limit reached here");
                                 }
                                 else{
                                     enable_new_segment = true;
@@ -362,11 +362,11 @@
                                 adf_limit = true;
                                 segments_sent++;
 //                                gPC.printf("segments_sent = "<<segments_sent<<ENDL;
-                                gPC.printf("in for adf limit reached");
+//                                gPC.printf("in for adf limit reached");
                             }
                             else{
                                 enable_new_segment = true;
-                                gPC.printf("data in next segment");
+//                                gPC.printf("data in next segment");
                                 segments_sent++;
 //                                cout<<"segments_sent = "<<segments_sent<<ENDL;
                             }
@@ -490,7 +490,7 @@
 }
 
 void execute_OBSRS_TC(Base_tc *tcp){
-    short_TC = true;
+//    short_TC = true;
     //pc.printf("WELCOME\n\r");
     FCTN_CDMS_SD_INIT();/* sd card initialization*/
 //    SID = 0x0;
@@ -499,34 +499,36 @@
 //    short_TC = true;
 //    adf_SND_SDCard();
 
-//    if( GETshort_or_long_tc(tcp) == SHORT_TC_CODE ){
-//        short_TC = true;
-//    }
-//    else{
-//        short_TC = false;    
-//    }
-//    /*  reading SID from TC  */
-//    SID = (tcp->TC_string[2]) & 0x0f;
-//    /*  reading FSC and no. of frames from TC  */
-//    if(short_TC){
-//    FSC  = tcp->TC_string[3] << 24;
-//    FSC += tcp->TC_string[4] << 16;
-//    FSC += tcp->TC_string[5] << 8;
-//    FSC += tcp->TC_string[6];
-//    no_of_frames = tcp->TC_string[7] << 8;
-//    no_of_frames += tcp->TC_string[8];
-//    }
-//    else{
-//        no_of_frames = tcp->TC_string[3];
-//        for(int i=0 ;i<no_of_frames ; i++){
-//            list_of_FSC[i] = tcp->TC_string[4+i];
-//        }
-//    }
-//    gPC.printf("sid = %u \r\n",SID);
-//    gPC.printf("FSC = %u\r\n",FSC);
-    SID = 0x0;
-    FSC = 10;
-    no_of_frames = 2;
+    if( GETshort_or_long_tc(tcp) == SHORT_TC_CODE ){
+        short_TC = true;
+        gPC.printf("it is short TC\r\n");
+    }
+    else{
+        gPC.printf("it is long TC\r\n");
+        short_TC = false;    
+    }
+    /*  reading SID from TC  */
+    SID = (tcp->TC_string[2]) & 0x0f;
+    /*  reading FSC and no. of frames from TC  */
+    if(short_TC){
+    FSC  = tcp->TC_string[3] << 24;
+    FSC += tcp->TC_string[4] << 16;
+    FSC += tcp->TC_string[5] << 8;
+    FSC += tcp->TC_string[6];
+    no_of_frames = tcp->TC_string[7] << 8;
+    no_of_frames += tcp->TC_string[8];
+    }
+    else{
+        no_of_frames = tcp->TC_string[3];
+        for(int i=0 ;i<no_of_frames ; i++){
+            list_of_FSC[i] = tcp->TC_string[4+i];
+        }
+    }
+    gPC.printf("sid = %u \r\n",SID);
+    gPC.printf("FSC = %u\r\n",FSC);
+//    SID = 0x0;
+//    FSC = 10;
+//    no_of_frames = 2;
 //    cout<<"max_segments = "<<max_segments<<ENDL;
     //while(0){
 //    while(!stop){