Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #77, Combine consecutive, mutually-exclusive status checks #78

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fsw/inc/hs_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
* \par Cause:
*
* This event message is issued on the first error when a table validation
* fails for a application monitor table load.
* fails for an application monitor table load.
*/
#define HS_AMTVAL_ERR_EID 51

Expand Down Expand Up @@ -708,7 +708,7 @@
* \par Cause:
*
* This event message is issued when a table validation has been
* completed for an message actions table load
* completed for a message actions table load
*/
#define HS_MATVAL_INF_EID 56

Expand All @@ -720,7 +720,7 @@
* \par Cause:
*
* This event message is issued on the first error when a table validation
* fails for an message actions table load.
* fails for a message actions table load.
*/
#define HS_MATVAL_ERR_EID 57

Expand Down
27 changes: 12 additions & 15 deletions fsw/src/hs_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,6 @@ void HS_EnableEventMonCmd(const CFE_SB_Buffer_t *BufPtr)
{
Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), HS_AppData.EventPipe,
CFE_SB_DEFAULT_QOS, HS_EVENT_PIPE_DEPTH);

if (Status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(HS_EVENTMON_LONG_SUB_EID, CFE_EVS_EventType_ERROR,
"Event Monitor Enable: Error Subscribing to long-format Events,RC=0x%08X",
(unsigned int)Status);
}

if (Status == CFE_SUCCESS)
{
Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_EVS_SHORT_EVENT_MSG_MID), HS_AppData.EventPipe,
Expand All @@ -425,6 +417,12 @@ void HS_EnableEventMonCmd(const CFE_SB_Buffer_t *BufPtr)
(unsigned int)Status);
}
}
else
{
CFE_EVS_SendEvent(HS_EVENTMON_LONG_SUB_EID, CFE_EVS_EventType_ERROR,
"Event Monitor Enable: Error Subscribing to long-format Events,RC=0x%08X",
(unsigned int)Status);
}
}

if (Status == CFE_SUCCESS)
Expand Down Expand Up @@ -462,13 +460,6 @@ void HS_DisableEventMonCmd(const CFE_SB_Buffer_t *BufPtr)
{
Status = CFE_SB_Unsubscribe(CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), HS_AppData.EventPipe);

if (Status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(HS_EVENTMON_LONG_UNSUB_EID, CFE_EVS_EventType_ERROR,
"Event Monitor Disable: Error Unsubscribing from long-format Events,RC=0x%08X",
(unsigned int)Status);
}

if (Status == CFE_SUCCESS)
{
Status = CFE_SB_Unsubscribe(CFE_SB_ValueToMsgId(CFE_EVS_SHORT_EVENT_MSG_MID), HS_AppData.EventPipe);
Expand All @@ -480,6 +471,12 @@ void HS_DisableEventMonCmd(const CFE_SB_Buffer_t *BufPtr)
(unsigned int)Status);
}
}
else
{
CFE_EVS_SendEvent(HS_EVENTMON_LONG_UNSUB_EID, CFE_EVS_EventType_ERROR,
"Event Monitor Disable: Error Unsubscribing from long-format Events,RC=0x%08X",
(unsigned int)Status);
}
}

if (Status == CFE_SUCCESS)
Expand Down