diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -4,4 +4,6 @@ syntax: glob *.o tests/*.err doc +*.srec +FSW-qt/bin/fsw diff --git a/FSW-qt/Makefile b/FSW-qt/Makefile --- a/FSW-qt/Makefile +++ b/FSW-qt/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: bin/fsw -# Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Nov 12 13:28:25 2013 +# Generated by qmake (2.01a) (Qt 4.8.5) on: Wed Nov 13 08:18:19 2013 # Project: fsw-qt.pro # Template: app # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro @@ -10,7 +10,7 @@ CC = sparc-rtems-gcc CXX = sparc-rtems-g++ -DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=21 -DPRINT_MESSAGES_ON_CONSOLE +DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=22 -DPRINT_MESSAGES_ON_CONSOLE CFLAGS = -pipe -O3 -Wall $(DEFINES) CXXFLAGS = -pipe -O3 -Wall $(DEFINES) INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header diff --git a/FSW-qt/fsw-qt.pro b/FSW-qt/fsw-qt.pro --- a/FSW-qt/fsw-qt.pro +++ b/FSW-qt/fsw-qt.pro @@ -7,11 +7,11 @@ CONFIG -= qt include(./sparc.pri) # flight software version -SWVERSION=-0-21 +SWVERSION=-0-22 DEFINES += SW_VERSION_N1=0 DEFINES += SW_VERSION_N2=0 DEFINES += SW_VERSION_N3=0 -DEFINES += SW_VERSION_N4=21 +DEFINES += SW_VERSION_N4=22 contains( CONFIG, verbose ) { DEFINES += PRINT_MESSAGES_ON_CONSOLE diff --git a/FSW-qt/fsw-qt.pro.user b/FSW-qt/fsw-qt.pro.user --- a/FSW-qt/fsw-qt.pro.user +++ b/FSW-qt/fsw-qt.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/header/tm_lfr_tc_exe.h b/header/tm_lfr_tc_exe.h --- a/header/tm_lfr_tc_exe.h +++ b/header/tm_lfr_tc_exe.h @@ -18,7 +18,7 @@ int send_tm_lfr_tc_exe_not_executable(cc int send_tm_lfr_tc_exe_not_implemented(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); int send_tm_lfr_tc_exe_error(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, - unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV); + unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, unsigned char destinationID); void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ); diff --git a/src/fsw_spacewire.c b/src/fsw_spacewire.c --- a/src/fsw_spacewire.c +++ b/src/fsw_spacewire.c @@ -117,6 +117,7 @@ rtems_task recv_task( rtems_task_argumen ccsdsTelecommandPacket_t currentTC; unsigned char computed_CRC[ 2 ]; unsigned char currentTC_LEN_RCV[ 2 ]; + unsigned char destinationID; unsigned int currentTC_LEN_RCV_AsUnsignedInt; unsigned int parserCode; rtems_status_code status; @@ -165,7 +166,15 @@ rtems_task recv_task( rtems_task_argumen !( (currentTC.serviceType==TC_TYPE_GEN) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_INFO)) ) { - send_tm_lfr_tc_exe_corrupted( ¤tTC, queue_send_id, computed_CRC, currentTC_LEN_RCV ); + if ( parserCode == WRONG_SRC_ID ) + { + destinationID = SID_TC_GROUND; + } + else + { + destinationID = currentTC.sourceID; + } + send_tm_lfr_tc_exe_corrupted( ¤tTC, queue_send_id, computed_CRC, currentTC_LEN_RCV, destinationID ); } } else diff --git a/src/tc_acceptance.c b/src/tc_acceptance.c --- a/src/tc_acceptance.c +++ b/src/tc_acceptance.c @@ -113,6 +113,7 @@ int tc_parser(ccsdsTelecommandPacket_t * */ int status; + int status_crc; unsigned char pid; unsigned char category; unsigned int length; @@ -169,9 +170,10 @@ int tc_parser(ccsdsTelecommandPacket_t * { status = tc_check_length( packetSubtype, length ); } + status_crc = tc_check_crc( TCPacket, length, computed_CRC ); if (status == CCSDS_TM_VALID ) // CHECK CRC { - status = tc_check_crc( TCPacket, length, computed_CRC ); + status = status_crc; } return status; diff --git a/src/tm_lfr_tc_exe.c b/src/tm_lfr_tc_exe.c --- a/src/tm_lfr_tc_exe.c +++ b/src/tm_lfr_tc_exe.c @@ -334,7 +334,8 @@ int send_tm_lfr_tc_exe_error( ccsdsTelec } int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, - unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV ) + unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, + unsigned char destinationID) { /** This function sends a TM_LFR_TC_EXE_CORRUPTED packet in the dedicated RTEMS message queue. * @@ -376,7 +377,7 @@ int send_tm_lfr_tc_exe_corrupted(ccsdsTe TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; TM.serviceType = TM_TYPE_TC_EXE; TM.serviceSubType = TM_SUBTYPE_EXE_NOK; - TM.destinationID = TC->sourceID; // default destination id + TM.destinationID = destinationID; TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);