##// END OF EJS Templates
sequence counters management added
paul -
r56:7b010fae8e4e default
parent child
Show More
@@ -1,6 +1,6
1 #############################################################################
1 #############################################################################
2 # Makefile for building: bin/fsw
2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Nov 5 13:12:35 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Nov 7 08:03:44 2013
4 # Project: fsw-qt.pro
4 # Project: fsw-qt.pro
5 # Template: app
5 # Template: app
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -1,6 +1,6
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 2.8.1, 2013-11-05T13:11:18. -->
3 <!-- Written by QtCreator 2.8.1, 2013-11-08T07:03:44. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -121,7 +121,6
121 #define CCSDS_TM_VALID 7
121 #define CCSDS_TM_VALID 7
122
122
123 // TC SID
123 // TC SID
124 #define SID_TC_DEFAULT 0 // the default SID for TC sent to the LFR
125 #define SID_TC_GROUND 0
124 #define SID_TC_GROUND 0
126 #define SID_TC_MISSION_TIMELINE 110
125 #define SID_TC_MISSION_TIMELINE 110
127 #define SID_TC_TC_SEQUENCES 111
126 #define SID_TC_TC_SEQUENCES 111
@@ -135,6 +134,25
135 #define SID_TC_AOCS 11
134 #define SID_TC_AOCS 11
136 #define SID_TC_RPW_INTERNAL 254
135 #define SID_TC_RPW_INTERNAL 254
137
136
137 enum apid_destid{
138 GROUND,
139 MISSION_TIMELINE,
140 TC_SEQUENCES,
141 RECOVERY_ACTION_CMD,
142 BACKUP_MISSION_TIMELINE,
143 DIRECT_CMD,
144 SPARE_GRD_SRC1,
145 SPARE_GRD_SRC2,
146 OBCP,
147 SYSTEM_CONTROL,
148 AOCS,
149 RPW_INTERNAL,
150 UNKNOWN
151 };
152 // SEQUENCE COUNTERS
153 #define SEQ_CNT_MAX 16383
154 #define SEQ_CNT_NB_DEST_ID 12
155
138 // TM SID
156 // TM SID
139 #define SID_HK 1
157 #define SID_HK 1
140 #define SID_PARAMETER_DUMP 10
158 #define SID_PARAMETER_DUMP 10
@@ -210,301 +228,301 enum TM_TYPE{
210
228
211 struct TMHeader_str
229 struct TMHeader_str
212 {
230 {
213 volatile unsigned char targetLogicalAddress;
231 unsigned char targetLogicalAddress;
214 volatile unsigned char protocolIdentifier;
232 unsigned char protocolIdentifier;
215 volatile unsigned char reserved;
233 unsigned char reserved;
216 volatile unsigned char userApplication;
234 unsigned char userApplication;
217 volatile unsigned char packetID[2];
235 unsigned char packetID[2];
218 volatile unsigned char packetSequenceControl[2];
236 unsigned char packetSequenceControl[2];
219 volatile unsigned char packetLength[2];
237 unsigned char packetLength[2];
220 // DATA FIELD HEADER
238 // DATA FIELD HEADER
221 volatile unsigned char spare1_pusVersion_spare2;
239 unsigned char spare1_pusVersion_spare2;
222 volatile unsigned char serviceType;
240 unsigned char serviceType;
223 volatile unsigned char serviceSubType;
241 unsigned char serviceSubType;
224 volatile unsigned char destinationID;
242 unsigned char destinationID;
225 volatile unsigned char time[6];
243 unsigned char time[6];
226 };
244 };
227 typedef struct TMHeader_str TMHeader_t;
245 typedef struct TMHeader_str TMHeader_t;
228
246
229 struct Packet_TM_LFR_TC_EXE_str
247 struct Packet_TM_LFR_TC_EXE_str
230 {
248 {
231 volatile unsigned char targetLogicalAddress;
249 unsigned char targetLogicalAddress;
232 volatile unsigned char protocolIdentifier;
250 unsigned char protocolIdentifier;
233 volatile unsigned char reserved;
251 unsigned char reserved;
234 volatile unsigned char userApplication;
252 unsigned char userApplication;
235 volatile unsigned char packetID[2];
253 unsigned char packetID[2];
236 volatile unsigned char packetSequenceControl[2];
254 unsigned char packetSequenceControl[2];
237 volatile unsigned char packetLength[2];
255 unsigned char packetLength[2];
238 // DATA FIELD HEADER
256 // DATA FIELD HEADER
239 volatile unsigned char spare1_pusVersion_spare2;
257 unsigned char spare1_pusVersion_spare2;
240 volatile unsigned char serviceType;
258 unsigned char serviceType;
241 volatile unsigned char serviceSubType;
259 unsigned char serviceSubType;
242 volatile unsigned char destinationID;
260 unsigned char destinationID;
243 volatile unsigned char time[6];
261 unsigned char time[6];
244 volatile unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1];
262 unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1];
245 };
263 };
246 typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t;
264 typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t;
247
265
248 struct Packet_TM_LFR_TC_EXE_SUCCESS_str
266 struct Packet_TM_LFR_TC_EXE_SUCCESS_str
249 {
267 {
250 volatile unsigned char targetLogicalAddress;
268 unsigned char targetLogicalAddress;
251 volatile unsigned char protocolIdentifier;
269 unsigned char protocolIdentifier;
252 volatile unsigned char reserved;
270 unsigned char reserved;
253 volatile unsigned char userApplication;
271 unsigned char userApplication;
254 // PACKET HEADER
272 // PACKET HEADER
255 volatile unsigned char packetID[2];
273 unsigned char packetID[2];
256 volatile unsigned char packetSequenceControl[2];
274 unsigned char packetSequenceControl[2];
257 volatile unsigned char packetLength[2];
275 unsigned char packetLength[2];
258 // DATA FIELD HEADER
276 // DATA FIELD HEADER
259 volatile unsigned char spare1_pusVersion_spare2;
277 unsigned char spare1_pusVersion_spare2;
260 volatile unsigned char serviceType;
278 unsigned char serviceType;
261 volatile unsigned char serviceSubType;
279 unsigned char serviceSubType;
262 volatile unsigned char destinationID;
280 unsigned char destinationID;
263 volatile unsigned char time[6];
281 unsigned char time[6];
264 //
282 //
265 volatile unsigned char telecommand_pkt_id[2];
283 unsigned char telecommand_pkt_id[2];
266 volatile unsigned char pkt_seq_control[2];
284 unsigned char pkt_seq_control[2];
267 };
285 };
268 typedef struct Packet_TM_LFR_TC_EXE_SUCCESS_str Packet_TM_LFR_TC_EXE_SUCCESS_t;
286 typedef struct Packet_TM_LFR_TC_EXE_SUCCESS_str Packet_TM_LFR_TC_EXE_SUCCESS_t;
269
287
270 struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str
288 struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str
271 {
289 {
272 volatile unsigned char targetLogicalAddress;
290 unsigned char targetLogicalAddress;
273 volatile unsigned char protocolIdentifier;
291 unsigned char protocolIdentifier;
274 volatile unsigned char reserved;
292 unsigned char reserved;
275 volatile unsigned char userApplication;
293 unsigned char userApplication;
276 // PACKET HEADER
294 // PACKET HEADER
277 volatile unsigned char packetID[2];
295 unsigned char packetID[2];
278 volatile unsigned char packetSequenceControl[2];
296 unsigned char packetSequenceControl[2];
279 volatile unsigned char packetLength[2];
297 unsigned char packetLength[2];
280 // DATA FIELD HEADER
298 // DATA FIELD HEADER
281 volatile unsigned char spare1_pusVersion_spare2;
299 unsigned char spare1_pusVersion_spare2;
282 volatile unsigned char serviceType;
300 unsigned char serviceType;
283 volatile unsigned char serviceSubType;
301 unsigned char serviceSubType;
284 volatile unsigned char destinationID;
302 unsigned char destinationID;
285 volatile unsigned char time[6];
303 unsigned char time[6];
286 //
304 //
287 volatile unsigned char tc_failure_code[2];
305 unsigned char tc_failure_code[2];
288 volatile unsigned char telecommand_pkt_id[2];
306 unsigned char telecommand_pkt_id[2];
289 volatile unsigned char pkt_seq_control[2];
307 unsigned char pkt_seq_control[2];
290 volatile unsigned char tc_service;
308 unsigned char tc_service;
291 volatile unsigned char tc_subtype;
309 unsigned char tc_subtype;
292 volatile unsigned char byte_position;
310 unsigned char byte_position;
293 volatile unsigned char rcv_value;
311 unsigned char rcv_value;
294 };
312 };
295 typedef struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
313 typedef struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
296
314
297 struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str
315 struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str
298 {
316 {
299 volatile unsigned char targetLogicalAddress;
317 unsigned char targetLogicalAddress;
300 volatile unsigned char protocolIdentifier;
318 unsigned char protocolIdentifier;
301 volatile unsigned char reserved;
319 unsigned char reserved;
302 volatile unsigned char userApplication;
320 unsigned char userApplication;
303 // PACKET HEADER
321 // PACKET HEADER
304 volatile unsigned char packetID[2];
322 unsigned char packetID[2];
305 volatile unsigned char packetSequenceControl[2];
323 unsigned char packetSequenceControl[2];
306 volatile unsigned char packetLength[2];
324 unsigned char packetLength[2];
307 // DATA FIELD HEADER
325 // DATA FIELD HEADER
308 volatile unsigned char spare1_pusVersion_spare2;
326 unsigned char spare1_pusVersion_spare2;
309 volatile unsigned char serviceType;
327 unsigned char serviceType;
310 volatile unsigned char serviceSubType;
328 unsigned char serviceSubType;
311 volatile unsigned char destinationID;
329 unsigned char destinationID;
312 volatile unsigned char time[6];
330 unsigned char time[6];
313 //
331 //
314 volatile unsigned char tc_failure_code[2];
332 unsigned char tc_failure_code[2];
315 volatile unsigned char telecommand_pkt_id[2];
333 unsigned char telecommand_pkt_id[2];
316 volatile unsigned char pkt_seq_control[2];
334 unsigned char pkt_seq_control[2];
317 volatile unsigned char tc_service;
335 unsigned char tc_service;
318 volatile unsigned char tc_subtype;
336 unsigned char tc_subtype;
319 volatile unsigned char lfr_status_word[2];
337 unsigned char lfr_status_word[2];
320 };
338 };
321 typedef struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
339 typedef struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
322
340
323 struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str
341 struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str
324 {
342 {
325 volatile unsigned char targetLogicalAddress;
343 unsigned char targetLogicalAddress;
326 volatile unsigned char protocolIdentifier;
344 unsigned char protocolIdentifier;
327 volatile unsigned char reserved;
345 unsigned char reserved;
328 volatile unsigned char userApplication;
346 unsigned char userApplication;
329 // PACKET HEADER
347 // PACKET HEADER
330 volatile unsigned char packetID[2];
348 unsigned char packetID[2];
331 volatile unsigned char packetSequenceControl[2];
349 unsigned char packetSequenceControl[2];
332 volatile unsigned char packetLength[2];
350 unsigned char packetLength[2];
333 // DATA FIELD HEADER
351 // DATA FIELD HEADER
334 volatile unsigned char spare1_pusVersion_spare2;
352 unsigned char spare1_pusVersion_spare2;
335 volatile unsigned char serviceType;
353 unsigned char serviceType;
336 volatile unsigned char serviceSubType;
354 unsigned char serviceSubType;
337 volatile unsigned char destinationID;
355 unsigned char destinationID;
338 volatile unsigned char time[6];
356 unsigned char time[6];
339 //
357 //
340 volatile unsigned char tc_failure_code[2];
358 unsigned char tc_failure_code[2];
341 volatile unsigned char telecommand_pkt_id[2];
359 unsigned char telecommand_pkt_id[2];
342 volatile unsigned char pkt_seq_control[2];
360 unsigned char pkt_seq_control[2];
343 volatile unsigned char tc_service;
361 unsigned char tc_service;
344 volatile unsigned char tc_subtype;
362 unsigned char tc_subtype;
345 };
363 };
346 typedef struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
364 typedef struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
347
365
348 struct Packet_TM_LFR_TC_EXE_ERROR_str
366 struct Packet_TM_LFR_TC_EXE_ERROR_str
349 {
367 {
350 volatile unsigned char targetLogicalAddress;
368 unsigned char targetLogicalAddress;
351 volatile unsigned char protocolIdentifier;
369 unsigned char protocolIdentifier;
352 volatile unsigned char reserved;
370 unsigned char reserved;
353 volatile unsigned char userApplication;
371 unsigned char userApplication;
354 // PACKET HEADER
372 // PACKET HEADER
355 volatile unsigned char packetID[2];
373 unsigned char packetID[2];
356 volatile unsigned char packetSequenceControl[2];
374 unsigned char packetSequenceControl[2];
357 volatile unsigned char packetLength[2];
375 unsigned char packetLength[2];
358 // DATA FIELD HEADER
376 // DATA FIELD HEADER
359 volatile unsigned char spare1_pusVersion_spare2;
377 unsigned char spare1_pusVersion_spare2;
360 volatile unsigned char serviceType;
378 unsigned char serviceType;
361 volatile unsigned char serviceSubType;
379 unsigned char serviceSubType;
362 volatile unsigned char destinationID;
380 unsigned char destinationID;
363 volatile unsigned char time[6];
381 unsigned char time[6];
364 //
382 //
365 volatile unsigned char tc_failure_code[2];
383 unsigned char tc_failure_code[2];
366 volatile unsigned char telecommand_pkt_id[2];
384 unsigned char telecommand_pkt_id[2];
367 volatile unsigned char pkt_seq_control[2];
385 unsigned char pkt_seq_control[2];
368 volatile unsigned char tc_service;
386 unsigned char tc_service;
369 volatile unsigned char tc_subtype;
387 unsigned char tc_subtype;
370 };
388 };
371 typedef struct Packet_TM_LFR_TC_EXE_ERROR_str Packet_TM_LFR_TC_EXE_ERROR_t;
389 typedef struct Packet_TM_LFR_TC_EXE_ERROR_str Packet_TM_LFR_TC_EXE_ERROR_t;
372
390
373 struct Packet_TM_LFR_TC_EXE_CORRUPTED_str
391 struct Packet_TM_LFR_TC_EXE_CORRUPTED_str
374 {
392 {
375 volatile unsigned char targetLogicalAddress;
393 unsigned char targetLogicalAddress;
376 volatile unsigned char protocolIdentifier;
394 unsigned char protocolIdentifier;
377 volatile unsigned char reserved;
395 unsigned char reserved;
378 volatile unsigned char userApplication;
396 unsigned char userApplication;
379 // PACKET HEADER
397 // PACKET HEADER
380 volatile unsigned char packetID[2];
398 unsigned char packetID[2];
381 volatile unsigned char packetSequenceControl[2];
399 unsigned char packetSequenceControl[2];
382 volatile unsigned char packetLength[2];
400 unsigned char packetLength[2];
383 // DATA FIELD HEADER
401 // DATA FIELD HEADER
384 volatile unsigned char spare1_pusVersion_spare2;
402 unsigned char spare1_pusVersion_spare2;
385 volatile unsigned char serviceType;
403 unsigned char serviceType;
386 volatile unsigned char serviceSubType;
404 unsigned char serviceSubType;
387 volatile unsigned char destinationID;
405 unsigned char destinationID;
388 volatile unsigned char time[6];
406 unsigned char time[6];
389 //
407 //
390 volatile unsigned char tc_failure_code[2];
408 unsigned char tc_failure_code[2];
391 volatile unsigned char telecommand_pkt_id[2];
409 unsigned char telecommand_pkt_id[2];
392 volatile unsigned char pkt_seq_control[2];
410 unsigned char pkt_seq_control[2];
393 volatile unsigned char tc_service;
411 unsigned char tc_service;
394 volatile unsigned char tc_subtype;
412 unsigned char tc_subtype;
395 volatile unsigned char pkt_len_rcv_value[2];
413 unsigned char pkt_len_rcv_value[2];
396 volatile unsigned char pkt_datafieldsize_cnt[2];
414 unsigned char pkt_datafieldsize_cnt[2];
397 volatile unsigned char rcv_crc[2];
415 unsigned char rcv_crc[2];
398 volatile unsigned char computed_crc[2];
416 unsigned char computed_crc[2];
399 };
417 };
400 typedef struct Packet_TM_LFR_TC_EXE_CORRUPTED_str Packet_TM_LFR_TC_EXE_CORRUPTED_t;
418 typedef struct Packet_TM_LFR_TC_EXE_CORRUPTED_str Packet_TM_LFR_TC_EXE_CORRUPTED_t;
401
419
402 struct Header_TM_LFR_SCIENCE_SWF_str
420 struct Header_TM_LFR_SCIENCE_SWF_str
403 {
421 {
404 volatile unsigned char targetLogicalAddress;
422 unsigned char targetLogicalAddress;
405 volatile unsigned char protocolIdentifier;
423 unsigned char protocolIdentifier;
406 volatile unsigned char reserved;
424 unsigned char reserved;
407 volatile unsigned char userApplication;
425 unsigned char userApplication;
408 volatile unsigned char packetID[2];
426 unsigned char packetID[2];
409 volatile unsigned char packetSequenceControl[2];
427 unsigned char packetSequenceControl[2];
410 volatile unsigned char packetLength[2];
428 unsigned char packetLength[2];
411 // DATA FIELD HEADER
429 // DATA FIELD HEADER
412 volatile unsigned char spare1_pusVersion_spare2;
430 unsigned char spare1_pusVersion_spare2;
413 volatile unsigned char serviceType;
431 unsigned char serviceType;
414 volatile unsigned char serviceSubType;
432 unsigned char serviceSubType;
415 volatile unsigned char destinationID;
433 unsigned char destinationID;
416 volatile unsigned char time[6];
434 unsigned char time[6];
417 // AUXILIARY HEADER
435 // AUXILIARY HEADER
418 volatile unsigned char sid;
436 unsigned char sid;
419 volatile unsigned char hkBIA;
437 unsigned char hkBIA;
420 volatile unsigned char pktCnt;
438 unsigned char pktCnt;
421 volatile unsigned char pktNr;
439 unsigned char pktNr;
422 volatile unsigned char acquisitionTime[6];
440 unsigned char acquisitionTime[6];
423 volatile unsigned char blkNr[2];
441 unsigned char blkNr[2];
424 };
442 };
425 typedef struct Header_TM_LFR_SCIENCE_SWF_str Header_TM_LFR_SCIENCE_SWF_t;
443 typedef struct Header_TM_LFR_SCIENCE_SWF_str Header_TM_LFR_SCIENCE_SWF_t;
426
444
427 struct Header_TM_LFR_SCIENCE_CWF_str
445 struct Header_TM_LFR_SCIENCE_CWF_str
428 {
446 {
429 volatile unsigned char targetLogicalAddress;
447 unsigned char targetLogicalAddress;
430 volatile unsigned char protocolIdentifier;
448 unsigned char protocolIdentifier;
431 volatile unsigned char reserved;
449 unsigned char reserved;
432 volatile unsigned char userApplication;
450 unsigned char userApplication;
433 volatile unsigned char packetID[2];
451 unsigned char packetID[2];
434 volatile unsigned char packetSequenceControl[2];
452 unsigned char packetSequenceControl[2];
435 volatile unsigned char packetLength[2];
453 unsigned char packetLength[2];
436 // DATA FIELD HEADER
454 // DATA FIELD HEADER
437 volatile unsigned char spare1_pusVersion_spare2;
455 unsigned char spare1_pusVersion_spare2;
438 volatile unsigned char serviceType;
456 unsigned char serviceType;
439 volatile unsigned char serviceSubType;
457 unsigned char serviceSubType;
440 volatile unsigned char destinationID;
458 unsigned char destinationID;
441 volatile unsigned char time[6];
459 unsigned char time[6];
442 // AUXILIARY DATA HEADER
460 // AUXILIARY DATA HEADER
443 volatile unsigned char sid;
461 unsigned char sid;
444 volatile unsigned char hkBIA;
462 unsigned char hkBIA;
445 volatile unsigned char acquisitionTime[6];
463 unsigned char acquisitionTime[6];
446 volatile unsigned char blkNr[2];
464 unsigned char blkNr[2];
447 };
465 };
448 typedef struct Header_TM_LFR_SCIENCE_CWF_str Header_TM_LFR_SCIENCE_CWF_t;
466 typedef struct Header_TM_LFR_SCIENCE_CWF_str Header_TM_LFR_SCIENCE_CWF_t;
449
467
450 struct Header_TM_LFR_SCIENCE_ASM_str
468 struct Header_TM_LFR_SCIENCE_ASM_str
451 {
469 {
452 volatile unsigned char targetLogicalAddress;
470 unsigned char targetLogicalAddress;
453 volatile unsigned char protocolIdentifier;
471 unsigned char protocolIdentifier;
454 volatile unsigned char reserved;
472 unsigned char reserved;
455 volatile unsigned char userApplication;
473 unsigned char userApplication;
456 volatile unsigned char packetID[2];
474 unsigned char packetID[2];
457 volatile unsigned char packetSequenceControl[2];
475 unsigned char packetSequenceControl[2];
458 volatile unsigned char packetLength[2];
476 unsigned char packetLength[2];
459 // DATA FIELD HEADER
477 // DATA FIELD HEADER
460 volatile unsigned char spare1_pusVersion_spare2;
478 unsigned char spare1_pusVersion_spare2;
461 volatile unsigned char serviceType;
479 unsigned char serviceType;
462 volatile unsigned char serviceSubType;
480 unsigned char serviceSubType;
463 volatile unsigned char destinationID;
481 unsigned char destinationID;
464 volatile unsigned char time[6];
482 unsigned char time[6];
465 // AUXILIARY HEADER
483 // AUXILIARY HEADER
466 volatile unsigned char sid;
484 unsigned char sid;
467 volatile unsigned char biaStatusInfo;
485 unsigned char biaStatusInfo;
468 volatile unsigned char cntASM;
486 unsigned char cntASM;
469 volatile unsigned char nrASM;
487 unsigned char nrASM;
470 volatile unsigned char acquisitionTime[6];
488 unsigned char acquisitionTime[6];
471 volatile unsigned char blkNr[2];
489 unsigned char blkNr[2];
472 };
490 };
473 typedef struct Header_TM_LFR_SCIENCE_ASM_str Header_TM_LFR_SCIENCE_ASM_t;
491 typedef struct Header_TM_LFR_SCIENCE_ASM_str Header_TM_LFR_SCIENCE_ASM_t;
474
492
475 struct ccsdsTelecommandPacket_str
493 struct ccsdsTelecommandPacket_str
476 {
494 {
477 //unsigned char targetLogicalAddress; // removed by the grspw module
495 //unsigned char targetLogicalAddress; // removed by the grspw module
478 volatile unsigned char protocolIdentifier;
496 unsigned char protocolIdentifier;
479 volatile unsigned char reserved;
497 unsigned char reserved;
480 volatile unsigned char userApplication;
498 unsigned char userApplication;
481 volatile unsigned char packetID[2];
499 unsigned char packetID[2];
482 volatile unsigned char packetSequenceControl[2];
500 unsigned char packetSequenceControl[2];
483 volatile unsigned char packetLength[2];
501 unsigned char packetLength[2];
484 // DATA FIELD HEADER
502 // DATA FIELD HEADER
485 volatile unsigned char headerFlag_pusVersion_Ack;
503 unsigned char headerFlag_pusVersion_Ack;
486 volatile unsigned char serviceType;
504 unsigned char serviceType;
487 volatile unsigned char serviceSubType;
505 unsigned char serviceSubType;
488 volatile unsigned char sourceID;
506 unsigned char sourceID;
489 volatile unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
507 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
490 };
508 };
491 typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t;
509 typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t;
492
510
493 struct Packet_TM_LFR_HK_str
511 struct Packet_TM_LFR_HK_str
494 {
512 {
495 volatile unsigned char targetLogicalAddress;
513 unsigned char targetLogicalAddress;
496 volatile unsigned char protocolIdentifier;
514 unsigned char protocolIdentifier;
497 volatile unsigned char reserved;
515 unsigned char reserved;
498 volatile unsigned char userApplication;
516 unsigned char userApplication;
499 volatile unsigned char packetID[2];
517 unsigned char packetID[2];
500 volatile unsigned char packetSequenceControl[2];
518 unsigned char packetSequenceControl[2];
501 volatile unsigned char packetLength[2];
519 unsigned char packetLength[2];
502 volatile unsigned char spare1_pusVersion_spare2;
520 unsigned char spare1_pusVersion_spare2;
503 volatile unsigned char serviceType;
521 unsigned char serviceType;
504 volatile unsigned char serviceSubType;
522 unsigned char serviceSubType;
505 volatile unsigned char destinationID;
523 unsigned char destinationID;
506 volatile unsigned char time[6];
524 unsigned char time[6];
507 volatile unsigned char sid;
525 unsigned char sid;
508
526
509 //**************
527 //**************
510 // HK PARAMETERS
528 // HK PARAMETERS
@@ -539,7 +557,7 struct Packet_TM_LFR_HK_str
539 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
557 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
540 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
558 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
541 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
559 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
542 unsigned char hk_lfr_dpu_spw_last_timc;
560 unsigned char hk_lfr_dpu_spw_last_time;
543 // ahb error statistics
561 // ahb error statistics
544 unsigned int hk_lfr_last_fail_addr;
562 unsigned int hk_lfr_last_fail_addr;
545 // temperatures
563 // temperatures
@@ -594,48 +612,48 typedef struct Packet_TM_LFR_HK_str Pack
594
612
595 struct Packet_TM_LFR_PARAMETER_DUMP_str
613 struct Packet_TM_LFR_PARAMETER_DUMP_str
596 {
614 {
597 volatile unsigned char targetLogicalAddress;
615 unsigned char targetLogicalAddress;
598 volatile unsigned char protocolIdentifier;
616 unsigned char protocolIdentifier;
599 volatile unsigned char reserved;
617 unsigned char reserved;
600 volatile unsigned char userApplication;
618 unsigned char userApplication;
601 volatile unsigned char packetID[2];
619 unsigned char packetID[2];
602 volatile unsigned char packetSequenceControl[2];
620 unsigned char packetSequenceControl[2];
603 volatile unsigned char packetLength[2];
621 unsigned char packetLength[2];
604 // DATA FIELD HEADER
622 // DATA FIELD HEADER
605 volatile unsigned char spare1_pusVersion_spare2;
623 unsigned char spare1_pusVersion_spare2;
606 volatile unsigned char serviceType;
624 unsigned char serviceType;
607 volatile unsigned char serviceSubType;
625 unsigned char serviceSubType;
608 volatile unsigned char destinationID;
626 unsigned char destinationID;
609 volatile unsigned char time[6];
627 unsigned char time[6];
610 volatile unsigned char sid;
628 unsigned char sid;
611
629
612 //******************
630 //******************
613 // COMMON PARAMETERS
631 // COMMON PARAMETERS
614 volatile unsigned char unused0;
632 unsigned char unused0;
615 volatile unsigned char bw_sp0_sp1_r0_r1;
633 unsigned char bw_sp0_sp1_r0_r1;
616
634
617 //******************
635 //******************
618 // NORMAL PARAMETERS
636 // NORMAL PARAMETERS
619 volatile unsigned char sy_lfr_n_swf_l[2];
637 unsigned char sy_lfr_n_swf_l[2];
620 volatile unsigned char sy_lfr_n_swf_p[2];
638 unsigned char sy_lfr_n_swf_p[2];
621 volatile unsigned char sy_lfr_n_asm_p[2];
639 unsigned char sy_lfr_n_asm_p[2];
622 volatile unsigned char sy_lfr_n_bp_p0;
640 unsigned char sy_lfr_n_bp_p0;
623 volatile unsigned char sy_lfr_n_bp_p1;
641 unsigned char sy_lfr_n_bp_p1;
624
642
625 //*****************
643 //*****************
626 // BURST PARAMETERS
644 // BURST PARAMETERS
627 volatile unsigned char sy_lfr_b_bp_p0;
645 unsigned char sy_lfr_b_bp_p0;
628 volatile unsigned char sy_lfr_b_bp_p1;
646 unsigned char sy_lfr_b_bp_p1;
629
647
630 //****************
648 //****************
631 // SBM1 PARAMETERS
649 // SBM1 PARAMETERS
632 volatile unsigned char sy_lfr_s1_bp_p0;
650 unsigned char sy_lfr_s1_bp_p0;
633 volatile unsigned char sy_lfr_s1_bp_p1;
651 unsigned char sy_lfr_s1_bp_p1;
634
652
635 //****************
653 //****************
636 // SBM2 PARAMETERS
654 // SBM2 PARAMETERS
637 volatile unsigned char sy_lfr_s2_bp_p0;
655 unsigned char sy_lfr_s2_bp_p0;
638 volatile unsigned char sy_lfr_s2_bp_p1;
656 unsigned char sy_lfr_s2_bp_p1;
639 };
657 };
640 typedef struct Packet_TM_LFR_PARAMETER_DUMP_str Packet_TM_LFR_PARAMETER_DUMP_t;
658 typedef struct Packet_TM_LFR_PARAMETER_DUMP_str Packet_TM_LFR_PARAMETER_DUMP_t;
641
659
@@ -24,16 +24,20 extern unsigned char lfrCurrentMode;
24 // MODE PARAMETERS
24 // MODE PARAMETERS
25 extern struct param_local_str param_local;
25 extern struct param_local_str param_local;
26 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
26 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
27 extern unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID];
27 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
28 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
29 extern unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
28
30
29 // RTEMS TASKS
31 // RTEMS TASKS
30 rtems_task Init( rtems_task_argument argument);
32 rtems_task Init( rtems_task_argument argument);
31
33
32 // OTHER functions
34 // OTHER functions
33 void create_names( void );
35 void create_names( void );
34 rtems_status_code create_message_queues( void );
35 int create_all_tasks( void );
36 int create_all_tasks( void );
36 int start_all_tasks( void );
37 int start_all_tasks( void );
38 //
39 rtems_status_code create_message_queues( void );
40 //
37 int start_recv_send_tasks( void );
41 int start_recv_send_tasks( void );
38 //
42 //
39 void init_local_mode_parameters( void );
43 void init_local_mode_parameters( void );
@@ -32,4 +32,6 rtems_task dumb_task( rtems_task_argumen
32
32
33 void init_housekeeping_parameters( void );
33 void init_housekeeping_parameters( void );
34
34
35 void increment_seq_counter( unsigned char *packet_sequence_control);
36
35 #endif // FSW_MISC_H_INCLUDED
37 #endif // FSW_MISC_H_INCLUDED
@@ -148,6 +148,8
148 #define TASK_PRIORITY_STAT 200
148 #define TASK_PRIORITY_STAT 200
149 #define TASK_PRIORITY_DUMB 200
149 #define TASK_PRIORITY_DUMB 200
150
150
151 #define SEMQ_PRIORITY_CEILING 30
152
151 #define ACTION_MSG_QUEUE_COUNT 10
153 #define ACTION_MSG_QUEUE_COUNT 10
152 #define ACTION_MSG_PKTS_COUNT 50
154 #define ACTION_MSG_PKTS_COUNT 50
153 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
155 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
@@ -198,32 +200,6
198 #define NB_BYTES_CWF3_LIGHT_BLK 6
200 #define NB_BYTES_CWF3_LIGHT_BLK 6
199 #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
201 #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
200
202
201 //******************
202 // SEQUENCE COUNTERS
203 #define SEQ_CNT_NB_PID 2
204 #define SEQ_CNT_NB_CAT 4
205 #define SEQ_CNT_NB_DEST_ID 11
206 // pid
207 #define SEQ_CNT_PID_76 0
208 #define SEQ_CNT_PID_79 1
209 //cat
210 #define SEQ_CNT_CAT_1 0
211 #define SEQ_CNT_CAT_4 1
212 #define SEQ_CNT_CAT_9 2
213 #define SEQ_CNT_CAT_12 3
214 // destination id
215 #define SEQ_CNT_DST_ID_GROUND 0
216 #define SEQ_CNT_DST_ID_MISSION_TIMELINE 1
217 #define SEQ_CNT_DST_ID_TC_SEQUENCES 2
218 #define SEQ_CNT_DST_ID_RECOVERY_ACTION_CMD 3
219 #define SEQ_CNT_DST_ID_BACKUP_MISSION_TIMELINE 4
220 #define SEQ_CNT_DST_ID_DIRECT_CMD 5
221 #define SEQ_CNT_DST_ID_SPARE_GRD_SRC1 6
222 #define SEQ_CNT_DST_ID_SPARE_GRD_SRC2 7
223 #define SEQ_CNT_DST_ID_OBCP 8
224 #define SEQ_CNT_DST_ID_SYSTEM_CONTROL 9
225 #define SEQ_CNT_DST_ID_AOCS 10
226
227 struct param_local_str{
203 struct param_local_str{
228 unsigned int local_sbm1_nb_cwf_sent;
204 unsigned int local_sbm1_nb_cwf_sent;
229 unsigned int local_sbm1_nb_cwf_max;
205 unsigned int local_sbm1_nb_cwf_max;
@@ -6,8 +6,10
6 #include <math.h>
6 #include <math.h>
7 #include <stdlib.h> // abs() is in the stdlib
7 #include <stdlib.h> // abs() is in the stdlib
8 #include <stdio.h> // printf()
8 #include <stdio.h> // printf()
9 #include <math.h>
9
10
10 #include "fsw_params.h"
11 #include "fsw_params.h"
12 #include "fsw_spacewire.h"
11
13
12
14
13 extern volatile int spec_mat_f0_0[ ];
15 extern volatile int spec_mat_f0_0[ ];
@@ -7,6 +7,7
7 #include "fsw_params.h"
7 #include "fsw_params.h"
8 #include "wf_handler.h"
8 #include "wf_handler.h"
9 #include "tm_lfr_tc_exe.h"
9 #include "tm_lfr_tc_exe.h"
10 #include "fsw_misc.h"
10
11
11 extern int fdSPW;
12 extern int fdSPW;
12 extern unsigned char lfrCurrentMode;
13 extern unsigned char lfrCurrentMode;
@@ -5,9 +5,11
5 #include <stdio.h>
5 #include <stdio.h>
6
6
7 #include "fsw_params.h"
7 #include "fsw_params.h"
8 #include "fsw_spacewire.h"
8
9
9 extern time_management_regs_t *time_management_regs;
10 extern time_management_regs_t *time_management_regs;
10 extern Packet_TM_LFR_HK_t housekeeping_packet;
11 extern Packet_TM_LFR_HK_t housekeeping_packet;
12 extern unsigned short sequenceCounters_TC_EXE[];
11
13
12 int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
14 int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
13 int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
15 int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
@@ -18,6 +20,8 int send_tm_lfr_tc_exe_error(ccsdsTeleco
18 int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
20 int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
19 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV);
21 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV);
20
22
23 void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id );
24
21 #endif // TM_LFR_TC_EXE_H_INCLUDED
25 #endif // TM_LFR_TC_EXE_H_INCLUDED
22
26
23
27
@@ -7,6 +7,8
7 #include <math.h>
7 #include <math.h>
8
8
9 #include "fsw_params.h"
9 #include "fsw_params.h"
10 #include "fsw_spacewire.h"
11 #include "fsw_misc.h"
10
12
11 #define pi 3.1415
13 #define pi 3.1415
12
14
@@ -31,6 +33,9 extern Packet_TM_LFR_HK_t housekeeping_p
31 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
33 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
32 extern struct param_local_str param_local;
34 extern struct param_local_str param_local;
33
35
36 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
37 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
38
34 extern rtems_name misc_name[5];
39 extern rtems_name misc_name[5];
35 extern rtems_name Task_name[20]; /* array of task ids */
40 extern rtems_name Task_name[20]; /* array of task ids */
36 extern rtems_id Task_id[20]; /* array of task ids */
41 extern rtems_id Task_id[20]; /* array of task ids */
@@ -78,4 +83,6 void set_local_nb_interrupt_f0_MAX();
78 void reset_local_sbm1_nb_cwf_sent();
83 void reset_local_sbm1_nb_cwf_sent();
79 void reset_local_sbm2_nb_cwf_sent();
84 void reset_local_sbm2_nb_cwf_sent();
80
85
86 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
87
81 #endif // WF_HANDLER_H_INCLUDED
88 #endif // WF_HANDLER_H_INCLUDED
@@ -83,7 +83,9 struct param_local_str param_local;
83 // HK PACKETS
83 // HK PACKETS
84 Packet_TM_LFR_HK_t housekeeping_packet;
84 Packet_TM_LFR_HK_t housekeeping_packet;
85 // sequence counters are incremented by APID (PID + CAT) and destination ID
85 // sequence counters are incremented by APID (PID + CAT) and destination ID
86 unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID];
86 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
87 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
88 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
87 spw_stats spacewire_stats;
89 spw_stats spacewire_stats;
88 spw_stats spacewire_stats_backup;
90 spw_stats spacewire_stats_backup;
89
91
@@ -197,8 +197,6 void init_local_mode_parameters( void )
197 */
197 */
198
198
199 unsigned int i;
199 unsigned int i;
200 unsigned int j;
201 unsigned int k;
202
200
203 // LOCAL PARAMETERS
201 // LOCAL PARAMETERS
204 set_local_sbm1_nb_cwf_max();
202 set_local_sbm1_nb_cwf_max();
@@ -213,16 +211,13 void init_local_mode_parameters( void )
213 reset_local_sbm2_nb_cwf_sent();
211 reset_local_sbm2_nb_cwf_sent();
214
212
215 // init sequence counters
213 // init sequence counters
216 for (i = 0; i<SEQ_CNT_NB_PID; i++)
214
215 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
217 {
216 {
218 for(j = 0; j<SEQ_CNT_NB_CAT; j++)
217 sequenceCounters_TC_EXE[i] = 0x00;
219 {
220 for(k = 0; k<SEQ_CNT_NB_DEST_ID; k++)
221 {
222 sequenceCounters[i][j][k] = 0x00;
223 }
224 }
225 }
218 }
219 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
220 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
226 }
221 }
227
222
228 void create_names( void ) // create all names for tasks and queues
223 void create_names( void ) // create all names for tasks and queues
@@ -352,7 +347,7 int create_all_tasks( void ) // create a
352 {
347 {
353 status = rtems_task_create(
348 status = rtems_task_create(
354 Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE,
349 Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE,
355 RTEMS_DEFAULT_MODES,
350 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
356 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS]
351 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS]
357 );
352 );
358 }
353 }
@@ -589,4 +584,3 rtems_status_code create_message_queues(
589
584
590 return ret;
585 return ret;
591 }
586 }
592
@@ -204,6 +204,7 rtems_task hous_task(rtems_task_argument
204 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 );
204 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 );
205 }
205 }
206 else {
206 else {
207 increment_seq_counter( housekeeping_packet.packetSequenceControl );
207