From cc1834f283403e252ab89380d5bfc4cea1068228 Mon Sep 17 00:00:00 2001 From: Avi Date: Fri, 21 Oct 2022 17:27:45 +1000 Subject: [PATCH] Fix #50, Apply consistent Event ID names to common events in MM --- fsw/inc/mm_events.h | 4 ++-- fsw/inc/mm_msgdefs.h | 26 +++++++++++++------------- fsw/src/mm_app.c | 2 +- fsw/src/mm_utils.c | 2 +- fsw/src/mm_utils.h | 2 +- unit-test/mm_app_tests.c | 2 +- unit-test/mm_utils_tests.c | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/fsw/inc/mm_events.h b/fsw/inc/mm_events.h index ed3e16f..e68e085 100644 --- a/fsw/inc/mm_events.h +++ b/fsw/inc/mm_events.h @@ -228,7 +228,7 @@ * This event message is issued when a software bus message is received * with an invalid command code. */ -#define MM_CC1_ERR_EID 17 +#define MM_CC_ERR_EID 17 /** * \brief MM Command Message Length Invalid Event ID @@ -240,7 +240,7 @@ * This event message is issued when command message is received with a message * length that doesn't match the expected value. */ -#define MM_LEN_ERR_EID 18 +#define MM_CMD_LEN_ERR_EID 18 /** * \brief MM Commanded Memory Type Invalid Event ID diff --git a/fsw/inc/mm_msgdefs.h b/fsw/inc/mm_msgdefs.h index 44f08c5..818cfca 100644 --- a/fsw/inc/mm_msgdefs.h +++ b/fsw/inc/mm_msgdefs.h @@ -99,7 +99,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * * \par Criticality * None @@ -131,7 +131,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * * \par Criticality * None @@ -175,7 +175,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_SYMNAME_ERR_EID * - Error specific event message #MM_DATA_SIZE_BITS_ERR_EID * - Error specific event message #MM_MEMTYPE_ERR_EID @@ -233,7 +233,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_SYMNAME_ERR_EID * - Error specific event message #MM_DATA_SIZE_BITS_ERR_EID * - Error specific event message #MM_MEMTYPE_ERR_EID @@ -293,7 +293,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_SYMNAME_ERR_EID * - Error specific event message #MM_LOAD_WID_CRC_ERR_EID * - Error specific event message #MM_OS_MEMVALIDATE_ERR_EID @@ -357,7 +357,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_OS_OPEN_ERR_EID * - Error specific event message #MM_OS_CLOSE_ERR_EID * - Error specific event message #MM_OS_READ_EXP_ERR_EID @@ -430,7 +430,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_SYMNAME_ERR_EID * - Error specific event message #MM_OS_CREAT_ERR_EID * - Error specific event message #MM_CFE_FS_WRITEHDR_ERR_EID @@ -488,7 +488,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_SYMNAME_ERR_EID * - Error specific event message #MM_OS_MEMVALIDATE_ERR_EID * - Error specific event message #MM_DATA_SIZE_BYTES_ERR_EID @@ -542,7 +542,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_SYMNAME_ERR_EID * - Error specific event message #MM_OS_MEMVALIDATE_ERR_EID * - Error specific event message #MM_DATA_SIZE_BYTES_ERR_EID @@ -592,7 +592,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_SYMNAME_NUL_ERR_EID * - Error specific event message #MM_SYMNAME_ERR_EID * @@ -630,7 +630,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_SYMFILENAME_NUL_ERR_EID * - Error specific event message #MM_SYMTBL_TO_FILE_FAIL_ERR_EID * @@ -668,7 +668,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_EEPROM_WRITE_ENA_ERR_EID * * \par Criticality @@ -706,7 +706,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #MM_HkPacket_Payload_t.ErrCounter will increment - * - Error specific event message #MM_LEN_ERR_EID + * - Error specific event message #MM_CMD_LEN_ERR_EID * - Error specific event message #MM_EEPROM_WRITE_DIS_ERR_EID * * \par Criticality diff --git a/fsw/src/mm_app.c b/fsw/src/mm_app.c index 7e506ef..845cc5a 100644 --- a/fsw/src/mm_app.c +++ b/fsw/src/mm_app.c @@ -348,7 +348,7 @@ void MM_AppPipe(const CFE_SB_Buffer_t *BufPtr) default: CmdResult = false; - CFE_EVS_SendEvent(MM_CC1_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(MM_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid ground command code: ID = 0x%08lX, CC = %d", (unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode); break; diff --git a/fsw/src/mm_utils.c b/fsw/src/mm_utils.c index 3bc16bf..a5b9b9b 100644 --- a/fsw/src/mm_utils.c +++ b/fsw/src/mm_utils.c @@ -117,7 +117,7 @@ bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) } else { - CFE_EVS_SendEvent(MM_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(MM_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d", (unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode, (int)ActualLength, (int)ExpectedLength); diff --git a/fsw/src/mm_utils.h b/fsw/src/mm_utils.h index 30a3b50..2841446 100644 --- a/fsw/src/mm_utils.h +++ b/fsw/src/mm_utils.h @@ -79,7 +79,7 @@ void MM_SegmentBreak(void); * \retval true Length matches expected * \retval false Length does not match expected * - * \sa #MM_LEN_ERR_EID + * \sa #MM_CMD_LEN_ERR_EID */ bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength); diff --git a/unit-test/mm_app_tests.c b/unit-test/mm_app_tests.c index 0f63da3..eaf3262 100644 --- a/unit-test/mm_app_tests.c +++ b/unit-test/mm_app_tests.c @@ -1100,7 +1100,7 @@ void MM_AppPipe_Test_InvalidCommandCode(void) UtAssert_INT32_EQ(MM_AppData.HkPacket.Payload.CmdCounter, 0); UtAssert_INT32_EQ(MM_AppData.HkPacket.Payload.ErrCounter, 1); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_CC1_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_CC_ERR_EID); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); diff --git a/unit-test/mm_utils_tests.c b/unit-test/mm_utils_tests.c index 27e5740..a2b0be2 100644 --- a/unit-test/mm_utils_tests.c +++ b/unit-test/mm_utils_tests.c @@ -180,7 +180,7 @@ void MM_VerifyCmdLength_Test_LengthError(void) /* Verify results */ UtAssert_True(Result == false, "Result == false"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_LEN_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_CMD_LEN_ERR_EID); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH);