Skip to content

Commit

Permalink
Fix nasa#118, failed commands send error event message
Browse files Browse the repository at this point in the history
  • Loading branch information
havencarlson committed Jul 14, 2022
1 parent c023d56 commit 6ca0e25
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fsw/src/cf_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ void CF_CmdTxFile(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_TX_FILE, CFE_EVS_EventType_ERROR, "CF: file transfer failed");
CF_CmdRej();
}
}
Expand Down Expand Up @@ -211,6 +212,7 @@ void CF_CmdPlaybackDir(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_PLAYBACK_DIR, CFE_EVS_EventType_ERROR, "CF: directory playback cmd failed");
CF_CmdRej();
}
}
Expand Down Expand Up @@ -286,6 +288,7 @@ void CF_CmdFreeze(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_FREEZE, CFE_EVS_EventType_ERROR, "CF: freeze cmd failed");
CF_CmdRej();
}
}
Expand All @@ -309,6 +312,7 @@ void CF_CmdThaw(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_THAW, CFE_EVS_EventType_ERROR, "CF: thaw cmd failed");
CF_CmdRej();
}
}
Expand Down Expand Up @@ -511,6 +515,8 @@ void CF_CmdCancel(CFE_SB_Buffer_t *msg)
}
else
{
/* No transaction was matched for the given combination of chan + eid + ts */
CFE_EVS_SendEvent(CF_EID_ERR_CMD_CANCEL_CHAN, CFE_EVS_EventType_ERROR, "CF: cancel cmd: no transaction found");
CF_CmdRej();
}
}
Expand Down Expand Up @@ -545,6 +551,9 @@ void CF_CmdAbandon(CFE_SB_Buffer_t *msg)
}
else
{
/* No transaction was matched for the given combination of chan + eid + ts */
CFE_EVS_SendEvent(CF_EID_ERR_CMD_ABANDON_CHAN, CFE_EVS_EventType_ERROR,
"CF: abandon cmd: no transaction found");
CF_CmdRej();
}
}
Expand Down Expand Up @@ -584,6 +593,7 @@ void CF_CmdEnableDequeue(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_ENABLE_DEQUEUE, CFE_EVS_EventType_ERROR, "CF: enable dequeue cmd failed");
CF_CmdRej();
}
}
Expand All @@ -608,6 +618,7 @@ void CF_CmdDisableDequeue(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_DISABLE_DEQUEUE, CFE_EVS_EventType_ERROR, "CF: disable dequeue cmd failed");
CF_CmdRej();
}
}
Expand Down Expand Up @@ -667,6 +678,8 @@ void CF_CmdEnablePolldir(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_ENABLE_POLLDIR, CFE_EVS_EventType_ERROR,
"CF: enable polling directory cmd failed");
CF_CmdRej();
}
}
Expand All @@ -692,6 +705,8 @@ void CF_CmdDisablePolldir(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_DISABLE_POLLDIR, CFE_EVS_EventType_ERROR,
"CF: disable polling directory cmd failed");
CF_CmdRej();
}
}
Expand Down Expand Up @@ -796,6 +811,7 @@ void CF_CmdPurgeQueue(CFE_SB_Buffer_t *msg)
}
else
{
CFE_EVS_SendEvent(CF_EID_ERR_CMD_PURGE_QUEUE, CFE_EVS_EventType_ERROR, "CF: purge queue cmd failed");
CF_CmdRej();
}
}
Expand Down
121 changes: 121 additions & 0 deletions fsw/src/cf_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,127 @@
*/
#define CF_EID_ERR_CMD_BAD_PARAM (154)

/**
* \brief CF Cancel Command No Matching Transaction Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Cancel command received without a matching transaction
*/
#define CF_EID_ERR_CMD_CANCEL_CHAN (155)

/**
* \brief CF Abandon Command No Matching Transaction Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Abandon command received without a matching transaction
*/
#define CF_EID_ERR_CMD_ABANDON_CHAN (156)

/**
* \brief CF Transfer File Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Transfer file command was unsuccessful
*/
#define CF_EID_ERR_CMD_TX_FILE (157)

/**
* \brief CF Playback Directory Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Playback directory command was unsuccessful
*/
#define CF_EID_ERR_CMD_PLAYBACK_DIR (158)

/**
* \brief CF Freeze Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Freeze command was unsuccessful
*/
#define CF_EID_ERR_CMD_FREEZE (159)

/**
* \brief CF Thaw Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Thaw command was unsuccessful
*/
#define CF_EID_ERR_CMD_THAW (160)

/**
* \brief CF Enable Dequeue Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Enable Dequeue command was unsuccessful
*/
#define CF_EID_ERR_CMD_ENABLE_DEQUEUE (161)

/**
* \brief CF Disable Dequeue Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Disable dequeue command was unsuccessful
*/
#define CF_EID_ERR_CMD_DISABLE_DEQUEUE (162)

/**
* \brief CF Enable Polldir Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Enable polldir command was unsuccessful
*/
#define CF_EID_ERR_CMD_ENABLE_POLLDIR (163)

/**
* \brief CF Disable Polldir Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Disable polldir command was unsuccessful
*/
#define CF_EID_ERR_CMD_DISABLE_POLLDIR (164)

/**
* \brief CF Purge Queue Command Failed Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* Purge queue command was unsuccessful
*/
#define CF_EID_ERR_CMD_PURGE_QUEUE (165)

/**\}*/

#endif /* !CF_EVENTS_H */
Loading

0 comments on commit 6ca0e25

Please sign in to comment.