From 6de6d242fabfb3b43c923885abaeee1478e26610 Mon Sep 17 00:00:00 2001 From: "Jose F. Martinez Pedraza" Date: Tue, 18 May 2021 14:43:00 -0400 Subject: [PATCH 01/26] Fix #1446, Remove unused EVS LogMode defines --- modules/evs/fsw/inc/cfe_evs_events.h | 4 ++-- modules/evs/fsw/inc/cfe_evs_msg.h | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/evs/fsw/inc/cfe_evs_events.h b/modules/evs/fsw/inc/cfe_evs_events.h index 8f1f8db1e..3bbf54a0d 100644 --- a/modules/evs/fsw/inc/cfe_evs_events.h +++ b/modules/evs/fsw/inc/cfe_evs_events.h @@ -561,7 +561,7 @@ ** This event message is generated when a "Set Log Mode" command is completed successfully. ** ** The event text identifies the Log Mode command argument. Valid Log Mode command -** arguments are: #CFE_EVS_LOG_OVERWRITE or #CFE_EVS_LOG_DISCARD. +** arguments are: #CFE_EVS_LogMode_OVERWRITE or #CFE_EVS_LogMode_DISCARD. **/ #define CFE_EVS_LOGMODE_EID 38 @@ -576,7 +576,7 @@ ** an invalid Log Mode command argument. ** ** The event text identifies the invalid Log Mode command argument. Valid Log Mode command -** arguments are: #CFE_EVS_LOG_OVERWRITE or #CFE_EVS_LOG_DISCARD. +** arguments are: #CFE_EVS_LogMode_OVERWRITE or #CFE_EVS_LogMode_DISCARD. **/ #define CFE_EVS_ERR_LOGMODE_EID 39 diff --git a/modules/evs/fsw/inc/cfe_evs_msg.h b/modules/evs/fsw/inc/cfe_evs_msg.h index 9315bd830..8e7c04d62 100644 --- a/modules/evs/fsw/inc/cfe_evs_msg.h +++ b/modules/evs/fsw/inc/cfe_evs_msg.h @@ -907,10 +907,6 @@ #define CFE_EVS_PORT3_BIT 0x0004 #define CFE_EVS_PORT4_BIT 0x0008 -/* EVS Log Modes */ -#define CFE_EVS_LOG_OVERWRITE 0 -#define CFE_EVS_LOG_DISCARD 1 - /****************** Structure Definitions *********************/ /** From 41dff6325302ffc6921c7b74c99c1cdf59141bb9 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 20 May 2021 09:09:10 -0400 Subject: [PATCH 02/26] Fix #1554, add doxygen aliases for OSAL parameter/retvals Adds "nonnull", "nonzero", and "covtest" tags to mark parameters and return values in documentation. This info is helpful when auditing the test cases. --- cmake/osal-common.doxyfile.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/osal-common.doxyfile.in b/cmake/osal-common.doxyfile.in index c52f671fa..435474023 100644 --- a/cmake/osal-common.doxyfile.in +++ b/cmake/osal-common.doxyfile.in @@ -16,6 +16,10 @@ ABBREVIATE_BRIEF = "The $name class " \ the TAB_SIZE = 8 OPTIMIZE_OUTPUT_FOR_C = YES +ALIASES += nonnull="(must not be null)" +ALIASES += nonzero="(must not be zero)" +ALIASES += covtest="(return value only verified in coverage test)" + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- From be1d5d5f4914fa780ffa0e23d49d578a516b4651 Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Thu, 20 May 2021 10:04:04 -0400 Subject: [PATCH 03/26] Fix #1441, Replace Header Content Type magic number. --- modules/fs/fsw/src/cfe_fs_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/fs/fsw/src/cfe_fs_api.c b/modules/fs/fsw/src/cfe_fs_api.c index a63262fbb..ef3154488 100644 --- a/modules/fs/fsw/src/cfe_fs_api.c +++ b/modules/fs/fsw/src/cfe_fs_api.c @@ -223,7 +223,7 @@ int32 CFE_FS_WriteHeader(osal_id_t FileDes, CFE_FS_Header_t *Hdr) Hdr->Length = sizeof(CFE_FS_Header_t); /* put the header, 'cfe1' in hex, in to the content type */ - Hdr->ContentType = 0x63464531; + Hdr->ContentType = CFE_FS_FILE_CONTENT_ID; /* ** Fill in the timestamp fields... From 849eed323f64c87d09e14d3c3f6b9971b7b3d289 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 20 May 2021 15:54:45 +0000 Subject: [PATCH 04/26] Fix #1548, Include verify headers to validate config --- modules/es/fsw/src/cfe_es_task.c | 1 + modules/evs/fsw/src/cfe_evs_task.c | 1 + modules/sb/fsw/src/cfe_sb_task.c | 1 + modules/tbl/fsw/src/cfe_tbl_task.c | 1 + modules/time/fsw/src/cfe_time_task.c | 1 + 5 files changed, 5 insertions(+) diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index 4cfdbc6b1..1d924d10b 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -39,6 +39,7 @@ #include "cfe_version.h" #include "target_config.h" +#include "cfe_es_verify.h" #include diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index 4bef19928..7d91f115c 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -32,6 +32,7 @@ /* Include Files */ #include "cfe_evs_module_all.h" /* All EVS internal definitions and API */ #include "cfe_version.h" /* cFE version definitions */ +#include "cfe_evs_verify.h" #include diff --git a/modules/sb/fsw/src/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c index 99954819a..81137deda 100644 --- a/modules/sb/fsw/src/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -33,6 +33,7 @@ #include "cfe_sb_module_all.h" #include "cfe_version.h" #include "cfe_es_msg.h" /* needed for local use of CFE_ES_RestartCmd_t */ +#include "cfe_sb_verify.h" #include diff --git a/modules/tbl/fsw/src/cfe_tbl_task.c b/modules/tbl/fsw/src/cfe_tbl_task.c index 6ee1e4efc..73f082c48 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.c +++ b/modules/tbl/fsw/src/cfe_tbl_task.c @@ -34,6 +34,7 @@ */ #include "cfe_tbl_module_all.h" #include "cfe_version.h" +#include "cfe_tbl_verify.h" #include diff --git a/modules/time/fsw/src/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c index 112e2d775..2119a6c78 100644 --- a/modules/time/fsw/src/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -34,6 +34,7 @@ */ #include "cfe_time_module_all.h" #include "cfe_version.h" +#include "cfe_time_verify.h" /* ** Time task global data... From 18152c32c40070112651fe0ea579a2ae18ea445e Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 20 May 2021 16:35:49 +0000 Subject: [PATCH 05/26] Fix #1507, Document TblName as app specific --- modules/core_api/fsw/inc/cfe_tbl.h | 25 +++++++++---------------- modules/tbl/fsw/src/cfe_tbl_api.c | 3 +-- modules/tbl/fsw/src/cfe_tbl_internal.c | 2 +- modules/tbl/fsw/src/cfe_tbl_internal.h | 22 +++++++++------------- 4 files changed, 20 insertions(+), 32 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_tbl.h b/modules/core_api/fsw/inc/cfe_tbl.h index 8fa42f9c3..06efafd42 100644 --- a/modules/core_api/fsw/inc/cfe_tbl.h +++ b/modules/core_api/fsw/inc/cfe_tbl.h @@ -70,9 +70,9 @@ ** when performing Table operations. This value is returned at ddress specified by ** TblHandlePtr. ** -** \param[in] Name The application-specific name. This name will be combined with the name of the -** application to produce a processor specific name of the form -** "ApplicationName.TableName". The processor specific name will be used in commands +** \param[in] Name The raw table name. This name will be combined with the name of the +** application to produce a name of the form "AppName.RawTableName". +** This application specific name will be used in commands ** for modifying or viewing the contents of the table. ** ** \param[in] Size The size, in bytes, of the table to be created. This is the size that will be @@ -209,12 +209,9 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t * TblHandlePtr, / ** identify table to cFE when performing Table operations. ** This value is returned at the address specified by TblHandlePtr. ** -** \param[in] TblName The processor specific name of the table. It is important to note -** that the processor specific table name is different from the table -** name specified in the #CFE_TBL_Register API call. The processor -** specific table name includes the name of the application that created -** the table. The name would be of the form "ApplicationName.TableName". -** An example of this would be "ACS.TamParams" for a table called "TamParams" +** \param[in] TblName The application specific name of the table of the form "AppName.RawTableName", +** where RawTableName is the name specified in the #CFE_TBL_Register API call. +** Example: "ACS.TamParams" for a table called "TamParams" ** that was registered by the application called "ACS". ** ** \return Execution status, see \ref CFEReturnCodes @@ -678,13 +675,9 @@ CFE_Status_t CFE_TBL_GetStatus(CFE_TBL_Handle_t TblHandle); ** with table characteristics and information. *TblInfoPtr is the description of the tables ** characteristics and registry information stored in the #CFE_TBL_Info_t data structure ** format. -** -** \param[in] TblName The processor specific name of the table. It is important to note -** that the processor specific table name is different from the table -** name specified in the #CFE_TBL_Register API call. The processor -** specific table name includes the name of the application that created -** the table. The name would be of the form "ApplicationName.TableName". -** An example of this would be "ACS.TamParams" for a table called "TamParams" +** \param[in] TblName The application specific name of the table of the form "AppName.RawTableName", +** where RawTableName is the name specified in the #CFE_TBL_Register API call. +** Example: "ACS.TamParams" for a table called "TamParams" ** that was registered by the application called "ACS". ** ** \return Execution status, see \ref CFEReturnCodes diff --git a/modules/tbl/fsw/src/cfe_tbl_api.c b/modules/tbl/fsw/src/cfe_tbl_api.c index f4e127b66..b17cdfef3 100644 --- a/modules/tbl/fsw/src/cfe_tbl_api.c +++ b/modules/tbl/fsw/src/cfe_tbl_api.c @@ -89,8 +89,7 @@ int32 CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name, size_t } else { - /* Modify specified name to be processor specific name */ - /* of the form "AppName.TableName" */ + /* Generate application specific table name */ CFE_TBL_FormTableName(TblName, Name, ThisAppId); /* Make sure the specified size is acceptable */ diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index bf65a8145..f551d31ee 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -603,7 +603,7 @@ void CFE_TBL_FormTableName(char *FullTblName, const char *TblName, CFE_ES_AppId_ /* Ensure that AppName is null terminated */ AppName[OS_MAX_API_NAME - 1] = '\0'; - /* Complete formation of processor specific table name */ + /* Complete formation of application specific table name */ sprintf(FullTblName, "%s.%s", AppName, TblName); return; diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.h b/modules/tbl/fsw/src/cfe_tbl_internal.h index 44ef85fe5..0873ea8ed 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.h +++ b/modules/tbl/fsw/src/cfe_tbl_internal.h @@ -244,22 +244,18 @@ CFE_TBL_Handle_t CFE_TBL_FindFreeHandle(void); ** \brief Creates a Full Table name from application name and table name ** ** \par Description -** Takes a given Table Name and combines it with the calling -** Application's name to make a processor specific name of the -** form: "AppName.TblName" +** Takes a given raw table name and combines it with the calling +** Application's name to make the application specific name of the +** form: "AppName.RawTableName" ** ** \par Assumptions, External Events, and Notes: -** Note: AppName portion will be truncated to OS_MAX_API_NAME. -** -** \param[in, out] FullTblName pointer to character buffer of #CFE_TBL_MAX_FULL_NAME_LEN size that will be filled with -** the processor specific Table Name. *FullTblName is the processor specific Table Name of the form -** "AppName.TblName". -** -** \param[in] TblName pointer to character string containing the Application's local name for -** the Table. -** -** \param[in] ThisAppId the Application ID of the Application making the call. +** AppName portion will be truncated to OS_MAX_API_NAME. ** +** \param[in, out] FullTblName Pointer to character buffer of #CFE_TBL_MAX_FULL_NAME_LEN +** size that will be filled with the application specific name +** of the form "AppName.RawTableName" +** \param[in] TblName Pointer to character string containing the raw table name. +** \param[in] ThisAppId Application ID of the Application making the call. */ void CFE_TBL_FormTableName(char *FullTblName, const char *TblName, CFE_ES_AppId_t ThisAppId); From 202c122b4692f4434e4a972bdfa7377077b3c686 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 20 May 2021 18:23:02 +0000 Subject: [PATCH 06/26] Fix #1494, Documentation cleanup in TBL/TIME --- modules/core_api/fsw/inc/cfe_tbl.h | 43 ++++++++++--------------- modules/core_api/fsw/inc/cfe_time.h | 27 +++++++++------- modules/tbl/fsw/src/cfe_tbl_task_cmds.c | 2 +- modules/tbl/fsw/src/cfe_tbl_task_cmds.h | 4 ++- modules/tbl/fsw/src/cfe_tbl_verify.h | 7 ---- modules/time/fsw/src/cfe_time_tone.c | 3 -- 6 files changed, 36 insertions(+), 50 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_tbl.h b/modules/core_api/fsw/inc/cfe_tbl.h index 8fa42f9c3..bfef4920c 100644 --- a/modules/core_api/fsw/inc/cfe_tbl.h +++ b/modules/core_api/fsw/inc/cfe_tbl.h @@ -316,13 +316,10 @@ CFE_Status_t CFE_TBL_Load(CFE_TBL_Handle_t TblHandle, CFE_TBL_SrcEnum_t SrcType, ** \brief Update contents of a specified table, if an update is pending ** ** \par Description -** An application is \b required to perform a periodic check for an update -** for all the tables that it creates. Typically, the application that -** created the table would call this function at the start or conclusion -** of any routine processing cycle or at regular intervals. To determine -** whether an update is pending prior to making this call, the Application -** can use the #CFE_TBL_GetStatus API first. If a table update is pending, -** it will take place during this function call. +** Typically, apps should just call #CFE_TBL_Manage as part +** of routine processing which will perform validation, update, or dump +** if pending. This API is provided for the case where just an +** update should be performed. ** ** \par Assumptions, External Events, and Notes: ** None @@ -347,13 +344,10 @@ CFE_Status_t CFE_TBL_Update(CFE_TBL_Handle_t TblHandle); ** \brief Perform steps to validate the contents of a table image. ** ** \par Description -** An application is \b required to perform a periodic check for an update -** or a validation request for all the tables that it creates. Typically, -** the application that created the table would call this function at the -** start or conclusion of any routine processing cycle. To determine whether -** a validation request is pending prior to making this call, the Application -** can use the #CFE_TBL_GetStatus API first. If a table validation is pending, -** the Application would call this function to perform the necessary actions. +** Typically, apps should just call #CFE_TBL_Manage as part +** of routine processing which will perform validation, update, or dump +** if pending. This API is provided for the case where just a +** validation should be performed. ** ** \par Assumptions, External Events, and Notes: ** None @@ -378,12 +372,10 @@ CFE_Status_t CFE_TBL_Validate(CFE_TBL_Handle_t TblHandle); ** \brief Perform standard operations to maintain a table. ** ** \par Description -** An application is \b required to perform a periodic check for an update -** or a validation request for all the tables that it creates. Typically, +** Applications should call this API periodically to process pending +** requests for update, validation, or dump to buffer. Typically, ** the application that created the table would call this function at the -** start or conclusion of any routine processing cycle. If a table update -** or validation request is pending, this function would perform either or -** both before returning. +** start or conclusion of any routine processing cycle. ** ** \par Assumptions, External Events, and Notes: ** None @@ -408,14 +400,13 @@ CFE_Status_t CFE_TBL_Manage(CFE_TBL_Handle_t TblHandle); ** \brief Copies the contents of a Dump Only Table to a shared buffer ** ** \par Description -** Copies contents of a Dump Only table to a shared buffer so that it -** can be written to a file by the Table Services routine. This function -** is called by the Application that owns the table in response to a #CFE_TBL_INFO_DUMP_PENDING -** status obtained via #CFE_TBL_GetStatus. +** Typically, apps should just call #CFE_TBL_Manage as part +** of routine processing which will perform validation, update, or dump +** if pending. This API is provided for the case where just a +** dump should be performed. ** ** \par Assumptions, External Events, and Notes: -** -# If the table does not have a dump pending status, nothing will occur (no error, no dump) -** -# Applications may wish to use this function in lieu of #CFE_TBL_Manage for their Dump Only tables +** If the table does not have a dump pending status, nothing will occur (no error, no dump) ** ** \param[in] TblHandle Handle of Table to be dumped. ** @@ -548,7 +539,7 @@ CFE_Status_t CFE_TBL_ReleaseAddress(CFE_TBL_Handle_t TblHandle); ** When a table has been created and initialized, it is available to ** any application that can identify it with its unique handle. In ** order to view the data contained in the table, an application must -** call this function or #CFE_TBL_GetAddresses. +** call this function or #CFE_TBL_GetAddress. ** ** \par Assumptions, External Events, and Notes: ** -# This call can be a blocking call when the table is not double buffered diff --git a/modules/core_api/fsw/inc/cfe_time.h b/modules/core_api/fsw/inc/cfe_time.h index 1ca214ba3..23ae0cc7f 100644 --- a/modules/core_api/fsw/inc/cfe_time.h +++ b/modules/core_api/fsw/inc/cfe_time.h @@ -67,12 +67,13 @@ ** \brief Get the current spacecraft time ** ** \par Description -** This routine returns the current spacecraft time. The time returned +** This routine returns the current spacecraft time, which is the amount of +** time elapsed since the epoch as set in mission configuration. The time returned ** is either TAI (no leap seconds) or UTC (including leap seconds). This choice ** is made in the mission configuration file by defining either #CFE_MISSION_TIME_CFG_DEFAULT_TAI ** or #CFE_MISSION_TIME_CFG_DEFAULT_UTC as true at compile time. To maintain re-usability ** across missions, most applications should be using this function -** (or #CFE_TIME_GetTime) rather than the specific routines for getting UTC/TAI directly. +** rather than the specific routines for getting UTC/TAI directly. ** ** \par Assumptions, External Events, and Notes: ** None @@ -215,10 +216,10 @@ uint32 CFE_TIME_GetMETsubsecs(void); ** \par Description ** This routine returns the current value of the spacecraft time correction ** factor. This is the delta time between the MET and the TAI time. -** Applications cannot set or adjust the STCF; that can only be done -** through ground commands. However, science applications may want to -** include the STCF in their data products to aid in time correlation -** during downstream science data processing. +** There is no API provided to set or adjust leap seconds or SCTF, those +** actions should be done by command only. This API is provided for +** applications to be able to include STCF in their data products to +** aid in time correlation during downstream science data processing. ** ** \par Assumptions, External Events, and Notes: ** Does not include leap seconds @@ -237,11 +238,12 @@ CFE_TIME_SysTime_t CFE_TIME_GetSTCF(void); ** \par Description ** This routine returns the current value of the leap seconds counter. ** This is the delta seconds between international atomic time (TAI) -** and universal coordinated time (UTC). Applications cannot set or -** adjust the leap seconds; that can only be done through ground commands. -** However, science applications may want to include the leap seconds -** counter in their data products to aid in time correlation during -** downstream science data processing. Note that some mission operations +** and universal coordinated time (UTC). +** There is no API provided to set or adjust leap seconds or SCTF, those +** actions should be done by command only. This API is provided for +** applications to be able to include leap seconds in their data products to +** aid in time correlation during downstream science data processing. +** Note that some mission operations ** teams do not maintain the leap seconds count, preferring to adjust the ** STCF instead. Users of this function should check with their mission ** ops team to see how they are planning to handle leap seconds. @@ -705,7 +707,8 @@ void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint); /*****************************************************************************/ /** -** \brief This function should be called from the system PSP layer once per second +** \brief This function is called via a timer callback set up at initialization +** of the TIME service. ** ** \par Description ** Drives the time processing logic from the system PSP layer. This must be called diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c index 9a619b2ca..baef3503c 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -1263,7 +1263,7 @@ int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistryCmd_t *data) /* * Before submitting the background request, use OS_stat() to check if the file exists already. * - * This is because TBL services issued a different event ID in some cases if + * This is needed because TBL services issues a different event ID in some cases if * it is overwriting a file vs. creating a new file. */ StatePtr->FileExisted = (OS_stat(StatePtr->FileWrite.FileName, &FileStat) == OS_SUCCESS); diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h index 0fbc6323f..959a54777 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h @@ -124,7 +124,9 @@ extern void CFE_TBL_GetTblRegData(void); ** \brief Process Housekeeping Request Message ** ** \par Description -** Constructs a Housekeeping Packet (#CFE_TBL_HousekeepingTlm_t) from task data and sends it out +** Constructs and sends a Housekeeping Packet (#CFE_TBL_HousekeepingTlm_t) from task data, +** sends the table registry packet if requested, and dumps any "dump-only" tables +** that are pending. ** ** \par Assumptions, External Events, and Notes: ** The message pointed to by data has been identified as a Housekeeping Request Message diff --git a/modules/tbl/fsw/src/cfe_tbl_verify.h b/modules/tbl/fsw/src/cfe_tbl_verify.h index 614031568..e626b891e 100644 --- a/modules/tbl/fsw/src/cfe_tbl_verify.h +++ b/modules/tbl/fsw/src/cfe_tbl_verify.h @@ -73,13 +73,6 @@ #error CFE_PLATFORM_TBL_START_TASK_STACK_SIZE must be greater than or equal to 2048 #endif -/* the following check is removed because some compilers cannot handle the sizeof operator in a #if statement */ -/* -#if sizeof(CFE_PLATFORM_TBL_DEFAULT_REG_DUMP_FILE) > OS_MAX_PATH_LEN - #error The length (including NULL terminator) of CFE_PLATFORM_TBL_DEFAULT_REG_DUMP_FILE cannot be greater than -OS_MAX_PATH_LEN #endif -*/ - /* * For configuration values that should be multiples of 4 * as noted in the documentation, this confirms that they are. diff --git a/modules/time/fsw/src/cfe_time_tone.c b/modules/time/fsw/src/cfe_time_tone.c index 3b867cb3d..56e471942 100644 --- a/modules/time/fsw/src/cfe_time_tone.c +++ b/modules/time/fsw/src/cfe_time_tone.c @@ -711,9 +711,6 @@ void CFE_TIME_ToneVerify(CFE_TIME_SysTime_t Time1, CFE_TIME_SysTime_t Time2) static CFE_TIME_SysTime_t PrevTime1 = {0, 0}; static CFE_TIME_SysTime_t PrevTime2 = {0, 0}; - /* - ** It is possible to call this func with static time value... - */ result = CFE_TIME_Compare(PrevTime1, Time1); if (result == CFE_TIME_EQUAL) { From ee19f1897a9114772443d7dac4bfedaaca9de88d Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 20 May 2021 18:42:09 +0000 Subject: [PATCH 07/26] Fix #1485, Document CFE_ES_PoolCreateEx NumBlockSizes error handling --- modules/core_api/fsw/inc/cfe_es.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h index 79f8d8481..f4d233d0e 100644 --- a/modules/core_api/fsw/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -1254,8 +1254,10 @@ CFE_Status_t CFE_ES_PoolCreate(CFE_ES_MemHandle_t *PoolID, void *MemPtr, size_t ** \param[in] Size The size of the pool of memory. Note that this must be an integral multiple of the ** memory alignment of the processor architecture. ** -** \param[in] NumBlockSizes The number of different block sizes specified in the \c BlockSizes array. If set equal to -** zero or if greater than 17, then default block sizes are used. +** \param[in] NumBlockSizes The number of different block sizes specified in the \c BlockSizes array. If set +** larger than #CFE_PLATFORM_ES_POOL_MAX_BUCKETS, #CFE_ES_BAD_ARGUMENT will be returned. +** If BlockSizes is null and NumBlockSizes is 0, NubBlockSizes will be set to +** #CFE_PLATFORM_ES_POOL_MAX_BUCKETS. ** ** \param[in] BlockSizes Pointer to an array of sizes to be used instead of the default block sizes specified by ** #CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 through #CFE_PLATFORM_ES_MAX_BLOCK_SIZE. If the From a98d83161ec86c307cadb90943334d5290d4e0ff Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 20 May 2021 14:40:55 -0400 Subject: [PATCH 08/26] Fix #1561, use OSAL script to generate API guide Instead of including the OSAL API guide templates and pages in the CFE repo, invoke the build script now provided in the OSAL repo itself. --- cmake/Makefile.sample | 1 - cmake/mission_build.cmake | 23 ++++------- cmake/osal-common.doxyfile.in | 78 ----------------------------------- cmake/osalguide.doxyfile.in | 18 -------- 4 files changed, 8 insertions(+), 112 deletions(-) delete mode 100644 cmake/osal-common.doxyfile.in delete mode 100644 cmake/osalguide.doxyfile.in diff --git a/cmake/Makefile.sample b/cmake/Makefile.sample index 48eddce98..62e86b48d 100644 --- a/cmake/Makefile.sample +++ b/cmake/Makefile.sample @@ -153,7 +153,6 @@ usersguide: osalguide: $(MAKE) --no-print-directory -C "$(O)" osalguide - @/bin/echo -e "\n\nOsal Users Guide: \nfile://$(CURDIR)/$(O)/doc/osalguide/html/index.html\n" # Make all the commands that use the build tree depend on a flag file # that is used to indicate the prep step has been done. This way diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 72954b59c..f024f864b 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -269,9 +269,6 @@ function(prepare) configure_file("${CFE_SOURCE_DIR}/cmake/cfe-common.doxyfile.in" "${CMAKE_BINARY_DIR}/doc/cfe-common.doxyfile") - configure_file("${CFE_SOURCE_DIR}/cmake/osal-common.doxyfile.in" - "${CMAKE_BINARY_DIR}/doc/osal-common.doxyfile") - configure_file("${CFE_SOURCE_DIR}/cmake/mission-detaildesign.doxyfile.in" "${CMAKE_BINARY_DIR}/doc/mission-detaildesign.doxyfile") @@ -298,18 +295,9 @@ function(prepare) string(REPLACE ";" " \\\n" MISSION_USERGUIDE_HEADERFILES "${MISSION_USERGUIDE_HEADERFILES}") - # OSAL API GUIDE include PUBLIC API - file(GLOB MISSION_OSAL_HEADERFILES - "${osal_MISSION_DIR}/src/os/inc/*.h" - "${CMAKE_BINARY_DIR}/doc/osconfig-example.h") - string(REPLACE ";" " \\\n" MISSION_OSAL_HEADERFILES "${MISSION_OSAL_HEADERFILES}") - configure_file("${CFE_SOURCE_DIR}/cmake/cfe-usersguide.doxyfile.in" "${CMAKE_BINARY_DIR}/doc/cfe-usersguide.doxyfile") - configure_file("${CFE_SOURCE_DIR}/cmake/osalguide.doxyfile.in" - "${CMAKE_BINARY_DIR}/doc/osalguide.doxyfile") - add_custom_target(mission-doc doxygen mission-detaildesign.doxyfile WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/doc") @@ -318,9 +306,14 @@ function(prepare) doxygen cfe-usersguide.doxyfile WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/doc") - add_custom_target(osalguide - doxygen osalguide.doxyfile - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/doc") + # OSAL API GUIDE include PUBLIC API + set(OSAL_API_INCLUDE_DIRECTORIES + "${osal_MISSION_DIR}/src/os/inc" + "${CMAKE_BINARY_DIR}/doc" + ) + add_subdirectory(${osal_MISSION_DIR}/doc/src ${CMAKE_BINARY_DIR}/doc/osalguide) + add_custom_target(osalguide) + add_dependencies(osalguide osal-apiguide) # Pull in any application-specific mission-scope configuration # This may include user configuration files such as cfe_mission_cfg.h, diff --git a/cmake/osal-common.doxyfile.in b/cmake/osal-common.doxyfile.in deleted file mode 100644 index c52f671fa..000000000 --- a/cmake/osal-common.doxyfile.in +++ /dev/null @@ -1,78 +0,0 @@ -#--------------------------------------------------------------------------- -# Project related configuration options, shared for all cFE doxygen outputs -#--------------------------------------------------------------------------- -@INCLUDE_PATH = @MISSION_SOURCE_DIR@ -OUTPUT_DIRECTORY = . -ABBREVIATE_BRIEF = "The $name class " \ - "The $name widget " \ - "The $name file " \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -TAB_SIZE = 8 -OPTIMIZE_OUTPUT_FOR_C = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -CASE_SENSE_NAMES = NO -GENERATE_TODOLIST = NO -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -WARN_NO_PARAMDOC = YES -WARN_LOGFILE = @CMAKE_BINARY_DIR@/doc/warnings.log -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -STRIP_FROM_PATH = @MISSION_SOURCE_DIR@ - -# Always include a standard set of CFE documentation in the input set -# This is applicable to both users guide and detail design outputs -INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfs_versions.dox -INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/osal_fs.dox -INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/osal_timer.dox - -FILE_PATTERNS = *.c *.cpp *.cc *.C *.h *.hh *.hpp *.H *.dox *.md -RECURSIVE = YES -EXAMPLE_PATTERNS = * -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_CMD_NAME = latex -COMPACT_LATEX = YES -PAPER_TYPE = letter -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -COMPACT_RTF = YES -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO -HAVE_DOT = YES -CLASS_GRAPH = NO -COLLABORATION_GRAPH = NO -INCLUDE_GRAPH = NO -INCLUDED_BY_GRAPH = NO -CALL_GRAPH = YES -GRAPHICAL_HIERARCHY = NO -MAX_DOT_GRAPH_DEPTH = 1000 -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/cmake/osalguide.doxyfile.in b/cmake/osalguide.doxyfile.in deleted file mode 100644 index 431d8cd73..000000000 --- a/cmake/osalguide.doxyfile.in +++ /dev/null @@ -1,18 +0,0 @@ -#--------------------------------------------------------------------------- -# Doxygen Configuration options to generate the "OSAL API Guide" -#--------------------------------------------------------------------------- - -# Start with the main page so document ordering is established -INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/osalmain.dox - -# Common definitions, some of which are extended or overridden here. -@INCLUDE = @MISSION_BINARY_DIR@/doc/osal-common.doxyfile -PROJECT_NAME = "OSAL User's Guide" -OUTPUT_DIRECTORY = osalguide -GENERATE_LATEX = YES - -#PREDEFINED -PREDEFINED += @OSALGUIDE_PREDEFINED@ - -# Bring in the cFE header files for the documentation of the various API calls -INPUT += @MISSION_OSAL_HEADERFILES@ From 2e0bc9ff9dc71b71ab7187b85af1a74c686b38cd Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 20 May 2021 15:17:14 -0400 Subject: [PATCH 09/26] Fix #1561, also remove dox files now in OSAL --- docs/src/osal_fs.dox | 94 ------------------------------- docs/src/osal_timer.dox | 8 --- docs/src/osalmain.dox | 121 ---------------------------------------- 3 files changed, 223 deletions(-) delete mode 100644 docs/src/osal_fs.dox delete mode 100644 docs/src/osal_timer.dox delete mode 100644 docs/src/osalmain.dox diff --git a/docs/src/osal_fs.dox b/docs/src/osal_fs.dox deleted file mode 100644 index 6a8b8cf29..000000000 --- a/docs/src/osal_fs.dox +++ /dev/null @@ -1,94 +0,0 @@ -/** -\page osalfsovr File System Overview - - The File System API is a thin wrapper around a selection of POSIX file APIs. - In addition the File System API presents a common directory structure and - volume view regardless of the underlying system type. For example, vxWorks - uses MS-DOS style volume names and directories where a vxWorks RAM disk might - have the volume “RAM:0”. With this File System API, volumes are represented - as Unix-style paths where each volume is mounted on the root file system: - -
    -
  • RAM:0/file1.dat becomes /mnt/ram/file1.dat -
  • FL:0/file2.dat becomes /mnt/fl/file2.dat -
