Skip to content

Commit

Permalink
Fix nasa#128, Standardize command responses
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Jun 8, 2024
1 parent ec96b02 commit f4a2c35
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions fsw/inc/ds_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@
/**
* \brief DS Reset Counters Command Event ID
*
* \par Type: DEBUG
* \par Type: INFORMATION
*
* \par Cause:
*
* This event signals the successful execution of a RESET housekeeping
* counters command. The command is used primarily to clear counters
* that have already been examined.
*/
#define DS_RESET_CMD_EID 33
#define DS_RESET_INF_EID 33

/**
* \brief DS Reset Counters Command Invalid Length Event ID
Expand Down
4 changes: 2 additions & 2 deletions fsw/inc/ds_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
* \par Command Verification
* Evidence of success may be found in the following telemetry:
* - #DS_HkTlm_Payload_t.CmdAcceptedCounter will reset to zero
* - The #DS_RESET_CMD_EID debug event message will be sent
* - The #DS_RESET_INF_EID informational event message will be sent
*
* \par Error Conditions
* This command can fail for the following reasons:
Expand Down Expand Up @@ -612,4 +612,4 @@

/**\}*/

#endif
#endif
2 changes: 1 addition & 1 deletion fsw/src/ds_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void DS_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr)
DS_AppData.FilterTblLoadCounter = 0;
DS_AppData.FilterTblErrCounter = 0;

CFE_EVS_SendEvent(DS_RESET_CMD_EID, CFE_EVS_EventType_DEBUG, "Reset counters command");
CFE_EVS_SendEvent(DS_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "Reset counters command");
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Expand Down
4 changes: 2 additions & 2 deletions unit-test/ds_cmds_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ void DS_ResetCountersCmd_Test_Nominal(void)
UtAssert_ZERO(DS_AppData.FilterTblErrCounter);

UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_RESET_CMD_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_RESET_INF_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);

/* Verify command struct size minus header is at least explicitly padded to 32-bit boundaries */
UtAssert_True(CMD_STRUCT_DATA_IS_32_ALIGNED(DS_ResetCountersCmd_t), "DS_ResetCountersCmd_t is 32-bit aligned");
Expand Down

0 comments on commit f4a2c35

Please sign in to comment.