From a555d95c143e5de32d317a121b6c1c3e9d267bf3 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 7 Jun 2022 15:59:03 -0600 Subject: [PATCH] Fix #217, Add mission rev and print in startup and noop events --- fsw/platform_inc/cf_platform_cfg.h | 19 ++++++++++++++++--- fsw/src/cf_app.c | 4 ++-- fsw/src/cf_cmd.c | 4 ++-- unit-test/cf_cmd_tests.c | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/fsw/platform_inc/cf_platform_cfg.h b/fsw/platform_inc/cf_platform_cfg.h index bde55f22..7a832578 100644 --- a/fsw/platform_inc/cf_platform_cfg.h +++ b/fsw/platform_inc/cf_platform_cfg.h @@ -323,12 +323,25 @@ typedef uint32 CF_TransactionSeq_t; /** * @brief Number of milliseconds to wait for a SB message - * - * @par Limits: - * */ #define CF_RCVMSG_TIMEOUT (100) +/** + * \brief Mission specific version number + * + * \par Description: + * An application version number consists of four parts: + * major version number, minor version number, revision + * number and mission specific revision number. The mission + * specific revision number is defined here such + * that missions can manage as a configuration definition + * + * \par Limits: + * Must be defined as a numeric value that is greater than + * or equal to zero. + */ +#define CF_MISSION_REV 0 + /**\}*/ #endif /* !CF_PLATFORM_CFG_H */ diff --git a/fsw/src/cf_app.c b/fsw/src/cf_app.c index d14671be..233e00e8 100644 --- a/fsw/src/cf_app.c +++ b/fsw/src/cf_app.c @@ -368,8 +368,8 @@ int32 CF_Init(void) goto err_out; } - status = CFE_EVS_SendEvent(CF_EID_INF_INIT, CFE_EVS_EventType_INFORMATION, "CF Initialized. Version %d.%d.%d", - CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION); + status = CFE_EVS_SendEvent(CF_EID_INF_INIT, CFE_EVS_EventType_INFORMATION, "CF Initialized. Version %d.%d.%d.%d", + CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION, CF_MISSION_REV); if (status != CFE_SUCCESS) { diff --git a/fsw/src/cf_cmd.c b/fsw/src/cf_cmd.c index 3c90f22f..4dcd75be 100644 --- a/fsw/src/cf_cmd.c +++ b/fsw/src/cf_cmd.c @@ -52,8 +52,8 @@ *-----------------------------------------------------------------*/ void CF_CmdNoop(CFE_SB_Buffer_t *msg) { - CFE_EVS_SendEvent(CF_EID_INF_CMD_NOOP, CFE_EVS_EventType_INFORMATION, "CF: No-Op received, Version %d.%d.%d", - CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION); + CFE_EVS_SendEvent(CF_EID_INF_CMD_NOOP, CFE_EVS_EventType_INFORMATION, "CF: No-Op received, Version %d.%d.%d.%d", + CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION, CF_MISSION_REV); CF_CmdAcc(); } diff --git a/unit-test/cf_cmd_tests.c b/unit-test/cf_cmd_tests.c index 7dd1005b..4f6db552 100644 --- a/unit-test/cf_cmd_tests.c +++ b/unit-test/cf_cmd_tests.c @@ -4241,7 +4241,7 @@ void Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x00_AndCall_CF_CmdNoop_With_m CFE_MSG_FcnCode_t forced_return_CFE_MSG_GetFcnCode = 0x00; /* 0x00 forces fns[0] which is CF_CmdNoop */ CFE_MSG_Size_t forced_return_CFE_MSG_GetSize = sizeof(CF_NoArgsCmd_t); /* sizeof(CF_NoArgsCmd_t) is expected size of CF_CmdNoop */ - const char * expected_Spec = "CF: No-Op received, Version %d.%d.%d"; + const char * expected_Spec = "CF: No-Op received, Version %d.%d.%d.%d"; CFE_MSG_GetFcnCode_context_t context_CFE_MSG_GetFcnCode; CFE_MSG_GetSize_context_t context_CFE_MSG_GetSize; CFE_EVS_SendEvent_context_t context_CFE_EVS_SendEvent;