Skip to content

Commit

Permalink
Fix #36, Apply consistent Event ID names to common events in MD
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Nov 1, 2023
1 parent b0ae64d commit 51402b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions fsw/inc/md_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fsw/inc/md_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
* the following telemetry:
* - #MD_HkTlm_Payload_t.ValidCmdCntr will be set to zero.
* - #MD_HkTlm_Payload_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):
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/md_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ CFE_Status_t MD_InitSoftwareBusServices(void)
}
else
{
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);
}

/*
Expand Down Expand Up @@ -622,7 +622,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;
Expand Down
4 changes: 2 additions & 2 deletions unit-test/md_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,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);
Expand Down Expand Up @@ -1574,7 +1574,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);
Expand Down

0 comments on commit 51402b6

Please sign in to comment.