Skip to content

Commit

Permalink
Merge pull request #51 from thnkslprpt/fix-50-apply-consistent-event-…
Browse files Browse the repository at this point in the history
…id-names

Fix #50, Apply consistent Event ID names to common events
  • Loading branch information
dzbaker authored Jul 15, 2024
2 parents 4b24eba + cc1834f commit b8fb572
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions fsw/inc/mm_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
* This event message is issued when a software bus message is received
* with an invalid command code.
*/
#define MM_CC1_ERR_EID 17
#define MM_CC_ERR_EID 17

/**
* \brief MM Command Message Length Invalid Event ID
Expand All @@ -240,7 +240,7 @@
* This event message is issued when command message is received with a message
* length that doesn't match the expected value.
*/
#define MM_LEN_ERR_EID 18
#define MM_CMD_LEN_ERR_EID 18

/**
* \brief MM Commanded Memory Type Invalid Event ID
Expand Down
26 changes: 13 additions & 13 deletions fsw/inc/mm_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
*
* \par Criticality
* None
Expand Down Expand Up @@ -131,7 +131,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
*
* \par Criticality
* None
Expand Down Expand Up @@ -176,7 +176,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_DATA_SIZE_BITS_ERR_EID
* - Error specific event message #MM_MEMTYPE_ERR_EID
Expand Down Expand Up @@ -235,7 +235,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_DATA_SIZE_BITS_ERR_EID
* - Error specific event message #MM_MEMTYPE_ERR_EID
Expand Down Expand Up @@ -295,7 +295,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_LOAD_WID_CRC_ERR_EID
* - Error specific event message #MM_OS_MEMVALIDATE_ERR_EID
Expand Down Expand Up @@ -359,7 +359,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_OS_OPEN_ERR_EID
* - Error specific event message #MM_OS_CLOSE_ERR_EID
* - Error specific event message #MM_OS_READ_EXP_ERR_EID
Expand Down Expand Up @@ -432,7 +432,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_OS_CREAT_ERR_EID
* - Error specific event message #MM_CFE_FS_WRITEHDR_ERR_EID
Expand Down Expand Up @@ -490,7 +490,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_OS_MEMVALIDATE_ERR_EID
* - Error specific event message #MM_DATA_SIZE_BYTES_ERR_EID
Expand Down Expand Up @@ -544,7 +544,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_OS_MEMVALIDATE_ERR_EID
* - Error specific event message #MM_DATA_SIZE_BYTES_ERR_EID
Expand Down Expand Up @@ -594,7 +594,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_NUL_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
*
Expand Down Expand Up @@ -632,7 +632,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMFILENAME_NUL_ERR_EID
* - Error specific event message #MM_SYMTBL_TO_FILE_FAIL_ERR_EID
*
Expand Down Expand Up @@ -670,7 +670,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_EEPROM_WRITE_ENA_ERR_EID
*
* \par Criticality
Expand Down Expand Up @@ -708,7 +708,7 @@
*
* \par Evidence of failure may be found in the following telemetry:
* - #MM_HkPacket_Payload_t.ErrCounter will increment
* - Error specific event message #MM_LEN_ERR_EID
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_EEPROM_WRITE_DIS_ERR_EID
*
* \par Criticality
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/mm_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void MM_AppPipe(const CFE_SB_Buffer_t *BufPtr)

default:
CmdResult = false;
CFE_EVS_SendEvent(MM_CC1_ERR_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(MM_CC_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid ground command code: ID = 0x%08lX, CC = %d",
(unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode);
break;
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/mm_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength)
}
else
{
CFE_EVS_SendEvent(MM_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
CFE_EVS_SendEvent(MM_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d",
(unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode, (int)ActualLength,
(int)ExpectedLength);
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/mm_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void MM_SegmentBreak(void);
* \retval true Length matches expected
* \retval false Length does not match expected
*
* \sa #MM_LEN_ERR_EID
* \sa #MM_CMD_LEN_ERR_EID
*/
bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength);

Expand Down
2 changes: 1 addition & 1 deletion unit-test/mm_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ void MM_AppPipe_Test_InvalidCommandCode(void)
UtAssert_INT32_EQ(MM_AppData.HkPacket.Payload.CmdCounter, 0);
UtAssert_INT32_EQ(MM_AppData.HkPacket.Payload.ErrCounter, 1);

UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_CC1_ERR_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_CC_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
2 changes: 1 addition & 1 deletion unit-test/mm_utils_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void MM_VerifyCmdLength_Test_LengthError(void)
/* Verify results */
UtAssert_True(Result == false, "Result == false");

UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_LEN_ERR_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_CMD_LEN_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

0 comments on commit b8fb572

Please sign in to comment.