Skip to content

Commit

Permalink
Fix nasa#263, Consistent use of MsgId types
Browse files Browse the repository at this point in the history
Make CFE core apps consistent in their use of the CFE_SB_MsgId type
and with the CFE SB API.  This employs the CFE SB API whenever any
of the following needs to happen:

- Use of a CFE_SB_MsgId_t value within a printf (event, syslog, etc).
- Initialization of a CFE_SB_MsgId_t from an integer value
- Comparison of two CFE_SB_MsgId_t values
- Checking if a CFE_SB_MsgId_t value is within the valid set

Notably, this replaces the switch/case constructs used in message
dispatch with a nested if/else based on CFE_SB_MsgId_Equal(), as
the switch statement can only be used with an integer.

A few new macros are introduced, mainly because the inline functions
that already existed for this purpose cannot be used where evaluation
must be done at compile time (e.g. constants, struct initialization).
These are initially just typecasts, but could become more interesting
in future revisions.
  • Loading branch information
jphickey committed Apr 10, 2020
1 parent 60a5f65 commit d0c0b6b
Show file tree
Hide file tree
Showing 19 changed files with 705 additions and 552 deletions.
394 changes: 195 additions & 199 deletions fsw/cfe-core/src/es/cfe_es_task.c

Large diffs are not rendered by default.

44 changes: 24 additions & 20 deletions fsw/cfe-core/src/evs/cfe_evs_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,26 +354,28 @@ int32 CFE_EVS_TaskInit ( void )
*/
void CFE_EVS_ProcessCommandPacket ( CFE_SB_MsgPtr_t EVS_MsgPtr )
{
CFE_SB_MsgId_t MessageID;

MessageID = CFE_SB_GetMsgId(EVS_MsgPtr);

/* Process all SB messages */
switch (CFE_SB_GetMsgId(EVS_MsgPtr))
if (CFE_SB_MsgId_Equal(MessageID, CFE_EVS_CMD_MID))
{
/* EVS task specific command */
CFE_EVS_ProcessGroundCommand(EVS_MsgPtr);
}
else if (CFE_SB_MsgId_Equal(MessageID, CFE_EVS_SEND_HK_MID))
{
/* Housekeeping request */
CFE_EVS_ReportHousekeepingCmd((CCSDS_CommandPacket_t*)EVS_MsgPtr);
}
else
{
case CFE_EVS_CMD_MID:
/* EVS task specific command */
CFE_EVS_ProcessGroundCommand(EVS_MsgPtr);
break;

case CFE_EVS_SEND_HK_MID:
/* Housekeeping request */
CFE_EVS_ReportHousekeepingCmd((CCSDS_CommandPacket_t*)EVS_MsgPtr);
break;

default:
/* Unknown command -- should never occur */
CFE_EVS_GlobalData.EVS_TlmPkt.Payload.CommandErrorCounter++;
EVS_SendEvent(CFE_EVS_ERR_MSGID_EID, CFE_EVS_EventType_ERROR,
"Invalid command packet, Message ID = 0x%08X",
(unsigned int)CFE_SB_GetMsgId(EVS_MsgPtr));
break;
/* Unknown command -- should never occur */
CFE_EVS_GlobalData.EVS_TlmPkt.Payload.CommandErrorCounter++;
EVS_SendEvent(CFE_EVS_ERR_MSGID_EID, CFE_EVS_EventType_ERROR,
"Invalid command packet, Message ID = 0x%08X",
(unsigned int)CFE_SB_MsgIdToValue(CFE_SB_GetMsgId(EVS_MsgPtr)));
}

return;
Expand Down Expand Up @@ -573,7 +575,8 @@ void CFE_EVS_ProcessGroundCommand ( CFE_SB_MsgPtr_t EVS_MsgPtr )

EVS_SendEvent(CFE_EVS_ERR_CC_EID, CFE_EVS_EventType_ERROR,
"Invalid command code -- ID = 0x%08x, CC = %d",
(unsigned int)CFE_SB_GetMsgId(EVS_MsgPtr), (int)CFE_SB_GetCmdCode(EVS_MsgPtr));
(unsigned int)CFE_SB_MsgIdToValue(CFE_SB_GetMsgId(EVS_MsgPtr)),
(int)CFE_SB_GetCmdCode(EVS_MsgPtr));
Status = CFE_STATUS_BAD_COMMAND_CODE;

