Skip to content

Commit

Permalink
Fix #2175, Rename Invalid Command Code Event IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Oct 21, 2022
1 parent 05d4a11 commit 7fd6661
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion modules/es/fsw/inc/cfe_es_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
*
* Invalid command code for message ID #CFE_ES_CMD_MID received on the ES message pipe.
*/
#define CFE_ES_CC1_ERR_EID 22
#define CFE_ES_CC_ERR_EID 22

/**
* \brief ES Invalid Command Length Event ID
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr)
break;

default:
CFE_EVS_SendEvent(CFE_ES_CC1_ERR_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CFE_ES_CC_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid ground command code: ID = 0x%X, CC = %d",
(unsigned int)CFE_SB_MsgIdToValue(MessageID), (int)CommandCode);
CFE_ES_Global.TaskData.CommandErrorCounter++;
Expand Down
2 changes: 1 addition & 1 deletion modules/es/ut-coverage/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -3329,7 +3329,7 @@ void TestTask(void)
/* Test the command pipe message process with an invalid command */
ES_ResetUnitTest();
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoArgsCmd), UT_TPID_CFE_ES_CMD_INVALID_CC);
CFE_UtAssert_EVENTSENT(CFE_ES_CC1_ERR_EID);
CFE_UtAssert_EVENTSENT(CFE_ES_CC_ERR_EID);

/* Test sending a no-op command with an invalid command length */
ES_ResetUnitTest();
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/fsw/inc/cfe_evs_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
*
* Invalid command code for message ID #CFE_EVS_CMD_MID received on the EVS message pipe.
*/
#define CFE_EVS_ERR_CC_EID 15
#define CFE_EVS_CC_ERR_EID 15

/**
* \brief EVS Reset Counters Command Success Event ID
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/fsw/src/cfe_evs_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ void CFE_EVS_ProcessGroundCommand(CFE_SB_Buffer_t *SBBufPtr, CFE_SB_MsgId_t MsgI
/* default is a bad command code as it was not found above */
default:

EVS_SendEvent(CFE_EVS_ERR_CC_EID, CFE_EVS_EventType_ERROR, "Invalid command code -- ID = 0x%08x, CC = %u",
EVS_SendEvent(CFE_EVS_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command code -- ID = 0x%08x, CC = %u",
(unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode);
Status = CFE_STATUS_BAD_COMMAND_CODE;

Expand Down
2 changes: 1 addition & 1 deletion modules/evs/ut-coverage/evs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ void Test_InvalidCmd(void)
/* Test invalid command code event */
UT_InitData();
UT_EVS_DoDispatchCheckEvents(&cmd, sizeof(cmd), UT_TPID_CFE_EVS_CMD_INVALID_CC, &UT_EVS_EventBuf);
UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_CC_EID);
UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_CC_ERR_EID);

/* Test invalid command length event */
UT_InitData();
Expand Down
2 changes: 1 addition & 1 deletion modules/sb/fsw/inc/cfe_sb_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
* Invalid command code for message ID #CFE_SB_CMD_MID or #CFE_SB_SUB_RPT_CTRL_MID received
* on the SB message pipe. OVERLOADED
*/
#define CFE_SB_BAD_CMD_CODE_EID 42
#define CFE_SB_CC_ERR_EID 42

/**
* \brief SB Invalid Message ID Received Event ID
Expand Down
4 changes: 2 additions & 2 deletions modules/sb/fsw/src/cfe_sb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void CFE_SB_ProcessCmdPipePkt(CFE_SB_Buffer_t *SBBufPtr)
break;

default:
CFE_EVS_SendEvent(CFE_SB_BAD_CMD_CODE_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CFE_SB_CC_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid Cmd, Unexpected Command Code %u", (unsigned int)FcnCode);
CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++;
break;
Expand Down Expand Up @@ -428,7 +428,7 @@ void CFE_SB_ProcessCmdPipePkt(CFE_SB_Buffer_t *SBBufPtr)
break;

default:
CFE_EVS_SendEvent(CFE_SB_BAD_CMD_CODE_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(CFE_SB_CC_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid Cmd, Unexpected Command Code %u", FcnCode);
CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++;
break;
Expand Down
2 changes: 1 addition & 1 deletion modules/sb/ut-coverage/sb_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ void Test_SB_Cmds_CmdUnexpCmdCode(void)
UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_CMD_BAD_FCNCODE, sizeof(CFE_MSG_CommandHeader_t), true);
CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL);
CFE_UtAssert_EVENTCOUNT(1);
CFE_UtAssert_EVENTSENT(CFE_SB_BAD_CMD_CODE_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_CC_ERR_EID);

UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SUB_RPT_CTRL_BAD_FCNCODE, sizeof(CFE_MSG_CommandHeader_t), true);
CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL);
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/fsw/inc/cfe_tbl_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
*
* Invalid command code for message ID #CFE_TBL_CMD_MID received on the TBL message pipe.
*/
#define CFE_TBL_CC1_ERR_EID 51
#define CFE_TBL_CC_ERR_EID 51

/**
* \brief TBL Invalid Command Length Event ID
Expand Down
3 changes: 1 addition & 2 deletions modules/tbl/fsw/src/cfe_tbl_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr)
/* "Bad Command Code" or "Bad Message ID" */
if (CmdIndx == CFE_TBL_BAD_CMD_CODE)
{
CFE_EVS_SendEvent(CFE_TBL_CC1_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid command code -- ID = 0x%X, CC = %u",
CFE_EVS_SendEvent(CFE_TBL_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command code -- ID = 0x%X, CC = %u",
(unsigned int)CFE_SB_MsgIdToValue(MessageID), (unsigned int)CommandCode);

/* Update the command error counter */
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/ut-coverage/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void Test_CFE_TBL_TaskInit(void)
*/
UT_InitData();
UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoArgsCmd), UT_TPID_CFE_TBL_CMD_INVALID_CC);
CFE_UtAssert_EVENTSENT(CFE_TBL_CC1_ERR_EID);
CFE_UtAssert_EVENTSENT(CFE_TBL_CC_ERR_EID);

/* Test command pipe messages handler response to other errors */
UT_InitData();
Expand Down

0 comments on commit 7fd6661

Please sign in to comment.