From a532820727063d437b5c6e7e4075f910759f97d3 Mon Sep 17 00:00:00 2001 From: Avi Date: Fri, 21 Oct 2022 19:45:11 +1000 Subject: [PATCH] Fix #60, Apply consistent Event ID names to common events --- fsw/src/ds_app.c | 8 ++++---- fsw/src/ds_cmds.c | 4 ++-- fsw/src/ds_events.h | 10 +++++----- fsw/src/ds_msgdefs.h | 4 ++-- unit-test/ds_app_tests.c | 4 ++-- unit-test/ds_cmds_tests.c | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/fsw/src/ds_app.c b/fsw/src/ds_app.c index 7e3a4ac..4c7b676 100644 --- a/fsw/src/ds_app.c +++ b/fsw/src/ds_app.c @@ -267,7 +267,7 @@ int32 DS_AppInitialize(void) */ if (Result == CFE_SUCCESS) { - CFE_EVS_SendEvent(DS_INIT_EID, CFE_EVS_EventType_INFORMATION, + CFE_EVS_SendEvent(DS_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "Application initialized, version %d.%d.%d.%d, data at %p", DS_MAJOR_VERSION, DS_MINOR_VERSION, DS_REVISION, DS_MISSION_REV, (void *)&DS_AppData); } @@ -311,7 +311,7 @@ void DS_AppProcessMsg(const CFE_SB_Buffer_t *BufPtr) ExpectedLength = sizeof(DS_NoopCmd_t); if (ExpectedLength != ActualLength) { - CFE_EVS_SendEvent(DS_HK_REQUEST_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(DS_HKREQ_LEN_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid HK request length: expected = %d, actual = %d", (int)ExpectedLength, (int)ActualLength); } @@ -478,8 +478,8 @@ void DS_AppProcessCmd(const CFE_SB_Buffer_t *BufPtr) ** DS application command with unknown command code... */ default: - CFE_EVS_SendEvent(DS_CMD_CODE_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid command code: MID = 0x%08X, CC = %d", DS_CMD_MID, CommandCode); + CFE_EVS_SendEvent(DS_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command code: MID = 0x%08X, CC = %d", + DS_CMD_MID, CommandCode); DS_AppData.CmdRejectedCounter++; break; diff --git a/fsw/src/ds_cmds.c b/fsw/src/ds_cmds.c index 0c15653..aa534bc 100644 --- a/fsw/src/ds_cmds.c +++ b/fsw/src/ds_cmds.c @@ -71,7 +71,7 @@ void DS_CmdNoop(const CFE_SB_Buffer_t *BufPtr) */ DS_AppData.CmdAcceptedCounter++; - CFE_EVS_SendEvent(DS_NOOP_CMD_EID, CFE_EVS_EventType_INFORMATION, "NOOP command, Version %d.%d.%d.%d", + CFE_EVS_SendEvent(DS_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "NOOP command, Version %d.%d.%d.%d", DS_MAJOR_VERSION, DS_MINOR_VERSION, DS_REVISION, DS_MISSION_REV); } } @@ -132,7 +132,7 @@ void DS_CmdReset(const CFE_SB_Buffer_t *BufPtr) DS_AppData.FilterTblLoadCounter = 0; DS_AppData.FilterTblErrCounter = 0; - CFE_EVS_SendEvent(DS_RESET_CMD_EID, CFE_EVS_EventType_DEBUG, "Reset counters command"); + CFE_EVS_SendEvent(DS_RESET_INF_EID, CFE_EVS_EventType_DEBUG, "Reset counters command"); } } diff --git a/fsw/src/ds_events.h b/fsw/src/ds_events.h index c41dbbf..46ec283 100644 --- a/fsw/src/ds_events.h +++ b/fsw/src/ds_events.h @@ -39,7 +39,7 @@ * This event message is issued if the Data Storage (DS) application successfully * completes its initialization. */ -#define DS_INIT_EID 1 +#define DS_INIT_INF_EID 1 /** * \brief DS Initialization Failed Event ID @@ -242,7 +242,7 @@ * these errors so the cause is more likely to result from sending "raw" * ground commands or on-board stored commands. */ -#define DS_CMD_CODE_ERR_EID 21 +#define DS_CC_ERR_EID 21 /** * \brief DS Housekeeping Request Invalid Length Event ID @@ -254,7 +254,7 @@ * This event signals the failed execution of a HK request command. * The cause of the failure is an invalid command packet length. */ -#define DS_HK_REQUEST_ERR_EID 22 +#define DS_HKREQ_LEN_ERR_EID 22 /** * \brief DS No-op Command Event ID @@ -267,7 +267,7 @@ * command. The command is used primarily as an indicator that the DS * application can receive commands and generate telemetry. */ -#define DS_NOOP_CMD_EID 31 +#define DS_NOOP_INF_EID 31 /** * \brief DS No-op Command Invalid Length Event ID @@ -292,7 +292,7 @@ * counters command. The command is used primarily to clear counters * that have already been examined. */ -#define DS_RESET_CMD_EID 33 +#define DS_RESET_INF_EID 33 /** * \brief DS Reset Counters Command Invalid Length Event ID diff --git a/fsw/src/ds_msgdefs.h b/fsw/src/ds_msgdefs.h index a616fd4..879be7c 100644 --- a/fsw/src/ds_msgdefs.h +++ b/fsw/src/ds_msgdefs.h @@ -43,7 +43,7 @@ * \par Command Verification * Evidence of success may be found in the following telemetry: * - #DS_HkPacket_t.CmdAcceptedCounter will increment - * - The #DS_NOOP_CMD_EID informational event message will be sent + * - The #DS_NOOP_INF_EID informational event message will be sent * * \par Error Conditions * This command can fail for the following reasons: @@ -70,7 +70,7 @@ * \par Command Verification * Evidence of success may be found in the following telemetry: * - #DS_HkPacket_t.CmdAcceptedCounter will reset to zero - * - The #DS_RESET_CMD_EID debug event message will be sent + * - The #DS_RESET_INF_EID debug event message will be sent * * \par Error Conditions * This command can fail for the following reasons: diff --git a/unit-test/ds_app_tests.c b/unit-test/ds_app_tests.c index b9cc27d..12c111e 100644 --- a/unit-test/ds_app_tests.c +++ b/unit-test/ds_app_tests.c @@ -160,7 +160,7 @@ void DS_AppInitialize_Test_Nominal(void) * are modified by subfunctions, which we're not testing here */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_INIT_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_INIT_INF_EID); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); } @@ -399,7 +399,7 @@ void DS_AppProcessMsg_Test_HKInvalidRequest(void) /* Verify results */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_HK_REQUEST_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_HKREQ_LEN_ERR_EID); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); } diff --git a/unit-test/ds_cmds_tests.c b/unit-test/ds_cmds_tests.c index c8afd00..1df8ae9 100644 --- a/unit-test/ds_cmds_tests.c +++ b/unit-test/ds_cmds_tests.c @@ -77,7 +77,7 @@ void DS_CmdNoop_Test_Nominal(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, DS_NOOP_CMD_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_NOOP_INF_EID); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); @@ -158,7 +158,7 @@ void DS_CmdReset_Test_Nominal(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, DS_RESET_CMD_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_RESET_INF_EID); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG);