Skip to content

Commit

Permalink
Fix nasa#26, Apply consistent Event ID names to common events
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Oct 21, 2022
1 parent 61eea35 commit 890e59c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/dox_src/cfs_hk.dox
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@

If the packet length field in the
command is set to the value expected by the HK app, then the command counter will
increment and a #HK_NOOP_CMD_EID event message
increment and a #HK_NOOP_INF_EID event message
will be sent. This no-op event will show the version number of the HK application.

<H2>4. Sending the reset counters command</H2>
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/hk_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int32 HK_AppInit(void)
}

/* Application initialization event */
Status = CFE_EVS_SendEvent(HK_INIT_EID, CFE_EVS_EventType_INFORMATION, "HK Initialized. Version %d.%d.%d.%d",
Status = CFE_EVS_SendEvent(HK_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "HK Initialized. Version %d.%d.%d.%d",
HK_MAJOR_VERSION, HK_MINOR_VERSION, HK_REVISION, HK_MISSION_REV);

if (Status != CFE_SUCCESS)
Expand Down Expand Up @@ -430,7 +430,7 @@ void HK_NoopCmd(const CFE_SB_Buffer_t *BufPtr)
}
else
{
CFE_EVS_SendEvent(HK_NOOP_CMD_EID, CFE_EVS_EventType_INFORMATION, "HK No-op command, Version %d.%d.%d.%d",
CFE_EVS_SendEvent(HK_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "HK No-op command, Version %d.%d.%d.%d",
HK_MAJOR_VERSION, HK_MINOR_VERSION, HK_REVISION, HK_MISSION_REV);

HK_AppData.CmdCounter++;
Expand All @@ -453,7 +453,7 @@ void HK_ResetCtrsCmd(const CFE_SB_Buffer_t *BufPtr)
else
{
HK_ResetHkData();
CFE_EVS_SendEvent(HK_RESET_CNTRS_CMD_EID, CFE_EVS_EventType_DEBUG, "HK Reset Counters command received");
CFE_EVS_SendEvent(HK_RESET_INF_EID, CFE_EVS_EventType_DEBUG, "HK Reset Counters command received");
}
}

Expand Down
6 changes: 3 additions & 3 deletions fsw/src/hk_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* This event message is issued when the Housekeeping App completes its
* initialization.
*/
#define HK_INIT_EID 1
#define HK_INIT_INF_EID 1

/**
* \brief HK Command Code Invalid Event ID
Expand Down Expand Up @@ -76,7 +76,7 @@
* \link #HK_NOOP_CC No-op command. \endlink The command is used primarily as an
* indicator that the HK application can receive commands and generate telemetry.
*/
#define HK_NOOP_CMD_EID 4
#define HK_NOOP_INF_EID 4

/**
* \brief HK Reset Counters Command Event ID
Expand All @@ -88,7 +88,7 @@
* This event message is issued when the HK application receives a Reset
* Counters command.
*/
#define HK_RESET_CNTRS_CMD_EID 5
#define HK_RESET_INF_EID 5

/**
* \brief HK Table Definition Exceeds Packet Length Event ID
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/hk_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* Successful execution of this command may be verified with the
* following telemetry:
* - #HK_HkPacket_t.CmdCounter will increment
* - The #HK_NOOP_CMD_EID informational event message will be generated
* - The #HK_NOOP_INF_EID informational event message will be generated
*
* \par Error Conditions
* There are no error conditions for this command. If the Housekeeping
Expand All @@ -71,7 +71,7 @@
* Successful execution of this command may be verified with the
* following telemetry:
* - #HK_HkPacket_t.CmdCounter will be reset
* - The #HK_RESET_CNTRS_CMD_EID informational event message will
* - The #HK_RESET_INF_EID informational event message will
* be generated
*
* \par Error Conditions
Expand Down
6 changes: 3 additions & 3 deletions unit-test/hk_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void Test_HK_AppInit_Success(void)

UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1);

UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, HK_INIT_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, HK_INIT_INF_EID);

UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);

Expand Down Expand Up @@ -1279,7 +1279,7 @@ void Test_HK_NoopCmd_LengthOk(void)
/* Assert */
UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1);

UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, HK_NOOP_CMD_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, HK_NOOP_INF_EID);

UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);

Expand Down Expand Up @@ -1346,7 +1346,7 @@ void Test_HK_ResetCtrsCmd_LengthOk(void)
/* Assert */
UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1);

UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, HK_RESET_CNTRS_CMD_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, HK_RESET_INF_EID);

UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG);

Expand Down

0 comments on commit 890e59c

Please sign in to comment.