##// END OF EJS Templates
HK_LFR_DPU_SPW_LINK_STATE: ERROR_WAIT = 1
paul -
r61:a34c50cabb1b default
parent child
Show More
@@ -1,885 +1,885
1 #ifndef CCSDS_TYPES_H_INCLUDED
1 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
3
3
4 #define TXBDCNT 50
4 #define TXBDCNT 50
5 #define RXBDCNT 10
5 #define RXBDCNT 10
6 #define TXDATASIZE 4096
6 #define TXDATASIZE 4096
7 #define TXHDRSIZE 34
7 #define TXHDRSIZE 34
8 #define RXPKTSIZE 200
8 #define RXPKTSIZE 200
9
9
10 #define SPW_RXSIZE 228
10 #define SPW_RXSIZE 228
11 #define SPW_TXDSIZE 4096
11 #define SPW_TXDSIZE 4096
12 #define SPW_TXHSIZE 64
12 #define SPW_TXHSIZE 64
13
13
14 #define BITS_PID_0 0x07
14 #define BITS_PID_0 0x07
15 #define BITS_PID_1 0x0f
15 #define BITS_PID_1 0x0f
16 #define BITS_CAT 0x0f
16 #define BITS_CAT 0x0f
17
17
18 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
18 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
19 #define CCSDS_TC_TM_PACKET_OFFSET 7
19 #define CCSDS_TC_TM_PACKET_OFFSET 7
20 #define PROTID_RES_APP 3
20 #define PROTID_RES_APP 3
21 #define CCSDS_TELEMETRY_HEADER_LENGTH (16+4)
21 #define CCSDS_TELEMETRY_HEADER_LENGTH (16+4)
22 #define CCSDS_TC_HEADER_LENGTH 10
22 #define CCSDS_TC_HEADER_LENGTH 10
23 #define CCSDS_TM_PKT_MAX_SIZE 4412
23 #define CCSDS_TM_PKT_MAX_SIZE 4412
24 #define CCSDS_TELECOMMAND_HEADER_LENGTH (10+4)
24 #define CCSDS_TELECOMMAND_HEADER_LENGTH (10+4)
25 #define CCSDS_TC_PKT_MAX_SIZE 232 // (228+3) with 3 for Prot ID, Reserved and User App bytes, SHALL BE A MULTIPLE OF 4
25 #define CCSDS_TC_PKT_MAX_SIZE 232 // (228+3) with 3 for Prot ID, Reserved and User App bytes, SHALL BE A MULTIPLE OF 4
26 #define CCSDS_TC_PKT_MIN_SIZE 16
26 #define CCSDS_TC_PKT_MIN_SIZE 16
27 #define CCSDS_PROCESS_ID 76
27 #define CCSDS_PROCESS_ID 76
28 #define CCSDS_PACKET_CATEGORY 12
28 #define CCSDS_PACKET_CATEGORY 12
29 #define CCSDS_NODE_ADDRESS 0xfe
29 #define CCSDS_NODE_ADDRESS 0xfe
30 #define CCSDS_USER_APP 0x00
30 #define CCSDS_USER_APP 0x00
31
31
32 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
32 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
33 #define DEFAULT_RESERVED 0x00
33 #define DEFAULT_RESERVED 0x00
34 #define DEFAULT_HKBIA 0x1e // 0001 1110
34 #define DEFAULT_HKBIA 0x1e // 0001 1110
35
35
36 // PACKET ID
36 // PACKET ID
37 #define TM_PACKET_PID_DEFAULT 76
37 #define TM_PACKET_PID_DEFAULT 76
38 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
38 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
39 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
39 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
40 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
40 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
41 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
41 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
42 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
42 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
43 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
43 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
44 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
44 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
45
45
46 // PACKET CAT
46 // PACKET CAT
47 #define TM_PACKET_CAT_TC_EXE 1
47 #define TM_PACKET_CAT_TC_EXE 1
48 #define TM_PACKET_CAT_HK 4
48 #define TM_PACKET_CAT_HK 4
49 #define TM_PACKET_CAT_SCIENCE 12
49 #define TM_PACKET_CAT_SCIENCE 12
50 #define TM_PACKET_CAT_DUMP 6
50 #define TM_PACKET_CAT_DUMP 6
51
51
52 // PACKET SEQUENCE CONTROL
52 // PACKET SEQUENCE CONTROL
53 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
53 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
54 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
54 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
55 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
55 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
56 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
56 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
57 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
57 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
58 #define TM_PACKET_SEQ_SHIFT 8
58 #define TM_PACKET_SEQ_SHIFT 8
59 #define SEQ_CNT_MAX 16383
59 #define SEQ_CNT_MAX 16383
60 #define SEQ_CNT_NB_DEST_ID 12
60 #define SEQ_CNT_NB_DEST_ID 12
61 #define SEQ_CNT_MASK 0x3fff // [0011 1111 1111 1111]
61 #define SEQ_CNT_MASK 0x3fff // [0011 1111 1111 1111]
62
62
63 // DESTINATION ID
63 // DESTINATION ID
64 #define TM_DESTINATION_ID_GROUND 0
64 #define TM_DESTINATION_ID_GROUND 0
65 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
65 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
66 #define TM_DESTINATION_ID_TC_SEQUENCES 111
66 #define TM_DESTINATION_ID_TC_SEQUENCES 111
67 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
67 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
68 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
68 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
69 #define TM_DESTINATION_ID_DIRECT_CMD 120
69 #define TM_DESTINATION_ID_DIRECT_CMD 120
70 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
70 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
71 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
71 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
72 #define TM_DESTINATION_ID_OBCP 15
72 #define TM_DESTINATION_ID_OBCP 15
73 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
73 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
74 #define TM_DESTINATION_ID_AOCS 11
74 #define TM_DESTINATION_ID_AOCS 11
75
75
76 //*********************************************************
76 //*********************************************************
77 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
77 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
78 //*********************************************************
78 //*********************************************************
79 #ifdef LPP_DPU_DESTID
79 #ifdef LPP_DPU_DESTID
80 #define CCSDS_DESTINATION_ID 32
80 #define CCSDS_DESTINATION_ID 32
81 #else
81 #else
82 #define CCSDS_DESTINATION_ID 0x01
82 #define CCSDS_DESTINATION_ID 0x01
83 #endif
83 #endif
84 #define CCSDS_PROTOCOLE_ID 0x02
84 #define CCSDS_PROTOCOLE_ID 0x02
85 #define CCSDS_RESERVED 0x00
85 #define CCSDS_RESERVED 0x00
86 #define CCSDS_USER_APP 0x00
86 #define CCSDS_USER_APP 0x00
87
87
88 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
88 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
89 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
89 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
90 #define SIZE_HK_PARAMETERS 112
90 #define SIZE_HK_PARAMETERS 112
91
91
92 // TC TYPES
92 // TC TYPES
93 #define TC_TYPE_GEN 181
93 #define TC_TYPE_GEN 181
94 #define TC_TYPE_TIME 9
94 #define TC_TYPE_TIME 9
95
95
96 // TC SUBTYPES
96 // TC SUBTYPES
97 #define TC_SUBTYPE_RESET 1
97 #define TC_SUBTYPE_RESET 1
98 #define TC_SUBTYPE_LOAD_COMM 11
98 #define TC_SUBTYPE_LOAD_COMM 11
99 #define TC_SUBTYPE_LOAD_NORM 13
99 #define TC_SUBTYPE_LOAD_NORM 13
100 #define TC_SUBTYPE_LOAD_BURST 19
100 #define TC_SUBTYPE_LOAD_BURST 19
101 #define TC_SUBTYPE_LOAD_SBM1 25
101 #define TC_SUBTYPE_LOAD_SBM1 25
102 #define TC_SUBTYPE_LOAD_SBM2 27
102 #define TC_SUBTYPE_LOAD_SBM2 27
103 #define TC_SUBTYPE_DUMP 31
103 #define TC_SUBTYPE_DUMP 31
104 #define TC_SUBTYPE_ENTER 41
104 #define TC_SUBTYPE_ENTER 41
105 #define TC_SUBTYPE_UPDT_INFO 51
105 #define TC_SUBTYPE_UPDT_INFO 51
106 #define TC_SUBTYPE_EN_CAL 61
106 #define TC_SUBTYPE_EN_CAL 61
107 #define TC_SUBTYPE_DIS_CAL 63
107 #define TC_SUBTYPE_DIS_CAL 63
108 #define TC_SUBTYPE_LOAD_K 93
108 #define TC_SUBTYPE_LOAD_K 93
109 #define TC_SUBTYPE_DUMP_K 95
109 #define TC_SUBTYPE_DUMP_K 95
110 #define TC_SUBTYPE_LOAD_FBINS 91
110 #define TC_SUBTYPE_LOAD_FBINS 91
111 #define TC_SUBTYPE_LOAD_FILTER_PAR 97
111 #define TC_SUBTYPE_LOAD_FILTER_PAR 97
112 #define TC_SUBTYPE_UPDT_TIME 129
112 #define TC_SUBTYPE_UPDT_TIME 129
113
113
114 // TC LEN
114 // TC LEN
115 #define TC_LEN_RESET 12
115 #define TC_LEN_RESET 12
116 #define TC_LEN_LOAD_COMM 14
116 #define TC_LEN_LOAD_COMM 14
117 #define TC_LEN_LOAD_NORM 22
117 #define TC_LEN_LOAD_NORM 22
118 #define TC_LEN_LOAD_BURST 14
118 #define TC_LEN_LOAD_BURST 14
119 #define TC_LEN_LOAD_SBM1 14
119 #define TC_LEN_LOAD_SBM1 14
120 #define TC_LEN_LOAD_SBM2 14
120 #define TC_LEN_LOAD_SBM2 14
121 #define TC_LEN_DUMP 12
121 #define TC_LEN_DUMP 12
122 #define TC_LEN_ENTER 20
122 #define TC_LEN_ENTER 20
123 #define TC_LEN_UPDT_INFO 110
123 #define TC_LEN_UPDT_INFO 110
124 #define TC_LEN_EN_CAL 12
124 #define TC_LEN_EN_CAL 12
125 #define TC_LEN_DIS_CAL 12
125 #define TC_LEN_DIS_CAL 12
126 #define TC_LEN_LOAD_K 142
126 #define TC_LEN_LOAD_K 142
127 #define TC_LEN_DUMP_K 12
127 #define TC_LEN_DUMP_K 12
128 #define TC_LEN_LOAD_FBINS 60
128 #define TC_LEN_LOAD_FBINS 60
129 #define TC_LEN_LOAD_FILTER_PAR 28
129 #define TC_LEN_LOAD_FILTER_PAR 28
130 #define TC_LEN_UPDT_TIME 18
130 #define TC_LEN_UPDT_TIME 18
131
131
132 // PACKET CODES
132 // PACKET CODES
133 #define TM_CODE_K_DUMP 0xb5600b00 // 181 (0xb5) ** 96 (0x60) ** 11 (0x0b) ** 0 (0x00)
133 #define TM_CODE_K_DUMP 0xb5600b00 // 181 (0xb5) ** 96 (0x60) ** 11 (0x0b) ** 0 (0x00)
134
134
135 // TM TYPES
135 // TM TYPES
136 #define TM_TYPE_TC_EXE 1
136 #define TM_TYPE_TC_EXE 1
137 #define TM_TYPE_HK 3
137 #define TM_TYPE_HK 3
138 #define TM_TYPE_LFR_SCIENCE 21
138 #define TM_TYPE_LFR_SCIENCE 21
139 #define TM_TYPE_PARAMETER_DUMP 181
139 #define TM_TYPE_PARAMETER_DUMP 181
140 #define TM_TYPE_K_DUMP 181
140 #define TM_TYPE_K_DUMP 181
141
141
142 // TM SUBTYPES
142 // TM SUBTYPES
143 #define TM_SUBTYPE_EXE_OK 7
143 #define TM_SUBTYPE_EXE_OK 7
144 #define TM_SUBTYPE_EXE_NOK 8
144 #define TM_SUBTYPE_EXE_NOK 8
145 #define TM_SUBTYPE_HK 25
145 #define TM_SUBTYPE_HK 25
146 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
146 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
147 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
147 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
148 #define TM_SUBTYPE_PARAMETER_DUMP 32
148 #define TM_SUBTYPE_PARAMETER_DUMP 32
149 #define TM_SUBTYPE_K_DUMP 96
149 #define TM_SUBTYPE_K_DUMP 96
150
150
151 // FAILURE CODES
151 // FAILURE CODES
152 #define ILLEGAL_APID 0
152 #define ILLEGAL_APID 0
153 #define WRONG_LEN_PKT 1
153 #define WRONG_LEN_PKT 1
154 #define INCOR_CHECKSUM 2
154 #define INCOR_CHECKSUM 2
155 #define ILL_TYPE 3
155 #define ILL_TYPE 3
156 #define ILL_SUBTYPE 4
156 #define ILL_SUBTYPE 4
157 #define WRONG_APP_DATA 5 // 0x00 0x05
157 #define WRONG_APP_DATA 5 // 0x00 0x05
158 #define TC_NOT_EXE 42000 // 0xa4 0x10
158 #define TC_NOT_EXE 42000 // 0xa4 0x10
159 #define WRONG_SRC_ID 42001 // 0xa4 0x11
159 #define WRONG_SRC_ID 42001 // 0xa4 0x11
160 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
160 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
161 #define FAIL_DETECTED 42003 // 0xa4 0x13
161 #define FAIL_DETECTED 42003 // 0xa4 0x13
162 #define NOT_ALLOWED 42004 // 0xa4 0x14
162 #define NOT_ALLOWED 42004 // 0xa4 0x14
163 #define CORRUPTED 42005 // 0xa4 0x15
163 #define CORRUPTED 42005 // 0xa4 0x15
164 #define CCSDS_TM_VALID 7
164 #define CCSDS_TM_VALID 7
165
165
166 // HK_LFR_LAST_ER_RID
166 // HK_LFR_LAST_ER_RID
167 #define RID_LE_LFR_TIME 42119
167 #define RID_LE_LFR_TIME 42119
168 #define RID_LE_LFR_DPU_SPW 42128
168 #define RID_LE_LFR_DPU_SPW 42128
169 #define RID_LE_LFR_TIMEC 42129
169 #define RID_LE_LFR_TIMEC 42129
170 #define RID_ME_LFR_DPU_SPW 42338
170 #define RID_ME_LFR_DPU_SPW 42338
171 // HK_LFR_LAST_ER_CODE
171 // HK_LFR_LAST_ER_CODE
172 #define CODE_PARITY 1
172 #define CODE_PARITY 1
173 #define CODE_DISCONNECT 2
173 #define CODE_DISCONNECT 2
174 #define CODE_ESCAPE 3
174 #define CODE_ESCAPE 3
175 #define CODE_CREDIT 4
175 #define CODE_CREDIT 4
176 #define CODE_WRITE_SYNC 5
176 #define CODE_WRITE_SYNC 5
177 #define CODE_EARLY_EOP_EEP 6
177 #define CODE_EARLY_EOP_EEP 6
178 #define CODE_INVALID_ADDRESS 7
178 #define CODE_INVALID_ADDRESS 7
179 #define CODE_EEP 8
179 #define CODE_EEP 8
180 #define CODE_RX_TOO_BIG 9
180 #define CODE_RX_TOO_BIG 9
181 #define CODE_HEADER_CRC 16
181 #define CODE_HEADER_CRC 16
182 #define CODE_DATA_CRC 17
182 #define CODE_DATA_CRC 17
183 #define CODE_ERRONEOUS 20
183 #define CODE_ERRONEOUS 20
184 #define CODE_MISSING 21
184 #define CODE_MISSING 21
185 #define CODE_INVALID 22
185 #define CODE_INVALID 22
186 #define CODE_TIMECODE_IT 24
186 #define CODE_TIMECODE_IT 24
187 #define CODE_NOT_SYNCHRO 25
187 #define CODE_NOT_SYNCHRO 25
188 #define CODE_TIMECODE_CTR 26
188 #define CODE_TIMECODE_CTR 26
189
189
190 // TC SID
190 // TC SID
191 #define SID_TC_GROUND 0
191 #define SID_TC_GROUND 0
192 #define SID_TC_MISSION_TIMELINE 110
192 #define SID_TC_MISSION_TIMELINE 110
193 #define SID_TC_TC_SEQUENCES 111
193 #define SID_TC_TC_SEQUENCES 111
194 #define SID_TC_RECOVERY_ACTION_CMD 112
194 #define SID_TC_RECOVERY_ACTION_CMD 112
195 #define SID_TC_BACKUP_MISSION_TIMELINE 113
195 #define SID_TC_BACKUP_MISSION_TIMELINE 113
196 #define SID_TC_DIRECT_CMD 120
196 #define SID_TC_DIRECT_CMD 120
197 #define SID_TC_SPARE_GRD_SRC1 121
197 #define SID_TC_SPARE_GRD_SRC1 121
198 #define SID_TC_SPARE_GRD_SRC2 122
198 #define SID_TC_SPARE_GRD_SRC2 122
199 #define SID_TC_OBCP 15
199 #define SID_TC_OBCP 15
200 #define SID_TC_SYSTEM_CONTROL 14
200 #define SID_TC_SYSTEM_CONTROL 14
201 #define SID_TC_AOCS 11
201 #define SID_TC_AOCS 11
202 #define SID_TC_RPW_INTERNAL 254
202 #define SID_TC_RPW_INTERNAL 254
203
203
204 enum apid_destid{
204 enum apid_destid{
205 GROUND,
205 GROUND,
206 MISSION_TIMELINE,
206 MISSION_TIMELINE,
207 TC_SEQUENCES,
207 TC_SEQUENCES,
208 RECOVERY_ACTION_CMD,
208 RECOVERY_ACTION_CMD,
209 BACKUP_MISSION_TIMELINE,
209 BACKUP_MISSION_TIMELINE,
210 DIRECT_CMD,
210 DIRECT_CMD,
211 SPARE_GRD_SRC1,
211 SPARE_GRD_SRC1,
212 SPARE_GRD_SRC2,
212 SPARE_GRD_SRC2,
213 OBCP,
213 OBCP,
214 SYSTEM_CONTROL,
214 SYSTEM_CONTROL,
215 AOCS,
215 AOCS,
216 RPW_INTERNAL
216 RPW_INTERNAL
217 };
217 };
218
218
219 // TM SID
219 // TM SID
220 #define SID_HK 1
220 #define SID_HK 1
221
221
222 #define SID_NORM_SWF_F0 3
222 #define SID_NORM_SWF_F0 3
223 #define SID_NORM_SWF_F1 4
223 #define SID_NORM_SWF_F1 4
224 #define SID_NORM_SWF_F2 5
224 #define SID_NORM_SWF_F2 5
225 #define SID_NORM_CWF_F3 1
225 #define SID_NORM_CWF_F3 1
226 #define SID_BURST_CWF_F2 2
226 #define SID_BURST_CWF_F2 2
227 #define SID_SBM1_CWF_F1 24
227 #define SID_SBM1_CWF_F1 24
228 #define SID_SBM2_CWF_F2 25
228 #define SID_SBM2_CWF_F2 25
229 #define SID_NORM_ASM_F0 11
229 #define SID_NORM_ASM_F0 11
230 #define SID_NORM_ASM_F1 12
230 #define SID_NORM_ASM_F1 12
231 #define SID_NORM_ASM_F2 13
231 #define SID_NORM_ASM_F2 13
232 #define SID_NORM_BP1_F0 14
232 #define SID_NORM_BP1_F0 14
233 #define SID_NORM_BP1_F1 15
233 #define SID_NORM_BP1_F1 15
234 #define SID_NORM_BP1_F2 16
234 #define SID_NORM_BP1_F2 16
235 #define SID_NORM_BP2_F0 19
235 #define SID_NORM_BP2_F0 19
236 #define SID_NORM_BP2_F1 20
236 #define SID_NORM_BP2_F1 20
237 #define SID_NORM_BP2_F2 21
237 #define SID_NORM_BP2_F2 21
238 #define SID_BURST_BP1_F0 17
238 #define SID_BURST_BP1_F0 17
239 #define SID_BURST_BP2_F0 22
239 #define SID_BURST_BP2_F0 22
240 #define SID_BURST_BP1_F1 18
240 #define SID_BURST_BP1_F1 18
241 #define SID_BURST_BP2_F1 23
241 #define SID_BURST_BP2_F1 23
242 #define SID_SBM1_BP1_F0 28
242 #define SID_SBM1_BP1_F0 28
243 #define SID_SBM1_BP2_F0 31
243 #define SID_SBM1_BP2_F0 31
244 #define SID_SBM2_BP1_F0 29
244 #define SID_SBM2_BP1_F0 29
245 #define SID_SBM2_BP2_F0 32
245 #define SID_SBM2_BP2_F0 32
246 #define SID_SBM2_BP1_F1 30
246 #define SID_SBM2_BP1_F1 30
247 #define SID_SBM2_BP2_F1 33
247 #define SID_SBM2_BP2_F1 33
248 #define SID_NORM_CWF_LONG_F3 34
248 #define SID_NORM_CWF_LONG_F3 34
249
249
250 #define SID_PARAMETER_DUMP 10
250 #define SID_PARAMETER_DUMP 10
251 #define SID_K_DUMP 11
251 #define SID_K_DUMP 11
252
252
253 // HEADER_LENGTH
253 // HEADER_LENGTH
254 //#define TM_HEADER_LEN 16
254 //#define TM_HEADER_LEN 16
255 #define HEADER_LENGTH_TM_LFR_SCIENCE_CWF 32
255 #define HEADER_LENGTH_TM_LFR_SCIENCE_CWF 32
256 #define HEADER_LENGTH_TM_LFR_SCIENCE_SWF 34
256 #define HEADER_LENGTH_TM_LFR_SCIENCE_SWF 34
257 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 34
257 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 34
258 // PACKET_LENGTH
258 // PACKET_LENGTH
259 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
259 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
260 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
260 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
261 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
261 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
262 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
262 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
263 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
263 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
264 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
264 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
265 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
265 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
266 #define PACKET_LENGTH_PARAMETER_DUMP (148 - CCSDS_TC_TM_PACKET_OFFSET)
266 #define PACKET_LENGTH_PARAMETER_DUMP (148 - CCSDS_TC_TM_PACKET_OFFSET)
267 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
267 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
268 // SCIENCE ASM
268 // SCIENCE ASM
269 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0_1 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 32 bins (32 + 32 + 24 ), 3 packets
269 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0_1 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 32 bins (32 + 32 + 24 ), 3 packets
270 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0_2 (2430 - CCSDS_TC_TM_PACKET_OFFSET) // 24 * 25 * 4 + 30 => 24 bins (32 + 32 + 24 ), 3 packets
270 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0_2 (2430 - CCSDS_TC_TM_PACKET_OFFSET) // 24 * 25 * 4 + 30 => 24 bins (32 + 32 + 24 ), 3 packets
271 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1_1 (3630 - CCSDS_TC_TM_PACKET_OFFSET) // 36 * 25 * 4 + 30 => 36 bins (36 + 36 + 32 ), 3 packets
271 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1_1 (3630 - CCSDS_TC_TM_PACKET_OFFSET) // 36 * 25 * 4 + 30 => 36 bins (36 + 36 + 32 ), 3 packets
272 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1_2 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 32 bins (36 + 36 + 32 ), 3 packets
272 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1_2 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 32 bins (36 + 36 + 32 ), 3 packets
273 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 96 bins (32 + 32 + 32 ), 3 packets
273 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (3230 - CCSDS_TC_TM_PACKET_OFFSET) // 32 * 25 * 4 + 30 => 96 bins (32 + 32 + 32 ), 3 packets
274 // SCIENCE NORM
274 // SCIENCE NORM
275 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (150 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 11 + 29 (1 spare byte in the header)
275 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (150 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 11 + 29 (1 spare byte in the header)
276 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (172 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 11 + 29 (1 spare byte in the header)
276 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (172 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 11 + 29 (1 spare byte in the header)
277 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
277 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
278 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
278 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
279 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
279 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
280 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
280 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
281 // SCIENCE SBM
281 // SCIENCE SBM
282 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
282 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
283 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
283 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
284 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
284 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
285 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
285 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
286
286
287 #define PACKET_LENGTH_DELTA 11 // 7 + 4
287 #define PACKET_LENGTH_DELTA 11 // 7 + 4
288
288
289 #define SPARE1_PUSVERSION_SPARE2 0x10
289 #define SPARE1_PUSVERSION_SPARE2 0x10
290
290
291 // R3
291 // R3
292 // one snapshot = 2048 samples = 6 packets * 304 + 224
292 // one snapshot = 2048 samples = 6 packets * 304 + 224
293 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
293 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
294 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
294 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
295 // one continuous buffer = 2688 samples = 8 packets * 336
295 // one continuous buffer = 2688 samples = 8 packets * 336
296 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
296 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
297 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
297 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
298 //
298 //
299 #define PKTCNT_SWF 0x07
299 #define PKTCNT_SWF 0x07
300 #define PKTCNT_ASM 3
300 #define PKTCNT_ASM 3
301 #define BLK_NR_304 0x0130
301 #define BLK_NR_304 0x0130
302 #define BLK_NR_224 0x00e0
302 #define BLK_NR_224 0x00e0
303 #define BLK_NR_CWF 0x0150 // 336
303 #define BLK_NR_CWF 0x0150 // 336
304 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
304 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
305
305
306 enum TM_TYPE{
306 enum TM_TYPE{
307 TM_LFR_TC_EXE_OK,
307 TM_LFR_TC_EXE_OK,
308 TM_LFR_TC_EXE_ERR,
308 TM_LFR_TC_EXE_ERR,
309 TM_LFR_HK,
309 TM_LFR_HK,
310 TM_LFR_SCI,
310 TM_LFR_SCI,
311 TM_LFR_SCI_SBM,
311 TM_LFR_SCI_SBM,
312 TM_LFR_PAR_DUMP
312 TM_LFR_PAR_DUMP
313 };
313 };
314
314
315 #define BYTES_PER_PACKETID 2
315 #define BYTES_PER_PACKETID 2
316 #define BYTES_PER_SEQ_CTRL 2
316 #define BYTES_PER_SEQ_CTRL 2
317 #define BYTES_PER_PKT_LEN 2
317 #define BYTES_PER_PKT_LEN 2
318 #define BYTES_PER_TIME 6
318 #define BYTES_PER_TIME 6
319 #define BYTES_PER_ERR_CODE 2
319 #define BYTES_PER_ERR_CODE 2
320 #define BYTES_PER_STA_WRD 2
320 #define BYTES_PER_STA_WRD 2
321 #define BYTES_PER_CRC 2
321 #define BYTES_PER_CRC 2
322 #define BYTES_PER_BLKNR 2
322 #define BYTES_PER_BLKNR 2
323 #define BYTES_PER_SW_VER 4
323 #define BYTES_PER_SW_VER 4
324 #define BYTES_PER_VHD_VER 3
324 #define BYTES_PER_VHD_VER 3
325 #define COUNTER_2_BYTES 2
325 #define COUNTER_2_BYTES 2
326 #define BYTES_PER_TYPE 2
326 #define BYTES_PER_TYPE 2
327 #define BYTES_PER_SUBTYPE 2
327 #define BYTES_PER_SUBTYPE 2
328 #define BYTES_PER_ADDR 4
328 #define BYTES_PER_ADDR 4
329 #define BYTES_PER_TEMP 2
329 #define BYTES_PER_TEMP 2
330 #define BYTES_PER_V 2
330 #define BYTES_PER_V 2
331 #define BYTES_PER_WORD 4
331 #define BYTES_PER_WORD 4
332 #define BYTES_PER_MASK 16
332 #define BYTES_PER_MASK 16
333 #define BYTES_PER_MASKS_SET 48 // 4 * 4 * 3
333 #define BYTES_PER_MASKS_SET 48 // 4 * 4 * 3
334
334
335 #define COUNTER_2_BYTES 2
335 #define COUNTER_2_BYTES 2
336 #define PARAM_2_BYTES 2
336 #define PARAM_2_BYTES 2
337 #define PARAM_4_BYTES 4
337 #define PARAM_4_BYTES 4
338
338
339 typedef struct {
339 typedef struct {
340 unsigned char targetLogicalAddress;
340 unsigned char targetLogicalAddress;
341 unsigned char protocolIdentifier;
341 unsigned char protocolIdentifier;
342 unsigned char reserved;
342 unsigned char reserved;
343 unsigned char userApplication;
343 unsigned char userApplication;
344 // PACKET HEADER
344 // PACKET HEADER
345 unsigned char packetID[BYTES_PER_PACKETID];
345 unsigned char packetID[BYTES_PER_PACKETID];
346 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
346 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
347 unsigned char packetLength[BYTES_PER_PKT_LEN];
347 unsigned char packetLength[BYTES_PER_PKT_LEN];
348 // DATA FIELD HEADER
348 // DATA FIELD HEADER
349 unsigned char spare1_pusVersion_spare2;
349 unsigned char spare1_pusVersion_spare2;
350 unsigned char serviceType;
350 unsigned char serviceType;
351 unsigned char serviceSubType;
351 unsigned char serviceSubType;
352 unsigned char destinationID;
352 unsigned char destinationID;
353 unsigned char time[BYTES_PER_TIME];
353 unsigned char time[BYTES_PER_TIME];
354 //
354 //
355 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
355 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
356 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
356 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
357 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
357 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
358
358
359 typedef struct {
359 typedef struct {
360 unsigned char targetLogicalAddress;
360 unsigned char targetLogicalAddress;
361 unsigned char protocolIdentifier;
361 unsigned char protocolIdentifier;
362 unsigned char reserved;
362 unsigned char reserved;
363 unsigned char userApplication;
363 unsigned char userApplication;
364 // PACKET HEADER
364 // PACKET HEADER
365 unsigned char packetID[BYTES_PER_PACKETID];
365 unsigned char packetID[BYTES_PER_PACKETID];
366 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
366 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
367 unsigned char packetLength[BYTES_PER_PKT_LEN];
367 unsigned char packetLength[BYTES_PER_PKT_LEN];
368 // DATA FIELD HEADER
368 // DATA FIELD HEADER
369 unsigned char spare1_pusVersion_spare2;
369 unsigned char spare1_pusVersion_spare2;
370 unsigned char serviceType;
370 unsigned char serviceType;
371 unsigned char serviceSubType;
371 unsigned char serviceSubType;
372 unsigned char destinationID;
372 unsigned char destinationID;
373 unsigned char time[BYTES_PER_TIME];
373 unsigned char time[BYTES_PER_TIME];
374 //
374 //
375 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
375 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
376 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
376 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
377 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
377 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
378 unsigned char tc_service;
378 unsigned char tc_service;
379 unsigned char tc_subtype;
379 unsigned char tc_subtype;
380 unsigned char byte_position;
380 unsigned char byte_position;
381 unsigned char rcv_value;
381 unsigned char rcv_value;
382 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
382 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
383
383
384 typedef struct {
384 typedef struct {
385 unsigned char targetLogicalAddress;
385 unsigned char targetLogicalAddress;
386 unsigned char protocolIdentifier;
386 unsigned char protocolIdentifier;
387 unsigned char reserved;
387 unsigned char reserved;
388 unsigned char userApplication;
388 unsigned char userApplication;
389 // PACKET HEADER
389 // PACKET HEADER
390 unsigned char packetID[BYTES_PER_PACKETID];
390 unsigned char packetID[BYTES_PER_PACKETID];
391 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
391 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
392 unsigned char packetLength[BYTES_PER_PKT_LEN];
392 unsigned char packetLength[BYTES_PER_PKT_LEN];
393 // DATA FIELD HEADER
393 // DATA FIELD HEADER
394 unsigned char spare1_pusVersion_spare2;
394 unsigned char spare1_pusVersion_spare2;
395 unsigned char serviceType;
395 unsigned char serviceType;
396 unsigned char serviceSubType;
396 unsigned char serviceSubType;
397 unsigned char destinationID;
397 unsigned char destinationID;
398 unsigned char time[BYTES_PER_TIME];
398 unsigned char time[BYTES_PER_TIME];
399 //
399 //
400 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
400 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
401 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
401 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
402 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
402 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
403 unsigned char tc_service;
403 unsigned char tc_service;
404 unsigned char tc_subtype;
404 unsigned char tc_subtype;
405 unsigned char lfr_status_word[2];
405 unsigned char lfr_status_word[2];
406 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
406 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
407
407
408 typedef struct {
408 typedef struct {
409 unsigned char targetLogicalAddress;
409 unsigned char targetLogicalAddress;
410 unsigned char protocolIdentifier;
410 unsigned char protocolIdentifier;
411 unsigned char reserved;
411 unsigned char reserved;
412 unsigned char userApplication;
412 unsigned char userApplication;
413 // PACKET HEADER
413 // PACKET HEADER
414 unsigned char packetID[BYTES_PER_PACKETID];
414 unsigned char packetID[BYTES_PER_PACKETID];
415 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
415 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
416 unsigned char packetLength[BYTES_PER_PKT_LEN];
416 unsigned char packetLength[BYTES_PER_PKT_LEN];
417 // DATA FIELD HEADER
417 // DATA FIELD HEADER
418 unsigned char spare1_pusVersion_spare2;
418 unsigned char spare1_pusVersion_spare2;
419 unsigned char serviceType;
419 unsigned char serviceType;
420 unsigned char serviceSubType;
420 unsigned char serviceSubType;
421 unsigned char destinationID;
421 unsigned char destinationID;
422 unsigned char time[BYTES_PER_TIME];
422 unsigned char time[BYTES_PER_TIME];
423 //
423 //
424 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
424 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
425 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
425 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
426 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
426 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
427 unsigned char tc_service;
427 unsigned char tc_service;
428 unsigned char tc_subtype;
428 unsigned char tc_subtype;
429 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
429 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
430
430
431 typedef struct {
431 typedef struct {
432 unsigned char targetLogicalAddress;
432 unsigned char targetLogicalAddress;
433 unsigned char protocolIdentifier;
433 unsigned char protocolIdentifier;
434 unsigned char reserved;
434 unsigned char reserved;
435 unsigned char userApplication;
435 unsigned char userApplication;
436 // PACKET HEADER
436 // PACKET HEADER
437 unsigned char packetID[BYTES_PER_PACKETID];
437 unsigned char packetID[BYTES_PER_PACKETID];
438 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
438 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
439 unsigned char packetLength[BYTES_PER_PKT_LEN];
439 unsigned char packetLength[BYTES_PER_PKT_LEN];
440 // DATA FIELD HEADER
440 // DATA FIELD HEADER
441 unsigned char spare1_pusVersion_spare2;
441 unsigned char spare1_pusVersion_spare2;
442 unsigned char serviceType;
442 unsigned char serviceType;
443 unsigned char serviceSubType;
443 unsigned char serviceSubType;
444 unsigned char destinationID;
444 unsigned char destinationID;
445 unsigned char time[BYTES_PER_TIME];
445 unsigned char time[BYTES_PER_TIME];
446 //
446 //
447 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
447 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
448 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
448 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
449 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
449 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
450 unsigned char tc_service;
450 unsigned char tc_service;
451 unsigned char tc_subtype;
451 unsigned char tc_subtype;
452 } Packet_TM_LFR_TC_EXE_ERROR_t;
452 } Packet_TM_LFR_TC_EXE_ERROR_t;
453
453
454 typedef struct {
454 typedef struct {
455 unsigned char targetLogicalAddress;
455 unsigned char targetLogicalAddress;
456 unsigned char protocolIdentifier;
456 unsigned char protocolIdentifier;
457 unsigned char reserved;
457 unsigned char reserved;
458 unsigned char userApplication;
458 unsigned char userApplication;
459 // PACKET HEADER
459 // PACKET HEADER
460 unsigned char packetID[BYTES_PER_PACKETID];
460 unsigned char packetID[BYTES_PER_PACKETID];
461 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
461 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
462 unsigned char packetLength[BYTES_PER_PKT_LEN];
462 unsigned char packetLength[BYTES_PER_PKT_LEN];
463 // DATA FIELD HEADER
463 // DATA FIELD HEADER
464 unsigned char spare1_pusVersion_spare2;
464 unsigned char spare1_pusVersion_spare2;
465 unsigned char serviceType;
465 unsigned char serviceType;
466 unsigned char serviceSubType;
466 unsigned char serviceSubType;
467 unsigned char destinationID;
467 unsigned char destinationID;
468 unsigned char time[BYTES_PER_TIME];
468 unsigned char time[BYTES_PER_TIME];
469 //
469 //
470 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
470 unsigned char telecommand_pkt_id[BYTES_PER_PACKETID];
471 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
471 unsigned char pkt_seq_control[BYTES_PER_SEQ_CTRL];
472 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
472 unsigned char tc_failure_code[BYTES_PER_ERR_CODE];
473 unsigned char tc_service;
473 unsigned char tc_service;
474 unsigned char tc_subtype;
474 unsigned char tc_subtype;
475 unsigned char pkt_len_rcv_value[BYTES_PER_PKT_LEN];
475 unsigned char pkt_len_rcv_value[BYTES_PER_PKT_LEN];
476 unsigned char pkt_datafieldsize_cnt[BYTES_PER_PKT_LEN];
476 unsigned char pkt_datafieldsize_cnt[BYTES_PER_PKT_LEN];
477 unsigned char rcv_crc[BYTES_PER_CRC];
477 unsigned char rcv_crc[BYTES_PER_CRC];
478 unsigned char computed_crc[BYTES_PER_CRC];
478 unsigned char computed_crc[BYTES_PER_CRC];
479 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
479 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
480
480
481 typedef struct {
481 typedef struct {
482 unsigned char targetLogicalAddress;
482 unsigned char targetLogicalAddress;
483 unsigned char protocolIdentifier;
483 unsigned char protocolIdentifier;
484 unsigned char reserved;
484 unsigned char reserved;
485 unsigned char userApplication;
485 unsigned char userApplication;
486 unsigned char packetID[BYTES_PER_PACKETID];
486 unsigned char packetID[BYTES_PER_PACKETID];
487 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
487 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
488 unsigned char packetLength[BYTES_PER_PKT_LEN];
488 unsigned char packetLength[BYTES_PER_PKT_LEN];
489 // DATA FIELD HEADER
489 // DATA FIELD HEADER
490 unsigned char spare1_pusVersion_spare2;
490 unsigned char spare1_pusVersion_spare2;
491 unsigned char serviceType;
491 unsigned char serviceType;
492 unsigned char serviceSubType;
492 unsigned char serviceSubType;
493 unsigned char destinationID;
493 unsigned char destinationID;
494 unsigned char time[BYTES_PER_TIME];
494 unsigned char time[BYTES_PER_TIME];
495 // AUXILIARY HEADER
495 // AUXILIARY HEADER
496 unsigned char sid;
496 unsigned char sid;
497 unsigned char pa_bia_status_info;
497 unsigned char pa_bia_status_info;
498 unsigned char sy_lfr_common_parameters_spare;
498 unsigned char sy_lfr_common_parameters_spare;
499 unsigned char sy_lfr_common_parameters;
499 unsigned char sy_lfr_common_parameters;
500 unsigned char pktCnt;
500 unsigned char pktCnt;
501 unsigned char pktNr;
501 unsigned char pktNr;
502 unsigned char acquisitionTime[BYTES_PER_TIME];
502 unsigned char acquisitionTime[BYTES_PER_TIME];
503 unsigned char blkNr[BYTES_PER_BLKNR];
503 unsigned char blkNr[BYTES_PER_BLKNR];
504 } Header_TM_LFR_SCIENCE_SWF_t;
504 } Header_TM_LFR_SCIENCE_SWF_t;
505
505
506 //*******************
506 //*******************
507 // TM_LFR_SCIENCE_CWF
507 // TM_LFR_SCIENCE_CWF
508
508
509 #define CWF_BLK_SIZE 6
509 #define CWF_BLK_SIZE 6
510
510
511 typedef struct {
511 typedef struct {
512 unsigned char targetLogicalAddress;
512 unsigned char targetLogicalAddress;
513 unsigned char protocolIdentifier;
513 unsigned char protocolIdentifier;
514 unsigned char reserved;
514 unsigned char reserved;
515 unsigned char userApplication;
515 unsigned char userApplication;
516 unsigned char packetID[BYTES_PER_PACKETID];
516 unsigned char packetID[BYTES_PER_PACKETID];
517 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
517 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
518 unsigned char packetLength[BYTES_PER_PKT_LEN];
518 unsigned char packetLength[BYTES_PER_PKT_LEN];
519 // DATA FIELD HEADER
519 // DATA FIELD HEADER
520 unsigned char spare1_pusVersion_spare2;
520 unsigned char spare1_pusVersion_spare2;
521 unsigned char serviceType;
521 unsigned char serviceType;
522 unsigned char serviceSubType;
522 unsigned char serviceSubType;
523 unsigned char destinationID;
523 unsigned char destinationID;
524 unsigned char time[BYTES_PER_TIME];
524 unsigned char time[BYTES_PER_TIME];
525 // AUXILIARY DATA HEADER
525 // AUXILIARY DATA HEADER
526 unsigned char sid;
526 unsigned char sid;
527 unsigned char pa_bia_status_info;
527 unsigned char pa_bia_status_info;
528 unsigned char sy_lfr_common_parameters_spare;
528 unsigned char sy_lfr_common_parameters_spare;
529 unsigned char sy_lfr_common_parameters;
529 unsigned char sy_lfr_common_parameters;
530 unsigned char acquisitionTime[BYTES_PER_TIME];
530 unsigned char acquisitionTime[BYTES_PER_TIME];
531 unsigned char blkNr[BYTES_PER_BLKNR];
531 unsigned char blkNr[BYTES_PER_BLKNR];
532 } Header_TM_LFR_SCIENCE_CWF_t;
532 } Header_TM_LFR_SCIENCE_CWF_t;
533
533
534 typedef struct {
534 typedef struct {
535 unsigned char targetLogicalAddress;
535 unsigned char targetLogicalAddress;
536 unsigned char protocolIdentifier;
536 unsigned char protocolIdentifier;
537 unsigned char reserved;
537 unsigned char reserved;
538 unsigned char userApplication;
538 unsigned char userApplication;
539 unsigned char packetID[BYTES_PER_PACKETID];
539 unsigned char packetID[BYTES_PER_PACKETID];
540 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
540 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
541 unsigned char packetLength[BYTES_PER_PKT_LEN];
541 unsigned char packetLength[BYTES_PER_PKT_LEN];
542 // DATA FIELD HEADER
542 // DATA FIELD HEADER
543 unsigned char spare1_pusVersion_spare2;
543 unsigned char spare1_pusVersion_spare2;
544 unsigned char serviceType;
544 unsigned char serviceType;
545 unsigned char serviceSubType;
545 unsigned char serviceSubType;
546 unsigned char destinationID;
546 unsigned char destinationID;
547 unsigned char time[BYTES_PER_TIME];
547 unsigned char time[BYTES_PER_TIME];
548 // AUXILIARY HEADER
548 // AUXILIARY HEADER
549 unsigned char sid;
549 unsigned char sid;
550 unsigned char pa_bia_status_info;
550 unsigned char pa_bia_status_info;
551 unsigned char sy_lfr_common_parameters_spare;
551 unsigned char sy_lfr_common_parameters_spare;
552 unsigned char sy_lfr_common_parameters;
552 unsigned char sy_lfr_common_parameters;
553 unsigned char pa_lfr_pkt_cnt_asm;
553 unsigned char pa_lfr_pkt_cnt_asm;
554 unsigned char pa_lfr_pkt_nr_asm;
554 unsigned char pa_lfr_pkt_nr_asm;
555 unsigned char acquisitionTime[BYTES_PER_TIME];
555 unsigned char acquisitionTime[BYTES_PER_TIME];
556 unsigned char pa_lfr_asm_blk_nr[BYTES_PER_BLKNR];
556 unsigned char pa_lfr_asm_blk_nr[BYTES_PER_BLKNR];
557 } Header_TM_LFR_SCIENCE_ASM_t;
557 } Header_TM_LFR_SCIENCE_ASM_t;
558
558
559 typedef struct {
559 typedef struct {
560 unsigned char targetLogicalAddress;
560 unsigned char targetLogicalAddress;
561 unsigned char protocolIdentifier;
561 unsigned char protocolIdentifier;
562 unsigned char reserved;
562 unsigned char reserved;
563 unsigned char userApplication;
563 unsigned char userApplication;
564 unsigned char packetID[BYTES_PER_PACKETID];
564 unsigned char packetID[BYTES_PER_PACKETID];
565 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
565 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
566 unsigned char packetLength[BYTES_PER_PKT_LEN];
566 unsigned char packetLength[BYTES_PER_PKT_LEN];
567 // DATA FIELD HEADER
567 // DATA FIELD HEADER
568 unsigned char spare1_pusVersion_spare2;
568 unsigned char spare1_pusVersion_spare2;
569 unsigned char serviceType;
569 unsigned char serviceType;
570 unsigned char serviceSubType;
570 unsigned char serviceSubType;
571 unsigned char destinationID;
571 unsigned char destinationID;
572 unsigned char time[BYTES_PER_TIME];
572 unsigned char time[BYTES_PER_TIME];
573 // AUXILIARY HEADER
573 // AUXILIARY HEADER
574 unsigned char sid;
574 unsigned char sid;
575 unsigned char pa_bia_status_info;
575 unsigned char pa_bia_status_info;
576 unsigned char sy_lfr_common_parameters_spare;
576 unsigned char sy_lfr_common_parameters_spare;
577 unsigned char sy_lfr_common_parameters;
577 unsigned char sy_lfr_common_parameters;
578 unsigned char acquisitionTime[BYTES_PER_TIME];
578 unsigned char acquisitionTime[BYTES_PER_TIME];
579 unsigned char source_data_spare;
579 unsigned char source_data_spare;
580 unsigned char pa_lfr_bp_blk_nr[BYTES_PER_BLKNR];
580 unsigned char pa_lfr_bp_blk_nr[BYTES_PER_BLKNR];
581 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
581 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
582
582
583 typedef struct {
583 typedef struct {
584 unsigned char targetLogicalAddress;
584 unsigned char targetLogicalAddress;
585 unsigned char protocolIdentifier;
585 unsigned char protocolIdentifier;
586 unsigned char reserved;
586 unsigned char reserved;
587 unsigned char userApplication;
587 unsigned char userApplication;
588 unsigned char packetID[BYTES_PER_PACKETID];
588 unsigned char packetID[BYTES_PER_PACKETID];
589 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
589 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
590 unsigned char packetLength[BYTES_PER_PKT_LEN];
590 unsigned char packetLength[BYTES_PER_PKT_LEN];
591 // DATA FIELD HEADER
591 // DATA FIELD HEADER
592 unsigned char spare1_pusVersion_spare2;
592 unsigned char spare1_pusVersion_spare2;
593 unsigned char serviceType;
593 unsigned char serviceType;
594 unsigned char serviceSubType;
594 unsigned char serviceSubType;
595 unsigned char destinationID;
595 unsigned char destinationID;
596 unsigned char time[BYTES_PER_TIME];
596 unsigned char time[BYTES_PER_TIME];
597 // AUXILIARY HEADER
597 // AUXILIARY HEADER
598 unsigned char sid;
598 unsigned char sid;
599 unsigned char pa_bia_status_info;
599 unsigned char pa_bia_status_info;
600 unsigned char sy_lfr_common_parameters_spare;
600 unsigned char sy_lfr_common_parameters_spare;
601 unsigned char sy_lfr_common_parameters;
601 unsigned char sy_lfr_common_parameters;
602 unsigned char acquisitionTime[BYTES_PER_TIME];
602 unsigned char acquisitionTime[BYTES_PER_TIME];
603 unsigned char pa_lfr_bp_blk_nr[BYTES_PER_BLKNR];
603 unsigned char pa_lfr_bp_blk_nr[BYTES_PER_BLKNR];
604 } Header_TM_LFR_SCIENCE_BP_t;
604 } Header_TM_LFR_SCIENCE_BP_t;
605
605
606 typedef struct {
606 typedef struct {
607 // TARGET LOGICAL ADDRESS (targetLogicalAddress) IS REMOVED BY THE GRSPW MODULE
607 // TARGET LOGICAL ADDRESS (targetLogicalAddress) IS REMOVED BY THE GRSPW MODULE
608 unsigned char protocolIdentifier;
608 unsigned char protocolIdentifier;
609 unsigned char reserved;
609 unsigned char reserved;
610 unsigned char userApplication;
610 unsigned char userApplication;
611 unsigned char packetID[BYTES_PER_PACKETID];
611 unsigned char packetID[BYTES_PER_PACKETID];
612 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
612 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
613 unsigned char packetLength[BYTES_PER_PKT_LEN];
613 unsigned char packetLength[BYTES_PER_PKT_LEN];
614 // DATA FIELD HEADER
614 // DATA FIELD HEADER
615 unsigned char headerFlag_pusVersion_Ack;
615 unsigned char headerFlag_pusVersion_Ack;
616 unsigned char serviceType;
616 unsigned char serviceType;
617 unsigned char serviceSubType;
617 unsigned char serviceSubType;
618 unsigned char sourceID;
618 unsigned char sourceID;
619 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-CCSDS_TC_HEADER_LENGTH];
619 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-CCSDS_TC_HEADER_LENGTH];
620 } ccsdsTelecommandPacket_t;
620 } ccsdsTelecommandPacket_t;
621
621
622 //**********
622 //**********
623 //**********
623 //**********
624 // TM_LFR_HK
624 // TM_LFR_HK
625
625
626 #define STATUS_WORD_SC_POTENTIAL_FLAG_BIT 0x40 // [0100 0000]
626 #define STATUS_WORD_SC_POTENTIAL_FLAG_BIT 0x40 // [0100 0000]
627 #define STATUS_WORD_SC_POTENTIAL_FLAG_MASK 0xbf // [1011 1111]
627 #define STATUS_WORD_SC_POTENTIAL_FLAG_MASK 0xbf // [1011 1111]
628 #define STATUS_WORD_PAS_FILTER_ENABLED_BIT 0x20 // [0010 0000]
628 #define STATUS_WORD_PAS_FILTER_ENABLED_BIT 0x20 // [0010 0000]
629 #define STATUS_WORD_PAS_FILTER_ENABLED_MASK 0xdf // [1101 1111]
629 #define STATUS_WORD_PAS_FILTER_ENABLED_MASK 0xdf // [1101 1111]
630 #define STATUS_WORD_WATCHDOG_BIT 0x10 // [0001 0000]
630 #define STATUS_WORD_WATCHDOG_BIT 0x10 // [0001 0000]
631 #define STATUS_WORD_WATCHDOG_MASK 0xef // [1110 1111]
631 #define STATUS_WORD_WATCHDOG_MASK 0xef // [1110 1111]
632 #define STATUS_WORD_CALIB_BIT 0x08 // [0000 1000]
632 #define STATUS_WORD_CALIB_BIT 0x08 // [0000 1000]
633 #define STATUS_WORD_CALIB_MASK 0xf7 // [1111 0111]
633 #define STATUS_WORD_CALIB_MASK 0xf7 // [1111 0111]
634 #define STATUS_WORD_RESET_CAUSE_BITS 0x07 // [0000 0111]
634 #define STATUS_WORD_RESET_CAUSE_BITS 0x07 // [0000 0111]
635 #define STATUS_WORD_RESET_CAUSE_MASK 0xf8 // [1111 1000]
635 #define STATUS_WORD_RESET_CAUSE_MASK 0xf8 // [1111 1000]
636 #define STATUS_WORD_LINK_STATE_BITS 0x03 // [0000 0111]
636 #define STATUS_WORD_LINK_STATE_BITS 0x07 // [0000 0111]
637 #define STATUS_WORD_LINK_STATE_MASK 0xf8 // [1111 1000]
637