Skip to content

Commit

Permalink
Fix #1117, Rename unclear FileWrite EIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Feb 4, 2023
1 parent 6d96c6e commit 5d7b37f
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion cmake/sample_defs/toolchain-i686-rtems4.11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ADD_DEFINITIONS(-DOS_RTEMS_4_DEPRECATED)
# RTEMS_DYNAMIC_LOAD definition:
# - Set to FALSE for platforms that create a RTEMS executable and link it
# to the cFE core.
# - Set to TRUE for platforms that expect the cFE core to to be dynamically
# - Set to TRUE for platforms that expect the cFE core to be dynamically
# loaded into an existing runtime image.
# This is tied to the OSAL-BSP and PSP implementation so generally cannot
# be switched on a specific OSAL/PSP platform without modifications.
Expand Down
2 changes: 1 addition & 1 deletion cmake/sample_defs/toolchain-i686-rtems5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ADD_DEFINITIONS(-DOS_RTEMS_5)
# RTEMS_DYNAMIC_LOAD definition:
# - Set to FALSE for platforms that create a RTEMS executable and link it
# to the cFE core.
# - Set to TRUE for platforms that expect the cFE core to to be dynamically
# - Set to TRUE for platforms that expect the cFE core to be dynamically
# loaded into an existing runtime image.
# This is tied to the OSAL-BSP and PSP implementation so generally cannot
# be switched on a specific OSAL/PSP platform without modifications.
Expand Down
2 changes: 1 addition & 1 deletion cmake/sample_defs/toolchain-i686-rtems6.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ADD_DEFINITIONS(-DOS_RTEMS_6)
# RTEMS_DYNAMIC_LOAD definition:
# - Set to FALSE for platforms that create a RTEMS executable and link it
# to the cFE core.
# - Set to TRUE for platforms that expect the cFE core to to be dynamically
# - Set to TRUE for platforms that expect the cFE core to be dynamically
# loaded into an existing runtime image.
# This is tied to the OSAL-BSP and PSP implementation so generally cannot
# be switched on a specific OSAL/PSP platform without modifications.
Expand Down
12 changes: 6 additions & 6 deletions modules/sb/eds/cfe_sb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@
following telemetry:
- \b \c \SB_CMDPC - command execution counter will increment.
- Specified filename created at specified location. See description.
- The #CFE_SB_SND_RTG_EID debug event message will be generated. All
- The #CFE_SB_FILE_WRITE_EID debug event message will be generated. All
debug events are filtered by default.

\par Error Conditions
Expand All @@ -598,7 +598,7 @@
Evidence of failure may be found in the following telemetry:
- \b \c \SB_CMDEC - command error counter will increment
- A command specific error event message is issued for all error
cases. See #CFE_SB_SND_RTG_ERR1_EID and #CFE_SB_FILEWRITE_ERR_EID
cases. See #CFE_SB_FILE_WRITE_CR_ERR_EID and #CFE_SB_FILE_WRITE_ERR_EID

\par Criticality
This command is not inherently dangerous. It will create a new
Expand Down Expand Up @@ -733,7 +733,7 @@
following telemetry:
- \b \c \SB_CMDPC - command execution counter will increment.
- Specified filename created at specified location. See description.
- The #CFE_SB_SND_RTG_EID debug event message will be generated. All
- The #CFE_SB_FILE_WRITE_EID debug event message will be generated. All
debug events are filtered by default.

\par Error Conditions
Expand All @@ -743,7 +743,7 @@
Evidence of failure may be found in the following telemetry:
- \b \c \SB_CMDEC - command error counter will increment
- A command specific error event message is issued for all error
cases. See #CFE_SB_SND_RTG_ERR1_EID and #CFE_SB_FILEWRITE_ERR_EID
cases. See #CFE_SB_FILE_WRITE_CR_ERR_EID and #CFE_SB_FILE_WRITE_ERR_EID

\par Criticality
This command is not inherently dangerous. It will create a new
Expand Down Expand Up @@ -784,7 +784,7 @@
following telemetry:
- \b \c \SB_CMDPC - command execution counter will increment.
- Specified filename created at specified location. See description.
- The #CFE_SB_SND_RTG_EID debug event message will be generated. All
- The #CFE_SB_FILE_WRITE_EID debug event message will be generated. All
debug events are filtered by default.

\par Error Conditions
Expand All @@ -794,7 +794,7 @@
Evidence of failure may be found in the following telemetry:
- \b \c \SB_CMDEC - command error counter will increment
- A command specific error event message is issued for all error
cases. See #CFE_SB_SND_RTG_ERR1_EID and #CFE_SB_FILEWRITE_ERR_EID
cases. See #CFE_SB_FILE_WRITE_CR_ERR_EID and #CFE_SB_FILE_WRITE_ERR_EID

