From 1c38e4f33f6e3f602ad68e936be9b1dc92049fb9 Mon Sep 17 00:00:00 2001 From: Avi Date: Fri, 21 Oct 2022 19:34:48 +1000 Subject: [PATCH] Fix #45, Apply consistent Event ID names to common events in LC --- fsw/inc/lc_events.h | 6 +++--- fsw/inc/lc_msgdefs.h | 16 ++++++++-------- fsw/src/lc_cmds.c | 2 +- fsw/src/lc_utils.c | 2 +- fsw/src/lc_utils.h | 2 +- unit-test/lc_cmds_tests.c | 2 +- unit-test/lc_utils_tests.c | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/fsw/inc/lc_events.h b/fsw/inc/lc_events.h index f9cb419..3bc8f16 100644 --- a/fsw/inc/lc_events.h +++ b/fsw/inc/lc_events.h @@ -394,14 +394,14 @@ /** * \brief LC Reset Counters Command Event ID * - * \par Type: DEBUG + * \par Type: INFORMATION * * \par Cause: * * This event message is issued when a reset counters command has * been received. */ -#define LC_RESET_DBG_EID 27 +#define LC_RESET_INF_EID 27 /** * \brief LC Set Limit Checker State Command Event ID @@ -596,7 +596,7 @@ * This event message is issued when a ground command message is received * with a message length that doesn't match the expected value. */ -#define LC_LEN_ERR_EID 43 +#define LC_CMD_LEN_ERR_EID 43 /** * \brief LC Watchpoint Message Unsubscribe Failed Event ID diff --git a/fsw/inc/lc_msgdefs.h b/fsw/inc/lc_msgdefs.h index e16b37f..e3d83dc 100644 --- a/fsw/inc/lc_msgdefs.h +++ b/fsw/inc/lc_msgdefs.h @@ -143,7 +143,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #LC_HkPacket_t.CmdErrCount will increment - * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_CMD_LEN_ERR_EID * * \par Criticality * None @@ -165,7 +165,7 @@ * Successful execution of this command may be verified with * the following telemetry: * - #LC_HkPacket_t.CmdCount will be cleared - * - The #LC_RESET_DBG_EID debug event message will be + * - The #LC_RESET_INF_EID informational event message will be * generated when the command is executed * * \par Error Conditions @@ -174,7 +174,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #LC_HkPacket_t.CmdErrCount will increment - * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_CMD_LEN_ERR_EID * * \par Criticality * None @@ -207,7 +207,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #LC_HkPacket_t.CmdErrCount will increment - * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_CMD_LEN_ERR_EID * - Error specific event message #LC_LCSTATE_ERR_EID * * \par Criticality @@ -243,7 +243,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #LC_HkPacket_t.CmdErrCount will increment - * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_CMD_LEN_ERR_EID * - Error specific event message #LC_APSTATE_NEW_ERR_EID * - Error specific event message #LC_APSTATE_APNUM_ERR_EID * - Error specific event message #LC_APSTATE_CURR_ERR_EID @@ -279,7 +279,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #LC_HkPacket_t.CmdErrCount will increment - * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_CMD_LEN_ERR_EID * - Error specific event message #LC_APOFF_APNUM_ERR_EID * - Error specific event message #LC_APOFF_CURR_ERR_EID * @@ -313,7 +313,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #LC_HkPacket_t.CmdErrCount will increment - * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_CMD_LEN_ERR_EID * - Error specific event message #LC_APSTATS_APNUM_ERR_EID * * \par Criticality @@ -347,7 +347,7 @@ * * \par Evidence of failure may be found in the following telemetry: * - #LC_HkPacket_t.CmdErrCount will increment - * - Error specific event message #LC_LEN_ERR_EID + * - Error specific event message #LC_CMD_LEN_ERR_EID * - Error specific event message #LC_WPSTATS_WPNUM_ERR_EID * * \par Criticality diff --git a/fsw/src/lc_cmds.c b/fsw/src/lc_cmds.c index 0acd6a0..51397be 100644 --- a/fsw/src/lc_cmds.c +++ b/fsw/src/lc_cmds.c @@ -526,7 +526,7 @@ void LC_ResetCmd(const CFE_SB_Buffer_t *BufPtr) { LC_ResetCounters(); - CFE_EVS_SendEvent(LC_RESET_DBG_EID, CFE_EVS_EventType_DEBUG, "Reset counters command"); + CFE_EVS_SendEvent(LC_RESET_INF_EID, CFE_EVS_EventType_DEBUG, "Reset counters command"); } return; diff --git a/fsw/src/lc_utils.c b/fsw/src/lc_utils.c index 4d0d0f4..e250a41 100644 --- a/fsw/src/lc_utils.c +++ b/fsw/src/lc_utils.c @@ -84,7 +84,7 @@ bool LC_VerifyMsgLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) /* ** All other cases, increment error counter */ - CFE_EVS_SendEvent(LC_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(LC_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/lc_utils.h b/fsw/src/lc_utils.h index 5a7dc43..e608f98 100644 --- a/fsw/src/lc_utils.h +++ b/fsw/src/lc_utils.h @@ -48,7 +48,7 @@ * \retval true Length verification passed * \retval false Length verification failed * - * \sa #LC_LEN_ERR_EID + * \sa #LC_CMD_LEN_ERR_EID */ bool LC_VerifyMsgLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength); diff --git a/unit-test/lc_cmds_tests.c b/unit-test/lc_cmds_tests.c index 76db891..be3e233 100644 --- a/unit-test/lc_cmds_tests.c +++ b/unit-test/lc_cmds_tests.c @@ -152,7 +152,7 @@ void LC_AppPipe_Test_Reset(void) * has been reached */ call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, LC_RESET_DBG_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, LC_RESET_INF_EID); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG); strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); diff --git a/unit-test/lc_utils_tests.c b/unit-test/lc_utils_tests.c index 62a0695..b4a0f73 100644 --- a/unit-test/lc_utils_tests.c +++ b/unit-test/lc_utils_tests.c @@ -137,7 +137,7 @@ void LC_VerifyMsgLength_Test_GenericLengthError(void) call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, LC_LEN_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, LC_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);