- - This abstraction allows the applications to use the same paths regardless of - the implementation and it also allows file systems to be simulated on a desktop - system for testing. On a desktop Linux system, the file system abstraction can - be set up to map virtual devices to a regular directory. This is accomplished - through the OS_mkfs call, OS_mount call, and a BSP specific volume table that - maps the virtual devices to real devices or underlying file systems. - - In order to make this file system volume abstraction work, a “Volume Table” - needs to be provided in the Board Support Package of the application. The table - has the following fields: - -
    -
  • Device Name: This is the name of the virtual device that the Application - uses. Common names are “ramdisk1”, “flash1”, or “volatile1” etc. But the - name can be any unique string. -
  • Physical Device Name: This is an implementation specific field. For - vxWorks it is not needed and can be left blank. For a File system based - implementation, it is the “mount point” on the root file system where all - of the volume will be mounted. A common place for this on Linux could - be a user’s home directory, “/tmp”, or even the current working - directory “.”. In the example of “/tmp” all of the directories created - for the volumes would be under “/tmp” on the Linux file system. For a real - disk device in Linux, such as a RAM disk, this field is the device - name “/dev/ram0”. -
  • Volume Type: This field defines the type of volume. The types are: - FS_BASED which uses the existing file system, RAM_DISK which uses a - RAM_DISK device in vxWorks, RTEMS, or Linux, FLASH_DISK_FORMAT which uses - a flash disk that is to be formatted before use, FLASH_DISK_INIT which - uses a flash disk with an existing format that is just to be initialized - before it’s use, EEPROM which is for an EEPROM or PROM based system. -
  • Volatile Flag: This flag indicates that the volume or disk is a volatile - disk (RAM disk ) or a non-volatile disk, that retains its contents when - the system is rebooted. This should be set to TRUE or FALSE. -
  • Free Flag: This is an internal flag that should be set to FALSE or zero. -
  • Is Mounted Flag: This is an internal flag that should be set to FALSE - or zero. Note that a “pre-mounted” FS_BASED path can be set up by setting - this flag to one. -
  • Volume Name: This is an internal field and should be set to a space - character “ “. -
  • Mount Point Field: This is an internal field and should be set to a space - character “ “. -
  • Block Size Field: This is used to record the block size of the device and - does not need to be set by the user. -
