diff --git a/fsw/cfe-core/src/inc/cfe_sb_events.h b/fsw/cfe-core/src/inc/cfe_sb_events.h index 16f8087fc..8087c5b0f 100644 --- a/fsw/cfe-core/src/inc/cfe_sb_events.h +++ b/fsw/cfe-core/src/inc/cfe_sb_events.h @@ -40,7 +40,7 @@ ** and when you're done adding, set this to the highest EID you used. It may ** be worthwhile to, on occasion, re-number the EID's to put them back in order. */ -#define CFE_SB_MAX_EID 61 +#define CFE_SB_MAX_EID 63 /* ** SB task event message ID's. @@ -844,6 +844,30 @@ **/ #define CFE_SB_LEN_ERR_EID 61 +/** \brief 'CreatePipeErr:Name Taken:app=\%s,ptr=0x\%x,depth=\%d,maxdepth=\%d' +** \event 'CreatePipeErr:Name Taken:app=\%s,ptr=0x\%x,depth=\%d,maxdepth=\%d' +** +** \par Type: ERROR +** +** \par Cause: +** +** This error event message is issued when the #CFE_SB_CreatePipe API tries to create +** a pipe with a name that is in use. +**/ +#define CFE_SB_CR_PIPE_NAME_TAKEN_EID 62 + +/** \brief 'CreatePipeErr:No Free:app=\%s,ptr=0x\%x,depth=\%d,maxdepth=\%d' +** \event 'CreatePipeErr:No Free:app=\%s,ptr=0x\%x,depth=\%d,maxdepth=\%d' +** +** \par Type: ERROR +** +** \par Cause: +** +** This error event message is issued when the #CFE_SB_CreatePipe API is unable to +** create a queue because there are no queues free. +**/ +#define CFE_SB_CR_PIPE_NO_FREE_EID 63 + #endif /* _cfe_sb_events_ */ diff --git a/fsw/cfe-core/src/sb/cfe_sb_api.c b/fsw/cfe-core/src/sb/cfe_sb_api.c index 74e6b5d58..4ec6371d3 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_api.c +++ b/fsw/cfe-core/src/sb/cfe_sb_api.c @@ -160,13 +160,27 @@ int32 CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const char * /* if OS_QueueCreate() failed because the pipe name passed in was already in use... */ /* let's make sure we don't alter the user's pipe ID data */ - if (Status == CFE_OS_ERR_NAME_TAKEN){ - *PipeIdPtr = OriginalPipeIdParamValue; - } - - CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, + switch(Status) { + case OS_ERR_NAME_TAKEN: + CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_NAME_TAKEN_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, + "CreatePipeErr:OS_QueueCreate failed, name taken (app=%s, name=%s)", + CFE_SB_GetAppTskName(TskId,FullName), PipeName); + + *PipeIdPtr = OriginalPipeIdParamValue; + + break; + case OS_ERR_NO_FREE_IDS: + CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_NO_FREE_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, + "CreatePipeErr:OS_QueueCreate failed, no free id's (app=%s)", + CFE_SB_GetAppTskName(TskId,FullName)); + + break; + default: + CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, "CreatePipeErr:OS_QueueCreate returned %d,app %s", (int)Status,CFE_SB_GetAppTskName(TskId,FullName)); + }/* end switch(Status) */ + return CFE_SB_PIPE_CR_ERR; }/* end if */