##// END OF EJS Templates
Minor bug corrected in the tc_acceptance function...
paul -
r42:939c648d248c 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: Thu Oct 17 10:12:11 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Oct 17 13:22:13 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
@@ -10,7 +10,7
10
10
11 CC = sparc-rtems-gcc
11 CC = sparc-rtems-gcc
12 CXX = sparc-rtems-g++
12 CXX = sparc-rtems-g++
13 DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=15 -DPRINT_MESSAGES_ON_CONSOLE
13 DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=16 -DPRINT_MESSAGES_ON_CONSOLE
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -7,11 +7,11 CONFIG -= qt
7 include(./sparc.pri)
7 include(./sparc.pri)
8
8
9 # flight software version
9 # flight software version
10 SWVERSION=-0-15
10 SWVERSION=-0-16
11 DEFINES += SW_VERSION_N1=0
11 DEFINES += SW_VERSION_N1=0
12 DEFINES += SW_VERSION_N2=0
12 DEFINES += SW_VERSION_N2=0
13 DEFINES += SW_VERSION_N3=0
13 DEFINES += SW_VERSION_N3=0
14 DEFINES += SW_VERSION_N4=15
14 DEFINES += SW_VERSION_N4=16
15
15
16 contains( CONFIG, verbose ) {
16 contains( CONFIG, verbose ) {
17 DEFINES += PRINT_MESSAGES_ON_CONSOLE
17 DEFINES += PRINT_MESSAGES_ON_CONSOLE
@@ -67,5 +67,5 HEADERS += \
67 ../header/fsw_spacewire.h \
67 ../header/fsw_spacewire.h \
68 ../header/tm_byte_positions.h \
68 ../header/tm_byte_positions.h \
69 ../header/tc_load_dump_parameters.h \
69 ../header/tc_load_dump_parameters.h \
70 ../header/tm_lfr_tc_exe
70 ../header/tm_lfr_tc_exe.h
71
71
@@ -143,8 +143,8
143 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
143 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
144 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
144 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
145
145
146 #define QUEUE_QUEU 0
146 #define QUEUE_RECV 0
147 #define QUEUE_PKTS 1
147 #define QUEUE_SEND 1
148
148
149 //*******
149 //*******
150 // MACROS
150 // MACROS
@@ -26,7 +26,7 void updateLFRCurrentMode();
26
26
27 //*********************
27 //*********************
28 // ACCEPTANCE FUNCTIONS
28 // ACCEPTANCE FUNCTIONS
29 int tc_acceptance(ccsdsTelecommandPacket_t *TC, unsigned int TC_LEN_RCV, rtems_id queue_queu_id, rtems_id queue_pkts_id);
29 int tc_acceptance(ccsdsTelecommandPacket_t *TC, unsigned int TC_LEN_RCV, rtems_id queue_recv_id, rtems_id queue_send_id);
30 int tc_parser(ccsdsTelecommandPacket_t * TCPacket, unsigned int TC_LEN_RCV);
30 int tc_parser(ccsdsTelecommandPacket_t * TCPacket, unsigned int TC_LEN_RCV);
31 int tc_check_type( unsigned char packetType );
31 int tc_check_type( unsigned char packetType );
32 int tc_check_subtype( unsigned char packetType );
32 int tc_check_subtype( unsigned char packetType );
@@ -264,8 +264,8 int create_names( void ) // create all n
264 // rate monotonic period name
264 // rate monotonic period name
265 HK_name = rtems_build_name( 'H', 'O', 'U', 'S' );
265 HK_name = rtems_build_name( 'H', 'O', 'U', 'S' );
266
266
267 misc_name[QUEUE_QUEU] = rtems_build_name( 'Q', 'U', 'E', 'U' );
267 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', 'U', 'E', 'U' );
268 misc_name[QUEUE_PKTS] = rtems_build_name( 'P', 'K', 'T', 'S' );
268 misc_name[QUEUE_SEND] = rtems_build_name( 'P', 'K', 'T', 'S' );
269
269
270 return RTEMS_SUCCESSFUL;
270 return RTEMS_SUCCESSFUL;
271 }
271 }
@@ -553,21 +553,21 rtems_status_code create_message_queues(
553 rtems_status_code ret;
553 rtems_status_code ret;
554 rtems_id queue_id;
554 rtems_id queue_id;
555
555
556 // create the queue for handling valid TCs
557 status = rtems_message_queue_create( misc_name[QUEUE_RECV], ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE,
558 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
559 if (status != RTEMS_SUCCESSFUL) {
560 ret = status;
561 BOOT_PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", ret)
562 }
563
556 // create the queue for handling TM packet sending
564 // create the queue for handling TM packet sending
557 ret = rtems_message_queue_create( misc_name[QUEUE_PKTS], ACTION_MSG_PKTS_COUNT,
565 ret = rtems_message_queue_create( misc_name[QUEUE_SEND], ACTION_MSG_PKTS_COUNT,
558 ACTION_MSG_PKTS_MAX_SIZE,
566 ACTION_MSG_PKTS_MAX_SIZE,
559 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
567 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
560 if (ret != RTEMS_SUCCESSFUL) {
568 if (ret != RTEMS_SUCCESSFUL) {
561 BOOT_PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", ret)
569 BOOT_PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", ret)
562 }
570 }
563
571
564 // create the queue for handling valid TCs
572 return ret;
565 status = rtems_message_queue_create( misc_name[QUEUE_QUEU], ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE,
566 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
567 if (status != RTEMS_SUCCESSFUL) {
568 ret = status;
569 BOOT_PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", ret)
570 }
571
572 return ret;
573 }
573 }
@@ -173,7 +173,7 rtems_task hous_task(rtems_task_argument
173 spw_ioctl_send.data = (char*) &housekeeping_packet;
173 spw_ioctl_send.data = (char*) &housekeeping_packet;
174 spw_ioctl_send.options = 0;
174 spw_ioctl_send.options = 0;
175
175
176 status = rtems_message_queue_ident( misc_name[QUEUE_PKTS], 0, &queue_id );
176 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
177 if (status != RTEMS_SUCCESSFUL)
177 if (status != RTEMS_SUCCESSFUL)
178 {
178 {
179 PRINTF1("in HOUS *** ERR %d\n", status)
179 PRINTF1("in HOUS *** ERR %d\n", status)
@@ -251,7 +251,7 rtems_task send_task( rtems_task_argumen
251 u_int32_t count;
251 u_int32_t count;
252 rtems_id queue_id;
252 rtems_id queue_id;
253
253
254 status = rtems_message_queue_ident( misc_name[QUEUE_PKTS], 0, &queue_id );
254 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
255 if (status != RTEMS_SUCCESSFUL)
255 if (status != RTEMS_SUCCESSFUL)
256 {
256 {
257 PRINTF1("in SEND *** ERR getting queue id, %d\n", status)
257 PRINTF1("in SEND *** ERR getting queue id, %d\n", status)
@@ -318,7 +318,7 rtems_id get_pkts_queue_id( void )
318 rtems_id queue_id;
318 rtems_id queue_id;
319 rtems_status_code status;
319 rtems_status_code status;
320
320
321 status = rtems_message_queue_ident( misc_name[QUEUE_PKTS], 0, &queue_id );
321 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
322 if (status != RTEMS_SUCCESSFUL)
322 if (status != RTEMS_SUCCESSFUL)
323 {
323 {
324 PRINTF1("in get_pkts_queue_id *** ERR %d\n", status)
324 PRINTF1("in get_pkts_queue_id *** ERR %d\n", status)
@@ -201,7 +201,7 rtems_task matr_task(rtems_task_argument
201
201
202 init_header_asm( &headerASM );
202 init_header_asm( &headerASM );
203
203
204 status = rtems_message_queue_ident( misc_name[QUEUE_PKTS], 0, &queue_id );
204 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
205 if (status != RTEMS_SUCCESSFUL)
205 if (status != RTEMS_SUCCESSFUL)
206 {
206 {
207 PRINTF1("in MATR *** ERR getting queue id, %d\n", status)
207 PRINTF1("in MATR *** ERR getting queue id, %d\n", status)
@@ -119,14 +119,14 void updateLFRCurrentMode()
119
119
120 //*********************
120 //*********************
121 // ACCEPTANCE FUNCTIONS
121 // ACCEPTANCE FUNCTIONS
122 int tc_acceptance(ccsdsTelecommandPacket_t *TC, unsigned int tc_len_recv, rtems_id queue_queu_id, rtems_id queue_pkts_id)
122 int tc_acceptance(ccsdsTelecommandPacket_t *TC, unsigned int tc_len_recv, rtems_id queue_recv_id, rtems_id queue_send_id)
123 {
123 {
124 /** This function executes the TeleCommand acceptance steps.
124 /** This function executes the TeleCommand acceptance steps.
125 *
125 *
126 * @param TC points to the TeleCommand packet which is under investigation.
126 * @param TC points to the TeleCommand packet which is under investigation.
127 * @param tc_len_recv contains the length of the packet that has been received.
127 * @param tc_len_recv contains the length of the packet that has been received.
128 * @param queue_queu_id is the id of the rtems queue in which messages are written if the acceptance is not successful
128 * @param queue_recv_id is the id of the rtems queue in which messages are written if the acceptance is not successful
129 * @param queue_pkts_id is the id of the rtems queue in which messages are written if the acceptance is successful
129 * @param queue_send_id is the id of the rtems queue in which messages are written if the acceptance is successful
130 * @return status code
130 * @return status code
131 *
131 *
132 * The acceptance steps can result in two different actions.
132 * The acceptance steps can result in two different actions.
@@ -145,10 +145,10 int tc_acceptance(ccsdsTelecommandPacket
145 if ( (parserCode == ILLEGAL_APID) | (parserCode == WRONG_LEN_PACKET) | (parserCode == INCOR_CHECKSUM)
145 if ( (parserCode == ILLEGAL_APID) | (parserCode == WRONG_LEN_PACKET) | (parserCode == INCOR_CHECKSUM)
146 | (parserCode == ILL_TYPE) | (parserCode == ILL_SUBTYPE) | (parserCode == WRONG_APP_DATA) )
146 | (parserCode == ILL_TYPE) | (parserCode == ILL_SUBTYPE) | (parserCode == WRONG_APP_DATA) )
147 { // send TM_LFR_TC_EXE_CORRUPTED
147 { // send TM_LFR_TC_EXE_CORRUPTED
148 send_tm_lfr_tc_exe_corrupted( TC, queue_queu_id, computed_CRC, currentTC_LEN_RCV );
148 send_tm_lfr_tc_exe_corrupted( TC, queue_send_id, computed_CRC, currentTC_LEN_RCV );
149 }
149 }
150 else { // send valid TC to the action launcher
150 else { // send valid TC to the action launcher
151 status = rtems_message_queue_send( queue_queu_id, TC, tc_len_recv + CCSDS_TC_TM_PACKET_OFFSET + 3);
151 status = rtems_message_queue_send( queue_recv_id, TC, tc_len_recv + CCSDS_TC_TM_PACKET_OFFSET + 3);
152 ret = LFR_SUCCESSFUL;
152 ret = LFR_SUCCESSFUL;
153 }
153 }
154 return ret;
154 return ret;
@@ -453,23 +453,23 rtems_task recv_task( rtems_task_argumen
453 ccsdsTelecommandPacket_t currentTC;
453 ccsdsTelecommandPacket_t currentTC;
454 char data[100];
454 char data[100];
455 rtems_status_code status;
455 rtems_status_code status;
456 rtems_id queue_queu_id;
456 rtems_id queue_recv_id;
457 rtems_id queue_pkts_id;
457 rtems_id queue_send_id;
458
458
459 for(i=0; i<100; i++) data[i] = 0;
459 for(i=0; i<100; i++) data[i] = 0;
460
460
461 initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes
461 initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes
462
462
463 status = rtems_message_queue_ident( misc_name[QUEUE_QUEU], 0, &queue_queu_id );
463 status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_recv_id );
464 if (status != RTEMS_SUCCESSFUL)
464 if (status != RTEMS_SUCCESSFUL)
465 {
465 {
466 PRINTF1("in RECV *** ERR getting queue_queu id, %d\n", status)
466 PRINTF1("in RECV *** ERR getting QUEUE_RECV id, %d\n", status)
467 }
467 }
468
468
469 status = rtems_message_queue_ident( misc_name[QUEUE_PKTS], 0, &queue_pkts_id );
469 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_send_id );
470 if (status != RTEMS_SUCCESSFUL)
470 if (status != RTEMS_SUCCESSFUL)
471 {
471 {
472 PRINTF1("in RECV *** ERR getting queue_pkts id, %d\n", status)
472 PRINTF1("in RECV *** ERR getting QUEUE_SEND id, %d\n", status)
473 }
473 }
474
474
475 BOOT_PRINTF("in RECV *** \n")
475 BOOT_PRINTF("in RECV *** \n")
@@ -489,7 +489,7 rtems_task recv_task( rtems_task_argumen
489 currentTC_LEN_RCV[1] = (unsigned char) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // build the corresponding packet size field
489 currentTC_LEN_RCV[1] = (unsigned char) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // build the corresponding packet size field
490 currentTC_LEN_RCV_AsUnsignedInt = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes
490 currentTC_LEN_RCV_AsUnsignedInt = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes
491 // CHECK THE TC
491 // CHECK THE TC
492 tc_acceptance(&currentTC, currentTC_LEN_RCV_AsUnsignedInt, queue_queu_id, queue_pkts_id);
492 tc_acceptance(&currentTC, currentTC_LEN_RCV_AsUnsignedInt, queue_recv_id, queue_send_id);
493 }
493 }
494 }
494 }
495 }
495 }
@@ -514,13 +514,13 rtems_task actn_task( rtems_task_argumen
514 rtems_id queue_rcv_id;
514 rtems_id queue_rcv_id;
515 rtems_id queue_snd_id;
515 rtems_id queue_snd_id;
516
516
517 status = rtems_message_queue_ident( misc_name[QUEUE_QUEU], 0, &queue_rcv_id );
517 status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_rcv_id );
518 if (status != RTEMS_SUCCESSFUL)
518 if (status != RTEMS_SUCCESSFUL)
519 {
519 {
520 PRINTF1("in ACTN *** ERR getting queue_rcv_id %d\n", status)
520 PRINTF1("in ACTN *** ERR getting queue_rcv_id %d\n", status)
521 }
521 }
522
522
523 status = rtems_message_queue_ident( misc_name[QUEUE_PKTS], 0, &queue_snd_id );
523 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_snd_id );
524 if (status != RTEMS_SUCCESSFUL)
524 if (status != RTEMS_SUCCESSFUL)
525 {
525 {
526 PRINTF1("in ACTN *** ERR getting queue_snd_id %d\n", status)
526 PRINTF1("in ACTN *** ERR getting queue_snd_id %d\n", status)
@@ -222,7 +222,7 rtems_task wfrm_task(rtems_task_argument
222
222
223 init_waveforms();
223 init_waveforms();
224
224
225 status = rtems_message_queue_ident( misc_name[QUEUE_PKTS], 0, &queue_id );
225 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
226 if (status != RTEMS_SUCCESSFUL)
226 if (status != RTEMS_SUCCESSFUL)
227 {
227 {
228 PRINTF1("in WFRM *** ERR getting queue id, %d\n", status)
228 PRINTF1("in WFRM *** ERR getting queue id, %d\n", status)
General Comments 0
You need to be logged in to leave comments. Login now