pl ack in tmtc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE_pl123 by shubham c

Files at this revision

API Documentation at this revision

Comitter:
pradeepvk2208
Date:
Sat Apr 02 04:17:20 2016 +0000
Parent:
139:17353d6311ce
Commit message:
included ack for pl_tc_tm

Changed in this revision

COM_MNG_TMTC.h Show annotated file Show diff for this revision Revisions of this file
FreescaleIAP.lib Show annotated file Show diff for this revision Revisions of this file
i2c.h Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/COM_MNG_TMTC.h	Wed Mar 30 14:04:48 2016 +0000
+++ b/COM_MNG_TMTC.h	Sat Apr 02 04:17:20 2016 +0000
@@ -1009,10 +1009,48 @@
             }   
                 
             if(GETshort_or_long_tc(tc_ptr) == LONG_TC_CODE)
-                FCTN_I2C_WRITE_PL((char*)tc_ptr->TC_string,TC_LONG_SIZE);
+                {
+                    int y=FCTN_I2C_WRITE_PL((char*)tc_ptr->TC_string,TC_LONG_SIZE);
+                    if(y==1)
+                    {
+                        tm_pointer->TM_string[0] = 0xB0; 
+                        tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
+                        tm_pointer->TM_string[2] = 0x33; //ack_code
+                        tm_pointer->TM_string[3] = 0x00; 
+                        tm_pointer->TM_string[4] = 0x00;
+                        for(uint8_t i=0;i<6;i++)
+                        {
+                            tm_pointer->TM_string[i+5] = 0;
+                        }
+                        crc16 = crc16_gen(tm_ptr->TM_string,11);
+                        tm_pointer->TM_string[11] = (uint8_t)((crc16&0xFF00)>>8);
+                        tm_pointer->TM_string[12] = (uint8_t)(crc16&0x00FF);
+                        tm_pointer->next_TM = NULL;                 
+                        return tm_ptr;
+                        break;
+                    }
+            }
             else 
             {
-                FCTN_I2C_WRITE_PL((char*)tc_ptr->TC_string,TC_SHORT_SIZE);
+                int y=FCTN_I2C_WRITE_PL((char*)tc_ptr->TC_string,TC_SHORT_SIZE);
+                if(y==1)
+                    {
+                        tm_pointer->TM_string[0] = 0xB0; 
+                        tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
+                        tm_pointer->TM_string[2] = 0x33; //ack_code
+                        tm_pointer->TM_string[3] = 0x00; 
+                        tm_pointer->TM_string[4] = 0x00;
+                        for(uint8_t i=0;i<6;i++)
+                        {
+                            tm_pointer->TM_string[i+5] = 0;
+                        }
+                        crc16 = crc16_gen(tm_ptr->TM_string,11);
+                        tm_pointer->TM_string[11] = (uint8_t)((crc16&0xFF00)>>8);
+                        tm_pointer->TM_string[12] = (uint8_t)(crc16&0x00FF);
+                        tm_pointer->next_TM = NULL;                 
+                        return tm_ptr;
+                        break;
+                    }
             }
             
             
--- a/FreescaleIAP.lib	Wed Mar 30 14:04:48 2016 +0000
+++ b/FreescaleIAP.lib	Sat Apr 02 04:17:20 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/Sissors/code/FreescaleIAP/#6749f7702fa5
+http://mbed.org/users/Sissors/code/FreescaleIAP/#ab8a833a25eb
--- a/i2c.h	Wed Mar 30 14:04:48 2016 +0000
+++ b/i2c.h	Sat Apr 02 04:17:20 2016 +0000
@@ -15,17 +15,15 @@
 
 uint8_t PL_TM_SIZE;//size of data to bev read from i2c
 
-void FCTN_I2C_WRITE_PL(char *data2,uint8_t tc_len2)
+int FCTN_I2C_WRITE_PL(char *data2,uint8_t tc_len2)
 {
     write_ack = master.write(addr_pl|0x00,data2,tc_len2);//address to be defined in payload
     if(write_ack == 1)
     {
         printf("\n\rdata not sent\n");
-        }
-    else
-    {
-        
-        }
+     }
+     return write_ack;
+    
 }
 void FCTN_I2C_READ_PL(char *data,int length)
 {   
--- a/mbed-rtos.lib	Wed Mar 30 14:04:48 2016 +0000
+++ b/mbed-rtos.lib	Sat Apr 02 04:17:20 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#c825593ece39
+http://mbed.org/users/mbed_official/code/mbed-rtos/#bdd541595fc5
--- a/mbed.bld	Wed Mar 30 14:04:48 2016 +0000
+++ b/mbed.bld	Sat Apr 02 04:17:20 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/99a22ba036c9
\ No newline at end of file