From 1f57ec8747dcbcbd09044440d621af45cee09dac Mon Sep 17 00:00:00 2001 From: avan989 Date: Wed, 28 Aug 2019 14:18:22 -0400 Subject: [PATCH 1/4] Fix #3, Update to valid Perfid --- fsw/mission_inc/ci_lab_perfids.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsw/mission_inc/ci_lab_perfids.h b/fsw/mission_inc/ci_lab_perfids.h index 1350aea..0847321 100644 --- a/fsw/mission_inc/ci_lab_perfids.h +++ b/fsw/mission_inc/ci_lab_perfids.h @@ -41,8 +41,8 @@ #define _ci_lab_perfids_h_ -#define CI_MAIN_TASK_PERF_ID 21 -#define CI_SOCKET_RCV_PERF_ID 24 +#define CI_MAIN_TASK_PERF_ID 32 +#define CI_SOCKET_RCV_PERF_ID 33 #endif /* _ci_lab_perfids_h_ */ From f74b9a02e22972a644dbb2c0c4cb3c821907852b Mon Sep 17 00:00:00 2001 From: avan989 Date: Mon, 26 Aug 2019 08:07:26 -0400 Subject: [PATCH 2/4] Fix #5, Remove classic build support --- fsw/for_build/Makefile | 112 ----------------------------------------- 1 file changed, 112 deletions(-) delete mode 100644 fsw/for_build/Makefile diff --git a/fsw/for_build/Makefile b/fsw/for_build/Makefile deleted file mode 100644 index 751eb8e..0000000 --- a/fsw/for_build/Makefile +++ /dev/null @@ -1,112 +0,0 @@ -############################################################################### -# File: CFS Application Makefile -# -# $Id: Makefile 1.8 2009/07/09 11:25:54GMT-05:00 rmcgraw Exp $ -# -# $Log: Makefile $ -# Revision 1.8 2009/07/09 11:25:54GMT-05:00 rmcgraw -# DCR8291:1 Changed CFE_MISSION_INC to CFS_MISSION_INC and added log -# -############################################################################### -# -# Subsystem produced by this makefile. -# -APPTARGET = ci_lab - -# -# Entry Point for task -# -ENTRY_PT = CI_Lab_AppMain - -# -# Object files required to build subsystem. -# -OBJS = ci_lab_app.o - -# -# Source files required to build subsystem; used to generate dependencies. -# As long as there are no assembly files this can be automated. -# -SOURCES = $(OBJS:.o=.c) - - -## -## Specify extra C Flags needed to build this subsystem -## -LOCAL_COPTS = - - -## -## EXEDIR is defined here, just in case it needs to be different for a custom -## build -## -EXEDIR=../exe - -## -## Certain OSs and Application Loaders require the following option for -## Shared libraries. Currently only needed for vxWorks 5.5 and RTEMS. -## For each shared library that this app depends on, you need to have an -## entry like the following: -## -R../tst_lib/tst_lib.elf -## -SHARED_LIB_LINK = - -######################################################################## -# Should not have to change below this line, except for customized -# Mission and cFE directory structures -######################################################################## - -# -# Set build type to CFE_APP. This allows us to -# define different compiler flags for the cFE Core and Apps. -# -BUILD_TYPE = CFE_APP - -## -## Include all necessary cFE make rules -## Any of these can be copied to a local file and -## changed if needed. -## -## -## cfe-config.mak contains PSP and OS selection -## -include ../cfe/cfe-config.mak -## -## debug-opts.mak contains debug switches -## -include ../cfe/debug-opts.mak -## -## compiler-opts.mak contains compiler definitions and switches/defines -## -include $(CFE_PSP_SRC)/$(PSP)/make/compiler-opts.mak - -## -## Setup the include path for this subsystem -## The OS specific includes are in the build-rules.make file -## -## If this subsystem needs include files from another app, add the path here. -## -INCLUDE_PATH = \ --I$(OSAL_SRC)/inc \ --I$(CFE_CORE_SRC)/inc \ --I$(CFE_PSP_SRC)/inc \ --I$(CFE_PSP_SRC)/$(PSP)/inc \ --I$(CFS_APP_SRC)/inc \ --I$(CFS_APP_SRC)/$(APPTARGET)/fsw/src \ --I$(CFS_MISSION_INC) \ --I../cfe/inc \ --I../inc - -## -## Define the VPATH make variable. -## This can be modified to include source from another directory. -## If there is no corresponding app in the cfs-apps directory, then this can be discarded, or -## if the mission chooses to put the src in another directory such as "src", then that can be -## added here as well. -## -VPATH = $(CFS_APP_SRC)/$(APPTARGET)/fsw/src - -## -## Include the common make rules for building a cFE Application -## -include $(CFE_CORE_SRC)/make/app-rules.mak From 4ad503c8997e765ff067f3712a29f6e7e083dabf Mon Sep 17 00:00:00 2001 From: avan989 Date: Fri, 23 Aug 2019 15:39:29 -0400 Subject: [PATCH 3/4] Fix #4, Remove CVS flags --- fsw/mission_inc/ci_lab_perfids.h | 13 +------------ fsw/platform_inc/ci_lab_msgids.h | 11 +---------- fsw/src/ci_lab_app.c | 19 ------------------- fsw/src/ci_lab_app.h | 14 -------------- fsw/src/ci_lab_defs.h | 8 +------- fsw/src/ci_lab_events.h | 11 +---------- fsw/src/ci_lab_msg.h | 14 +------------- fsw/src/ci_lab_version.h | 14 +------------- 8 files changed, 6 insertions(+), 98 deletions(-) diff --git a/fsw/mission_inc/ci_lab_perfids.h b/fsw/mission_inc/ci_lab_perfids.h index 0847321..039e0ca 100644 --- a/fsw/mission_inc/ci_lab_perfids.h +++ b/fsw/mission_inc/ci_lab_perfids.h @@ -18,24 +18,13 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: -** $Id: ci_lab_perfids.h 1.3 2010/09/20 12:27:19GMT-05:00 wmoleski Exp $ +** File: ci_lab_perfids.h ** ** Purpose: ** Define CI Lab Performance IDs ** ** Notes: ** -** $Log: ci_lab_perfids.h $ -** Revision 1.3 2010/09/20 12:27:19GMT-05:00 wmoleski -** Modified the CI_LAB, SCH_LAB and TO_LAB applications to use unique message IDs and Pipe Names. The "_LAB" -** was added to all definitions so that a mission can use these "Lab" apps as well as their own mission apps together. -** Revision 1.2 2008/04/30 13:07:44EDT rjmcgraw -** Member moved from ci_lab_perfids.h in project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/platform_inc/project.pj to ci_lab_perfids.h in project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/mission_inc/project.pj. -** Revision 1.1 2008/04/30 12:07:44ACT rjmcgraw -** Initial revision -** Member added to project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/platform_inc/project.pj -** *************************************************************************/ #ifndef _ci_lab_perfids_h_ #define _ci_lab_perfids_h_ diff --git a/fsw/platform_inc/ci_lab_msgids.h b/fsw/platform_inc/ci_lab_msgids.h index 5c56504..65b62bb 100644 --- a/fsw/platform_inc/ci_lab_msgids.h +++ b/fsw/platform_inc/ci_lab_msgids.h @@ -18,22 +18,13 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: -** $Id: ci_lab_msgids.h 1.2 2010/09/20 12:27:18GMT-05:00 wmoleski Exp $ +** File: ci_lab_msgids.h ** ** Purpose: ** Define CI Lab Message IDs ** ** Notes: ** -** $Log: ci_lab_msgids.h $ -** Revision 1.2 2010/09/20 12:27:18GMT-05:00 wmoleski -** Modified the CI_LAB, SCH_LAB and TO_LAB applications to use unique message IDs and Pipe Names. The "_LAB" -** was added to all definitions so that a mission can use these "Lab" apps as well as their own mission apps together. -** Revision 1.1 2008/04/30 13:07:18EDT rjmcgraw -** Initial revision -** Member added to project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/platform_inc/project.pj -** *************************************************************************/ #ifndef _ci_lab_msgids_h_ #define _ci_lab_msgids_h_ diff --git a/fsw/src/ci_lab_app.c b/fsw/src/ci_lab_app.c index 8af45ed..ca94ff3 100644 --- a/fsw/src/ci_lab_app.c +++ b/fsw/src/ci_lab_app.c @@ -23,25 +23,6 @@ ** Purpose: ** This file contains the source code for the Command Ingest task. ** -** $Log: ci_lab_app.c $ -** Revision 1.7 2010/09/20 12:27:19GMT-05:00 wmoleski -** Modified the CI_LAB, SCH_LAB and TO_LAB applications to use unique message IDs and Pipe Names. The "_LAB" -** was added to all definitions so that a mission can use these "Lab" apps as well as their own mission apps together. -** Revision 1.6 2010/09/02 09:53:55EDT wmoleski -** Modifications to the CI_Lab code to capture, drop and/or manipulate CFDP PDUs that are uplinked -** from the ground. These changes were needed to test the CF fault detection requirements. -** Revision 1.5 2008/09/22 13:58:20EDT apcudmore -** Added RunLoop call to CI_LAB app. Also added the task delete handler to close the CI socket. -** Revision 1.4 2008/09/19 15:30:42EDT rjmcgraw -** DCR4337:1 Added #include version.h and display version after initialization is complete -** Revision 1.3 2008/05/01 11:49:21EDT rjmcgraw -** DCR1718:1 Changed wording in intiialization event -** Revision 1.2 2008/04/30 15:24:31EDT rjmcgraw -** DCR1718:1 Added version number in initialization event -** Revision 1.1 2008/04/30 13:56:37EDT rjmcgraw -** Initial revision -** Member added to CFS project -** *******************************************************************************/ /* diff --git a/fsw/src/ci_lab_app.h b/fsw/src/ci_lab_app.h index d906b4d..c4523cb 100644 --- a/fsw/src/ci_lab_app.h +++ b/fsw/src/ci_lab_app.h @@ -23,20 +23,6 @@ ** Purpose: ** This file is main hdr file for the Command Ingest lab application. ** -** $Log: ci_lab_app.h $ -** Revision 1.5 2010/11/17 08:13:27GMT-05:00 wmoleski -** The TO_Lab_APP, CI_Lab_APP and SCH_Lab_APP did not compile with cFE6.1.0. An include statement of cfe_error.h needed to be added to each app. -** Revision 1.4 2010/09/02 09:53:55EDT wmoleski -** Modifications to the CI_Lab code to capture, drop and/or manipulate CFDP PDUs that are uplinked -** from the ground. These changes were needed to test the CF fault detection requirements. -** Revision 1.3 2008/09/22 13:58:24EDT apcudmore -** Added RunLoop call to CI_LAB app. Also added the task delete handler to close the CI socket. -** Revision 1.2 2008/04/30 15:24:32EDT rjmcgraw -** DCR1718:1 Added version number in initialization event -** Revision 1.1 2008/04/30 13:56:18EDT rjmcgraw -** Initial revision -** Member added to project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/src/project.pj -** *******************************************************************************/ #ifndef _ci_lab_app_h_ diff --git a/fsw/src/ci_lab_defs.h b/fsw/src/ci_lab_defs.h index 4931c7e..1e15c76 100644 --- a/fsw/src/ci_lab_defs.h +++ b/fsw/src/ci_lab_defs.h @@ -18,19 +18,13 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: -** $Id: ci_lab_defs.h 1.1 2010/09/08 07:05:25GMT-05:00 wmoleski Exp $ +** File: ci_lab_defs.h ** ** Purpose: ** Define CI Lab Definitions that other apps may need to use ** ** Notes: ** -** $Log: ci_lab_defs.h $ -** Revision 1.1 2010/09/08 07:05:25GMT-05:00 wmoleski -** Initial revision -** Member added to project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/src/project.pj -** *******************************************************************************/ #ifndef _ci_lab_defs_h_ #define _ci_lab_defs_h_ diff --git a/fsw/src/ci_lab_events.h b/fsw/src/ci_lab_events.h index 8ff721f..39e6480 100644 --- a/fsw/src/ci_lab_events.h +++ b/fsw/src/ci_lab_events.h @@ -18,22 +18,13 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: -** $Id: ci_lab_events.h 1.2 2010/09/02 08:53:56GMT-05:00 wmoleski Exp $ +** File: ci_lab_events.h ** ** Purpose: ** Define CI Lab Events IDs ** ** Notes: ** -** $Log: ci_lab_events.h $ -** Revision 1.2 2010/09/02 08:53:56GMT-05:00 wmoleski -** Modifications to the CI_Lab code to capture, drop and/or manipulate CFDP PDUs that are uplinked -** from the ground. These changes were needed to test the CF fault detection requirements. -** Revision 1.1 2008/04/30 13:09:04EDT rjmcgraw -** Initial revision -** Member added to project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/src/project.pj -** *************************************************************************/ #ifndef _ci_lab_events_h_ #define _ci_lab_events_h_ diff --git a/fsw/src/ci_lab_msg.h b/fsw/src/ci_lab_msg.h index 35814d4..f4e85a7 100644 --- a/fsw/src/ci_lab_msg.h +++ b/fsw/src/ci_lab_msg.h @@ -18,25 +18,13 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: -** $Id: ci_lab_msg.h 1.3 2010/09/20 12:27:18GMT-05:00 wmoleski Exp $ +** File: ci_lab_msg.h ** ** Purpose: ** Define CI Lab Messages and info ** ** Notes: ** -** $Log: ci_lab_msg.h $ -** Revision 1.3 2010/09/20 12:27:18GMT-05:00 wmoleski -** Modified the CI_LAB, SCH_LAB and TO_LAB applications to use unique message IDs and Pipe Names. The "_LAB" -** was added to all definitions so that a mission can use these "Lab" apps as well as their own mission apps together. -** Revision 1.2 2010/09/02 09:53:56EDT wmoleski -** Modifications to the CI_Lab code to capture, drop and/or manipulate CFDP PDUs that are uplinked -** from the ground. These changes were needed to test the CF fault detection requirements. -** Revision 1.1 2008/04/30 13:09:17EDT rjmcgraw -** Initial revision -** Member added to project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/src/project.pj -** *******************************************************************************/ #ifndef _ci_lab_msg_h_ #define _ci_lab_msg_h_ diff --git a/fsw/src/ci_lab_version.h b/fsw/src/ci_lab_version.h index de03951..eb31cac 100644 --- a/fsw/src/ci_lab_version.h +++ b/fsw/src/ci_lab_version.h @@ -18,25 +18,13 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: -** $Id: ci_lab_version.h 1.2 2010/11/16 14:18:17GMT-05:00 bmedina Exp $ +** File: ci_lab_version.h ** ** Purpose: ** The CI Lab Application header file containing version number ** ** Notes: ** -** $Log: ci_lab_version.h $ -** Revision 1.3 2016/06/17 sstrege -** changed version number to 2.2.0.0 for updates made to: -** 1. Resolve compiler warnings -** 2. Fix CI_ProcessPDU never detects CMD headers -** Revision 1.2 2010/11/16 14:18:17GMT-05:00 bmedina -** changed version to 2.1.0.0 -** Revision 1.1 2008/09/19 15:03:11EDT rjmcgraw -** Initial revision -** Member added to project c:/MKSDATA/MKS-REPOSITORY/CFS-REPOSITORY/ci_lab/fsw/src/project.pj -** *************************************************************************/ #ifndef _ci_lab_version_h_ #define _ci_lab_version_h_ From faaa6d5c86c570d5383b5108e1312fe56c49124b Mon Sep 17 00:00:00 2001 From: Jake Hageman Date: Thu, 29 Aug 2019 14:51:41 -0400 Subject: [PATCH 4/4] Fix #7, Remove deprecated dependencies --- fsw/src/ci_lab_app.c | 149 ++++++++++++++++++++++--------------------- fsw/src/ci_lab_app.h | 2 +- 2 files changed, 77 insertions(+), 74 deletions(-) diff --git a/fsw/src/ci_lab_app.c b/fsw/src/ci_lab_app.c index ca94ff3..064674a 100644 --- a/fsw/src/ci_lab_app.c +++ b/fsw/src/ci_lab_app.c @@ -43,7 +43,7 @@ ** CI global data... */ -boolean CI_SocketConnected = FALSE; +bool CI_SocketConnected = false; ci_hk_tlm_t CI_HkTelemetryPkt; CFE_SB_PipeId_t CI_CommandPipe; CFE_SB_MsgPtr_t CIMsgPtr; @@ -52,21 +52,21 @@ struct sockaddr_in CI_SocketAddress; uint8 CI_IngestBuffer[CI_MAX_INGEST]; CFE_SB_Msg_t *CI_IngestPointer = (CFE_SB_Msg_t *) &CI_IngestBuffer[0]; CFE_SB_MsgId_t PDUMessageID = 0; -boolean adjustFileSize = FALSE; +bool adjustFileSize = false; int PDUFileSizeAdjustment; -boolean dropFileData = FALSE; +bool dropFileData = false; int dropFileDataCnt; -boolean dropEOF = FALSE; +bool dropEOF = false; int dropEOFCnt; -boolean dropFIN = FALSE; +bool dropFIN = false; int dropFINCnt; -boolean dropACK = FALSE; +bool dropACK = false; int dropACKCnt; -boolean dropMetaData = FALSE; +bool dropMetaData = false; int dropMetaDataCnt; -boolean dropNAK = FALSE; +bool dropNAK = false; int dropNAKCnt; -boolean corruptChecksum = FALSE; +bool corruptChecksum = false; static CFE_EVS_BinFilter_t CI_EventFilters[] = { /* Event ID mask */ @@ -93,7 +93,7 @@ static CFE_EVS_BinFilter_t CI_EventFilters[] = void CI_Lab_AppMain( void ) { int32 status; - uint32 RunStatus = CFE_ES_APP_RUN; + uint32 RunStatus = CFE_ES_RunStatus_APP_RUN; CFE_ES_PerfLogEntry(CI_MAIN_TASK_PERF_ID); @@ -102,7 +102,7 @@ void CI_Lab_AppMain( void ) /* ** CI Runloop */ - while (CFE_ES_RunLoop(&RunStatus) == TRUE) + while (CFE_ES_RunLoop(&RunStatus) == true) { CFE_ES_PerfLogExit(CI_MAIN_TASK_PERF_ID); @@ -149,7 +149,7 @@ void CI_TaskInit(void) CFE_EVS_Register(CI_EventFilters, sizeof(CI_EventFilters)/sizeof(CFE_EVS_BinFilter_t), - CFE_EVS_BINARY_FILTER); + CFE_EVS_EventFilter_BINARY); CFE_SB_CreatePipe(&CI_CommandPipe, CI_PIPE_DEPTH,"CI_LAB_CMD_PIPE"); CFE_SB_Subscribe(CI_LAB_CMD_MID, CI_CommandPipe); @@ -157,7 +157,8 @@ void CI_TaskInit(void) if ( (CI_SocketID = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { - CFE_EVS_SendEvent(CI_SOCKETCREATE_ERR_EID,CFE_EVS_ERROR,"CI: create socket failed = %d", errno); + CFE_EVS_SendEvent(CI_SOCKETCREATE_ERR_EID,CFE_EVS_EventType_ERROR, + "CI: create socket failed = %d", errno); } else { @@ -168,11 +169,12 @@ void CI_TaskInit(void) if ( (bind(CI_SocketID, (struct sockaddr *) &CI_SocketAddress, sizeof(CI_SocketAddress)) < 0) ) { - CFE_EVS_SendEvent(CI_SOCKETBIND_ERR_EID,CFE_EVS_ERROR,"CI: bind socket failed = %d", errno); + CFE_EVS_SendEvent(CI_SOCKETBIND_ERR_EID,CFE_EVS_EventType_ERROR, + "CI: bind socket failed = %d", errno); } else { - CI_SocketConnected = TRUE; + CI_SocketConnected = true; #ifdef _HAVE_FCNTL_ /* ** Set the socket to non-blocking @@ -193,10 +195,10 @@ void CI_TaskInit(void) CFE_SB_InitMsg(&CI_HkTelemetryPkt, CI_LAB_HK_TLM_MID, - CI_LAB_HK_TLM_LNGTH, TRUE); + CI_LAB_HK_TLM_LNGTH, true); - CFE_EVS_SendEvent (CI_STARTUP_INF_EID, CFE_EVS_INFORMATION, + CFE_EVS_SendEvent (CI_STARTUP_INF_EID, CFE_EVS_EventType_INFORMATION, "CI Lab Initialized. Version %d.%d.%d.%d", CI_LAB_MAJOR_VERSION, CI_LAB_MINOR_VERSION, @@ -236,7 +238,7 @@ MsgId = CFE_SB_GetMsgId(CIMsgPtr); default: CI_HkTelemetryPkt.ci_command_error_count++; - CFE_EVS_SendEvent(CI_COMMAND_ERR_EID,CFE_EVS_ERROR, + CFE_EVS_SendEvent(CI_COMMAND_ERR_EID,CFE_EVS_EventType_ERROR, "CI: invalid command packet,MID = 0x%x", MsgId); break; } @@ -262,7 +264,7 @@ uint16 CommandCode; { case CI_NOOP_CC: CI_HkTelemetryPkt.ci_command_count++; - CFE_EVS_SendEvent(CI_COMMANDNOP_INF_EID,CFE_EVS_INFORMATION, + CFE_EVS_SendEvent(CI_COMMANDNOP_INF_EID,CFE_EVS_EventType_INFORMATION, "CI: NOOP command"); break; @@ -345,7 +347,7 @@ void CI_ResetCounters(void) CI_HkTelemetryPkt.NAKPdusDropped = 0; CI_HkTelemetryPkt.PDUsCaptured = 0; - CFE_EVS_SendEvent(CI_COMMANDRST_INF_EID, CFE_EVS_INFORMATION, + CFE_EVS_SendEvent(CI_COMMANDRST_INF_EID, CFE_EVS_EventType_INFORMATION, "CI: RESET command"); return; @@ -375,10 +377,10 @@ CI_ModifyFileSizeCmd_t *CmdPtr; PDUFileSizeAdjustment = 0 - CmdPtr->Amount; /* Set the flag to modify File Size */ - adjustFileSize = TRUE; + adjustFileSize = true; CI_HkTelemetryPkt.ci_command_count++; - CFE_EVS_SendEvent(CI_MOD_PDU_FILESIZE_CMD_EID, CFE_EVS_DEBUG, + CFE_EVS_SendEvent(CI_MOD_PDU_FILESIZE_CMD_EID, CFE_EVS_EventType_DEBUG, "CI: Modify PDU File Size\n"); } @@ -401,10 +403,10 @@ uint16 ExpectedLength = sizeof(CI_NoArgsCmd_t); if (CI_VerifyCmdLength(msg, ExpectedLength)) { /* Set the flag to modify File Size */ - corruptChecksum = TRUE; + corruptChecksum = true; CI_HkTelemetryPkt.ci_command_count++; - CFE_EVS_SendEvent(CI_CORRUPT_CHECKSUM_CMD_EID, CFE_EVS_DEBUG, + CFE_EVS_SendEvent(CI_CORRUPT_CHECKSUM_CMD_EID, CFE_EVS_EventType_DEBUG, "CI: Corrupt PDU Checksum\n"); } @@ -432,37 +434,38 @@ CI_DropPDUCmd_t *CmdPtr; /* Get the PDU Type */ if (CmdPtr->PDUType == FILE_DATA_PDU) { - dropFileData = TRUE; + dropFileData = true; dropFileDataCnt = CmdPtr->PDUsToDrop; } else if (CmdPtr->PDUType == EOF_PDU) { - dropEOF = TRUE; + dropEOF = true; dropEOFCnt = CmdPtr->PDUsToDrop; } else if (CmdPtr->PDUType == FIN_PDU) { - dropFIN = TRUE; + dropFIN = true; dropFINCnt = CmdPtr->PDUsToDrop; } else if (CmdPtr->PDUType == ACK_PDU) { - dropACK = TRUE; + dropACK = true; dropACKCnt = CmdPtr->PDUsToDrop; } else if (CmdPtr->PDUType == META_DATA_PDU) { - dropMetaData = TRUE; + dropMetaData = true; dropMetaDataCnt = CmdPtr->PDUsToDrop; } else if (CmdPtr->PDUType == NAK_PDU) { - dropNAK = TRUE; + dropNAK = true; dropNAKCnt = CmdPtr->PDUsToDrop; } CI_HkTelemetryPkt.ci_command_count++; - CFE_EVS_SendEvent(CI_DROP_PDU_CMD_EID, CFE_EVS_DEBUG, "CI: Drop PDU\n"); + CFE_EVS_SendEvent(CI_DROP_PDU_CMD_EID, CFE_EVS_EventType_DEBUG, + "CI: Drop PDU\n"); } return; @@ -486,19 +489,19 @@ CI_CapturePDUCmd_t *CmdPtr; { CmdPtr = ((CI_CapturePDUCmd_t *)msg); - if (CmdPtr->PDUMsgID <= CFE_SB_HIGHEST_VALID_MSGID) + if (CmdPtr->PDUMsgID <= CFE_PLATFORM_SB_HIGHEST_VALID_MSGID) { /* Save the messageID in a global variable */ PDUMessageID = CmdPtr->PDUMsgID; CI_HkTelemetryPkt.ci_command_count++; - CFE_EVS_SendEvent(CI_CAPTUREPDU_CMD_EID, CFE_EVS_DEBUG, + CFE_EVS_SendEvent(CI_CAPTUREPDU_CMD_EID, CFE_EVS_EventType_DEBUG, "CI: PDU Capture initialized for 0x%04X\n",CmdPtr->PDUMsgID); } else { CI_HkTelemetryPkt.ci_command_error_count++; - CFE_EVS_SendEvent(CI_INVALID_MSGID_ERR_EID, CFE_EVS_ERROR, + CFE_EVS_SendEvent(CI_INVALID_MSGID_ERR_EID, CFE_EVS_EventType_ERROR, "CI: Invalid PDU MsgID: 0x%04x\n",CmdPtr->PDUMsgID); } } @@ -524,31 +527,31 @@ uint16 ExpectedLength = sizeof(CI_NoArgsCmd_t); if (PDUMessageID != 0) { CI_HkTelemetryPkt.ci_command_count++; - CFE_EVS_SendEvent(CI_STOP_PDUCAPTURE_CMD_EID, CFE_EVS_DEBUG, + CFE_EVS_SendEvent(CI_STOP_PDUCAPTURE_CMD_EID, CFE_EVS_EventType_DEBUG, "CI: PDU Capture stopped for 0x%04X\n",PDUMessageID); /* Set the global data back to there initial values */ PDUMessageID = 0; - adjustFileSize = FALSE; + adjustFileSize = false; PDUFileSizeAdjustment = 0; - dropFileData = FALSE; + dropFileData = false; dropFileDataCnt = 0; - dropEOF = FALSE; + dropEOF = false; dropEOFCnt = 0; - dropFIN = FALSE; + dropFIN = false; dropFINCnt = 0; - dropACK = FALSE; + dropACK = false; dropACKCnt = 0; - dropMetaData = FALSE; + dropMetaData = false; dropMetaDataCnt = 0; - dropNAK = FALSE; + dropNAK = false; dropNAKCnt = 0; - corruptChecksum = FALSE; + corruptChecksum = false; } else { CI_HkTelemetryPkt.ci_command_error_count++; - CFE_EVS_SendEvent(CI_NOCAPTURE_ERR_EID, CFE_EVS_ERROR, + CFE_EVS_SendEvent(CI_NOCAPTURE_ERR_EID, CFE_EVS_EventType_ERROR, "CI: PDU Capture is not enabled\n"); } } @@ -570,7 +573,7 @@ uint8 *IncomingPduPtr; uint8 PduData0; uint8 EntityIdBytes, TransSeqBytes, PduHdrBytes; CFE_SB_MsgId_t MessageID = CFE_SB_GetMsgId(CI_IngestPointer); -boolean sendToSB = FALSE; +bool sendToSB = false; uint32 *checkSumPtr; uint32 *fileSizePtr; @@ -601,7 +604,7 @@ uint32 *fileSizePtr; if (CFE_TST(PduHdrPtr->Octet1,4)) { OS_printf("CI: File Data PDU rcv'd\n"); - if ((dropFileData == TRUE) && (dropFileDataCnt > 0)) + if ((dropFileData == true) && (dropFileDataCnt > 0)) { dropFileDataCnt--; OS_printf("CI: File Data PDU dropped\n"); @@ -609,8 +612,8 @@ uint32 *fileSizePtr; } else { - sendToSB = TRUE; - dropFileData = FALSE; + sendToSB = true; + dropFileData = false; } } else @@ -624,7 +627,7 @@ uint32 *fileSizePtr; { case 4: OS_printf("CI: EOF PDU rcv'd\n"); - if ((dropEOF == TRUE) && (dropEOFCnt > 0)) + if ((dropEOF == true) && (dropEOFCnt > 0)) { dropEOFCnt--; OS_printf("CI: EOF PDU dropped\n"); @@ -632,37 +635,37 @@ uint32 *fileSizePtr; } else { - sendToSB = TRUE; - dropEOF = FALSE; + sendToSB = true; + dropEOF = false; } PduDataPtr += 2; checkSumPtr = (uint32 *)PduDataPtr; fileSizePtr = checkSumPtr + 1; - if (corruptChecksum == TRUE) + if (corruptChecksum == true) { OS_printf("CI: good checksum = %x\n",(unsigned int)*checkSumPtr); /* Corrupt the checksum */ *checkSumPtr = 0x12345678; OS_printf("CI: corrupted checksum = %x\n",(unsigned int)*checkSumPtr); - corruptChecksum = FALSE; + corruptChecksum = false; } - if (adjustFileSize == TRUE) + if (adjustFileSize == true) { OS_printf("CI: good file size = %d\n",(int)*fileSizePtr); /* Adjust the file size */ *fileSizePtr += PDUFileSizeAdjustment; OS_printf("CI: adjusted file size = %d\n",(int)*fileSizePtr); - adjustFileSize = FALSE; + adjustFileSize = false; } break; case 5: OS_printf("CI: FIN PDU rcv'd\n"); - if ((dropFIN == TRUE) && (dropFINCnt > 0)) + if ((dropFIN == true) && (dropFINCnt > 0)) { dropFINCnt--; OS_printf("CI: FIN PDU dropped\n"); @@ -670,15 +673,15 @@ uint32 *fileSizePtr; } else { - sendToSB = TRUE; - dropFIN = FALSE; + sendToSB = true; + dropFIN = false; } break; case 6: OS_printf("CI: ACK PDU rcv'd\n"); - if ((dropACK == TRUE) && (dropACKCnt > 0)) + if ((dropACK == true) && (dropACKCnt > 0)) { dropACKCnt--; OS_printf("CI: ACK PDU dropped\n"); @@ -686,15 +689,15 @@ uint32 *fileSizePtr; } else { - sendToSB = TRUE; - dropACK = FALSE; + sendToSB = true; + dropACK = false; } break; case 7: OS_printf("CI: Meta Data PDU rcv'd\n"); - if ((dropMetaData == TRUE) && (dropMetaDataCnt > 0)) + if ((dropMetaData == true) && (dropMetaDataCnt > 0)) { dropMetaDataCnt--; OS_printf("CI: Meta Data PDU dropped\n"); @@ -702,15 +705,15 @@ uint32 *fileSizePtr; } else { - sendToSB = TRUE; - dropMetaData = FALSE; + sendToSB = true; + dropMetaData = false; } break; case 8: OS_printf("CI: NAK PDU rcv'd\n"); - if ((dropNAK == TRUE) && (dropNAKCnt > 0)) + if ((dropNAK == true) && (dropNAKCnt > 0)) { dropNAKCnt--; OS_printf("CI: NAK PDU dropped\n"); @@ -718,8 +721,8 @@ uint32 *fileSizePtr; } else { - sendToSB = TRUE; - dropNAK = FALSE; + sendToSB = true; + dropNAK = false; } break; @@ -731,10 +734,10 @@ uint32 *fileSizePtr; } else { - sendToSB = TRUE; + sendToSB = true; } - if (sendToSB == TRUE) + if (sendToSB == true) { CFE_ES_PerfLogEntry(CI_SOCKET_RCV_PERF_ID); CI_HkTelemetryPkt.IngestPackets++; @@ -800,9 +803,9 @@ void CI_ReadUpLink(void) /* CI_VerifyCmdLength() -- Verify command packet length */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ -boolean CI_VerifyCmdLength(CFE_SB_MsgPtr_t msg, uint16 ExpectedLength) +bool CI_VerifyCmdLength(CFE_SB_MsgPtr_t msg, uint16 ExpectedLength) { -boolean result = TRUE; +bool result = true; uint16 ActualLength = CFE_SB_GetTotalMsgLength(msg); /* @@ -813,10 +816,10 @@ uint16 ActualLength = CFE_SB_GetTotalMsgLength(msg); CFE_SB_MsgId_t MessageID = CFE_SB_GetMsgId(msg); uint16 CommandCode = CFE_SB_GetCmdCode(msg); - CFE_EVS_SendEvent(CI_LEN_ERR_EID, CFE_EVS_ERROR, + CFE_EVS_SendEvent(CI_LEN_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid msg length: ID = 0x%X, CC = %d, Len = %d, Expected = %d", MessageID, CommandCode, ActualLength, ExpectedLength); - result = FALSE; + result = false; CI_HkTelemetryPkt.ci_command_error_count++; } diff --git a/fsw/src/ci_lab_app.h b/fsw/src/ci_lab_app.h index c4523cb..a1a2a20 100644 --- a/fsw/src/ci_lab_app.h +++ b/fsw/src/ci_lab_app.h @@ -86,6 +86,6 @@ void CI_StopPDUCaptureCmd(CFE_SB_MsgPtr_t msg); void CI_ProcessPDU(void); void CI_ReadUpLink(void); -boolean CI_VerifyCmdLength(CFE_SB_MsgPtr_t msg, uint16 ExpectedLength); +bool CI_VerifyCmdLength(CFE_SB_MsgPtr_t msg, uint16 ExpectedLength); #endif /* _ci_lab_app_h_ */