From 11b5c0878fcc1889df82a2f81af87ff5a6a2e13f Mon Sep 17 00:00:00 2001 From: Avi Date: Fri, 21 Oct 2022 19:54:03 +1000 Subject: [PATCH] Fix #36, Apply consistent Event ID names to common events in MD --- fsw/inc/md_events.h | 4 ++-- fsw/inc/md_msgdefs.h | 2 +- fsw/src/md_app.c | 4 ++-- unit-test/md_app_tests.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fsw/inc/md_events.h b/fsw/inc/md_events.h index 6860eee..74d85ba 100644 --- a/fsw/inc/md_events.h +++ b/fsw/inc/md_events.h @@ -127,7 +127,7 @@ * * Issued upon receipt of a Memory Dwell Reset Counters command. */ -#define MD_RESET_CNTRS_DBG_EID 11 +#define MD_RESET_INF_EID 11 /** * \brief MD Start Command Event ID @@ -696,7 +696,7 @@ * * This event message is issued when MD cannot create the software bus pipe. */ -#define MD_CREATE_PIPE_ERR_EID 71 +#define MD_CR_PIPE_ERR_EID 71 /** * \brief MD Housekeeping Subscribe Failed Event ID diff --git a/fsw/inc/md_msgdefs.h b/fsw/inc/md_msgdefs.h index e46b6fb..b5f3f99 100644 --- a/fsw/inc/md_msgdefs.h +++ b/fsw/inc/md_msgdefs.h @@ -83,7 +83,7 @@ * the following telemetry: * - #MD_HkTlm_t.ValidCmdCntr will be set to zero. * - #MD_HkTlm_t.InvalidCmdCntr will be set to zero. - * - The #MD_RESET_CNTRS_DBG_EID debug event message will be generated. + * - The #MD_RESET_INF_EID debug event message will be generated. * * \par Error Conditions * This command may fail for the following reason(s): diff --git a/fsw/src/md_app.c b/fsw/src/md_app.c index afd764f..2e9fbf3 100644 --- a/fsw/src/md_app.c +++ b/fsw/src/md_app.c @@ -273,7 +273,7 @@ int32 MD_InitSoftwareBusServices(void) if (Status != CFE_SUCCESS) { - CFE_EVS_SendEvent(MD_CREATE_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to create pipe. RC = %d", Status); + CFE_EVS_SendEvent(MD_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to create pipe. RC = %d", Status); } /* @@ -624,7 +624,7 @@ void MD_ExecRequest(const CFE_SB_Buffer_t *BufPtr) case MD_RESET_CNTRS_CC: - CFE_EVS_SendEvent(MD_RESET_CNTRS_DBG_EID, CFE_EVS_EventType_DEBUG, "Reset Counters Cmd Received"); + CFE_EVS_SendEvent(MD_RESET_INF_EID, CFE_EVS_EventType_DEBUG, "Reset Counters Cmd Received"); MD_AppData.CmdCounter = 0; MD_AppData.ErrCounter = 0; break; diff --git a/unit-test/md_app_tests.c b/unit-test/md_app_tests.c index a3dde01..74eadfa 100644 --- a/unit-test/md_app_tests.c +++ b/unit-test/md_app_tests.c @@ -654,7 +654,7 @@ void MD_InitSoftwareBusServices_Test_CreatePipeError(void) UtAssert_True(Result == -1, "Result == -1"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MD_CREATE_PIPE_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MD_CR_PIPE_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); @@ -1579,7 +1579,7 @@ void MD_ExecRequest_Test_ResetCounters(void) UtAssert_True(MD_AppData.CmdCounter == 0, "MD_AppData.CmdCounter == 0"); UtAssert_True(MD_AppData.ErrCounter == 0, "MD_AppData.ErrCounter == 0"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MD_RESET_CNTRS_DBG_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MD_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);