-**/ - -/** -\page osalfsfd File Descriptors In Osal - - The OSAL uses abstracted file descriptors. This means that the file descriptors - passed back from the OS_open and OS_creat calls will only work with other OSAL OS_* - calls. The reasoning for this is as follows: - - Because the OSAL now keeps track of all file descriptors, OSAL specific information - can be associated with a specific file descriptor in an OS independent way. For -instance, the path of the file that the file descriptor points to can be easily - retrieved. Also, the OSAL task ID of the task that opened the file can also be - retrieved easily. Both of these pieces of information are very useful when trying - to determine statistics for a task, or the entire system. This information can all - be retrieved with a single API, OS_FDGetInfo. - - All of possible file system calls are not implemented. "Special" files requiring OS - specific control/operations are by nature not portable. Abstraction in this case is - is not possible, so the raw OS calls should be used (including open/close/etc). Mixing - with OSAL calls is not supported for such cases. #OS_TranslatePath is available to - support using open directly by an app and maintain abstraction on the file system. - - There are some small drawbacks with the OSAL file descriptors. Because the related - information is kept in a table, there is a define called OS_MAX_NUM_OPEN_FILES that - defines the maximum number of file descriptors available. This is a configuration -parameter, and can be changed to fit your needs. - - Also, if you open or create a file not using the OSAL calls (OS_open or OS_creat) - then none of the other OS_* calls that accept a file descriptor as a parameter will -work (the results of doing so are undefined). Therefore, if you open a file with - the underlying OS's open call, you must continue to use the OS's calls until you - close the file descriptor. Be aware that by doing this your software may no longer - be OS agnostic. -**/ diff --git a/docs/src/osal_timer.dox b/docs/src/osal_timer.dox deleted file mode 100644 index 793bc24c7..000000000 --- a/docs/src/osal_timer.dox +++ /dev/null @@ -1,8 +0,0 @@ -/** - \page osaltimerover Timer Overview - - The timer API is a generic interface to the OS timer facilities. It is - implemented using the POSIX timers on Linux and vxWorks and the native timer - API on RTEMS. The number of timers supported is controlled by the configuration - parameter OS_MAX_TIMERS. -**/ diff --git a/docs/src/osalmain.dox b/docs/src/osalmain.dox deleted file mode 100644 index 7502b6991..000000000 --- a/docs/src/osalmain.dox +++ /dev/null @@ -1,121 +0,0 @@ -/** - \mainpage Osal API Documentation - -
    -
  • General Information and Concepts -
      -
    • \subpage osalIntro -
    -
  • Core -
      -
    • \ref OSReturnCodes -
    • \ref OSObjectTypes -
    • APIs -
        -
      • \ref OSAPICore -
      • \ref OSAPIObjUtil -
      • \ref OSAPITask -
      • \ref OSAPIMsgQueue -
      • \ref OSAPIHeap -
      • \ref OSAPIError -
      • \ref OSAPISelect -
      • \ref OSAPIPrintf -
      • \ref OSAPIBsp -
      • \ref OSAPIClock -
      • \ref OSAPIShell -
      -
    • \subpage osapi-common.h "Common Reference" -
    • \subpage osapi-error.h "Return Code Reference" -
    • \subpage osapi-idmap.h "Id Map Reference" -
    • \subpage osapi-clock.h "Clock Reference" -
    • \subpage osapi-task.h "Task Reference" -
    • \subpage osapi-queue.h "Message Queue Reference" -
    • \subpage osapi-heap.h "Heap Reference" -
    • \subpage osapi-select.h "Select Reference" -
    • \subpage osapi-printf.h "Printf Reference" -
    • \subpage osapi-bsp.h "BSP Reference" -
    • \subpage osapi-shell.h "Shell Reference" -
    -
  • File System -
      -
    • \subpage osalfsovr -
    • \subpage osalfsfd -
    • \ref OSFileAccess -
    • \ref OSFileOffset -
    • APIs -
        -
      • \ref OSAPIFile -
      • \ref OSAPIDir -
      • \ref OSAPIFileSys -
      -
    • \subpage osapi-filesys.h "File System Reference" -
    • \subpage osapi-file.h "File Reference" -
    • \subpage osapi-dir.h "Directory Reference" -
    -
  • Object File Loader -
      -
    • APIs -
        -
      • \ref OSAPILoader -
      -
    • \subpage osapi-module.h "File Loader Reference" -
    -
  • Network -
      -
    • APIs -
        -
      • \ref OSALAPINetwork -
      • \ref OSAPISocketAddr -
      • \ref OSALAPISocket -
      -
    • \subpage osapi-network.h "Network Reference" -
    • \subpage osapi-sockets.h "Socket Reference" -
    -
  • Timer -
      -
    • \subpage osaltimerover -
    • APIs -
        -
      • \ref OSAPITimebase -
      • \ref OSAPITimer -
      -
    • \subpage osapi-timer.h "Timer Reference" -
    • \subpage osapi-timebase.h "Time Base Reference" -
    -
  • Semaphore and Mutex -
      -
    • \ref OSSemaphoreStates -
    • APIs -
        -
      • \ref OSAPIBinSem -
      • \ref OSAPICountSem -
      • \ref OSAPIMutex -
      -
    • \subpage osapi-binsem.h "Binary Semaphore Reference" -
    • \subpage osapi-countsem.h "Counting Semaphore Reference" -
    • \subpage osapi-mutex.h "Mutex Reference" -
    -
-**/ - -/** - \page osalIntro OSAL Introduction - - The goal of this library is to promote the creation of portable and - reusable real time embedded system software. Given the necessary OS - abstraction layer implementations, the same embedded software should - compile and run on a number of platforms ranging from spacecraft - computer systems to desktop PCs. - - The OS Application Program Interfaces (APIs) are broken up into core, - file system, loader, network, and timer APIs. See the related document - sections for full descriptions. - - @note The majority of these APIs should be called from a task running - in the context of an OSAL application and in general should not be called - from an ISR. There are a few exceptions, such as the ability to give a - binary semaphore from an ISR. -**/ - - - From 6333d25ea82548048d084ccec4d5c5708a873913 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Fri, 21 May 2021 22:26:59 +0000 Subject: [PATCH 10/26] Fix #1476, Use CFE_MSG_SequenceCount_t for seqcnt type --- modules/sbr/fsw/src/cfe_sbr_route_unsorted.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sbr/fsw/src/cfe_sbr_route_unsorted.c b/modules/sbr/fsw/src/cfe_sbr_route_unsorted.c index c41060702..0c9bdc108 100644 --- a/modules/sbr/fsw/src/cfe_sbr_route_unsorted.c +++ b/modules/sbr/fsw/src/cfe_sbr_route_unsorted.c @@ -201,7 +201,7 @@ void CFE_SBR_IncrementSequenceCounter(CFE_SBR_RouteId_t RouteId) *-----------------------------------------------------------------*/ CFE_MSG_SequenceCount_t CFE_SBR_GetSequenceCounter(CFE_SBR_RouteId_t RouteId) { - uint32 seqcnt = 0; + CFE_MSG_SequenceCount_t seqcnt = 0; if (CFE_SBR_IsValidRouteId(RouteId)) { From 8c84e57d8cf04d6681180ddbfa0d8bc53f23e60f Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Fri, 21 May 2021 22:39:44 +0000 Subject: [PATCH 11/26] Fix #1455, Add CFE_SB_DestinationD tag and use for pointers --- .../fsw/inc/cfe_sb_destination_typedef.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h b/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h index daaf9f95c..2403bdcdf 100644 --- a/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h +++ b/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h @@ -38,17 +38,17 @@ * Note: Changing the size of this structure may require the memory pool * block sizes to change. */ -typedef struct +typedef struct CFE_SB_DestinationD { - CFE_SB_PipeId_t PipeId; - uint8 Active; - uint16 MsgId2PipeLim; - uint16 BuffCount; - uint16 DestCnt; - uint8 Scope; - uint8 Spare[3]; - void * Prev; - void * Next; + CFE_SB_PipeId_t PipeId; + uint8 Active; + uint16 MsgId2PipeLim; + uint16 BuffCount; + uint16 DestCnt; + uint8 Scope; + uint8 Spare[3]; + struct CFE_SB_DestinationD *Prev; + struct CFE_SB_DestinationD *Next; } CFE_SB_DestinationD_t; #endif /* CFE_SB_DESTINATION_TYPEDEF_H */ From 4652c0d8ed1e5ad34380e345b5e0eb9e94fff68f Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Fri, 21 May 2021 23:03:15 +0000 Subject: [PATCH 12/26] Fix #1423, Remove deprecated elements --- modules/core_api/fsw/inc/cfe_error.h | 10 ------- .../core_api/fsw/inc/cfe_sb_api_typedefs.h | 27 ------------------- 2 files changed, 37 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h index 47259cc1a..eff79c50e 100644 --- a/modules/core_api/fsw/inc/cfe_error.h +++ b/modules/core_api/fsw/inc/cfe_error.h @@ -1338,14 +1338,4 @@ typedef int32 CFE_Status_t; #define CFE_TIME_BAD_ARGUMENT ((CFE_Status_t)0xce000005) /**@}*/ -/* Compatibility for error names which have been updated */ -#ifndef CFE_OMIT_DEPRECATED_6_8 -#define CFE_ES_ERR_TASKID CFE_ES_ERR_RESOURCEID_NOT_VALID -#define CFE_ES_ERR_APPID CFE_ES_ERR_RESOURCEID_NOT_VALID -#define CFE_ES_ERR_MEM_HANDLE CFE_ES_ERR_RESOURCEID_NOT_VALID -#define CFE_ES_ERR_APPNAME CFE_ES_ERR_NAME_NOT_FOUND -#define CFE_ES_CDS_NOT_FOUND_ERR CFE_ES_ERR_NAME_NOT_FOUND -#define CFE_ES_CDS_REGISTRY_FULL CFE_ES_NO_RESOURCE_IDS_AVAILABLE -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - #endif /* CFE_ERROR_H */ diff --git a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h index 5cc2e9366..e3a91d604 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -130,31 +130,4 @@ typedef union CFE_SB_Msg long double LongDouble; /**< \brief Align to support Long Double */ } CFE_SB_Buffer_t; -#ifndef CFE_OMIT_DEPRECATED_6_8 - -/** \brief Deperecated type to minimize required changes */ -typedef CFE_SB_Buffer_t CFE_SB_Msg_t; - -/** \brief Deperecated type to minimize required changes */ -typedef CFE_MSG_CommandHeader_t CFE_SB_CmdHdr_t; - -/** \brief Deperecated type to minimize required changes */ -typedef CFE_MSG_TelemetryHeader_t CFE_SB_TlmHdr_t; - -#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t)) /**< \brief Size of command header */ -#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_MSG_TelemetryHeader_t)) /**< \brief Size of telemetry header */ - -/** \brief Pointer to an SB Message */ -typedef CFE_MSG_Message_t *CFE_SB_MsgPtr_t; - -/** \brief CFE_SB_MsgPayloadPtr_t defined as an opaque pointer to a message Payload portion */ -typedef uint8 *CFE_SB_MsgPayloadPtr_t; - -#define CFE_SB_Default_Qos CFE_SB_DEFAULT_QOS /**< \deprecated use CFE_SB_DEFAULT_QOS */ - -#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t)) /**< \brief Size of command header */ -#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_MSG_TelemetryHeader_t)) /**< \brief Size of telemetry header */ - -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - #endif /* CFE_SB_API_TYPEDEFS_H */ From d7c2b244ad6dff161b954a205b1f8eee5935454a Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 24 May 2021 19:11:47 +0000 Subject: [PATCH 13/26] Fix #1435, Consistent use of uint16 for EventID --- modules/core_api/fsw/inc/cfe_evs.h | 2 +- modules/core_api/ut-stubs/src/cfe_evs_stubs.c | 4 ++-- modules/evs/fsw/src/cfe_evs.c | 2 +- modules/evs/fsw/src/cfe_evs_task.h | 2 +- modules/evs/fsw/src/cfe_evs_utils.c | 2 +- modules/evs/fsw/src/cfe_evs_utils.h | 2 +- modules/evs/ut-coverage/evs_UT.c | 6 +++--- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_evs.h b/modules/core_api/fsw/inc/cfe_evs.h index b6c8f6b1b..ed691b7dd 100644 --- a/modules/core_api/fsw/inc/cfe_evs.h +++ b/modules/core_api/fsw/inc/cfe_evs.h @@ -305,7 +305,7 @@ CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, uin ** \sa #CFE_EVS_ResetAllFilters ** **/ -CFE_Status_t CFE_EVS_ResetFilter(int16 EventID); +CFE_Status_t CFE_EVS_ResetFilter(uint16 EventID); /** ** \brief Resets all of the calling application's event filters. diff --git a/modules/core_api/ut-stubs/src/cfe_evs_stubs.c b/modules/core_api/ut-stubs/src/cfe_evs_stubs.c index 72fd2ec5c..73a1222e8 100644 --- a/modules/core_api/ut-stubs/src/cfe_evs_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_evs_stubs.c @@ -70,11 +70,11 @@ CFE_Status_t CFE_EVS_ResetAllFilters(void) * Generated stub function for CFE_EVS_ResetFilter() * ---------------------------------------------------- */ -CFE_Status_t CFE_EVS_ResetFilter(int16 EventID) +CFE_Status_t CFE_EVS_ResetFilter(uint16 EventID) { UT_GenStub_SetupReturnBuffer(CFE_EVS_ResetFilter, CFE_Status_t); - UT_GenStub_AddParam(CFE_EVS_ResetFilter, int16, EventID); + UT_GenStub_AddParam(CFE_EVS_ResetFilter, uint16, EventID); UT_GenStub_Execute(CFE_EVS_ResetFilter, Basic, NULL); diff --git a/modules/evs/fsw/src/cfe_evs.c b/modules/evs/fsw/src/cfe_evs.c index 62513f4ee..583a0b462 100644 --- a/modules/evs/fsw/src/cfe_evs.c +++ b/modules/evs/fsw/src/cfe_evs.c @@ -275,7 +275,7 @@ int32 CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, uint16 Eve * See description in header file for argument/return detail * *-----------------------------------------------------------------*/ -int32 CFE_EVS_ResetFilter(int16 EventID) +int32 CFE_EVS_ResetFilter(uint16 EventID) { int32 Status; EVS_BinFilter_t *FilterPtr = NULL; diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index fe14805bb..6dcd8bf5d 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -74,7 +74,7 @@ typedef struct { - int16 EventID; /* Numerical event identifier */ + uint16 EventID; /* Numerical event identifier */ uint16 Mask; /* Binary filter mask */ uint16 Count; /* Binary filter counter */ uint16 Padding; /* Structure padding */ diff --git a/modules/evs/fsw/src/cfe_evs_utils.c b/modules/evs/fsw/src/cfe_evs_utils.c index f5fd7318e..63be13efd 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.c +++ b/modules/evs/fsw/src/cfe_evs_utils.c @@ -297,7 +297,7 @@ bool EVS_IsFiltered(EVS_AppData_t *AppDataPtr, uint16 EventID, uint16 EventType) * See description in header file for argument/return detail * *-----------------------------------------------------------------*/ -EVS_BinFilter_t *EVS_FindEventID(int16 EventID, EVS_BinFilter_t *FilterArray) +EVS_BinFilter_t *EVS_FindEventID(uint16 EventID, EVS_BinFilter_t *FilterArray) { uint32 i; diff --git a/modules/evs/fsw/src/cfe_evs_utils.h b/modules/evs/fsw/src/cfe_evs_utils.h index 5b3be35e7..8cfca2a4c 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.h +++ b/modules/evs/fsw/src/cfe_evs_utils.h @@ -199,7 +199,7 @@ bool EVS_IsFiltered(EVS_AppData_t *AppDataPtr, uint16 EventID, uint16 EventType) * This routine searches and returns an index to the given Event ID with the * given application filter array. */ -EVS_BinFilter_t *EVS_FindEventID(int16 EventID, EVS_BinFilter_t *FilterArray); +EVS_BinFilter_t *EVS_FindEventID(uint16 EventID, EVS_BinFilter_t *FilterArray); /*---------------------------------------------------------------------------------------*/ /** diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index c81e0a224..1ada881df 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -666,9 +666,9 @@ void Test_FilterReset(void) */ void Test_Format(void) { - int i; - char long_msg[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH + 2]; - int16 EventID[2]; + int i; + char long_msg[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH + 2]; + uint16 EventID[2]; CFE_TIME_SysTime_t time = {0, 0}; CFE_EVS_SetEventFormatModeCmd_t modecmd; From 6ce02300af72aca1cf9b3a65045240067f7c60d8 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 25 May 2021 16:58:51 +0000 Subject: [PATCH 14/26] Fix #1394, Remove shell file subtype and clarify scope --- .../core_api/fsw/inc/cfe_fs_extern_typedefs.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h index d1780b544..89c3e9db5 100644 --- a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h @@ -53,7 +53,12 @@ #define CFE_FS_FILE_CONTENT_ID 0x63464531 /**< \brief Magic Number for cFE compliant files (= 'cFE1') */ /** - * @brief Label definitions associated with CFE_FS_SubType_Enum_t + * @brief File subtypes used within cFE + * + * This defines all the file subtypes used by cFE. + * Note apps can extend as needed but need to + * avoid conflicts (app context not currently included + * in the file header). */ enum CFE_FS_SubType { @@ -98,15 +103,6 @@ enum CFE_FS_SubType */ CFE_FS_SubType_ES_PERFDATA = 4, - /** - * @brief Executive Services Shell Response File - * - * Executive Services Shell Response Data File which is generated in response to a - * shell command. - * - */ - CFE_FS_SubType_ES_SHELL = 5, - /** * @brief Executive Services Critical Data Store Registry Dump File * From b9aa9ca64d9954432de1a473141af1726215b1f3 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 25 May 2021 17:34:27 +0000 Subject: [PATCH 15/26] Fix #1391, EVS/FS documentation cleanup --- modules/core_api/fsw/inc/cfe_fs.h | 5 +- .../core_api/fsw/inc/cfe_fs_extern_typedefs.h | 2 +- .../fsw/inc/cfe_evs_log_typedef.h | 2 +- modules/evs/fsw/src/cfe_evs_task.c | 50 ++++--------------- 4 files changed, 14 insertions(+), 45 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_fs.h b/modules/core_api/fsw/inc/cfe_fs.h index 0354bd95c..13aa0f103 100644 --- a/modules/core_api/fsw/inc/cfe_fs.h +++ b/modules/core_api/fsw/inc/cfe_fs.h @@ -58,12 +58,11 @@ ** -# The File has already been successfully opened using #OS_OpenCreate and ** the caller has a legitimate File Descriptor. ** -** \param[in] FileDes File Descriptor obtained from a previous call to #OS_OpenCreate -** that is associated with the file whose header is to be read. -** ** \param[in, out] Hdr Pointer to a variable of type #CFE_FS_Header_t that will be ** filled with the contents of the Standard cFE File Header. *Hdr is the contents of the ** Standard cFE File Header for the specified file. +** \param[in] FileDes File Descriptor obtained from a previous call to #OS_OpenCreate +** that is associated with the file whose header is to be read. ** ** \return Execution status, see \ref CFEReturnCodes ** diff --git a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h index d1780b544..c882eeec2 100644 --- a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h @@ -213,7 +213,7 @@ typedef struct CFE_FS_Header uint32 SubType; /**< \brief Type of \c ContentType, if necessary */ /**< Standard SubType definitions can be found \link #CFE_FS_SubType_ES_ERLOG here \endlink */ - uint32 Length; /**< \brief Length of primary header */ + uint32 Length; /**< \brief Length of this header to support external processing */ uint32 SpacecraftID; /**< \brief Spacecraft that generated the file */ uint32 ProcessorID; /**< \brief Processor that generated the file */ uint32 ApplicationID; /**< \brief Application that generated the file */ diff --git a/modules/core_private/fsw/inc/cfe_evs_log_typedef.h b/modules/core_private/fsw/inc/cfe_evs_log_typedef.h index 66da533b0..a4ba33db8 100644 --- a/modules/core_private/fsw/inc/cfe_evs_log_typedef.h +++ b/modules/core_private/fsw/inc/cfe_evs_log_typedef.h @@ -40,7 +40,7 @@ typedef struct { uint16 Next; /**< \brief Index of the next entry in the local event log */ - uint16 LogCount; /**< \brief Local Event Kog counter */ + uint16 LogCount; /**< \brief Local Event Log counter */ uint8 LogFullFlag; /**< \brief Local Event Log full flag */ uint8 LogMode; /**< \brief Local Event Logging mode (overwrite/discard) */ uint16 LogOverflowCounter; /**< \brief Local Event Log overflow counter */ diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index 4bef19928..74feac64f 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -718,10 +718,7 @@ int32 CFE_EVS_SetFilterCmd(const CFE_EVS_SetFilterCmd_t *data) EVS_AppData_t * AppDataPtr; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ @@ -1011,10 +1008,7 @@ int32 CFE_EVS_EnableAppEventTypeCmd(const CFE_EVS_EnableAppEventTypeCmd_t *data) int32 Status; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retrieve application data */ @@ -1079,10 +1073,7 @@ int32 CFE_EVS_DisableAppEventTypeCmd(const CFE_EVS_DisableAppEventTypeCmd_t *dat int32 Status; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ @@ -1147,10 +1138,7 @@ int32 CFE_EVS_EnableAppEventsCmd(const CFE_EVS_EnableAppEventsCmd_t *data) int32 Status; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retrieve application data */ @@ -1199,10 +1187,7 @@ int32 CFE_EVS_DisableAppEventsCmd(const CFE_EVS_DisableAppEventsCmd_t *data) int32 Status; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ @@ -1251,10 +1236,7 @@ int32 CFE_EVS_ResetAppCounterCmd(const CFE_EVS_ResetAppCounterCmd_t *data) int32 Status; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ @@ -1304,10 +1286,7 @@ int32 CFE_EVS_ResetFilterCmd(const CFE_EVS_ResetFilterCmd_t *data) EVS_AppData_t * AppDataPtr; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ @@ -1371,10 +1350,7 @@ int32 CFE_EVS_ResetAllFiltersCmd(const CFE_EVS_ResetAllFiltersCmd_t *data) uint32 i; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ @@ -1427,10 +1403,7 @@ int32 CFE_EVS_AddEventFilterCmd(const CFE_EVS_AddEventFilterCmd_t *data) EVS_AppData_t * AppDataPtr; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ @@ -1514,10 +1487,7 @@ int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilterCmd_t *data) EVS_AppData_t * AppDataPtr; char LocalName[OS_MAX_API_NAME]; - /* - * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, - * the value is passed to EVS_SendEvent which does require termination (normal C string) - */ + /* Copy appname from command, ensures NULL termination */ CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ From 8280c27a140e94e55187913251a6fc1b18bd90d1 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 25 May 2021 12:50:53 -0600 Subject: [PATCH 16/26] Fix #1386, Remove CFE_EVS_Unregister API - Removed requirement cEVS3101 - Removed documentation references - Removed from API header - Removed stub - Removed implementation - Removed coverage test --- docs/cFE Application Developers Guide.md | 14 +---------- docs/cFE_FunctionalRequirements.csv | 8 ------ docs/src/cfe_api.dox | 1 - modules/core_api/fsw/inc/cfe_evs.h | 25 ------------------- modules/core_api/ut-stubs/src/cfe_evs_stubs.c | 14 ----------- modules/evs/fsw/src/cfe_evs.c | 24 ------------------ modules/evs/fsw/src/cfe_evs_task.c | 1 - modules/evs/ut-coverage/evs_UT.c | 22 +++------------- 8 files changed, 4 insertions(+), 105 deletions(-) diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index dc4c0cb26..302b9fd2e 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -2365,19 +2365,7 @@ consistent style of writing in all messages. One should consult, if possible, with members of the Flight Operations team and scientists to find what kind of messages are required and how they should be worded. -## 7.6 Event Service Un-registration - -Applications that have registered with the EVS can un-register -themselves. The cFE, however, will automatically un-register an -Application when the Application is terminated. An example of the -function call to perform un-registration from within an Application is -shown below: - -``` -CFE_EVS_Unregister (); -``` - -## 7.7 Best Practices for using Event Services +## 7.6 Best Practices for using Event Services The following are recommended "best practices" for applications using EVS. 1. Event Message IDs should be unique across an application so that an diff --git a/docs/cFE_FunctionalRequirements.csv b/docs/cFE_FunctionalRequirements.csv index 8793bb771..f1f90f1d4 100644 --- a/docs/cFE_FunctionalRequirements.csv +++ b/docs/cFE_FunctionalRequirements.csv @@ -259,14 +259,6 @@ EVS: Register App,cEVS3100,"Upon receipt of Request, the cFE shall register an A EVS: Register App - Create Filter Counter,cEVS3100.1,"Upon receipt of Request to register an Application for event service, the cFE shall create one Application Binary Filter Counter per registered Event ID.",Supports the cFE's Binary Filtering Algorithm. EVS: Register App - Create Sent Message Counter,cEVS3100.2,"Upon receipt of Request to register an Application for event service, the cFE shall create an Application Event Message Sent Counter.",Supports the cFE's dynamic Application model. EVS: Register App - Default Event Enable Status,cEVS3100.3,"Upon receipt of Request to register an Application for event service, the cFE shall use the `` Application Event Type Enable Statuses for each event.","By default each platform should have a standard configuration for each event message type (eg. DEBUGs disable. INFO, ERROR and CRITICAL events DISABLED) that should be applied to all events. Commands are available to modify the settings." -EVS: Unregister App,cEVS3101,"Upon receipt of Request, the cFE shall un-register an Application from using event services, deleting the following Application data: - -- Application Event Message Sent Counter -- Application Event Service Enable Status -- Application Event Type Enable Statuses (one for each Event Type) -- Application Filtered Event IDs -- Application Binary Filter Masks (one per registered Event ID) -- Application Binary Filter Counters (one per registered Event ID)",Supports the cFE's dynamic Application model allowing applications to clean up after themselves. EVS: Message Types,cEVS3102,The cFE shall support the following Event Message Types: Debug Informational Error Critical.,Supports cFE event services. EVS: Create Message,cEVS3103,"Upon receipt of a Request to send an Event Message, the cFE shall create a Short or Long Event Message, as specified by the SB Event Format Mode, ONLY if the following cFE conditions are met: diff --git a/docs/src/cfe_api.dox b/docs/src/cfe_api.dox index b09273272..19c3d99f7 100644 --- a/docs/src/cfe_api.dox +++ b/docs/src/cfe_api.dox @@ -80,7 +80,6 @@
  • \ref CFEAPIEVSReg
    • #CFE_EVS_Register - \copybrief CFE_EVS_Register -
    • #CFE_EVS_Unregister - \copybrief CFE_EVS_Unregister
  • \ref CFEAPIEVSSend
      diff --git a/modules/core_api/fsw/inc/cfe_evs.h b/modules/core_api/fsw/inc/cfe_evs.h index b6c8f6b1b..a97fb651a 100644 --- a/modules/core_api/fsw/inc/cfe_evs.h +++ b/modules/core_api/fsw/inc/cfe_evs.h @@ -102,35 +102,10 @@ ** \retval #CFE_EVS_APP_FILTER_OVERLOAD \copybrief CFE_EVS_APP_FILTER_OVERLOAD ** \retval #CFE_EVS_UNKNOWN_FILTER \copybrief CFE_EVS_UNKNOWN_FILTER ** \retval #CFE_EVS_APP_ILLEGAL_APP_ID \copybrief CFE_EVS_APP_ILLEGAL_APP_ID -** -** \sa #CFE_EVS_Unregister -** **/ CFE_Status_t CFE_EVS_Register(const void *Filters, /* Pointer to an array of filters */ uint16 NumFilteredEvents, /* How many elements in the array? */ uint16 FilterScheme); /* Filtering Algorithm to be implemented */ - -/** -** \brief Cleanup internal structures used by the event manager for the calling Application. -** -** \par Description -** This routine un-registers the calling application from receiving event services -** and removes and deletes the calling applications filters and counters from the -** internal event service filter and counter tables if registered. Applications -** must call this routine as part of their orderly shutdown process. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \return Execution status below or from #CFE_ES_GetAppID/#CFE_ES_PutPoolBuf, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_EVS_APP_NOT_REGISTERED \copybrief CFE_EVS_APP_NOT_REGISTERED -** \retval #CFE_EVS_APP_ILLEGAL_APP_ID \copybrief CFE_EVS_APP_ILLEGAL_APP_ID -** -** \sa #CFE_EVS_Register -** -**/ -CFE_Status_t CFE_EVS_Unregister(void); /**@}*/ /** @defgroup CFEAPIEVSSend cFE Send Event APIs diff --git a/modules/core_api/ut-stubs/src/cfe_evs_stubs.c b/modules/core_api/ut-stubs/src/cfe_evs_stubs.c index 72fd2ec5c..488fcc61b 100644 --- a/modules/core_api/ut-stubs/src/cfe_evs_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_evs_stubs.c @@ -148,17 +148,3 @@ CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, uin return UT_GenStub_GetReturnValue(CFE_EVS_SendTimedEvent, CFE_Status_t); } - -/* - * ---------------------------------------------------- - * Generated stub function for CFE_EVS_Unregister() - * ---------------------------------------------------- - */ -CFE_Status_t CFE_EVS_Unregister(void) -{ - UT_GenStub_SetupReturnBuffer(CFE_EVS_Unregister, CFE_Status_t); - - UT_GenStub_Execute(CFE_EVS_Unregister, Basic, NULL); - - return UT_GenStub_GetReturnValue(CFE_EVS_Unregister, CFE_Status_t); -} diff --git a/modules/evs/fsw/src/cfe_evs.c b/modules/evs/fsw/src/cfe_evs.c index 62513f4ee..59b6b9ea1 100644 --- a/modules/evs/fsw/src/cfe_evs.c +++ b/modules/evs/fsw/src/cfe_evs.c @@ -113,30 +113,6 @@ int32 CFE_EVS_Register(const void *Filters, uint16 NumEventFilters, uint16 Filte return (Status); } -/*---------------------------------------------------------------- - * - * Function: CFE_EVS_Unregister - * - * Implemented per public API - * See description in header file for argument/return detail - * - *-----------------------------------------------------------------*/ -int32 CFE_EVS_Unregister(void) -{ - int32 Status; - CFE_ES_AppId_t AppID; - EVS_AppData_t *AppDataPtr; - - /* Query and verify the caller's AppID */ - Status = EVS_GetCurrentContext(&AppDataPtr, &AppID); - if (Status == CFE_SUCCESS && EVS_AppDataIsMatch(AppDataPtr, AppID)) - { - EVS_AppDataSetFree(AppDataPtr); - } - - return (Status); -} - /*---------------------------------------------------------------- * * Function: CFE_EVS_SendEvent diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index 4bef19928..5318d9d8f 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -184,7 +184,6 @@ int32 CFE_EVS_CleanUpApp(CFE_ES_AppId_t AppID) } else if (EVS_AppDataIsMatch(AppDataPtr, AppID)) { - /* Same cleanup as CFE_EVS_Unregister() */ EVS_AppDataSetFree(AppDataPtr); } diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index c81e0a224..b7d769da8 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -392,12 +392,6 @@ void Test_IllegalAppID(void) UT_Report(__FILE__, __LINE__, CFE_EVS_Register(NULL, 0, 0) == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_Register", "Illegal app ID"); - /* Test unregistering an event using an illegal application ID */ - UT_InitData(); - UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); - UT_Report(__FILE__, __LINE__, CFE_EVS_Unregister() == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_Unregister", - "Illegal app ID"); - /* Test sending an event using an illegal application ID */ UT_InitData(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); @@ -458,10 +452,7 @@ void Test_UnregisteredApp(void) UT_InitData(); /* Unregister the application (it was registered in CFE_EVS_TaskInit) */ - CFE_EVS_Unregister(); - - /* Test unregistering an already unregistered application */ - UT_Report(__FILE__, __LINE__, CFE_EVS_Unregister() == CFE_SUCCESS, "CFE_EVS_Unregister", "App not registered"); + CFE_EVS_CleanUpApp(AppID); /* Test sending an event to an unregistered application */ UT_InitData(); @@ -531,21 +522,14 @@ void Test_FilterRegistration(void) UT_Report(__FILE__, __LINE__, CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY) == CFE_SUCCESS, "CFE_EVS_Register", "Valid w/ no filters"); - /* Test filter unregistration with failed ES_putPool */ - UT_InitData(); - UT_SetDefaultReturnValue(UT_KEY(CFE_ES_PutPoolBuf), -1); - UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetAppID), 1, -1); - UT_Report(__FILE__, __LINE__, CFE_EVS_Unregister() < 0, "CFE_EVS_Unregister", - "Unregistration with failed ES_putPool"); - /* Re-register to test valid unregistration */ UT_InitData(); UT_Report(__FILE__, __LINE__, CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY) == CFE_SUCCESS, "CFE_EVS_Register", "Valid with no filters (re-registration)"); - /* Test successful filter unregistration */ + /* Test successful app cleanup */ UT_InitData(); - UT_Report(__FILE__, __LINE__, CFE_EVS_Unregister() == CFE_SUCCESS, "CFE_EVS_Unregister", "Valid unregistration"); + UT_Report(__FILE__, __LINE__, CFE_EVS_CleanUpApp(AppID) == CFE_SUCCESS, "CFE_EVS_CleanUpApp", "Valid cleanup"); /* Test successful filter registration with a valid filter */ UT_InitData(); From 81283846a39796c089ce37cc955176f4beaceb1f Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 25 May 2021 19:32:14 +0000 Subject: [PATCH 17/26] Fix #1366, Resolve mismatched endforeach of CMakeList.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1765e5dec..c0bb23d19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,5 +122,5 @@ prepare() # Call the process_arch macro for each architecture foreach(SYSVAR ${TGTSYS_LIST}) process_arch(${SYSVAR}) -endforeach(SYSVAR IN LISTS TGTSYS_LIST) +endforeach(SYSVAR ${TGTSYS_LIST}) From 18e4d065589c89a6bc1137d787decf9872ea9d6a Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 25 May 2021 20:17:54 +0000 Subject: [PATCH 18/26] Fix #1390, Improve event filter documentation --- modules/core_api/fsw/inc/cfe_evs.h | 5 +++-- modules/core_api/fsw/inc/cfe_evs_api_typedefs.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_evs.h b/modules/core_api/fsw/inc/cfe_evs.h index b6c8f6b1b..cc9f61669 100644 --- a/modules/core_api/fsw/inc/cfe_evs.h +++ b/modules/core_api/fsw/inc/cfe_evs.h @@ -288,8 +288,9 @@ CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, uin ** \brief Resets the calling application's event filter for a single event ID. ** ** \par Description -** The effect of resetting an event filter depends on the filter scheme. -** The #CFE_EVS_EventFilter_BINARY scheme resets the filter counter for the specified Event ID. +** Resets the filter such that the next event is treated like the first. +** For example, if the filter was set to only send the first event, the +** next event following the reset would be sent. ** ** \par Assumptions, External Events, and Notes: ** None diff --git a/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h b/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h index eb787cdf2..0594c2067 100644 --- a/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h @@ -39,7 +39,9 @@ #include "common_types.h" /* Basic data types */ #include "cfe_evs_extern_typedefs.h" -/** \name Common Event Filter Mask Values */ +/** \name Common Event Filter Mask Values + * Message is sent if (previous event count) & MASK == 0 + */ /** \{ */ #define CFE_EVS_NO_FILTER 0x0000 /**< \brief Stops any filtering. All messages are sent. */ #define CFE_EVS_FIRST_ONE_STOP 0xFFFF /**< \brief Sends the first event. All remaining messages are filtered. */ From 251267a3470859503f02c4d532acbd36448269f7 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 25 May 2021 20:24:30 +0000 Subject: [PATCH 19/26] Fix #1364, Update ES verify errors to match test --- modules/es/fsw/src/cfe_es_verify.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_verify.h b/modules/es/fsw/src/cfe_es_verify.h index 751eb5a0d..886b83d33 100644 --- a/modules/es/fsw/src/cfe_es_verify.h +++ b/modules/es/fsw/src/cfe_es_verify.h @@ -48,7 +48,7 @@ #endif #if CFE_PLATFORM_ES_ER_LOG_ENTRIES < 1 -#error CFE_PLATFORM_ES_ER_LOG_ENTRIES cannot be less than 10! +#error CFE_PLATFORM_ES_ER_LOG_ENTRIES cannot be less than 1! #endif #if CFE_PLATFORM_ES_SYSTEM_LOG_SIZE < 512 @@ -160,7 +160,7 @@ ** Alignment of ES memory pool */ #if CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN <= 0 -#error CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN cannot be 0! +#error CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN cannot be less than or equal to 0! #elif (CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN & (CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN - 1)) != 0 #error CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN must be a power of 2! #endif @@ -169,15 +169,15 @@ ** Intermediate ES Memory Pool Block Sizes */ #if CFE_PLATFORM_ES_MAX_BLOCK_SIZE < CFE_MISSION_SB_MAX_SB_MSG_SIZE -#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_MISSION_SB_MAX_SB_MSG_SIZE! +#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be equal to or larger than CFE_MISSION_SB_MAX_SB_MSG_SIZE! #endif #if CFE_PLATFORM_ES_MAX_BLOCK_SIZE < CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE -#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE! +#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be equal to or larger than CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE! #endif #if CFE_PLATFORM_ES_MAX_BLOCK_SIZE < CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE -#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE! +#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be equal to or larger than CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE! #endif #if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02 From ee6c43d4d7f0d06efe95bd59d2df92d5b9055a7e Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 24 May 2021 18:36:34 +0000 Subject: [PATCH 20/26] Fix #1569, Remove unused CFE_SB_NO_SUBSCRIBERS --- modules/core_api/fsw/inc/cfe_error.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h index 47259cc1a..c0d3187cd 100644 --- a/modules/core_api/fsw/inc/cfe_error.h +++ b/modules/core_api/fsw/inc/cfe_error.h @@ -779,15 +779,6 @@ typedef int32 CFE_Status_t; */ #define CFE_SB_MAX_DESTS_MET ((CFE_Status_t)0xca00000a) -/** - * @brief No Subscribers - * - * This error code is returned by the #CFE_SB_Unsubscribe API if there has - * not been an entry in the routing tables for the MsgId/PipeId given as - * parameters. - */ -#define CFE_SB_NO_SUBSCRIBERS ((CFE_Status_t)0xca00000b) - /** * @brief Internal Error * From d6c00911c60d57dd6b29176e7c66a874bb8934e1 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 24 May 2021 18:45:05 +0000 Subject: [PATCH 21/26] Fix #1452, Document cleanup from SB/MSG/SBR review --- .../core_api/fsw/inc/cfe_msg_api_typedefs.h | 2 +- modules/core_api/fsw/inc/cfe_sb.h | 19 +++++++++++-------- .../core_api/fsw/inc/cfe_sb_api_typedefs.h | 8 +++++--- modules/core_private/fsw/inc/cfe_sbr.h | 2 +- .../msg/option_inc/default_cfe_msg_hdr_pri.h | 3 ++- .../option_inc/default_cfe_msg_hdr_priext.h | 3 ++- modules/sb/fsw/src/cfe_sb_api.c | 4 ++-- modules/sbr/CMakeLists.txt | 2 +- 8 files changed, 25 insertions(+), 18 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h b/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h index b91001bd6..43e89510c 100644 --- a/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h @@ -45,7 +45,7 @@ /* * Types */ -typedef size_t CFE_MSG_Size_t; /**< \brief Message size (CCSDS needs uint32 for max size) */ +typedef size_t CFE_MSG_Size_t; /**< \brief Message size, note CCSDS maximum is UINT16_MAX+7 */ typedef uint32 CFE_MSG_Checksum_t; /**< \brief Message checksum (Oversized to avoid redefine) */ typedef uint16 CFE_MSG_FcnCode_t; /**< \brief Message function code */ typedef uint16 CFE_MSG_HeaderVersion_t; /**< \brief Message header version */ diff --git a/modules/core_api/fsw/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h index 3967688bd..0a04d7a18 100644 --- a/modules/core_api/fsw/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -154,7 +154,7 @@ CFE_Status_t CFE_SB_PipeId_ToIndex(CFE_SB_PipeId_t PipeID, uint32 *Idx); ** ** \param[in] PipeId The pipe ID of the pipe to set options on. ** -** \param[in] Opts A bit field of options. +** \param[in] Opts A bit field of options: \ref CFESBPipeOptions ** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS @@ -173,7 +173,7 @@ CFE_Status_t CFE_SB_SetPipeOpts(CFE_SB_PipeId_t PipeId, uint8 Opts); ** ** \param[in] PipeId The pipe ID of the pipe to get options from. ** -** \param[out] *OptsPtr A bit field of options. +** \param[out] *OptsPtr A bit field of options: \ref CFESBPipeOptions ** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS @@ -312,8 +312,9 @@ CFE_Status_t CFE_SB_Subscribe(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId); ** the specified message ID. This is similar to #CFE_SB_SubscribeEx ** with the Quality field set to #CFE_SB_DEFAULT_QOS and MsgLim set ** to #CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT, but will not report the subscription. -** Subscription Reporting is enabled for interprocessor communication -** by way of the Software Bus Network (SBN) Application. +** +** Software Bus Network (SBN) application is an example use case, +** where local subscriptions should not be reported to peers. ** ** \par Assumptions, External Events, and Notes: ** - This API is typically only used by Software Bus Network (SBN) Application @@ -346,7 +347,8 @@ CFE_Status_t CFE_SB_SubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, ** list for the specified message ID. ** ** \par Assumptions, External Events, and Notes: -** None +** If the Pipe is not subscribed to MsgId, the CFE_SB_UNSUB_NO_SUBS_EID +** event will be generated and #CFE_SUCCESS will be returned ** ** \param[in] MsgId The message ID of the message to be unsubscribed. ** @@ -355,7 +357,6 @@ CFE_Status_t CFE_SB_SubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, ** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_NO_SUBSCRIBERS \copybrief CFE_SB_NO_SUBSCRIBERS ** \retval #CFE_SB_INTERNAL_ERR \copybrief CFE_SB_INTERNAL_ERR ** ** \sa #CFE_SB_Subscribe, #CFE_SB_SubscribeEx, #CFE_SB_SubscribeLocal, #CFE_SB_UnsubscribeLocal @@ -371,7 +372,9 @@ CFE_Status_t CFE_SB_Unsubscribe(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId); ** list for the specified message ID on the current CPU. ** ** \par Assumptions, External Events, and Notes: -** - This API is typically only used by Software Bus Network (SBN) Application +** This API is typically only used by Software Bus Network (SBN) Application. +** If the Pipe is not subscribed to MsgId, the CFE_SB_UNSUB_NO_SUBS_EID +** event will be generated and #CFE_SUCCESS will be returned ** ** \param[in] MsgId The message ID of the message to be unsubscribed. ** @@ -380,7 +383,6 @@ CFE_Status_t CFE_SB_Unsubscribe(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId); ** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_NO_SUBSCRIBERS \copybrief CFE_SB_NO_SUBSCRIBERS ** \retval #CFE_SB_INTERNAL_ERR \copybrief CFE_SB_INTERNAL_ERR ** ** \sa #CFE_SB_Subscribe, #CFE_SB_SubscribeEx, #CFE_SB_SubscribeLocal, #CFE_SB_Unsubscribe @@ -489,6 +491,7 @@ CFE_Status_t CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t Pipe ** It will automatically be freed by SB once all recipients have finished reading it. ** -# Applications must not de-reference the message pointer (for reading ** or writing) after the call to CFE_SB_TransmitBuffer(). +** -# If #CFE_SB_ReleaseMessageBuffer should be used only if a message is not transmitted ** ** \param[in] MsgSize The size of the SB message buffer the caller wants ** (including the SB message header). diff --git a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h index 5cc2e9366..0f7873da0 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -110,11 +110,13 @@ */ #define CFE_SB_INVALID_PIPE CFE_SB_PIPEID_C(CFE_RESOURCEID_UNDEFINED) -/* -** Pipe option bit fields. -*/ +/** + * @defgroup CFESBPipeOptions cFE SB Pipe options + * @{ + */ #define CFE_SB_PIPEOPTS_IGNOREMINE \ 0x00000001 /**< \brief Messages sent by the app that owns this pipe will not be sent to this pipe. */ +/**@}*/ #define CFE_SB_DEFAULT_QOS ((CFE_SB_Qos_t) {0}) /**< \brief Default Qos macro */ diff --git a/modules/core_private/fsw/inc/cfe_sbr.h b/modules/core_private/fsw/inc/cfe_sbr.h index efee0e056..2b351b74b 100644 --- a/modules/core_private/fsw/inc/cfe_sbr.h +++ b/modules/core_private/fsw/inc/cfe_sbr.h @@ -50,7 +50,7 @@ void CFE_SBR_Init(void); /** - * \brief Add a route for the given a message id + * \brief Add a route for the given message id * * Called for the first subscription to a message ID, uses up one * element in the routing table. Assumes check for existing diff --git a/modules/msg/option_inc/default_cfe_msg_hdr_pri.h b/modules/msg/option_inc/default_cfe_msg_hdr_pri.h index ca27a0cd3..dbc7336ee 100644 --- a/modules/msg/option_inc/default_cfe_msg_hdr_pri.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_pri.h @@ -88,7 +88,8 @@ struct CFE_MSG_TelemetryHeader { CFE_MSG_Message_t Msg; /**< \brief Base message */ CFE_MSG_TelemetrySecondaryHeader_t Sec; /**< \brief Secondary header */ - uint8 Spare[4]; /**< \brief Padding to end on 64 bit boundary */ + uint8 Spare[4]; /**< \brief Pad to avoid compiler padding if payload + requires 64 bit alignment */ }; #endif /* DEFAULT_CFE_MSG_HDR_PRI_H */ diff --git a/modules/msg/option_inc/default_cfe_msg_hdr_priext.h b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h index 233f9c799..3205aca87 100644 --- a/modules/msg/option_inc/default_cfe_msg_hdr_priext.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h @@ -74,7 +74,8 @@ typedef struct CFE_MSG_Message_t Msg; /**< \brief Base message */ CFE_MSG_CommandSecondaryHeader_t Sec; /**< \brief Secondary header */ - uint8 Spare[4]; /**< /brief Padding to end on 64 bit boundary */ + uint8 Spare[4]; /**< /brief Pad to avoid compiler padding if payload + requires 64 bit alignment */ } CFE_MSG_CommandHeader_t; diff --git a/modules/sb/fsw/src/cfe_sb_api.c b/modules/sb/fsw/src/cfe_sb_api.c index f991a2cd9..4cc541070 100644 --- a/modules/sb/fsw/src/cfe_sb_api.c +++ b/modules/sb/fsw/src/cfe_sb_api.c @@ -1244,11 +1244,11 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, uint8 /* get routing id */ RouteId = CFE_SBR_GetRouteId(MsgId); - /* if there have never been subscriptions for this message id... */ + /* Status remains CFE_SUCCESS if route is valid or not */ if (!CFE_SBR_IsValidRouteId(RouteId)) { + /* If there are no subscriptions, simply report via event */ PendingEventID = CFE_SB_UNSUB_NO_SUBS_EID; - /* Status stays CFE_SUCCESS here */ } else { diff --git a/modules/sbr/CMakeLists.txt b/modules/sbr/CMakeLists.txt index a8a564a7a..e32ba5e03 100644 --- a/modules/sbr/CMakeLists.txt +++ b/modules/sbr/CMakeLists.txt @@ -30,7 +30,7 @@ elseif (MISSION_MSGMAP_IMPLEMENTATION STREQUAL "HASH") ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_sbr_map_hash.c ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_sbr_route_unsorted.c) else() - message(ERROR "Invalid software bush routing implementation selected:" MISSION_MSGMAP_IMPLEMENTATION) + message(ERROR "Invalid software bus routing implementation selected:" MISSION_MSGMAP_IMPLEMENTATION) endif() # Module library From 560111cdab03da2c9bd843330622cd856acd3f4c Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 26 May 2021 12:38:12 +0000 Subject: [PATCH 22/26] Fix #1362, Simplify file open/truncate logic - Updated CFE_ES_QueryAllCmd handler - Updated CFE_ES_QueryAllTasksCmd handler --- modules/es/fsw/src/cfe_es_task.c | 24 ++---------------------- modules/es/ut-coverage/es_UT.c | 17 ----------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index 4cfdbc6b1..617514e68 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -1317,17 +1317,7 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) if (Result == CFE_SUCCESS) { /* - ** Check to see if the file already exists - */ - Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY); - if (Result >= 0) - { - OS_close(FileDescriptor); - OS_remove(QueryAllFilename); - } - - /* - ** Create ES task log data file + ** Create (or truncate) ES task log data file */ Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); @@ -1469,17 +1459,7 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data) if (Result == CFE_SUCCESS) { /* - ** Check to see if the file already exists - */ - Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY); - if (Result >= 0) - { - OS_close(FileDescriptor); - OS_remove(QueryAllFilename); - } - - /* - ** Create ES task log data file + ** Create (or truncate) ES task log data file */ Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index ad08647dc..f788e2704 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -3151,14 +3151,6 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_LEN_ERR_EID), "CFE_ES_QueryAllAppCmd", "Query all applications command; invalid command length"); - /* Test write of all app data to file with a file open failure */ - ES_ResetUnitTest(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_SetDeferredRetcode(UT_KEY(OS_OpenCreate), 1, OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); - UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_ALL_APPS_EID), "CFE_ES_QueryAllCmd", - "Write application information file fail; file open"); - /* Test sending a write request for all tasks with an * invalid command length */ @@ -3167,15 +3159,6 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_LEN_ERR_EID), "CFE_ES_QueryAllAppCmd", "Query all tasks command; invalid command length"); - /* Test write of all task data to file with a file open failure */ - ES_ResetUnitTest(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_SetDeferredRetcode(UT_KEY(OS_OpenCreate), 1, OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), - UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); - UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_TASKINFO_EID), "CFE_ES_QueryAllCmd", - "Write task information file fail; file open"); - /* Test sending a request to clear the system log with an * invalid command length */ From 13eb53f6c3f44f4282edc624a319903c8c1a8193 Mon Sep 17 00:00:00 2001 From: ArielSAdamsNASA Date: Thu, 13 May 2021 12:12:57 -0500 Subject: [PATCH 23/26] Fix #1512, Add Coding Standard Rules in CodeQL --- .github/workflows/codeql-build.yml | 73 ++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 1f9571b3b..3eb1cd3b6 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -11,8 +11,23 @@ env: BUILDTYPE: release jobs: + #Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action. + check-for-duplicates: + runs-on: ubuntu-latest + # Map a step output to a job output + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + with: + concurrent_skipping: 'same_content' + skip_after_successful_duplicate: 'true' + do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' - CodeQL-Build: + CodeQL-Security-Build: + needs: check-for-duplicates + if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }} runs-on: ubuntu-18.04 timeout-minutes: 15 @@ -35,8 +50,8 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: - languages: c - queries: +security-extended, security-and-quality + languages: c + config-file: nasa/cFS/.github/codeql/codeql-security.yml@main # Setup the build system - name: Set up for build @@ -44,11 +59,59 @@ jobs: cp ./cfe/cmake/Makefile.sample Makefile cp -r ./cfe/cmake/sample_defs sample_defs make prep - + # Build the code - name: Build run: | make -C build/native/default_cpu1 core_api core_private es evs fs msg resourceid sb sbr tbl time - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 + + CodeQL-Coding-Standard-Build: + needs: check-for-duplicates + if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }} + runs-on: ubuntu-18.04 + timeout-minutes: 15 + + steps: + # Checks out a copy of your repository on the ubuntu-latest machine + - name: Checkout bundle + uses: actions/checkout@v2 + with: + repository: nasa/cFS + submodules: true + + - name: Checkout submodule + uses: actions/checkout@v2 + with: + path: cfe + + - name: Check versions + run: git submodule + + - name: Checkout codeql code + uses: actions/checkout@v2 + with: + repository: github/codeql + submodules: true + path: codeql + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: c + config-file: nasa/cFS/.github/codeql/codeql-coding-standard.yml@main + + # Setup the build system + - name: Set up for build + run: | + cp ./cfe/cmake/Makefile.sample Makefile + cp -r ./cfe/cmake/sample_defs sample_defs + make prep + + # Build the code + - name: Build + run: | + make -C build/native/default_cpu1 core_api core_private es evs fs msg resourceid sb sbr tbl time + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 \ No newline at end of file From acea60e6a7cc897ba41589191138f7b96d3728b3 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Thu, 27 May 2021 13:12:31 -0400 Subject: [PATCH 24/26] IC:2021-06-01, Remove deprecated doxygen reference HOTFIX, `CFE_ES_CDS_REGISTRY_FULL` is deprecated --- modules/core_api/fsw/inc/cfe_es.h | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/core_api/fsw/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h index 1a1bf69d9..d40ad92ad 100644 --- a/modules/core_api/fsw/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -1044,7 +1044,6 @@ void CFE_ES_ProcessAsyncEvent(void); ** \retval #CFE_ES_CDS_ALREADY_EXISTS \copybrief CFE_ES_CDS_ALREADY_EXISTS ** \retval #CFE_ES_CDS_INVALID_SIZE \copybrief CFE_ES_CDS_INVALID_SIZE ** \retval #CFE_ES_CDS_INVALID_NAME \copybrief CFE_ES_CDS_INVALID_NAME -** \retval #CFE_ES_CDS_REGISTRY_FULL \copybrief CFE_ES_CDS_REGISTRY_FULL ** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_CopyToCDS, #CFE_ES_RestoreFromCDS From 16196d48b391f2564755923b1d7cdcf8970e850b Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Tue, 1 Jun 2021 10:21:55 -0400 Subject: [PATCH 25/26] Fix #1585, Fix Calculate CRC header return description. --- modules/core_api/fsw/inc/cfe_es.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core_api/fsw/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h index edaf23745..70b11d108 100644 --- a/modules/core_api/fsw/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -984,7 +984,9 @@ CFE_Status_t CFE_ES_WriteToSysLog(const char *SpecStringPtr, ...) OS_PRINTF(1, 2 ** XorOut: 0x0000 ** \arg \c CFE_MISSION_ES_CRC_32 - (not currently implemented) ** -** \return The result of the CRC calculation on the specified memory block, or error code \ref CFEReturnCodes +** \return The result of the CRC calculation on the specified memory block. +** If the TypeCRC is unimplemented will return 0. +** If DataPtr is null or DataLength is 0, will return InputCRC ** ******************************************************************************/ uint32 CFE_ES_CalculateCRC(const void *DataPtr, size_t DataLength, uint32 InputCRC, uint32 TypeCRC); From 66378f9cf1b8539d6f889fe43c4472d69ba32ad4 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Tue, 8 Jun 2021 12:33:56 -0400 Subject: [PATCH 26/26] IC:2021-06-01, Bump to v6.8.0-rc1+dev642 --- README.md | 26 ++++++++++++++++++++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ffbb07e7b..e0447a101 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,32 @@ The detailed cFE user's guide can be viewed at and + ### Development Build: v6.8.0-rc1+dev593 - Uses `int` with %d conversions inUtAssert_True and UtPrintf for platform portability. diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 2b9284959..e1b71a6d3 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -28,7 +28,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 593 /*!< Development Build: Number of commits since baseline */ +#define CFE_BUILD_NUMBER 642 /*!< Development Build: Number of commits since baseline */ #define CFE_BUILD_BASELINE \ "v6.8.0-rc1" /*!< Development Build: git tag that is the base for the current development \ */