Skip to content

Commit

Permalink
Fix #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 Mar 30, 2023
1 parent eff974a commit 7d51d63
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 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/inc/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/inc/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_HkTlm_Payload_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_HkTlm_Payload_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
4 changes: 2 additions & 2 deletions fsw/src/hk_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,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 @@ -360,7 +360,7 @@ void HK_NoopCmd(const CFE_SB_Buffer_t *BufPtr)
void HK_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr)
{
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 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 @@ -978,7 +978,7 @@ void Test_HK_NoopCmd(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 @@ -1019,7 +1019,7 @@ void Test_HK_ResetCountersCmd(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 7d51d63

Please sign in to comment.