break;
Expand Down Expand Up @@ -618,7 +621,8 @@ bool CFE_EVS_VerifyCmdLength(CFE_SB_MsgPtr_t Msg, uint16 ExpectedLength)

EVS_SendEvent(CFE_EVS_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid cmd length: ID = 0x%X, CC = %d, Exp Len = %d, Len = %d",
(unsigned int)MessageID, (int)CommandCode, (int)ExpectedLength, (int)ActualLength);
(unsigned int)CFE_SB_MsgIdToValue(MessageID),
(int)CommandCode, (int)ExpectedLength, (int)ActualLength);
result = false;
}

Expand Down
72 changes: 67 additions & 5 deletions fsw/cfe-core/src/inc/cfe_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,54 @@
#define CFE_SB_SUBSCRIPTION 0 /**< \brief Subtype specifier used in #CFE_SB_SingleSubscriptionTlm_t by SBN App */
#define CFE_SB_UNSUBSCRIPTION 1 /**< \brief Subtype specified used in #CFE_SB_SingleSubscriptionTlm_t by SBN App */

#define CFE_SB_INVALID_MSG_ID 0xFFFF /**< \brief Initializer for #CFE_SB_MsgId_t values that will not match any real MsgId */
/* ------------------------------------------------------ */
/* Macro Constants for use with the CFE_SB_MsgId_t type */
/* ------------------------------------------------------ */

/**
* \brief Translation macro to convert from MsgId integer values to opaque/abstract API values
*
* This conversion exists in macro form to allow compile-time evaluation for constants, and
* should not be used directly in application code.
*
* For applications, use the CFE_SB_ValueToMsgId() inline function instead.
*
* \sa CFE_SB_ValueToMsgId()
*/
#define CFE_SB_MSGID_WRAP_VALUE(val) ((CFE_SB_MsgId_t)(val))

/**
* \brief Translation macro to convert to MsgId integer values from opaque/abstract API values
*
* This conversion exists in macro form to allow compile-time evaluation for constants, and
* should not be used directly in application code.
*
* For applications, use the CFE_SB_MsgIdToValue() inline function instead.
*
* \sa CFE_SB_MsgIdToValue()
*/
#define CFE_SB_MSGID_UNWRAP_VALUE(mid) ((CFE_SB_MsgId_Atom_t)(mid))

/**
* \brief Reserved value for CFE_SB_MsgId_t that will not match any valid MsgId
*
* This rvalue macro can be used for static/compile-time data initialization to ensure that
* the initialized value does not alias to a valid MsgId object.
*/
#define CFE_SB_MSGID_RESERVED CFE_SB_MSGID_WRAP_VALUE(-1)

/**
* \brief A literal of the CFE_SB_MsgId_t type representing an invalid ID
*
* This value should be used for runtime initialization of CFE_SB_MsgId_t values.
*
* \note This may be a compound literal in a future revision. Per C99, compound
* literals are lvalues, not rvalues, so this value should not be used in
* static/compile-time data initialization. For static data initialization
* purposes (rvalue), #CFE_SB_MSGID_RESERVED should be used instead.
* However, in the current implementation, they are equivalent.
*/
#define CFE_SB_INVALID_MSG_ID CFE_SB_MSGID_RESERVED

/*
** Macro Definitions
Expand Down Expand Up @@ -1278,7 +1325,21 @@ bool CFE_SB_ValidateChecksum(CFE_SB_MsgPtr_t MsgPtr);

/*****************************************************************************/
/**
* \brief Identifies whether a two #CFE_SB_MsgId_t values are equal
* \brief Identifies whether a given CFE_SB_MsgId_t is valid
*
* \par Description
* Implements a basic sanity check on the value provided
*
* \return Boolean message ID validity indicator
* \retval true Message ID is within the valid range
* \retval false Message ID is not within the valid range
*/
bool CFE_SB_IsValidMsgId(CFE_SB_MsgId_t MsgId);


/*****************************************************************************/
/**
* \brief Identifies whether two #CFE_SB_MsgId_t values are equal
*
* \par Description
* In cases where the #CFE_SB_MsgId_t type is not a simple integer
Expand All @@ -1296,7 +1357,7 @@ bool CFE_SB_ValidateChecksum(CFE_SB_MsgPtr_t MsgPtr);
*/
static inline bool CFE_SB_MsgId_Equal(CFE_SB_MsgId_t MsgId1, CFE_SB_MsgId_t MsgId2)
{
return (MsgId1 == MsgId2);
return CFE_SB_MSGID_UNWRAP_VALUE(MsgId1) == CFE_SB_MSGID_UNWRAP_VALUE(MsgId2);
}

