##// END OF EJS Templates
CCSDS_TC_PKT_MAX_SIZE updated
paul -
r55:3e4216a0e698 default
parent child
Show More
@@ -1,808 +1,807
1 1 #ifndef CCSDS_TYPES_H_INCLUDED
2 2 #define CCSDS_TYPES_H_INCLUDED
3 3
4 4 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
5 5 #define CCSDS_TC_TM_PACKET_OFFSET 7
6 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
6 #define CCSDS_TELEMETRY_HEADER_LENGTH (16+4)
7 7 #define CCSDS_TM_PKT_MAX_SIZE 4412
8 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
9 //#define CCSDS_TC_PKT_MAX_SIZE 256
10 #define CCSDS_TC_PKT_MAX_SIZE 2048
8 #define CCSDS_TELECOMMAND_HEADER_LENGTH (10+4)
9 #define CCSDS_TC_PKT_MAX_SIZE (228+3) // => 3 is for Prot ID, Reserved and User App bytes
11 10 #define CCSDS_TC_PKT_MIN_SIZE 16
12 11 #define CCSDS_PROCESS_ID 76
13 12 #define CCSDS_PACKET_CATEGORY 12
14 13 #define CCSDS_NODE_ADDRESS 0xfe
15 14 #define CCSDS_USER_APP 0x00
16 15
17 16 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
18 17 #define DEFAULT_RESERVED 0x00
19 18 #define DEFAULT_HKBIA 0x1e // 0001 1110
20 19
21 20 // PACKET ID
22 21 #define TM_PACKET_PID_DEFAULT 76
23 22 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
24 23 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
25 24 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
26 25 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
27 26 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
28 27 #define APID_TM_PARAMETER_DUMP 0x0cc6 // PID 76 CAT 6
29 28 #define APID_TM_KCOEFFICIENTS_DUMP 0x0cc6 // PID 76 CAT 6
30 29 // PACKET CAT
31 30 #define TM_PACKET_CAT_TC_EXE 1
32 31 #define TM_PACKET_CAT_HK 4
33 32 #define TM_PACKET_CAT_SCIENCE 12
34 33 #define TM_PACKET_CAT_DUMP 6
35 34
36 35 // PACKET SEQUENCE CONTROL
37 36 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
38 37 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
39 38 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
40 39 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
41 40 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
42 41
43 42 // DESTINATION ID
44 43 #define TM_DESTINATION_ID_GROUND 0
45 44 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
46 45 #define TM_DESTINATION_ID_TC_SEQUENCES 111
47 46 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
48 47 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
49 48 #define TM_DESTINATION_ID_DIRECT_CMD 120
50 49 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
51 50 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
52 51 #define TM_DESTINATION_ID_OBCP 15
53 52 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
54 53 #define TM_DESTINATION_ID_AOCS 11
55 54
56 55 //*********************************************************
57 56 //*** /!\ change CCSDS_DESTINATION_ID before flight /!\ ***
58 57 //*********************************************************
59 58 #ifdef LPP_DPU_DESTID
60 59 #define CCSDS_DESTINATION_ID 32
61 60 #else
62 61 #define CCSDS_DESTINATION_ID 0x01
63 62 #endif
64 63 #define CCSDS_PROTOCOLE_ID 0x02
65 64 #define CCSDS_RESERVED 0x00
66 65 #define CCSDS_USER_APP 0x00
67 66
68 67 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
69 68 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
70 69 #define SIZE_HK_PARAMETERS 112
71 70
72 71 // TC TYPES
73 72 #define TC_TYPE_GEN 181
74 73 #define TC_TYPE_TIME 9
75 74
76 75 // TC SUBTYPES
77 76 #define TC_SUBTYPE_RESET 1
78 77 #define TC_SUBTYPE_LOAD_COMM 11
79 78 #define TC_SUBTYPE_LOAD_NORM 13
80 79 #define TC_SUBTYPE_LOAD_BURST 19
81 80 #define TC_SUBTYPE_LOAD_SBM1 25
82 81 #define TC_SUBTYPE_LOAD_SBM2 27
83 82 #define TC_SUBTYPE_DUMP 31
84 83 #define TC_SUBTYPE_ENTER 41
85 84 #define TC_SUBTYPE_UPDT_INFO 51
86 85 #define TC_SUBTYPE_EN_CAL 61
87 86 #define TC_SUBTYPE_DIS_CAL 63
88 87 #define TC_SUBTYPE_LOAD_K 93
89 88 #define TC_SUBTYPE_DUMP_K 95
90 89 #define TC_SUBTYPE_LOAD_FBINS 91
91 90 #define TC_SUBTYPE_LOAD_FILTER_PAR 97
92 91 #define TC_SUBTYPE_UPDT_TIME 129
93 92
94 93 // TC LEN
95 94 #define TC_LEN_RESET 12
96 95 #define TC_LEN_LOAD_COMM 14
97 96 #define TC_LEN_LOAD_NORM 22
98 97 #define TC_LEN_LOAD_BURST 14
99 98 #define TC_LEN_LOAD_SBM1 14
100 99 #define TC_LEN_LOAD_SBM2 14
101 100 #define TC_LEN_DUMP 12
102 101 #define TC_LEN_ENTER 20
103 102 #define TC_LEN_UPDT_INFO 110
104 103 #define TC_LEN_EN_CAL 12
105 104 #define TC_LEN_DIS_CAL 12
106 105 #define TC_LEN_LOAD_K 142
107 106 #define TC_LEN_DUMP_K 12
108 107 #define TC_LEN_LOAD_FBINS 60
109 108 #define TC_LEN_LOAD_FILTER_PAR 28
110 109 #define TC_LEN_UPDT_TIME 18
111 110
112 111 // PACKET CODES
113 112 #define TM_CODE_K_DUMP 0xb5600b00 // 181 (0xb5) ** 96 (0x60) ** 11 (0x0b) ** 0 (0x00)
114 113
115 114 // TM TYPES
116 115 #define TM_TYPE_TC_EXE 1
117 116 #define TM_TYPE_HK 3
118 117 #define TM_TYPE_LFR_SCIENCE 21
119 118 #define TM_TYPE_PARAMETER_DUMP 181
120 119 #define TM_TYPE_K_DUMP 181
121 120
122 121 // TM SUBTYPES
123 122 #define TM_SUBTYPE_EXE_OK 7
124 123 #define TM_SUBTYPE_EXE_NOK 8
125 124 #define TM_SUBTYPE_HK 25
126 125 #define TM_SUBTYPE_LFR_SCIENCE_3 3 // TM packets with fixed size
127 126 #define TM_SUBTYPE_LFR_SCIENCE_6 6 // TM packets with variable size
128 127 #define TM_SUBTYPE_PARAMETER_DUMP 32
129 128 #define TM_SUBTYPE_K_DUMP 96
130 129
131 130 // FAILURE CODES
132 131 #define ILLEGAL_APID 0
133 132 #define WRONG_LEN_PKT 1
134 133 #define INCOR_CHECKSUM 2
135 134 #define ILL_TYPE 3
136 135 #define ILL_SUBTYPE 4
137 136 #define WRONG_APP_DATA 5 // 0x00 0x05
138 137 #define TC_NOT_EXE 42000 // 0xa4 0x10
139 138 #define WRONG_SRC_ID 42001 // 0xa4 0x11
140 139 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
141 140 #define FAIL_DETECTED 42003 // 0xa4 0x13
142 141 #define NOT_ALLOWED 42004 // 0xa4 0x14
143 142 #define CORRUPTED 42005 // 0xa4 0x15
144 143 #define CCSDS_TM_VALID 7
145 144
146 145 // HK_LFR_LAST_ER_RID
147 146 #define RID_LE_LFR_TIME 42119
148 147 #define RID_LE_LFR_DPU_SPW 42128
149 148 #define RID_LE_LFR_TIMEC 42129
150 149 #define RID_ME_LFR_DPU_SPW 42338
151 150 // HK_LFR_LAST_ER_CODE
152 151 #define CODE_PARITY 1
153 152 #define CODE_DISCONNECT 2
154 153 #define CODE_ESCAPE 3
155 154 #define CODE_CREDIT 4
156 155 #define CODE_WRITE_SYNC 5
157 156 #define CODE_EARLY_EOP_EEP 6
158 157 #define CODE_INVALID_ADDRESS 7
159 158 #define CODE_EEP 8
160 159 #define CODE_RX_TOO_BIG 9
161 160 #define CODE_HEADER_CRC 16
162 161 #define CODE_DATA_CRC 17
163 162 #define CODE_ERRONEOUS 20
164 163 #define CODE_MISSING 21
165 164 #define CODE_INVALID 22
166 165 #define CODE_TIMECODE_IT 24
167 166 #define CODE_NOT_SYNCHRO 25
168 167 #define CODE_TIMECODE_CTR 26
169 168
170 169 // TC SID
171 170 #define SID_TC_GROUND 0
172 171 #define SID_TC_MISSION_TIMELINE 110
173 172 #define SID_TC_TC_SEQUENCES 111
174 173 #define SID_TC_RECOVERY_ACTION_CMD 112
175 174 #define SID_TC_BACKUP_MISSION_TIMELINE 113
176 175 #define SID_TC_DIRECT_CMD 120
177 176 #define SID_TC_SPARE_GRD_SRC1 121
178 177 #define SID_TC_SPARE_GRD_SRC2 122
179 178 #define SID_TC_OBCP 15
180 179 #define SID_TC_SYSTEM_CONTROL 14
181 180 #define SID_TC_AOCS 11
182 181 #define SID_TC_RPW_INTERNAL 254
183 182
184 183 enum apid_destid{
185 184 GROUND,
186 185 MISSION_TIMELINE,
187 186 TC_SEQUENCES,
188 187 RECOVERY_ACTION_CMD,
189 188 BACKUP_MISSION_TIMELINE,
190 189 DIRECT_CMD,
191 190 SPARE_GRD_SRC1,
192 191 SPARE_GRD_SRC2,
193 192 OBCP,
194 193 SYSTEM_CONTROL,
195 194 AOCS,
196 195 RPW_INTERNAL
197 196 };
198 197 // SEQUENCE COUNTERS
199 198 #define SEQ_CNT_MAX 16383
200 199 #define SEQ_CNT_NB_DEST_ID 12
201 200
202 201 // TM SID
203 202 #define SID_HK 1
204 203
205 204 #define SID_NORM_SWF_F0 3
206 205 #define SID_NORM_SWF_F1 4
207 206 #define SID_NORM_SWF_F2 5
208 207 #define SID_NORM_CWF_F3 1
209 208 #define SID_BURST_CWF_F2 2
210 209 #define SID_SBM1_CWF_F1 24
211 210 #define SID_SBM2_CWF_F2 25
212 211 #define SID_NORM_ASM_F0 11
213 212 #define SID_NORM_ASM_F1 12
214 213 #define SID_NORM_ASM_F2 13
215 214 #define SID_NORM_BP1_F0 14
216 215 #define SID_NORM_BP1_F1 15
217 216 #define SID_NORM_BP1_F2 16
218 217 #define SID_NORM_BP2_F0 19
219 218 #define SID_NORM_BP2_F1 20
220 219 #define SID_NORM_BP2_F2 21
221 220 #define SID_BURST_BP1_F0 17
222 221 #define SID_BURST_BP2_F0 22
223 222 #define SID_BURST_BP1_F1 18
224 223 #define SID_BURST_BP2_F1 23
225 224 #define SID_SBM1_BP1_F0 28
226 225 #define SID_SBM1_BP2_F0 31
227 226 #define SID_SBM2_BP1_F0 29
228 227 #define SID_SBM2_BP2_F0 32
229 228 #define SID_SBM2_BP1_F1 30
230 229 #define SID_SBM2_BP2_F1 33
231 230 #define SID_NORM_CWF_LONG_F3 34
232 231
233 232 #define SID_PARAMETER_DUMP 10
234 233 #define SID_K_DUMP 11
235 234
236 235 // HEADER_LENGTH
237 236 //#define TM_HEADER_LEN 16
238 237 #define HEADER_LENGTH_TM_LFR_SCIENCE_CWF 32
239 238 #define HEADER_LENGTH_TM_LFR_SCIENCE_SWF 34
240 239 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 34
241 240 // PACKET_LENGTH
242 241 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
243 242 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
244 243 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
245 244 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
246 245 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
247 246 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
248 247 #define PACKET_LENGTH_HK (136 - CCSDS_TC_TM_PACKET_OFFSET)
249 248 #define PACKET_LENGTH_PARAMETER_DUMP (148 - CCSDS_TC_TM_PACKET_OFFSET)
250 249 #define PACKET_LENGTH_K_DUMP (3920 - CCSDS_TC_TM_PACKET_OFFSET)
251 250 // SCIENCE ASM
252 251 #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
253 252 #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
254 253 #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
255 254 #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
256 255 #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
257 256 // SCIENCE NORM
258 257 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (150 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 11 + 29 (1 spare byte in the header)
259 258 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (172 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 11 + 29 (1 spare byte in the header)
260 259 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (160 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 11 + 28
261 260 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (358 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 28
262 261 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (418 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 28
263 262 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (388 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 28
264 263 // SCIENCE SBM
265 264 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (270 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 11 + 28
266 265 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (688 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 28
267 266 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (314 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 11 + 28
268 267 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (808 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 28
269 268
270 269 #define PACKET_LENGTH_DELTA 11 // 7 + 4
271 270
272 271 #define SPARE1_PUSVERSION_SPARE2 0x10
273 272
274 273 // R3
275 274 // one snapshot = 2048 samples = 6 packets * 304 + 224
276 275 #define TM_LEN_SCI_SWF_304 (3678 - CCSDS_TC_TM_PACKET_OFFSET) // 304 * 12 + 30
277 276 #define TM_LEN_SCI_SWF_224 (2718 - CCSDS_TC_TM_PACKET_OFFSET) // 224 * 12 + 30
278 277 // one continuous buffer = 2688 samples = 8 packets * 336
279 278 #define TM_LEN_SCI_CWF_336 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 336 * 12 + 28
280 279 #define TM_LEN_SCI_CWF_672 (4060 - CCSDS_TC_TM_PACKET_OFFSET) // 672 * 6 + 28
281 280 //
282 281 #define DEFAULT_PKTCNT 0x07
283 282 #define BLK_NR_304 0x0130
284 283 #define BLK_NR_224 0x00e0
285 284 #define BLK_NR_CWF 0x0150 // 336
286 285 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
287 286
288 287 enum TM_TYPE{
289 288 TM_LFR_TC_EXE_OK,
290 289 TM_LFR_TC_EXE_ERR,
291 290 TM_LFR_HK,
292 291 TM_LFR_SCI,
293 292 TM_LFR_SCI_SBM,
294 293 TM_LFR_PAR_DUMP
295 294 };
296 295
297 296 typedef struct {
298 297 unsigned char targetLogicalAddress;
299 298 unsigned char protocolIdentifier;
300 299 unsigned char reserved;
301 300 unsigned char userApplication;
302 301 // PACKET HEADER
303 302 unsigned char packetID[2];
304 303 unsigned char packetSequenceControl[2];
305 304 unsigned char packetLength[2];
306 305 // DATA FIELD HEADER
307 306 unsigned char spare1_pusVersion_spare2;
308 307 unsigned char serviceType;
309 308 unsigned char serviceSubType;
310 309 unsigned char destinationID;
311 310 unsigned char time[6];
312 311 //
313 312 unsigned char telecommand_pkt_id[2];
314 313 unsigned char pkt_seq_control[2];
315 314 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
316 315
317 316 typedef struct {
318 317 unsigned char targetLogicalAddress;
319 318 unsigned char protocolIdentifier;
320 319 unsigned char reserved;
321 320 unsigned char userApplication;
322 321 // PACKET HEADER
323 322 unsigned char packetID[2];
324 323 unsigned char packetSequenceControl[2];
325 324 unsigned char packetLength[2];
326 325 // DATA FIELD HEADER
327 326 unsigned char spare1_pusVersion_spare2;
328 327 unsigned char serviceType;
329 328 unsigned char serviceSubType;
330 329 unsigned char destinationID;
331 330 unsigned char time[6];
332 331 //
333 332 unsigned char telecommand_pkt_id[2];
334 333 unsigned char pkt_seq_control[2];
335 334 unsigned char tc_failure_code[2];
336 335 unsigned char tc_service;
337 336 unsigned char tc_subtype;
338 337 unsigned char byte_position;
339 338 unsigned char rcv_value;
340 339 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
341 340
342 341 typedef struct {
343 342 unsigned char targetLogicalAddress;
344 343 unsigned char protocolIdentifier;
345 344 unsigned char reserved;
346 345 unsigned char userApplication;
347 346 // PACKET HEADER
348 347 unsigned char packetID[2];
349 348 unsigned char packetSequenceControl[2];
350 349 unsigned char packetLength[2];
351 350 // DATA FIELD HEADER
352 351 unsigned char spare1_pusVersion_spare2;
353 352 unsigned char serviceType;
354 353 unsigned char serviceSubType;
355 354 unsigned char destinationID;
356 355 unsigned char time[6];
357 356 //
358 357 unsigned char telecommand_pkt_id[2];
359 358 unsigned char pkt_seq_control[2];
360 359 unsigned char tc_failure_code[2];
361 360 unsigned char tc_service;
362 361 unsigned char tc_subtype;
363 362 unsigned char lfr_status_word[2];
364 363 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
365 364
366 365 typedef struct {
367 366 unsigned char targetLogicalAddress;
368 367 unsigned char protocolIdentifier;
369 368 unsigned char reserved;
370 369 unsigned char userApplication;
371 370 // PACKET HEADER
372 371 unsigned char packetID[2];
373 372 unsigned char packetSequenceControl[2];
374 373 unsigned char packetLength[2];
375 374 // DATA FIELD HEADER
376 375 unsigned char spare1_pusVersion_spare2;
377 376 unsigned char serviceType;
378 377 unsigned char serviceSubType;
379 378 unsigned char destinationID;
380 379 unsigned char time[6];
381 380 //
382 381 unsigned char telecommand_pkt_id[2];
383 382 unsigned char pkt_seq_control[2];
384 383 unsigned char tc_failure_code[2];
385 384 unsigned char tc_service;
386 385 unsigned char tc_subtype;
387 386 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
388 387
389 388 typedef struct {
390 389 unsigned char targetLogicalAddress;
391 390 unsigned char protocolIdentifier;
392 391 unsigned char reserved;
393 392 unsigned char userApplication;
394 393 // PACKET HEADER
395 394 unsigned char packetID[2];
396 395 unsigned char packetSequenceControl[2];
397 396 unsigned char packetLength[2];
398 397 // DATA FIELD HEADER
399 398 unsigned char spare1_pusVersion_spare2;
400 399 unsigned char serviceType;
401 400 unsigned char serviceSubType;
402 401 unsigned char destinationID;
403 402 unsigned char time[6];
404 403 //
405 404 unsigned char telecommand_pkt_id[2];
406 405 unsigned char pkt_seq_control[2];
407 406 unsigned char tc_failure_code[2];
408 407 unsigned char tc_service;
409 408 unsigned char tc_subtype;
410 409 } Packet_TM_LFR_TC_EXE_ERROR_t;
411 410
412 411 typedef struct {
413 412 unsigned char targetLogicalAddress;
414 413 unsigned char protocolIdentifier;
415 414 unsigned char reserved;
416 415 unsigned char userApplication;
417 416 // PACKET HEADER
418 417 unsigned char packetID[2];
419 418 unsigned char packetSequenceControl[2];
420 419 unsigned char packetLength[2];
421 420 // DATA FIELD HEADER
422 421 unsigned char spare1_pusVersion_spare2;
423 422 unsigned char serviceType;
424 423 unsigned char serviceSubType;
425 424 unsigned char destinationID;
426 425 unsigned char time[6];
427 426 //
428 427 unsigned char telecommand_pkt_id[2];
429 428 unsigned char pkt_seq_control[2];
430 429 unsigned char tc_failure_code[2];
431 430 unsigned char tc_service;
432 431 unsigned char tc_subtype;
433 432 unsigned char pkt_len_rcv_value[2];
434 433 unsigned char pkt_datafieldsize_cnt[2];
435 434 unsigned char rcv_crc[2];
436 435 unsigned char computed_crc[2];
437 436 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
438 437
439 438 typedef struct {
440 439 unsigned char targetLogicalAddress;
441 440 unsigned char protocolIdentifier;
442 441 unsigned char reserved;
443 442 unsigned char userApplication;
444 443 unsigned char packetID[2];
445 444 unsigned char packetSequenceControl[2];
446 445 unsigned char packetLength[2];
447 446 // DATA FIELD HEADER
448 447 unsigned char spare1_pusVersion_spare2;
449 448 unsigned char serviceType;
450 449 unsigned char serviceSubType;
451 450 unsigned char destinationID;
452 451 unsigned char time[6];
453 452 // AUXILIARY HEADER
454 453 unsigned char sid;
455 454 unsigned char pa_bia_status_info;
456 455 unsigned char sy_lfr_common_parameters_spare;
457 456 unsigned char sy_lfr_common_parameters;
458 457 unsigned char pktCnt;
459 458 unsigned char pktNr;
460 459 unsigned char acquisitionTime[6];
461 460 unsigned char blkNr[2];
462 461 } Header_TM_LFR_SCIENCE_SWF_t;
463 462
464 463 typedef struct {
465 464 unsigned char targetLogicalAddress;
466 465 unsigned char protocolIdentifier;
467 466 unsigned char reserved;
468 467 unsigned char userApplication;
469 468 unsigned char packetID[2];
470 469 unsigned char packetSequenceControl[2];
471 470 unsigned char packetLength[2];
472 471 // DATA FIELD HEADER
473 472 unsigned char spare1_pusVersion_spare2;
474 473 unsigned char serviceType;
475 474 unsigned char serviceSubType;
476 475 unsigned char destinationID;
477 476 unsigned char time[6];
478 477 // AUXILIARY DATA HEADER
479 478 unsigned char sid;
480 479 unsigned char pa_bia_status_info;
481 480 unsigned char sy_lfr_common_parameters_spare;
482 481 unsigned char sy_lfr_common_parameters;
483 482 unsigned char acquisitionTime[6];
484 483 unsigned char blkNr[2];
485 484 } Header_TM_LFR_SCIENCE_CWF_t;
486 485
487 486 typedef struct {
488 487 unsigned char targetLogicalAddress;
489 488 unsigned char protocolIdentifier;
490 489 unsigned char reserved;
491 490 unsigned char userApplication;
492 491 unsigned char packetID[2];
493 492 unsigned char packetSequenceControl[2];
494 493 unsigned char packetLength[2];
495 494 // DATA FIELD HEADER
496 495 unsigned char spare1_pusVersion_spare2;
497 496 unsigned char serviceType;
498 497 unsigned char serviceSubType;
499 498 unsigned char destinationID;
500 499 unsigned char time[6];
501 500 // AUXILIARY HEADER
502 501 unsigned char sid;
503 502 unsigned char pa_bia_status_info;
504 503 unsigned char sy_lfr_common_parameters_spare;
505 504 unsigned char sy_lfr_common_parameters;
506 505 unsigned char pa_lfr_pkt_cnt_asm;
507 506 unsigned char pa_lfr_pkt_nr_asm;
508 507 unsigned char acquisitionTime[6];
509 508 unsigned char pa_lfr_asm_blk_nr[2];
510 509 } Header_TM_LFR_SCIENCE_ASM_t;
511 510
512 511 typedef struct {
513 512 unsigned char targetLogicalAddress;
514 513 unsigned char protocolIdentifier;
515 514 unsigned char reserved;
516 515 unsigned char userApplication;
517 516 unsigned char packetID[2];
518 517 unsigned char packetSequenceControl[2];
519 518 unsigned char packetLength[2];
520 519 // DATA FIELD HEADER
521 520 unsigned char spare1_pusVersion_spare2;
522 521 unsigned char serviceType;
523 522 unsigned char serviceSubType;
524 523 unsigned char destinationID;
525 524 unsigned char time[6];
526 525 // AUXILIARY HEADER
527 526 unsigned char sid;
528 527 unsigned char pa_bia_status_info;
529 528 unsigned char sy_lfr_common_parameters_spare;
530 529 unsigned char sy_lfr_common_parameters;
531 530 unsigned char acquisitionTime[6];
532 531 unsigned char source_data_spare;
533 532 unsigned char pa_lfr_bp_blk_nr[2];
534 533 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
535 534
536 535 typedef struct {
537 536 unsigned char targetLogicalAddress;
538 537 unsigned char protocolIdentifier;
539 538 unsigned char reserved;
540 539 unsigned char userApplication;
541 540 unsigned char packetID[2];
542 541 unsigned char packetSequenceControl[2];
543 542 unsigned char packetLength[2];
544 543 // DATA FIELD HEADER
545 544 unsigned char spare1_pusVersion_spare2;
546 545 unsigned char serviceType;
547 546 unsigned char serviceSubType;
548 547 unsigned char destinationID;
549 548 unsigned char time[6];
550 549 // AUXILIARY HEADER
551 550 unsigned char sid;
552 551 unsigned char pa_bia_status_info;
553 552 unsigned char sy_lfr_common_parameters_spare;
554 553 unsigned char sy_lfr_common_parameters;
555 554 unsigned char acquisitionTime[6];
556 555 unsigned char pa_lfr_bp_blk_nr[2];
557 556 } Header_TM_LFR_SCIENCE_BP_t;
558 557
559 558 typedef struct {
560 //targetLogicalAddress is removed by the grspw module
559 // TARGET LOGICAL ADDRESS (targetLogicalAddress) IS REMOVED BY THE GRSPW MODULE
561 560 unsigned char protocolIdentifier;
562 561 unsigned char reserved;
563 562 unsigned char userApplication;
564 563 unsigned char packetID[2];
565 564 unsigned char packetSequenceControl[2];
566 565 unsigned char packetLength[2];
567 566 // DATA FIELD HEADER
568 567 unsigned char headerFlag_pusVersion_Ack;
569 568 unsigned char serviceType;
570 569 unsigned char serviceSubType;
571 570 unsigned char sourceID;
572 571 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
573 572 } ccsdsTelecommandPacket_t;
574 573
575 574 typedef struct {
576 575 unsigned char targetLogicalAddress;
577 576 unsigned char protocolIdentifier;
578 577 unsigned char reserved;
579 578 unsigned char userApplication;
580 579 unsigned char packetID[2];
581 580 unsigned char packetSequenceControl[2];
582 581 unsigned char packetLength[2];
583 582 unsigned char spare1_pusVersion_spare2;
584 583 unsigned char serviceType;
585 584 unsigned char serviceSubType;
586 585 unsigned char destinationID;
587 586 unsigned char time[6];
588 587 unsigned char sid;
589 588
590 589 //**************
591 590 // HK PARAMETERS
592 591 unsigned char lfr_status_word[2];
593 592 unsigned char lfr_sw_version[4];
594 593 unsigned char lfr_fpga_version[3];
595 594 // ressource statistics
596 595 unsigned char hk_lfr_cpu_load;
597 596 unsigned char hk_lfr_cpu_load_max;
598 597 unsigned char hk_lfr_cpu_load_aver;
599 598 unsigned char hk_lfr_q_sd_fifo_size_max;
600 599 unsigned char hk_lfr_q_sd_fifo_size;
601 600 unsigned char hk_lfr_q_rv_fifo_size_max;
602 601 unsigned char hk_lfr_q_rv_fifo_size;
603 602 unsigned char hk_lfr_q_p0_fifo_size_max;
604 603 unsigned char hk_lfr_q_p0_fifo_size;
605 604 unsigned char hk_lfr_q_p1_fifo_size_max;
606 605 unsigned char hk_lfr_q_p1_fifo_size;
607 606 unsigned char hk_lfr_q_p2_fifo_size_max;
608 607 unsigned char hk_lfr_q_p2_fifo_size;
609 608 // tc statistics
610 609 unsigned char hk_lfr_update_info_tc_cnt[2];
611 610 unsigned char hk_lfr_update_time_tc_cnt[2];
612 611 unsigned char hk_lfr_exe_tc_cnt[2];
613 612 unsigned char hk_lfr_rej_tc_cnt[2];
614 613 unsigned char hk_lfr_last_exe_tc_id[2];
615 614 unsigned char hk_lfr_last_exe_tc_type[2];
616 615 unsigned char hk_lfr_last_exe_tc_subtype[2];
617 616 unsigned char hk_lfr_last_exe_tc_time[6];
618 617 unsigned char hk_lfr_last_rej_tc_id[2];
619 618 unsigned char hk_lfr_last_rej_tc_type[2];
620 619 unsigned char hk_lfr_last_rej_tc_subtype[2];
621 620 unsigned char hk_lfr_last_rej_tc_time[6];
622 621 // anomaly statistics
623 622 unsigned char hk_lfr_le_cnt[2];
624 623 unsigned char hk_lfr_me_cnt[2];
625 624 unsigned char hk_lfr_he_cnt[2];
626 625 unsigned char hk_lfr_last_er_rid[2];
627 626 unsigned char hk_lfr_last_er_code;
628 627 unsigned char hk_lfr_last_er_time[6];
629 628 // vhdl_blk_status
630 629 unsigned char hk_lfr_vhdl_aa_sm;
631 630 unsigned char hk_lfr_vhdl_fft_sr;
632 631 unsigned char hk_lfr_vhdl_cic_hk;
633 632 unsigned char hk_lfr_vhdl_iir_cal;
634 633 // spacewire_if_statistics
635 634 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
636 635 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
637 636 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
638 637 unsigned char hk_lfr_dpu_spw_last_timc;
639 638 // ahb error statistics
640 639 unsigned char hk_lfr_last_fail_addr[4];
641 640 // temperatures
642 641 unsigned char hk_lfr_temp_scm[2];
643 642 unsigned char hk_lfr_temp_pcb[2];
644 643 unsigned char hk_lfr_temp_fpga[2];
645 644 // spacecraft potential
646 645 unsigned char hk_lfr_sc_v_f3[2];
647 646 unsigned char hk_lfr_sc_e1_f3[2];
648 647 unsigned char hk_lfr_sc_e2_f3[2];
649 648 // lfr common parameters
650 649 unsigned char sy_lfr_common_parameters_spare;
651 650 unsigned char sy_lfr_common_parameters;
652 651 // error counters
653 652 unsigned char hk_lfr_dpu_spw_parity;
654 653 unsigned char hk_lfr_dpu_spw_disconnect;
655 654 unsigned char hk_lfr_dpu_spw_escape;
656 655 unsigned char hk_lfr_dpu_spw_credit;
657 656 unsigned char hk_lfr_dpu_spw_write_sync;
658 657 unsigned char hk_lfr_dpu_spw_rx_ahb;
659 658 unsigned char hk_lfr_dpu_spw_tx_ahb;
660 659 unsigned char hk_lfr_dpu_spw_early_eop;
661 660 unsigned char hk_lfr_dpu_spw_invalid_addr;
662 661 unsigned char hk_lfr_dpu_spw_eep;
663 662 unsigned char hk_lfr_dpu_spw_rx_too_big;
664 663 // timecode
665 664 unsigned char hk_lfr_timecode_erroneous;
666 665 unsigned char hk_lfr_timecode_missing;
667 666 unsigned char hk_lfr_timecode_invalid;
668 667 // time
669 668 unsigned char hk_lfr_time_timecode_it;
670 669 unsigned char hk_lfr_time_not_synchro;
671 670 unsigned char hk_lfr_time_timecode_ctr;
672 671 // hk_lfr_buffer_dpu_
673 672 unsigned char hk_lfr_buffer_dpu_tc_fifo;
674 673 unsigned char hk_lfr_buffer_dpu_tm_fifo;
675 674 // hk_lfr_ahb_
676 675 unsigned char hk_lfr_ahb_correctable;
677 676 unsigned char hk_lfr_ahb_uncorrectable;
678 677 // reaction wheel frequency
679 678 unsigned char hk_lfr_sc_rw_f_flags;
680 679 } Packet_TM_LFR_HK_t;
681 680
682 681 typedef struct {
683 682 unsigned char targetLogicalAddress;
684 683 unsigned char protocolIdentifier;
685 684 unsigned char reserved;
686 685 unsigned char userApplication;
687 686 unsigned char packetID[2];
688 687 unsigned char packetSequenceControl[2];
689 688 unsigned char packetLength[2];
690 689 // DATA FIELD HEADER
691 690 unsigned char spare1_pusVersion_spare2;
692 691 unsigned char serviceType;
693 692 unsigned char serviceSubType;
694 693 unsigned char destinationID;
695 694 unsigned char time[6];
696 695 unsigned char sid;
697 696
698 697 //******************
699 698 // COMMON PARAMETERS
700 699 unsigned char sy_lfr_common_parameters_spare;
701 700 unsigned char sy_lfr_common_parameters;
702 701
703 702 //******************
704 703 // NORMAL PARAMETERS
705 704 unsigned char sy_lfr_n_swf_l[2];
706 705 unsigned char sy_lfr_n_swf_p[2];
707 706 unsigned char sy_lfr_n_asm_p[2];
708 707 unsigned char sy_lfr_n_bp_p0;
709 708 unsigned char sy_lfr_n_bp_p1;
710 709 unsigned char sy_lfr_n_cwf_long_f3;
711 710 unsigned char pa_rpw_spare8_1;
712 711
713 712 //*****************
714 713 // BURST PARAMETERS
715 714 unsigned char sy_lfr_b_bp_p0;
716 715 unsigned char sy_lfr_b_bp_p1;
717 716
718 717 //****************
719 718 // SBM1 PARAMETERS
720 719 unsigned char sy_lfr_s1_bp_p0;
721 720 unsigned char sy_lfr_s1_bp_p1;
722 721
723 722 //****************
724 723 // SBM2 PARAMETERS
725 724 unsigned char sy_lfr_s2_bp_p0;
726 725 unsigned char sy_lfr_s2_bp_p1;
727 726
728 727 // mask F0
729 728 union{
730 729 struct{
731 730 unsigned char f0_word1[4];
732 731 unsigned char f0_word2[4];
733 732 unsigned char f0_word3[4];
734 733 unsigned char f0_word4[4];
735 734 // mask F1
736 735 unsigned char f1_word1[4];
737 736 unsigned char f1_word2[4];
738 737 unsigned char f1_word3[4];
739 738 unsigned char f1_word4[4];
740 739 // mask F2
741 740 unsigned char f2_word1[4];
742 741 unsigned char f2_word2[4];
743 742 unsigned char f2_word3[4];
744 743 unsigned char f2_word4[4];
745 744 } fx;
746 745 unsigned char raw[ 4 * 4 * 3 ];
747 746 } sy_lfr_fbins;
748 747
749 748 // PAS FILTER PARAMETERS
750 749 unsigned char pa_rpw_spare8_2;
751 750 unsigned char spare_sy_lfr_pas_filter_enabled;
752 751 unsigned char sy_lfr_pas_filter_modulus;
753 752 unsigned char sy_lfr_pas_filter_tbad[4];
754 753 unsigned char sy_lfr_pas_filter_offset;
755 754 unsigned char sy_lfr_pas_filter_shift[4];
756 755 unsigned char sy_lfr_sc_rw_delta_f[4];
757 756
758 757 // LFR_RW_MASK
759 758 union{
760 759 struct{
761 760 unsigned char f0_word1[4];
762 761 unsigned char f0_word2[4];
763 762 unsigned char f0_word3[4];
764 763 unsigned char f0_word4[4];
765 764 // mask F1
766 765 unsigned char f1_word1[4];
767 766 unsigned char f1_word2[4];
768 767 unsigned char f1_word3[4];
769 768 unsigned char f1_word4[4];
770 769 // mask F2
771 770 unsigned char f2_word1[4];
772 771 unsigned char f2_word2[4];
773 772 unsigned char f2_word3[4];
774 773 unsigned char f2_word4[4];
775 774 } fx;
776 775 unsigned char raw[ 4 * 4 * 3 ];
777 776 } sy_lfr_rw_mask;
778 777
779 778 // SPARE
780 779 unsigned char pa_rpw_spare8_3;
781 780 } Packet_TM_LFR_PARAMETER_DUMP_t;
782 781
783 782 typedef struct {
784 783 unsigned char targetLogicalAddress;
785 784 unsigned char protocolIdentifier;
786 785 unsigned char reserved;
787 786 unsigned char userApplication;
788 787 unsigned char packetID[2];
789 788 unsigned char packetSequenceControl[2];
790 789 unsigned char packetLength[2];
791 790 // DATA FIELD HEADER
792 791 unsigned char spare1_pusVersion_spare2;
793 792 unsigned char serviceType;
794 793 unsigned char serviceSubType;
795 794 unsigned char destinationID;
796 795 unsigned char time[6];
797 796 unsigned char sid;
798 797 unsigned char pkt_cnt;
799 798 unsigned char pkt_nr;
800 799 unsigned char blk_nr;
801 800
802 801 //******************
803 802 // SOURCE DATA repeated N times with N in [0 .. PA_LFR_KCOEFF_BLK_NR]
804 803 unsigned char kcoeff_blks[3900]; // one blk is 2 + 4 * 32 = 130 bytes, 30 blks max in one packet (30 * 130 = 3900)
805 804
806 805 } Packet_TM_LFR_KCOEFFICIENTS_DUMP_t;
807 806
808 807 #endif // CCSDS_TYPES_H_INCLUDED
General Comments 0
You need to be logged in to leave comments. Login now