Skip to content

Commit

Permalink
Merge pull request #78 from thnkslprpt/fix-77-combine-consecutive-mut…
Browse files Browse the repository at this point in the history
…ually-exclusive-status-checks

Fix #77, Combine consecutive, mutually-exclusive status checks
  • Loading branch information
dzbaker authored Mar 30, 2023
2 parents 3aadd2f + 43a17cf commit 7697f3f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
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 @@ -417,14 +417,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 @@ -437,6 +429,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 @@ -474,13 +472,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 @@ -492,6 +483,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

0 comments on commit 7697f3f

Please sign in to comment.