/*****************************************************************************/
Expand Down Expand Up @@ -1327,7 +1388,7 @@ static inline bool CFE_SB_MsgId_Equal(CFE_SB_MsgId_t MsgId1, CFE_SB_MsgId_t MsgI
*/
static inline CFE_SB_MsgId_Atom_t CFE_SB_MsgIdToValue(CFE_SB_MsgId_t MsgId)
{
return MsgId;
return CFE_SB_MSGID_UNWRAP_VALUE(MsgId);
}

/*****************************************************************************/
Expand Down Expand Up @@ -1356,7 +1417,8 @@ static inline CFE_SB_MsgId_Atom_t CFE_SB_MsgIdToValue(CFE_SB_MsgId_t MsgId)
*/
static inline CFE_SB_MsgId_t CFE_SB_ValueToMsgId(CFE_SB_MsgId_Atom_t MsgIdValue)
{
return MsgIdValue;
CFE_SB_MsgId_t Result = CFE_SB_MSGID_WRAP_VALUE(MsgIdValue);
return Result;
}
/**@}*/

Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/inc/cfe_sb_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ typedef struct{
** Structure of one element of the map information in response to #CFE_SB_SEND_MAP_INFO_CC
*/
typedef struct{
CFE_SB_MsgId_Atom_t MsgId;/**< \brief Message Id which has been subscribed to */
CFE_SB_MsgId_t MsgId;/**< \brief Message Id which has been subscribed to */
CFE_SB_MsgRouteIdx_Atom_t Index;/**< \brief Routing table index where pipe destinations are found */
}CFE_SB_MsgMapFileEntry_t;

Expand Down
69 changes: 43 additions & 26 deletions fsw/cfe-core/src/sb/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
CFE_SB.HKTlmMsg.Payload.SubscribeErrorCounter++;
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_SUB_INV_PIPE_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Subscribe Err:Invalid Pipe Id,Msg=0x%x,PipeId=%d,App %s",(unsigned int)MsgId,(int)PipeId,
CFE_SB_GetAppTskName(TskId,FullName));
"Subscribe Err:Invalid Pipe Id,Msg=0x%x,PipeId=%d,App %s",(unsigned int)CFE_SB_MsgIdToValue(MsgId),
(int)PipeId, CFE_SB_GetAppTskName(TskId,FullName));
return CFE_SB_BAD_ARGUMENT;
}/* end if */

Expand All @@ -752,7 +752,7 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_SUB_INV_CALLER_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Subscribe Err:Caller(%s) is not the owner of pipe %d,Msg=0x%x",
CFE_SB_GetAppTskName(TskId,FullName),(int)PipeId,(unsigned int)MsgId);
CFE_SB_GetAppTskName(TskId,FullName),(int)PipeId,(unsigned int)CFE_SB_MsgIdToValue(MsgId));
return CFE_SB_BAD_ARGUMENT;
}/* end if */

Expand All @@ -763,7 +763,8 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_SUB_ARG_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Subscribe Err:Bad Arg,MsgId 0x%x,PipeId %d,app %s,scope %d",
(unsigned int)MsgId,(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName),Scope);
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName),Scope);
return CFE_SB_BAD_ARGUMENT;
}/* end if */

Expand All @@ -776,7 +777,8 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_DUP_SUBSCRIP_EID,CFE_EVS_EventType_INFORMATION,CFE_SB.AppId,
"Duplicate Subscription,MsgId 0x%x on %s pipe,app %s",
(unsigned int)MsgId,PipeName,CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
PipeName,CFE_SB_GetAppTskName(TskId,FullName));
return CFE_SUCCESS;
}/* end if */

Expand Down Expand Up @@ -811,7 +813,9 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_MAX_MSGS_MET_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Subscribe Err:Max Msgs(%d)In Use,MsgId 0x%x,pipe %s,app %s",
CFE_PLATFORM_SB_MAX_MSG_IDS,(unsigned int)MsgId,PipeName,CFE_SB_GetAppTskName(TskId,FullName));
CFE_PLATFORM_SB_MAX_MSG_IDS,
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
PipeName,CFE_SB_GetAppTskName(TskId,FullName));
return CFE_SB_MAX_MSGS_MET;
}/* end if */

Expand All @@ -835,8 +839,9 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_MAX_DESTS_MET_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Subscribe Err:Max Dests(%d)In Use For Msg 0x%x,pipe %s,app %s",
CFE_PLATFORM_SB_MAX_DEST_PER_PKT,(unsigned int)MsgId,PipeName,
CFE_SB_GetAppTskName(TskId,FullName));
CFE_PLATFORM_SB_MAX_DEST_PER_PKT,
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
PipeName, CFE_SB_GetAppTskName(TskId,FullName));

return CFE_SB_MAX_DESTS_MET;
}/* end if */
Expand All @@ -845,7 +850,8 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
if(DestBlkPtr == NULL){
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_DEST_BLK_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Subscribe Err:Request for Destination Blk failed for Msg 0x%x", (unsigned int)MsgId);
"Subscribe Err:Request for Destination Blk failed for Msg 0x%x",
(unsigned int)CFE_SB_MsgIdToValue(MsgId));
return CFE_SB_BUF_ALOC_ERR;
}/* end if */

Expand Down Expand Up @@ -880,7 +886,8 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
Stat = CFE_SB_SendMsg((CFE_SB_Msg_t *)&CFE_SB.SubRprtMsg);
CFE_EVS_SendEventWithAppID(CFE_SB_SUBSCRIPTION_RPT_EID,CFE_EVS_EventType_DEBUG,CFE_SB.AppId,
"Sending Subscription Report Msg=0x%x,Pipe=%d,Stat=0x%x",
(unsigned int)MsgId,(int)PipeId,(unsigned int)Stat);
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
(int)PipeId,(unsigned int)Stat);
CFE_SB_LockSharedData(__func__,__LINE__);/* to prevent back-to-back unlock */
}/* end if */

Expand All @@ -889,7 +896,8 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,

CFE_EVS_SendEventWithAppID(CFE_SB_SUBSCRIPTION_RCVD_EID,CFE_EVS_EventType_DEBUG,CFE_SB.AppId,
"Subscription Rcvd:MsgId 0x%x on %s(%d),app %s",
(unsigned int)MsgId,PipeName,(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
PipeName,(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName));

return CFE_SUCCESS;

Expand Down Expand Up @@ -1020,7 +1028,8 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId,CFE_SB_PipeId_t PipeId,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_UNSUB_INV_PIPE_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Unsubscribe Err:Invalid Pipe Id Msg=0x%x,Pipe=%d,app=%s",
(unsigned int)MsgId,(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName));
return CFE_SB_BAD_ARGUMENT;
}/* end if */

Expand All @@ -1029,7 +1038,8 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId,CFE_SB_PipeId_t PipeId,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_UNSUB_INV_CALLER_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Unsubscribe Err:Caller(%s) is not the owner of pipe %d,Msg=0x%x",
CFE_SB_GetAppTskName(TskId,FullName),(int)PipeId,(unsigned int)MsgId);
CFE_SB_GetAppTskName(TskId,FullName),(int)PipeId,
(unsigned int)CFE_SB_MsgIdToValue(MsgId));
return CFE_SB_BAD_ARGUMENT;
}/* end if */

Expand All @@ -1041,7 +1051,8 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId,CFE_SB_PipeId_t PipeId,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_UNSUB_ARG_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"UnSubscribe Err:Bad Arg,MsgId 0x%x,PipeId %d,app %s,scope %d",
(unsigned int)MsgId,(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName),(int)Scope);
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName),(int)Scope);
return CFE_SB_BAD_ARGUMENT;
}/* end if */

Expand All @@ -1059,7 +1070,8 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId,CFE_SB_PipeId_t PipeId,

CFE_EVS_SendEventWithAppID(CFE_SB_UNSUB_NO_SUBS_EID,CFE_EVS_EventType_INFORMATION,CFE_SB.AppId,
"Unsubscribe Err:No subs for Msg 0x%x on %s,app %s",
(unsigned int)MsgId,PipeName,CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
PipeName,CFE_SB_GetAppTskName(TskId,FullName));
return CFE_SUCCESS;
}/* end if */

Expand Down Expand Up @@ -1094,7 +1106,8 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId,CFE_SB_PipeId_t PipeId,

CFE_EVS_SendEventWithAppID(CFE_SB_SUBSCRIPTION_REMOVED_EID,CFE_EVS_EventType_DEBUG,CFE_SB.AppId,
"Subscription Removed:Msg 0x%x on pipe %d,app %s",
(unsigned int)MsgId,(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName));