\par Criticality
This command is not inherently dangerous. It will create a new
Expand Down
6 changes: 3 additions & 3 deletions modules/sb/fsw/inc/cfe_sb_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@
*
* An SB file write successfully completed. OVERLOADED
*/
#define CFE_SB_SND_RTG_EID 39
#define CFE_SB_FILE_WRITE_EID 39

/**
* \brief SB File Write Create File Failure Event ID
Expand All @@ -446,7 +446,7 @@
*
* An SB file write failure due to file creation error. OVERLOADED
*/
#define CFE_SB_SND_RTG_ERR1_EID 40
#define CFE_SB_FILE_WRITE_CR_ERR_EID 40

/**
* \brief SB Invalid Command Code Received Event ID
Expand Down Expand Up @@ -537,7 +537,7 @@
*
* An SB file write failure encountered when writing to the file.
*/
#define CFE_SB_FILEWRITE_ERR_EID 49
#define CFE_SB_FILE_WRITE_ERR_EID 49

/**
* \brief SB Subscribe API Invalid Pipe Event ID
Expand Down
12 changes: 6 additions & 6 deletions modules/sb/fsw/inc/cfe_sb_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
** - The file specified in the command (or the default specified
** by the #CFE_PLATFORM_SB_DEFAULT_ROUTING_FILENAME configuration parameter) will be
** updated with the latest information.
** - The #CFE_SB_SND_RTG_EID debug event message will be generated
** - The #CFE_SB_FILE_WRITE_EID debug event message will be generated
**
** \par Error Conditions
** This command may fail for the following reason(s):
Expand All @@ -192,7 +192,7 @@
** Evidence of failure may be found in the following telemetry:
** - \b \c \SB_CMDEC - command error counter will increment
** - A command specific error event message is issued for all error
** cases. See #CFE_SB_SND_RTG_ERR1_EID and #CFE_SB_FILEWRITE_ERR_EID
** cases. See #CFE_SB_FILE_WRITE_CR_ERR_EID and #CFE_SB_FILE_WRITE_ERR_EID
**
** \par Criticality
** This command is not inherently dangerous. It will create a new
Expand Down Expand Up @@ -306,7 +306,7 @@
** - The file specified in the command (or the default specified
** by the #CFE_PLATFORM_SB_DEFAULT_PIPE_FILENAME configuration parameter) will be
** updated with the latest information.
** - The #CFE_SB_SND_RTG_EID debug event message will be generated
** - The #CFE_SB_FILE_WRITE_EID debug event message will be generated
**
** \par Error Conditions
** This command may fail for the following reason(s):
Expand All @@ -316,7 +316,7 @@
** Evidence of failure may be found in the following telemetry:
** - \b \c \SB_CMDEC - command error counter will increment
** - A command specific error event message is issued for all error
** cases. See #CFE_SB_SND_RTG_ERR1_EID and #CFE_SB_FILEWRITE_ERR_EID
** cases. See #CFE_SB_FILE_WRITE_CR_ERR_EID and #CFE_SB_FILE_WRITE_ERR_EID
**
** \par Criticality
** This command is not inherently dangerous. It will create a new
Expand Down Expand Up @@ -352,7 +352,7 @@
** - The file specified in the command (or the default specified
** by the #CFE_PLATFORM_SB_DEFAULT_MAP_FILENAME configuration parameter) will be
** updated with the latest information.
** - The #CFE_SB_SND_RTG_EID debug event message will be generated
** - The #CFE_SB_FILE_WRITE_EID debug event message will be generated
**
** \par Error Conditions
** This command may fail for the following reason(s):
Expand All @@ -362,7 +362,7 @@
** Evidence of failure may be found in the following telemetry:
** - \b \c \SB_CMDEC - command error counter will increment
** - A command specific error event message is issued for all error
** cases. See #CFE_SB_SND_RTG_ERR1_EID and #CFE_SB_FILEWRITE_ERR_EID
** cases. See #CFE_SB_FILE_WRITE_CR_ERR_EID and #CFE_SB_FILE_WRITE_ERR_EID
**
** \par Criticality
** This command is not inherently dangerous. It will create a new
Expand Down
6 changes: 3 additions & 3 deletions modules/sb/fsw/src/cfe_sb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,20 +901,20 @@ void CFE_SB_BackgroundFileEventHandler(void *Meta, CFE_FS_FileWriteEvent_t Event
switch (Event)
{
case CFE_FS_FileWriteEvent_COMPLETE:
CFE_EVS_SendEventWithAppID(CFE_SB_SND_RTG_EID, CFE_EVS_EventType_DEBUG, CFE_SB_Global.AppId,
CFE_EVS_SendEventWithAppID(CFE_SB_FILE_WRITE_EID, CFE_EVS_EventType_DEBUG, CFE_SB_Global.AppId,
"%s written:Size=%d,Entries=%d", BgFilePtr->FileWrite.FileName, (int)Position,
(int)RecordNum);
break;

case CFE_FS_FileWriteEvent_HEADER_WRITE_ERROR:
case CFE_FS_FileWriteEvent_RECORD_WRITE_ERROR:
CFE_EVS_SendEventWithAppID(CFE_SB_FILEWRITE_ERR_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
CFE_EVS_SendEventWithAppID(CFE_SB_FILE_WRITE_ERR_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
"File write,byte cnt err,file %s,request=%d,actual=%d",
BgFilePtr->FileWrite.FileName, (int)BlockSize, (int)Status);
break;

case CFE_FS_FileWriteEvent_CREATE_ERROR:
CFE_EVS_SendEventWithAppID(CFE_SB_SND_RTG_ERR1_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
CFE_EVS_SendEventWithAppID(CFE_SB_FILE_WRITE_CR_ERR_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
"Error creating file %s, stat=0x%x", BgFilePtr->FileWrite.FileName, (int)Status);
break;

Expand Down
26 changes: 13 additions & 13 deletions modules/sb/ut-coverage/sb_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,12 @@ void Test_SB_Cmds_RoutingInfoDef(void)

CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID);

/* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */
/* Also test with a bad file name - should generate CFE_SB_FILE_WRITE_CR_ERR_EID */
UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH);
UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd),
UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC);

CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_CR_ERR_EID);

UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC);
CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID);
Expand Down Expand Up @@ -656,7 +656,7 @@ void Test_SB_Cmds_RoutingInfoAlreadyPending(void)

CFE_UtAssert_EVENTCOUNT(1);

CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_CR_ERR_EID);
}

/*
Expand Down Expand Up @@ -765,11 +765,11 @@ void Test_SB_Cmds_PipeInfoDef(void)

CFE_UtAssert_EVENTSENT(CFE_SB_PIPE_ADDED_EID);

/* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */
/* Also test with a bad file name - should generate CFE_SB_FILE_WRITE_CR_ERR_EID */
UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH);
UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd),
UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC);
CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_CR_ERR_EID);

UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC);
CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID);
Expand Down Expand Up @@ -802,7 +802,7 @@ void Test_SB_Cmds_PipeInfoAlreadyPending(void)

CFE_UtAssert_EVENTCOUNT(1);

CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_CR_ERR_EID);
}

/*
Expand Down Expand Up @@ -857,19 +857,19 @@ void Test_SB_Cmds_BackgroundFileWriteEvents(void)

UT_ClearEventHistory();
CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_COMPLETE, CFE_SUCCESS, 10, 0, 1000);
CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_EID);

UT_ClearEventHistory();
CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_RECORD_WRITE_ERROR, CFE_SUCCESS, 10, 10, 1000);
CFE_UtAssert_EVENTSENT(CFE_SB_FILEWRITE_ERR_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_ERR_EID);

UT_ClearEventHistory();
CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_HEADER_WRITE_ERROR, CFE_SUCCESS, 10, 10, 1000);
CFE_UtAssert_EVENTSENT(CFE_SB_FILEWRITE_ERR_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_ERR_EID);

UT_ClearEventHistory();
CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_CREATE_ERROR, OS_ERROR, 10, 0, 0);
CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_CR_ERR_EID);

UT_ClearEventHistory();
CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_UNDEFINED, OS_ERROR, 0, 0, 0);
Expand Down Expand Up @@ -969,11 +969,11 @@ void Test_SB_Cmds_MapInfoDef(void)

CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID);

/* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */
/* Also test with a bad file name - should generate CFE_SB_FILE_WRITE_CR_ERR_EID */
UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH);
UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd),
UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC);
CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_CR_ERR_EID);

/* Bad Size */
UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC);
Expand Down Expand Up @@ -1007,7 +1007,7 @@ void Test_SB_Cmds_MapInfoAlreadyPending(void)

CFE_UtAssert_EVENTCOUNT(1);

CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID);
CFE_UtAssert_EVENTSENT(CFE_SB_FILE_WRITE_CR_ERR_EID);
}

/*
Expand Down

0 comments on commit 5d7b37f

Please sign in to comment.