return CFE_SUCCESS;

Expand Down Expand Up @@ -1205,7 +1218,8 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_SEND_INV_MSGID_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Send Err:Invalid MsgId(0x%x)in msg,App %s",
(unsigned int)MsgId,CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
CFE_SB_GetAppTskName(TskId,FullName));
return CFE_SB_BAD_ARGUMENT;
}/* end if */

Expand All @@ -1223,7 +1237,8 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,
CFE_SB_UnlockSharedData(__func__,__LINE__);
CFE_EVS_SendEventWithAppID(CFE_SB_MSG_TOO_BIG_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Send Err:Msg Too Big MsgId=0x%x,app=%s,size=%d,MaxSz=%d",
(unsigned int)MsgId,CFE_SB_GetAppTskName(TskId,FullName),(int)TotalMsgSize,CFE_MISSION_SB_MAX_SB_MSG_SIZE);
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
CFE_SB_GetAppTskName(TskId,FullName),(int)TotalMsgSize,CFE_MISSION_SB_MAX_SB_MSG_SIZE);
return CFE_SB_MSG_TOO_BIG;
}/* end if */

Expand Down Expand Up @@ -1252,7 +1267,8 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,

CFE_EVS_SendEventWithAppID(CFE_SB_SEND_NO_SUBS_EID,CFE_EVS_EventType_INFORMATION,CFE_SB.AppId,
"No subscribers for MsgId 0x%x,sender %s",
(unsigned int)MsgId,CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
CFE_SB_GetAppTskName(TskId,FullName));

/* clear the bit so the task may send this event again */
CFE_SB_FinishSendEvent(TskId,CFE_SB_SEND_NO_SUBS_EID_BIT);
Expand All @@ -1277,7 +1293,8 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,

CFE_EVS_SendEventWithAppID(CFE_SB_GET_BUF_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Send Err:Request for Buffer Failed. MsgId 0x%x,app %s,size %d",
(unsigned int)MsgId,CFE_SB_GetAppTskName(TskId,FullName),(int)TotalMsgSize);
(unsigned int)CFE_SB_MsgIdToValue(MsgId),
CFE_SB_GetAppTskName(TskId,FullName),(int)TotalMsgSize);

/* clear the bit so the task may send this event again */
CFE_SB_FinishSendEvent(TskId,CFE_SB_GET_BUF_ERR_EID_BIT);
Expand Down Expand Up @@ -1427,8 +1444,8 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,

CFE_EVS_SendEventWithAppID(CFE_SB_MSGID_LIM_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Msg Limit Err,MsgId 0x%x,pipe %s,sender %s",
(unsigned int)RtgTblPtr->MsgId, PipeName,
CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(RtgTblPtr->MsgId),
PipeName, CFE_SB_GetAppTskName(TskId,FullName));

/* clear the bit so the task may send this event again */
CFE_SB_FinishSendEvent(TskId,CFE_SB_MSGID_LIM_ERR_EID_BIT);
Expand All @@ -1446,8 +1463,8 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,

CFE_EVS_SendEventWithAppID(CFE_SB_Q_FULL_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Pipe Overflow,MsgId 0x%x,pipe %s,sender %s",
(unsigned int)RtgTblPtr->MsgId, PipeName,
CFE_SB_GetAppTskName(TskId,FullName));
(unsigned int)CFE_SB_MsgIdToValue(RtgTblPtr->MsgId),
PipeName, CFE_SB_GetAppTskName(TskId,FullName));

/* clear the bit so the task may send this event again */
CFE_SB_FinishSendEvent(TskId,CFE_SB_Q_FULL_ERR_EID_BIT);
Expand All @@ -1462,8 +1479,8 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,

CFE_EVS_SendEventWithAppID(CFE_SB_Q_WR_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Pipe Write Err,MsgId 0x%x,pipe %s,sender %s,stat 0x%x",
(unsigned int)RtgTblPtr->MsgId, PipeName,
CFE_SB_GetAppTskName(TskId,FullName),
(unsigned int)CFE_SB_MsgIdToValue(RtgTblPtr->MsgId),
PipeName, CFE_SB_GetAppTskName(TskId,FullName),
(unsigned int)SBSndErr.EvtBuf[i].ErrStat);

/* clear the bit so the task may send this event again */
Expand Down
Loading

0 comments on commit d0c0b6b

Please sign in to comment.