From 8aa153b21e0ddb565edd52b0a8f4d12098dbbc7c Mon Sep 17 00:00:00 2001 From: oliverhamburger Date: Wed, 14 Jul 2021 14:12:25 -0400 Subject: [PATCH 001/200] Fix #1546, use cfe time clock state enum t in cmd/tlm and handling --- modules/time/fsw/inc/cfe_time_msg.h | 33 ++++++++++++++------------- modules/time/fsw/src/cfe_time_utils.c | 8 +++---- modules/time/fsw/src/cfe_time_utils.h | 12 +++++----- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/modules/time/fsw/inc/cfe_time_msg.h b/modules/time/fsw/inc/cfe_time_msg.h index 3924fe4ec..d0ac1092f 100644 --- a/modules/time/fsw/inc/cfe_time_msg.h +++ b/modules/time/fsw/inc/cfe_time_msg.h @@ -767,10 +767,11 @@ typedef struct CFE_TIME_SetLeapSecondsCmd */ typedef struct CFE_TIME_StateCmd_Payload { - int16 ClockState; /**< \brief #CFE_TIME_ClockState_INVALID=Spacecraft time has not been accurately set, - #CFE_TIME_ClockState_VALID=Spacecraft clock has been accurately set, - #CFE_TIME_ClockState_FLYWHEEL=Force into FLYWHEEL mode */ - /**< Selects the current clock state */ + CFE_TIME_ClockState_Enum_t ClockState; /**< \brief #CFE_TIME_ClockState_INVALID=Spacecraft time has + not been accurately set, #CFE_TIME_ClockState_VALID=Spacecraft clock + has been accurately set, #CFE_TIME_ClockState_FLYWHEEL=Force into + FLYWHEEL mode */ + /**< Selects the current clock state */ } CFE_TIME_StateCmd_Payload_t; /** @@ -883,10 +884,10 @@ typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Sub1HZAdjustmentCmd_t; */ typedef struct CFE_TIME_ToneDataCmd_Payload { - CFE_TIME_SysTime_t AtToneMET; /**< \brief MET at time of tone */ - CFE_TIME_SysTime_t AtToneSTCF; /**< \brief STCF at time of tone */ - int16 AtToneLeapSeconds; /**< \brief Leap Seconds at time of tone */ - int16 AtToneState; /**< \brief Clock state at time of tone */ + CFE_TIME_SysTime_t AtToneMET; /**< \brief MET at time of tone */ + CFE_TIME_SysTime_t AtToneSTCF; /**< \brief STCF at time of tone */ + int16 AtToneLeapSeconds; /**< \brief Leap Seconds at time of tone */ + CFE_TIME_ClockState_Enum_t AtToneState; /**< \brief Clock state at time of tone */ } CFE_TIME_ToneDataCmd_Payload_t; /** @@ -916,10 +917,10 @@ typedef struct CFE_TIME_HousekeepingTlm_Payload /* ** Clock state flags and "as calculated" clock state... */ - uint16 ClockStateFlags; /**< \cfetlmmnemonic \TIME_STATEFLG - \brief State Flags */ - int16 ClockStateAPI; /**< \cfetlmmnemonic \TIME_APISTATE - \brief API State */ + uint16 ClockStateFlags; /**< \cfetlmmnemonic \TIME_STATEFLG + \brief State Flags */ + CFE_TIME_ClockState_Enum_t ClockStateAPI; /**< \cfetlmmnemonic + \TIME_APISTATE \brief API State */ /* ** Leap Seconds... @@ -987,10 +988,10 @@ typedef struct CFE_TIME_DiagnosticTlm_Payload CFE_TIME_SysTime_t AtToneLatch; /**< \cfetlmmnemonic \TIME_TVALIDS \brief Local clock latched at time of tone */ - int16 AtToneLeapSeconds; /**< \cfetlmmnemonic \TIME_LEAPS - \brief Leap Seconds at time of tone */ - int16 ClockStateAPI; /**< \cfetlmmnemonic \TIME_APISTATE - \brief Clock state as per API */ + int16 AtToneLeapSeconds; /**< \cfetlmmnemonic \TIME_LEAPS + \brief Leap Seconds at time of tone */ + CFE_TIME_ClockState_Enum_t ClockStateAPI; /**< \cfetlmmnemonic \TIME_APISTATE + \brief Clock state as per API */ /* ** Data values that reflect the time (right now)... diff --git a/modules/time/fsw/src/cfe_time_utils.c b/modules/time/fsw/src/cfe_time_utils.c index aee970c9d..5b6d20129 100644 --- a/modules/time/fsw/src/cfe_time_utils.c +++ b/modules/time/fsw/src/cfe_time_utils.c @@ -393,7 +393,7 @@ void CFE_TIME_GetHkData(const CFE_TIME_Reference_t *Reference) /* ** Current "as calculated" clock state... */ - CFE_TIME_Global.HkPacket.Payload.ClockStateAPI = (int16)CFE_TIME_CalculateState(Reference); + CFE_TIME_Global.HkPacket.Payload.ClockStateAPI = (CFE_TIME_ClockState_Enum_t)CFE_TIME_CalculateState(Reference); /* ** Current clock state flags... @@ -728,9 +728,9 @@ CFE_TIME_SysTime_t CFE_TIME_CalculateUTC(const CFE_TIME_Reference_t *Reference) * See description in header file for argument/return detail * *-----------------------------------------------------------------*/ -int16 CFE_TIME_CalculateState(const CFE_TIME_Reference_t *Reference) +CFE_TIME_ClockState_Enum_t CFE_TIME_CalculateState(const CFE_TIME_Reference_t *Reference) { - int16 ClockState; + CFE_TIME_ClockState_Enum_t ClockState; /* ** Determine the current clock state... @@ -782,7 +782,7 @@ int16 CFE_TIME_CalculateState(const CFE_TIME_Reference_t *Reference) * See description in header file for argument/return detail * *-----------------------------------------------------------------*/ -void CFE_TIME_SetState(int16 NewState) +void CFE_TIME_SetState(CFE_TIME_ClockState_Enum_t NewState) { volatile CFE_TIME_ReferenceState_t *RefState; diff --git a/modules/time/fsw/src/cfe_time_utils.h b/modules/time/fsw/src/cfe_time_utils.h index ec08f7aa6..fc9d3156c 100644 --- a/modules/time/fsw/src/cfe_time_utils.h +++ b/modules/time/fsw/src/cfe_time_utils.h @@ -186,10 +186,10 @@ typedef struct /* ** Pending data values (from "time at tone" command data)... */ - CFE_TIME_SysTime_t PendingMET; - CFE_TIME_SysTime_t PendingSTCF; - int16 PendingLeaps; - int16 PendingState; + CFE_TIME_SysTime_t PendingMET; + CFE_TIME_SysTime_t PendingSTCF; + int16 PendingLeaps; + CFE_TIME_ClockState_Enum_t PendingState; /* ** STCF adjustment values... @@ -395,13 +395,13 @@ CFE_TIME_SysTime_t CFE_TIME_CalculateUTC(const CFE_TIME_Reference_t *Reference); /** * @brief determine current time state (per API) */ -int16 CFE_TIME_CalculateState(const CFE_TIME_Reference_t *Reference); +CFE_TIME_ClockState_Enum_t CFE_TIME_CalculateState(const CFE_TIME_Reference_t *Reference); /*---------------------------------------------------------------------------------------*/ /** * @brief set clock state */ -void CFE_TIME_SetState(int16 NewState); +void CFE_TIME_SetState(CFE_TIME_ClockState_Enum_t NewState); #if (CFE_PLATFORM_TIME_CFG_SOURCE == true) From bc2a58f8ebde08fc741bb45df4606d4673d86be8 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 4 Aug 2021 20:12:30 -0500 Subject: [PATCH 002/200] Fix #1672, return type conversions in CFE_ES_GetTaskName Provide better status code conversion from OS_GetResourceName --- modules/cfe_testcase/src/es_task_test.c | 2 +- modules/es/fsw/src/cfe_es_api.c | 14 +++++++++++++- modules/es/ut-coverage/es_UT.c | 6 +++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/modules/cfe_testcase/src/es_task_test.c b/modules/cfe_testcase/src/es_task_test.c index bd9f64bf4..9c35feac8 100644 --- a/modules/cfe_testcase/src/es_task_test.c +++ b/modules/cfe_testcase/src/es_task_test.c @@ -120,7 +120,7 @@ void TestChildTaskName(void) UtAssert_INT32_EQ(CFE_ES_GetTaskName(NULL, TaskId, sizeof(TaskNameBuf)), CFE_ES_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_ES_GetTaskName(TaskNameBuf, CFE_ES_TASKID_UNDEFINED, sizeof(TaskNameBuf)), CFE_ES_ERR_RESOURCEID_NOT_VALID); - UtAssert_INT32_EQ(CFE_ES_GetTaskName(TaskNameBuf, TaskId, sizeof(TaskName) - 4), CFE_ES_ERR_RESOURCEID_NOT_VALID); + UtAssert_INT32_EQ(CFE_ES_GetTaskName(TaskNameBuf, TaskId, sizeof(TaskName) - 4), CFE_ES_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_ES_DeleteChildTask(TaskId), CFE_SUCCESS); } diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index dd8c3094b..bcc699542 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -1000,10 +1000,22 @@ CFE_Status_t CFE_ES_GetTaskName(char *TaskName, CFE_ES_TaskId_t TaskId, size_t B OsalId = CFE_ES_TaskId_ToOSAL(TaskId); OsStatus = OS_GetResourceName(OsalId, TaskName, BufferLength); - if (OsStatus != OS_SUCCESS) + if (OsStatus == OS_ERR_INVALID_ID) { + /* Supplied ID is not a CFE task */ return CFE_ES_ERR_RESOURCEID_NOT_VALID; } + if (OsStatus == OS_ERR_NAME_TOO_LONG) + { + /* Name is too long to fit in supplied buffer */ + return CFE_ES_BAD_ARGUMENT; + } + if (OsStatus != OS_SUCCESS) + { + /* Some other uncaught error */ + CFE_ES_WriteToSysLog("%s(): Unexpected error from OS_GetResourceName(): %ld", __func__, (long)OsStatus); + return CFE_STATUS_EXTERNAL_RESOURCE_FAIL; + } return CFE_SUCCESS; } diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index cf315f6d5..fb905d0d5 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -4004,8 +4004,12 @@ void TestAPI(void) CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_ES_GetTaskName(NULL, TaskId, sizeof(AppName)), CFE_ES_BAD_ARGUMENT); CFE_UtAssert_SUCCESS(CFE_ES_GetTaskName(AppName, TaskId, sizeof(AppName))); - UT_SetDeferredRetcode(UT_KEY(OS_GetResourceName), 1, OS_ERROR); + UT_SetDeferredRetcode(UT_KEY(OS_GetResourceName), 1, OS_ERR_INVALID_ID); UtAssert_INT32_EQ(CFE_ES_GetTaskName(AppName, TaskId, sizeof(AppName)), CFE_ES_ERR_RESOURCEID_NOT_VALID); + UT_SetDeferredRetcode(UT_KEY(OS_GetResourceName), 1, OS_ERR_NAME_TOO_LONG); + UtAssert_INT32_EQ(CFE_ES_GetTaskName(AppName, TaskId, sizeof(AppName)), CFE_ES_BAD_ARGUMENT); + UT_SetDeferredRetcode(UT_KEY(OS_GetResourceName), 1, OS_ERROR); + UtAssert_INT32_EQ(CFE_ES_GetTaskName(AppName, TaskId, sizeof(AppName)), CFE_STATUS_EXTERNAL_RESOURCE_FAIL); UtAssert_INT32_EQ(CFE_ES_GetTaskIDByName(&TaskId, NULL), CFE_ES_BAD_ARGUMENT); CFE_UtAssert_SUCCESS(CFE_ES_GetTaskIDByName(&TaskId, AppName)); From d81ad3d15820f1842d9ad83a0b1afce08ede9b1c Mon Sep 17 00:00:00 2001 From: pavll Date: Sat, 28 Aug 2021 23:36:14 +0200 Subject: [PATCH 003/200] Fix #1319, Remove extern from function prototypes --- modules/core_api/ut-stubs/src/cfe_es_stubs.c | 32 ++++++++--------- modules/core_api/ut-stubs/src/cfe_evs_stubs.c | 6 ++-- modules/core_api/ut-stubs/src/cfe_fs_stubs.c | 18 +++++----- modules/core_api/ut-stubs/src/cfe_msg_stubs.c | 36 +++++++++---------- .../ut-stubs/src/cfe_resourceid_stubs.c | 8 ++--- modules/core_api/ut-stubs/src/cfe_sb_stubs.c | 30 ++++++++-------- modules/core_api/ut-stubs/src/cfe_tbl_stubs.c | 6 ++-- .../core_api/ut-stubs/src/cfe_time_stubs.c | 18 +++++----- .../fsw/inc/cfe_es_core_internal.h | 4 +-- .../fsw/inc/cfe_evs_core_internal.h | 6 ++-- .../fsw/inc/cfe_fs_core_internal.h | 2 +- .../fsw/inc/cfe_sb_core_internal.h | 6 ++-- .../fsw/inc/cfe_tbl_core_internal.h | 6 ++-- .../fsw/inc/cfe_time_core_internal.h | 6 ++-- .../ut-stubs/src/cfe_es_core_internal_stubs.c | 2 +- .../ut-stubs/src/cfe_fs_core_internal_stubs.c | 2 +- .../core_private/ut-stubs/src/ut_support.c | 2 +- modules/es/fsw/src/cfe_es_global.h | 6 ++-- modules/es/fsw/src/cfe_es_resource.h | 16 ++++----- modules/es/fsw/src/cfe_es_start.h | 10 +++--- modules/es/ut-coverage/es_UT.c | 2 +- modules/evs/fsw/src/cfe_evs_task.h | 4 +-- modules/fs/fsw/src/cfe_fs_priv.h | 8 ++--- modules/sb/fsw/src/cfe_sb_priv.h | 2 +- modules/tbl/fsw/src/cfe_tbl_internal.h | 2 +- modules/tbl/fsw/src/cfe_tbl_task.h | 2 +- modules/tbl/fsw/src/cfe_tbl_task_cmds.h | 8 ++--- 27 files changed, 125 insertions(+), 125 deletions(-) diff --git a/modules/core_api/ut-stubs/src/cfe_es_stubs.c b/modules/core_api/ut-stubs/src/cfe_es_stubs.c index 9f36afda0..5a1a75c2c 100644 --- a/modules/core_api/ut-stubs/src/cfe_es_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_es_stubs.c @@ -29,22 +29,22 @@ #include "cfe_es.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_ES_AppID_ToIndex(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_CopyToCDS(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_ExitApp(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_GetAppID(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_GetAppIDByName(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_GetAppName(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_GetPoolBuf(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_GetResetType(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_GetTaskID(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_GetTaskInfo(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_PoolCreate(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_PoolCreateNoSem(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_RestoreFromCDS(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_RunLoop(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_TaskID_ToIndex(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ES_WriteToSysLog(void *, UT_EntryKey_t, const UT_StubContext_t *, va_list); +void UT_DefaultHandler_CFE_ES_AppID_ToIndex(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_CopyToCDS(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_ExitApp(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_GetAppID(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_GetAppIDByName(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_GetAppName(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_GetPoolBuf(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_GetResetType(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_GetTaskID(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_GetTaskInfo(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_PoolCreate(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_PoolCreateNoSem(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_RestoreFromCDS(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_RunLoop(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_TaskID_ToIndex(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_WriteToSysLog(void *, UT_EntryKey_t, const UT_StubContext_t *, va_list); /* * ---------------------------------------------------- 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 d3c4560f2..e71bf88de 100644 --- a/modules/core_api/ut-stubs/src/cfe_evs_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_evs_stubs.c @@ -29,9 +29,9 @@ #include "cfe_evs.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_EVS_SendEvent(void *, UT_EntryKey_t, const UT_StubContext_t *, va_list); -extern void UT_DefaultHandler_CFE_EVS_SendEventWithAppID(void *, UT_EntryKey_t, const UT_StubContext_t *, va_list); -extern void UT_DefaultHandler_CFE_EVS_SendTimedEvent(void *, UT_EntryKey_t, const UT_StubContext_t *, va_list); +void UT_DefaultHandler_CFE_EVS_SendEvent(void *, UT_EntryKey_t, const UT_StubContext_t *, va_list); +void UT_DefaultHandler_CFE_EVS_SendEventWithAppID(void *, UT_EntryKey_t, const UT_StubContext_t *, va_list); +void UT_DefaultHandler_CFE_EVS_SendTimedEvent(void *, UT_EntryKey_t, const UT_StubContext_t *, va_list); /* * ---------------------------------------------------- diff --git a/modules/core_api/ut-stubs/src/cfe_fs_stubs.c b/modules/core_api/ut-stubs/src/cfe_fs_stubs.c index 7e447664e..3485b325b 100644 --- a/modules/core_api/ut-stubs/src/cfe_fs_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_fs_stubs.c @@ -27,15 +27,15 @@ #include "cfe_fs.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_FS_BackgroundFileDumpIsPending(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_FS_BackgroundFileDumpRequest(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_FS_ExtractFilenameFromPath(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_FS_GetDefaultExtension(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_FS_GetDefaultMountPoint(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_FS_ParseInputFileName(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_FS_ParseInputFileNameEx(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_FS_ReadHeader(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_FS_WriteHeader(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_BackgroundFileDumpIsPending(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_BackgroundFileDumpRequest(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_ExtractFilenameFromPath(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_GetDefaultExtension(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_GetDefaultMountPoint(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_ParseInputFileName(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_ParseInputFileNameEx(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_ReadHeader(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_WriteHeader(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_api/ut-stubs/src/cfe_msg_stubs.c b/modules/core_api/ut-stubs/src/cfe_msg_stubs.c index 1c5b6059f..6168f7bbe 100644 --- a/modules/core_api/ut-stubs/src/cfe_msg_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_msg_stubs.c @@ -27,24 +27,24 @@ #include "cfe_msg.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_MSG_GetApId(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetEDSVersion(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetEndian(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetFcnCode(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetHasSecondaryHeader(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetHeaderVersion(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetMsgId(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetMsgTime(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetNextSequenceCount(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetPlaybackFlag(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetSegmentationFlag(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetSequenceCount(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetSize(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetSubsystem(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetSystem(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetType(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_GetTypeFromMsgId(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_MSG_ValidateChecksum(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetApId(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetEDSVersion(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetEndian(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetFcnCode(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetHasSecondaryHeader(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetHeaderVersion(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetMsgId(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetMsgTime(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetNextSequenceCount(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetPlaybackFlag(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetSegmentationFlag(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetSequenceCount(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetSize(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetSubsystem(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetSystem(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetType(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_GetTypeFromMsgId(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_MSG_ValidateChecksum(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_api/ut-stubs/src/cfe_resourceid_stubs.c b/modules/core_api/ut-stubs/src/cfe_resourceid_stubs.c index 7eb1c7c7b..f565a79f3 100644 --- a/modules/core_api/ut-stubs/src/cfe_resourceid_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_resourceid_stubs.c @@ -27,10 +27,10 @@ #include "cfe_resourceid.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_ResourceId_FindNext(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ResourceId_GetBase(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ResourceId_GetSerial(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_ResourceId_ToIndex(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ResourceId_FindNext(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ResourceId_GetBase(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ResourceId_GetSerial(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ResourceId_ToIndex(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_api/ut-stubs/src/cfe_sb_stubs.c b/modules/core_api/ut-stubs/src/cfe_sb_stubs.c index 711cb8a85..005099647 100644 --- a/modules/core_api/ut-stubs/src/cfe_sb_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_sb_stubs.c @@ -27,21 +27,21 @@ #include "cfe_sb.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_SB_AllocateMessageBuffer(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_CreatePipe(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_DeletePipe(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_GetPipeIdByName(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_GetPipeName(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_GetUserData(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_GetUserDataLength(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_IsValidMsgId(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_MessageStringGet(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_MessageStringSet(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_ReceiveBuffer(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_SetUserDataLength(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_TimeStampMsg(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_TransmitBuffer(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_SB_TransmitMsg(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_AllocateMessageBuffer(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_CreatePipe(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_DeletePipe(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_GetPipeIdByName(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_GetPipeName(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_GetUserData(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_GetUserDataLength(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_IsValidMsgId(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_MessageStringGet(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_MessageStringSet(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_ReceiveBuffer(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_SetUserDataLength(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_TimeStampMsg(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_TransmitBuffer(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_SB_TransmitMsg(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_api/ut-stubs/src/cfe_tbl_stubs.c b/modules/core_api/ut-stubs/src/cfe_tbl_stubs.c index c0c28d727..d063d91cb 100644 --- a/modules/core_api/ut-stubs/src/cfe_tbl_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_tbl_stubs.c @@ -27,9 +27,9 @@ #include "cfe_tbl.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_TBL_GetAddress(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TBL_GetInfo(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TBL_Register(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TBL_GetAddress(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TBL_GetInfo(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TBL_Register(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_api/ut-stubs/src/cfe_time_stubs.c b/modules/core_api/ut-stubs/src/cfe_time_stubs.c index 722a176e2..dc436599a 100644 --- a/modules/core_api/ut-stubs/src/cfe_time_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_time_stubs.c @@ -27,15 +27,15 @@ #include "cfe_time.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_TIME_Add(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TIME_GetMET(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TIME_GetSTCF(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TIME_GetTAI(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TIME_GetTime(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TIME_GetUTC(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TIME_MET2SCTime(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TIME_Print(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_TIME_Subtract(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_Add(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_GetMET(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_GetSTCF(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_GetTAI(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_GetTime(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_GetUTC(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_MET2SCTime(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_Print(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_TIME_Subtract(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_private/fsw/inc/cfe_es_core_internal.h b/modules/core_private/fsw/inc/cfe_es_core_internal.h index 257c7d24f..86237f229 100644 --- a/modules/core_private/fsw/inc/cfe_es_core_internal.h +++ b/modules/core_private/fsw/inc/cfe_es_core_internal.h @@ -59,7 +59,7 @@ ** None ** ******************************************************************************/ -extern void CFE_ES_TaskMain(void); +void CFE_ES_TaskMain(void); /*****************************************************************************/ /** @@ -72,7 +72,7 @@ extern void CFE_ES_TaskMain(void); ** -# This function MUST be called before any module API's are called. ** ******************************************************************************/ -extern int32 CFE_ES_CDS_EarlyInit(void); +int32 CFE_ES_CDS_EarlyInit(void); /*****************************************************************************/ /** diff --git a/modules/core_private/fsw/inc/cfe_evs_core_internal.h b/modules/core_private/fsw/inc/cfe_evs_core_internal.h index 694833da3..712f96baf 100644 --- a/modules/core_private/fsw/inc/cfe_evs_core_internal.h +++ b/modules/core_private/fsw/inc/cfe_evs_core_internal.h @@ -59,7 +59,7 @@ ** None ** ******************************************************************************/ -extern void CFE_EVS_TaskMain(void); +void CFE_EVS_TaskMain(void); /*****************************************************************************/ /** @@ -72,7 +72,7 @@ extern void CFE_EVS_TaskMain(void); ** -# This function MUST be called before any module API's are called. ** ******************************************************************************/ -extern int32 CFE_EVS_EarlyInit(void); +int32 CFE_EVS_EarlyInit(void); /*****************************************************************************/ /** @@ -84,7 +84,7 @@ extern int32 CFE_EVS_EarlyInit(void); ** that have been allocated to the specified Application. ** ******************************************************************************/ -extern int32 CFE_EVS_CleanUpApp(CFE_ES_AppId_t AppId); +int32 CFE_EVS_CleanUpApp(CFE_ES_AppId_t AppId); /**@}*/ diff --git a/modules/core_private/fsw/inc/cfe_fs_core_internal.h b/modules/core_private/fsw/inc/cfe_fs_core_internal.h index 2a1d11b1f..2533fcedd 100644 --- a/modules/core_private/fsw/inc/cfe_fs_core_internal.h +++ b/modules/core_private/fsw/inc/cfe_fs_core_internal.h @@ -53,7 +53,7 @@ ** -# This function MUST be called before any module API's are called. ** ******************************************************************************/ -extern int32 CFE_FS_EarlyInit(void); +int32 CFE_FS_EarlyInit(void); /*****************************************************************************/ /** diff --git a/modules/core_private/fsw/inc/cfe_sb_core_internal.h b/modules/core_private/fsw/inc/cfe_sb_core_internal.h index 25ee96929..673fe7510 100644 --- a/modules/core_private/fsw/inc/cfe_sb_core_internal.h +++ b/modules/core_private/fsw/inc/cfe_sb_core_internal.h @@ -56,7 +56,7 @@ ** None ** ******************************************************************************/ -extern void CFE_SB_TaskMain(void); +void CFE_SB_TaskMain(void); /*****************************************************************************/ /** @@ -69,7 +69,7 @@ extern void CFE_SB_TaskMain(void); ** -# This function MUST be called before any module API's are called. ** ******************************************************************************/ -extern int32 CFE_SB_EarlyInit(void); +int32 CFE_SB_EarlyInit(void); /*****************************************************************************/ /** @@ -81,7 +81,7 @@ extern int32 CFE_SB_EarlyInit(void); ** that have been allocated to the specified Application. ** ******************************************************************************/ -extern int32 CFE_SB_CleanUpApp(CFE_ES_AppId_t AppId); +int32 CFE_SB_CleanUpApp(CFE_ES_AppId_t AppId); /**@}*/ diff --git a/modules/core_private/fsw/inc/cfe_tbl_core_internal.h b/modules/core_private/fsw/inc/cfe_tbl_core_internal.h index b298b2054..36a0a8da6 100644 --- a/modules/core_private/fsw/inc/cfe_tbl_core_internal.h +++ b/modules/core_private/fsw/inc/cfe_tbl_core_internal.h @@ -64,7 +64,7 @@ ** None ** ******************************************************************************/ -extern void CFE_TBL_TaskMain(void); +void CFE_TBL_TaskMain(void); /*****************************************************************************/ /** @@ -77,7 +77,7 @@ extern void CFE_TBL_TaskMain(void); ** -# This function MUST be called before any TBL API's are called. ** ******************************************************************************/ -extern int32 CFE_TBL_EarlyInit(void); +int32 CFE_TBL_EarlyInit(void); /*****************************************************************************/ /** @@ -93,7 +93,7 @@ extern int32 CFE_TBL_EarlyInit(void); ** the specified application from the Critical Data Store. ** ******************************************************************************/ -extern int32 CFE_TBL_CleanUpApp(CFE_ES_AppId_t AppId); +int32 CFE_TBL_CleanUpApp(CFE_ES_AppId_t AppId); /**@}*/ diff --git a/modules/core_private/fsw/inc/cfe_time_core_internal.h b/modules/core_private/fsw/inc/cfe_time_core_internal.h index 0c0fc5839..c883eb65c 100644 --- a/modules/core_private/fsw/inc/cfe_time_core_internal.h +++ b/modules/core_private/fsw/inc/cfe_time_core_internal.h @@ -56,7 +56,7 @@ ** None ** ******************************************************************************/ -extern void CFE_TIME_TaskMain(void); +void CFE_TIME_TaskMain(void); /*****************************************************************************/ /** @@ -69,7 +69,7 @@ extern void CFE_TIME_TaskMain(void); ** -# This function MUST be called before any module API's are called. ** ******************************************************************************/ -extern int32 CFE_TIME_EarlyInit(void); +int32 CFE_TIME_EarlyInit(void); /*****************************************************************************/ /** @@ -81,7 +81,7 @@ extern int32 CFE_TIME_EarlyInit(void); ** that have been allocated to the specified Application. ** ******************************************************************************/ -extern int32 CFE_TIME_CleanUpApp(CFE_ES_AppId_t AppId); +int32 CFE_TIME_CleanUpApp(CFE_ES_AppId_t AppId); /**@}*/ diff --git a/modules/core_private/ut-stubs/src/cfe_es_core_internal_stubs.c b/modules/core_private/ut-stubs/src/cfe_es_core_internal_stubs.c index c3f75ef0f..ff53a95da 100644 --- a/modules/core_private/ut-stubs/src/cfe_es_core_internal_stubs.c +++ b/modules/core_private/ut-stubs/src/cfe_es_core_internal_stubs.c @@ -27,7 +27,7 @@ #include "cfe_es_core_internal.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_ES_RegisterCDSEx(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_RegisterCDSEx(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_private/ut-stubs/src/cfe_fs_core_internal_stubs.c b/modules/core_private/ut-stubs/src/cfe_fs_core_internal_stubs.c index 8b4c3e176..f9540e6a1 100644 --- a/modules/core_private/ut-stubs/src/cfe_fs_core_internal_stubs.c +++ b/modules/core_private/ut-stubs/src/cfe_fs_core_internal_stubs.c @@ -27,7 +27,7 @@ #include "cfe_fs_core_internal.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_FS_RunBackgroundFileDump(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_FS_RunBackgroundFileDump(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_private/ut-stubs/src/ut_support.c b/modules/core_private/ut-stubs/src/ut_support.c index 5f50655fa..c8a43afa1 100644 --- a/modules/core_private/ut-stubs/src/ut_support.c +++ b/modules/core_private/ut-stubs/src/ut_support.c @@ -69,7 +69,7 @@ static uint16 UT_SendEventHistory[UT_EVENT_HISTORY_SIZE]; static uint16 UT_SendTimedEventHistory[UT_EVENT_HISTORY_SIZE]; static uint16 UT_SendEventAppIDHistory[UT_EVENT_HISTORY_SIZE * 10]; -extern int32 dummy_function(void); +int32 dummy_function(void); /* ** Functions diff --git a/modules/es/fsw/src/cfe_es_global.h b/modules/es/fsw/src/cfe_es_global.h index c522ac0a5..04ad8ed24 100644 --- a/modules/es/fsw/src/cfe_es_global.h +++ b/modules/es/fsw/src/cfe_es_global.h @@ -228,7 +228,7 @@ typedef struct /* ** The Executive Services Global Data declaration */ -extern CFE_ES_Global_t CFE_ES_Global; +CFE_ES_Global_t CFE_ES_Global; /*---------------------------------------------------------------------------------------*/ /** @@ -240,7 +240,7 @@ extern CFE_ES_Global_t CFE_ES_Global; * @param FunctionName the name of the function/caller * @param LineNumber the line number of the caller */ -extern void CFE_ES_LockSharedData(const char *FunctionName, int32 LineNumber); +void CFE_ES_LockSharedData(const char *FunctionName, int32 LineNumber); /*---------------------------------------------------------------------------------------*/ /** @@ -252,6 +252,6 @@ extern void CFE_ES_LockSharedData(const char *FunctionName, int32 LineNumber); * @param FunctionName the name of the function/caller * @param LineNumber the line number of the caller */ -extern void CFE_ES_UnlockSharedData(const char *FunctionName, int32 LineNumber); +void CFE_ES_UnlockSharedData(const char *FunctionName, int32 LineNumber); #endif /* CFE_ES_GLOBAL_H */ diff --git a/modules/es/fsw/src/cfe_es_resource.h b/modules/es/fsw/src/cfe_es_resource.h index 0530d3242..ef358903b 100644 --- a/modules/es/fsw/src/cfe_es_resource.h +++ b/modules/es/fsw/src/cfe_es_resource.h @@ -64,7 +64,7 @@ * @param[in] AppID the app ID to locate * @return pointer to App Table entry for the given app ID, or NULL if out of range */ -extern CFE_ES_AppRecord_t *CFE_ES_LocateAppRecordByID(CFE_ES_AppId_t AppID); +CFE_ES_AppRecord_t *CFE_ES_LocateAppRecordByID(CFE_ES_AppId_t AppID); /*---------------------------------------------------------------------------------------*/ /** @@ -92,7 +92,7 @@ extern CFE_ES_AppRecord_t *CFE_ES_LocateAppRecordByID(CFE_ES_AppId_t AppID); * @param[in] LibID the Lib ID to locate * @return pointer to Library Table entry for the given Lib ID, or NULL if out of range */ -extern CFE_ES_LibRecord_t *CFE_ES_LocateLibRecordByID(CFE_ES_LibId_t LibID); +CFE_ES_LibRecord_t *CFE_ES_LocateLibRecordByID(CFE_ES_LibId_t LibID); /*---------------------------------------------------------------------------------------*/ /** @@ -120,7 +120,7 @@ extern CFE_ES_LibRecord_t *CFE_ES_LocateLibRecordByID(CFE_ES_LibId_t LibID); * @param[in] TaskID the task ID to locate * @return pointer to Task Table entry for the given task ID, or NULL if out of range */ -extern CFE_ES_TaskRecord_t *CFE_ES_LocateTaskRecordByID(CFE_ES_TaskId_t TaskID); +CFE_ES_TaskRecord_t *CFE_ES_LocateTaskRecordByID(CFE_ES_TaskId_t TaskID); /*---------------------------------------------------------------------------------------*/ /** @@ -148,7 +148,7 @@ extern CFE_ES_TaskRecord_t *CFE_ES_LocateTaskRecordByID(CFE_ES_TaskId_t TaskID); * @param[in] CounterID the Counter ID to locate * @return pointer to Counter Table entry for the given Counter ID, or NULL if out of range */ -extern CFE_ES_GenCounterRecord_t *CFE_ES_LocateCounterRecordByID(CFE_ES_CounterId_t CounterID); +CFE_ES_GenCounterRecord_t *CFE_ES_LocateCounterRecordByID(CFE_ES_CounterId_t CounterID); /*---------------------------------------------------------------------------------------*/ /** @@ -659,7 +659,7 @@ static inline const char *CFE_ES_CounterRecordGetName(const CFE_ES_GenCounterRec * * The global data lock should be obtained prior to invoking this function. */ -extern CFE_ES_AppRecord_t *CFE_ES_GetAppRecordByContext(void); +CFE_ES_AppRecord_t *CFE_ES_GetAppRecordByContext(void); /*---------------------------------------------------------------------------------------*/ /** @@ -672,7 +672,7 @@ extern CFE_ES_AppRecord_t *CFE_ES_GetAppRecordByContext(void); * * The global data lock should be obtained prior to invoking this function. */ -extern CFE_ES_TaskRecord_t *CFE_ES_GetTaskRecordByContext(void); +CFE_ES_TaskRecord_t *CFE_ES_GetTaskRecordByContext(void); /* * OSAL <-> CFE task ID conversion @@ -706,7 +706,7 @@ extern CFE_ES_TaskRecord_t *CFE_ES_GetTaskRecordByContext(void); * @param[in] id The CFE task ID * @returns The OSAL task ID */ -extern osal_id_t CFE_ES_TaskId_ToOSAL(CFE_ES_TaskId_t id); +osal_id_t CFE_ES_TaskId_ToOSAL(CFE_ES_TaskId_t id); /*---------------------------------------------------------------------------------------*/ /** @@ -727,7 +727,7 @@ extern osal_id_t CFE_ES_TaskId_ToOSAL(CFE_ES_TaskId_t id); * @param[in] id The OSAL task ID * @returns The CFE task ID */ -extern CFE_ES_TaskId_t CFE_ES_TaskId_FromOSAL(osal_id_t id); +CFE_ES_TaskId_t CFE_ES_TaskId_FromOSAL(osal_id_t id); /* * Internal functions to perform name based resource lookups diff --git a/modules/es/fsw/src/cfe_es_start.h b/modules/es/fsw/src/cfe_es_start.h index cae467ac1..df757d94c 100644 --- a/modules/es/fsw/src/cfe_es_start.h +++ b/modules/es/fsw/src/cfe_es_start.h @@ -81,7 +81,7 @@ typedef struct /* ** Exported data */ -extern CFE_ES_ObjectTable_t CFE_ES_ObjectTable[CFE_PLATFORM_ES_OBJECT_TABLE_SIZE]; /* es object table */ +CFE_ES_ObjectTable_t CFE_ES_ObjectTable[CFE_PLATFORM_ES_OBJECT_TABLE_SIZE]; /* es object table */ /* * Name: CFE_ES_CreateObjects @@ -89,7 +89,7 @@ extern CFE_ES_ObjectTable_t CFE_ES_ObjectTable[CFE_PLATFORM_ES_OBJECT_TABLE_SIZE * Purpose: This function reads the es_object_table and performs all of the * application layer initialization. */ -extern void CFE_ES_CreateObjects(void); +void CFE_ES_CreateObjects(void); /* * Name: CFE_ES_SetupResetVariables @@ -99,7 +99,7 @@ extern void CFE_ES_CreateObjects(void); * have happened. * */ -extern void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 BootSource); +void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 BootSource); /* * Name: CFE_ES_InitializeFileSystems @@ -107,7 +107,7 @@ extern void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, ui * Purpose: This function initializes the file systems used in the cFE core. * */ -extern void CFE_ES_InitializeFileSystems(uint32 StartType); +void CFE_ES_InitializeFileSystems(uint32 StartType); /* * Name: CFE_ES_SetupPerfVariables @@ -118,6 +118,6 @@ extern void CFE_ES_InitializeFileSystems(uint32 StartType); * This code must be called before any other task or code that would use * CFE_ES_PerfLogEntry() / CFE_ES_PerfLogExit() functions */ -extern void CFE_ES_SetupPerfVariables(uint32 ResetType); +void CFE_ES_SetupPerfVariables(uint32 ResetType); #endif /* CFE_ES_START_H */ diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index cf315f6d5..ea93b1ab4 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -56,7 +56,7 @@ extern CFE_ES_Global_t CFE_ES_Global; -extern int32 dummy_function(void); +int32 dummy_function(void); /* ** Global variables diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index 6dcd8bf5d..a837a60a9 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -139,7 +139,7 @@ extern CFE_EVS_Global_t CFE_EVS_Global; * * This function performs any necessary EVS task initialization. */ -extern int32 CFE_EVS_TaskInit(void); +int32 CFE_EVS_TaskInit(void); /*---------------------------------------------------------------------------------------*/ /** @@ -147,7 +147,7 @@ extern int32 CFE_EVS_TaskInit(void); * * This function processes packets received on the EVS command pipe. */ -extern void CFE_EVS_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr); +void CFE_EVS_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr); /* * EVS Message Handler Functions diff --git a/modules/fs/fsw/src/cfe_fs_priv.h b/modules/fs/fsw/src/cfe_fs_priv.h index 376b65802..11ad51ea9 100644 --- a/modules/fs/fsw/src/cfe_fs_priv.h +++ b/modules/fs/fsw/src/cfe_fs_priv.h @@ -154,7 +154,7 @@ extern CFE_FS_Global_t CFE_FS_Global; * * @param FunctionName The name of the calling function */ -extern void CFE_FS_LockSharedData(const char *FunctionName); +void CFE_FS_LockSharedData(const char *FunctionName); /*---------------------------------------------------------------------------------------*/ /** @@ -162,7 +162,7 @@ extern void CFE_FS_LockSharedData(const char *FunctionName); * * @param FunctionName The name of the calling function */ -extern void CFE_FS_UnlockSharedData(const char *FunctionName); +void CFE_FS_UnlockSharedData(const char *FunctionName); /*---------------------------------------------------------------------------------------*/ /** @@ -170,7 +170,7 @@ extern void CFE_FS_UnlockSharedData(const char *FunctionName); * * @param Hdr The object to byte swap */ -extern void CFE_FS_ByteSwapCFEHeader(CFE_FS_Header_t *Hdr); +void CFE_FS_ByteSwapCFEHeader(CFE_FS_Header_t *Hdr); /*---------------------------------------------------------------------------------------*/ /** @@ -178,6 +178,6 @@ extern void CFE_FS_ByteSwapCFEHeader(CFE_FS_Header_t *Hdr); * * @param Uint32ToSwapPtr The buffer to byte swap */ -extern void CFE_FS_ByteSwapUint32(uint32 *Uint32ToSwapPtr); +void CFE_FS_ByteSwapUint32(uint32 *Uint32ToSwapPtr); #endif /* CFE_FS_PRIV_H */ diff --git a/modules/sb/fsw/src/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h index d4a5c90e5..f9247dfac 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -920,7 +920,7 @@ int32 CFE_SB_SendPrevSubsCmd(const CFE_SB_SendPrevSubsCmd_t *data); * @param[in] PipeId the Pipe ID to locate * @return pointer to Pipe Table entry for the given Pipe ID */ -extern CFE_SB_PipeD_t *CFE_SB_LocatePipeDescByID(CFE_SB_PipeId_t PipeId); +CFE_SB_PipeD_t *CFE_SB_LocatePipeDescByID(CFE_SB_PipeId_t PipeId); /*---------------------------------------------------------------------------------------*/ /** diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.h b/modules/tbl/fsw/src/cfe_tbl_internal.h index 545599bfb..d9d84cec7 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.h +++ b/modules/tbl/fsw/src/cfe_tbl_internal.h @@ -550,7 +550,7 @@ int32 CFE_TBL_SendNotificationMsg(CFE_TBL_RegistryRec_t *RegRecPtr); ** \param[in, out] Uint32ToSwapPtr Pointer to uint32 value to be swapped. *Uint32ToSwapPtr is the swapped uint32 value ** */ -extern void CFE_TBL_ByteSwapUint32(uint32 *Uint32ToSwapPtr); +void CFE_TBL_ByteSwapUint32(uint32 *Uint32ToSwapPtr); /* * Internal helper functions for Table Registry dump diff --git a/modules/tbl/fsw/src/cfe_tbl_task.h b/modules/tbl/fsw/src/cfe_tbl_task.h index 90244636b..269c25038 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.h +++ b/modules/tbl/fsw/src/cfe_tbl_task.h @@ -370,7 +370,7 @@ typedef struct ** \retval #CFE_TBL_BAD_MSG_ID \copydoc CFE_TBL_BAD_MSG_ID ** */ -extern int16 CFE_TBL_SearchCmdHndlrTbl(CFE_SB_MsgId_t MessageID, uint16 CommandCode); +int16 CFE_TBL_SearchCmdHndlrTbl(CFE_SB_MsgId_t MessageID, uint16 CommandCode); /*---------------------------------------------------------------------------------------*/ /** diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h index 959a54777..c8b2c8594 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h @@ -101,7 +101,7 @@ typedef struct ** None ** */ -extern void CFE_TBL_GetHkData(void); +void CFE_TBL_GetHkData(void); /*---------------------------------------------------------------------------------------*/ /** @@ -117,7 +117,7 @@ extern void CFE_TBL_GetHkData(void); ** the Table Registry. ** */ -extern void CFE_TBL_GetTblRegData(void); +void CFE_TBL_GetTblRegData(void); /*---------------------------------------------------------------------------------------*/ /** @@ -336,8 +336,8 @@ int32 CFE_TBL_AbortLoadCmd(const CFE_TBL_AbortLoadCmd_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR */ -extern CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile(const char *DumpFilename, const char *TableName, - const void *DumpDataAddr, size_t TblSizeInBytes); +CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile(const char *DumpFilename, const char *TableName, const void *DumpDataAddr, + size_t TblSizeInBytes); /*---------------------------------------------------------------------------------------*/ /** From f46bc4fb98e9b27f4bc504543c43190e86006de2 Mon Sep 17 00:00:00 2001 From: pavll Date: Sun, 29 Aug 2021 13:41:23 +0200 Subject: [PATCH 004/200] Fix #1302, Use macro in CFE_ResourceId_IsDefined --- modules/core_api/fsw/inc/cfe_resourceid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core_api/fsw/inc/cfe_resourceid.h b/modules/core_api/fsw/inc/cfe_resourceid.h index 49108d207..70fec7e44 100644 --- a/modules/core_api/fsw/inc/cfe_resourceid.h +++ b/modules/core_api/fsw/inc/cfe_resourceid.h @@ -152,7 +152,7 @@ static inline bool CFE_ResourceId_Equal(CFE_ResourceId_t id1, CFE_ResourceId_t i */ static inline bool CFE_ResourceId_IsDefined(CFE_ResourceId_t id) { - return (CFE_RESOURCEID_UNWRAP(id) != 0); + return (!CFE_ResourceId_Equal(id, CFE_RESOURCEID_UNDEFINED)); } /** \} */ From 17f57707230c723fee68aaad06529dd179e634f1 Mon Sep 17 00:00:00 2001 From: pavll Date: Tue, 21 Sep 2021 23:32:53 +0200 Subject: [PATCH 005/200] Fix #1818, EVS functional test add for different event types --- modules/cfe_testcase/src/evs_send_test.c | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/modules/cfe_testcase/src/evs_send_test.c b/modules/cfe_testcase/src/evs_send_test.c index bd25184c1..bd14a2ff8 100644 --- a/modules/cfe_testcase/src/evs_send_test.c +++ b/modules/cfe_testcase/src/evs_send_test.c @@ -39,6 +39,15 @@ void TestSendEvent(void) UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "OK Send"), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, NULL), CFE_EVS_INVALID_PARAMETER); + + UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_DEBUG, "OK (Debug) Send"), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_DEBUG, NULL), CFE_EVS_INVALID_PARAMETER); + + UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_ERROR, "OK (Error) Send"), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_ERROR, NULL), CFE_EVS_INVALID_PARAMETER); + + UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_CRITICAL, "OK (Critical) Send"), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_CRITICAL, NULL), CFE_EVS_INVALID_PARAMETER); } void TestSendEventAppID(void) @@ -55,6 +64,24 @@ void TestSendEventAppID(void) CFE_EVS_INVALID_PARAMETER); UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_INFORMATION, CFE_ES_APPID_UNDEFINED, "OK"), CFE_EVS_APP_ILLEGAL_APP_ID); + + UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_DEBUG, AppId, " OK (Debug) App ID"), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_DEBUG, AppId, NULL), CFE_EVS_INVALID_PARAMETER); + UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_DEBUG, CFE_ES_APPID_UNDEFINED, "OK (Debug)"), + CFE_EVS_APP_ILLEGAL_APP_ID); + + UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_ERROR, AppId, "OK (Error) App ID"), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_ERROR, AppId, NULL), CFE_EVS_INVALID_PARAMETER); + UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_ERROR, CFE_ES_APPID_UNDEFINED, "OK (Error)"), + CFE_EVS_APP_ILLEGAL_APP_ID); + + UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_CRITICAL, AppId, "OK (Critical) App ID"), + CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_CRITICAL, AppId, NULL), + CFE_EVS_INVALID_PARAMETER); + UtAssert_INT32_EQ( + CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_CRITICAL, CFE_ES_APPID_UNDEFINED, "OK (Critical)"), + CFE_EVS_APP_ILLEGAL_APP_ID); } void TestSendTimedEvent(void) @@ -64,6 +91,15 @@ void TestSendTimedEvent(void) UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(Time, 0, CFE_EVS_EventType_INFORMATION, "OK Time"), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(Time, 0, CFE_EVS_EventType_INFORMATION, NULL), CFE_EVS_INVALID_PARAMETER); + + UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(Time, 0, CFE_EVS_EventType_DEBUG, "Ok (Debug) Time"), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(Time, 0, CFE_EVS_EventType_DEBUG, NULL), CFE_EVS_INVALID_PARAMETER); + + UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(Time, 0, CFE_EVS_EventType_ERROR, "Ok (Error) Time"), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(Time, 0, CFE_EVS_EventType_ERROR, NULL), CFE_EVS_INVALID_PARAMETER); + + UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(Time, 0, CFE_EVS_EventType_CRITICAL, "Ok (Critical) Time"), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(Time, 0, CFE_EVS_EventType_CRITICAL, NULL), CFE_EVS_INVALID_PARAMETER); } void EVSSendTestSetup(void) From 168181f20be0c4fb5f02f8701baa022294b18f7f Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 10 Sep 2021 17:01:26 -0400 Subject: [PATCH 006/200] Fix #1945, add CFE_SB_ValueToMsgId/MsgIdToValue wrappers Correct code that was not correctly using the CFE_SB_ValueToMsgId or CFE_SB_MsgIdToValue conversion wrappers where required to do so. This should be used whenever the value is intentionally converted to/from an integer. The CFE_SB_MsgId_t type should not be assumed to be an integer in nature. --- modules/cfe_testcase/src/message_id_test.c | 4 ++-- modules/cfe_testcase/src/msg_api_test.c | 4 ++-- modules/cfe_testcase/src/sb_subscription_test.c | 7 +------ modules/cfe_testcase/src/tbl_information_test.c | 2 +- .../cfe_testcase/src/tbl_registration_test.c | 2 +- modules/core_api/fsw/inc/cfe_sb.h | 2 +- modules/core_api/fsw/inc/cfe_sb_api_typedefs.h | 17 +++++++++++++++-- modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c | 11 ++++++----- 8 files changed, 29 insertions(+), 20 deletions(-) diff --git a/modules/cfe_testcase/src/message_id_test.c b/modules/cfe_testcase/src/message_id_test.c index 235d1cf8d..2956c2895 100644 --- a/modules/cfe_testcase/src/message_id_test.c +++ b/modules/cfe_testcase/src/message_id_test.c @@ -42,7 +42,7 @@ void TestMsgId(void) UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, expectedmsgid), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - UtAssert_UINT32_EQ(msgid, expectedmsgid); + CFE_Assert_MSGID_EQ(msgid, expectedmsgid); UtAssert_INT32_EQ(CFE_MSG_SetMsgId(NULL, msgid), CFE_MSG_BAD_ARGUMENT); @@ -93,4 +93,4 @@ void MessageIdTestSetup(void) { UtTest_Add(TestMsgId, NULL, NULL, "Test Set/Get Message ID"); UtTest_Add(TestGetTypeFromMsgId, NULL, NULL, "Test Get Type From Message ID"); -} \ No newline at end of file +} diff --git a/modules/cfe_testcase/src/msg_api_test.c b/modules/cfe_testcase/src/msg_api_test.c index 11e12f40d..ddeb29b6a 100644 --- a/modules/cfe_testcase/src/msg_api_test.c +++ b/modules/cfe_testcase/src/msg_api_test.c @@ -53,9 +53,9 @@ void TestMsgApiBasic(void) msgId = CFE_SB_ValueToMsgId(0); /* test msg-init */ - UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(NULL, msgId, sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, msgId, 0), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1, sizeof(cmd)), + UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, msgId, sizeof(cmd)), CFE_SUCCESS); diff --git a/modules/cfe_testcase/src/sb_subscription_test.c b/modules/cfe_testcase/src/sb_subscription_test.c index 8e1745272..628360445 100644 --- a/modules/cfe_testcase/src/sb_subscription_test.c +++ b/modules/cfe_testcase/src/sb_subscription_test.c @@ -54,7 +54,6 @@ void TestSubscribeUnsubscribe(void) /* Subscribe - Confirm Bad MsgId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_Subscribe(CFE_SB_INVALID_MSG_ID, PipeId1), CFE_SB_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_SB_Subscribe(CFE_SB_MSGID_RESERVED, PipeId2), CFE_SB_BAD_ARGUMENT); /* Subscribe - Confirm Bad PipeId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_Subscribe(CFE_FT_CMD_MSGID, CFE_SB_INVALID_PIPE), CFE_SB_BAD_ARGUMENT); @@ -73,7 +72,6 @@ void TestSubscribeUnsubscribe(void) /* Unsubscribe - Confirm Bad MsgId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_Unsubscribe(CFE_SB_INVALID_MSG_ID, PipeId1), CFE_SB_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_SB_Unsubscribe(CFE_SB_MSGID_RESERVED, PipeId2), CFE_SB_BAD_ARGUMENT); /* Unsubscribe - Confirm Bad PipeId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_Unsubscribe(CFE_FT_CMD_MSGID, CFE_SB_INVALID_PIPE), CFE_SB_BAD_ARGUMENT); @@ -108,7 +106,6 @@ void TestSubscribeUnsubscribeLocal(void) /* Subscribe - Confirm Bad MsgId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_SubscribeLocal(CFE_SB_INVALID_MSG_ID, PipeId1, 2), CFE_SB_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_SB_SubscribeLocal(CFE_SB_MSGID_RESERVED, PipeId2, 2), CFE_SB_BAD_ARGUMENT); /* Subscribe - Confirm Bad PipeId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_SubscribeLocal(CFE_FT_CMD_MSGID, CFE_SB_INVALID_PIPE, 2), CFE_SB_BAD_ARGUMENT); @@ -127,7 +124,6 @@ void TestSubscribeUnsubscribeLocal(void) /* Unsubscribe - Confirm Bad MsgId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_UnsubscribeLocal(CFE_SB_INVALID_MSG_ID, PipeId1), CFE_SB_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_SB_UnsubscribeLocal(CFE_SB_MSGID_RESERVED, PipeId2), CFE_SB_BAD_ARGUMENT); /* Unsubscribe - Confirm Bad PipeId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_UnsubscribeLocal(CFE_FT_CMD_MSGID, CFE_SB_INVALID_PIPE), CFE_SB_BAD_ARGUMENT); @@ -174,7 +170,6 @@ void TestSubscribeEx(void) /* Subscribe - Confirm Bad MsgId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_SubscribeEx(CFE_SB_INVALID_MSG_ID, PipeId1, CFE_SB_DEFAULT_QOS, 2), CFE_SB_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_SB_SubscribeEx(CFE_SB_MSGID_RESERVED, PipeId2, CFE_SB_DEFAULT_QOS, 2), CFE_SB_BAD_ARGUMENT); /* Subscribe - Confirm Bad PipeId Arg Rejection */ UtAssert_INT32_EQ(CFE_SB_SubscribeEx(CFE_FT_CMD_MSGID, CFE_SB_INVALID_PIPE, CFE_SB_DEFAULT_QOS, 2), @@ -214,7 +209,7 @@ void TestSBMaxSubscriptions(void) while (NumSubs <= CFE_PLATFORM_SB_MAX_MSG_IDS) { /* fabricate a msgid to subscribe to (this may overlap real msgids) */ - TestMsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_PLATFORM_CMD_MID_BASE + NumSubs); + TestMsgId = CFE_SB_ValueToMsgId(CFE_PLATFORM_CMD_MID_BASE + NumSubs); Status = CFE_SB_Subscribe(TestMsgId, PipeId); if (Status != CFE_SUCCESS) diff --git a/modules/cfe_testcase/src/tbl_information_test.c b/modules/cfe_testcase/src/tbl_information_test.c index 813aa4ef0..bb44c31dc 100644 --- a/modules/cfe_testcase/src/tbl_information_test.c +++ b/modules/cfe_testcase/src/tbl_information_test.c @@ -78,7 +78,7 @@ void TestNotifyByMessage(void) UtPrintf("Testing: CFE_TBL_NotifyByMessage"); CFE_TBL_Handle_t SharedTblHandle; const char * SharedTblName = "SAMPLE_APP.SampleAppTable"; - CFE_SB_MsgId_t TestMsgId = CFE_TEST_CMD_MID; + CFE_SB_MsgId_t TestMsgId = CFE_SB_ValueToMsgId(CFE_TEST_CMD_MID); CFE_MSG_FcnCode_t TestCmdCode = 0; uint32 TestParameter = 0; diff --git a/modules/cfe_testcase/src/tbl_registration_test.c b/modules/cfe_testcase/src/tbl_registration_test.c index ed300ece3..dcbf74885 100644 --- a/modules/cfe_testcase/src/tbl_registration_test.c +++ b/modules/cfe_testcase/src/tbl_registration_test.c @@ -220,7 +220,7 @@ void TestTblNonAppContext(void) CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_TBL_Manage(CFE_FT_Global.TblHandle), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_TBL_Modified(CFE_FT_Global.TblHandle), CFE_ES_ERR_RESOURCEID_NOT_VALID); - UtAssert_INT32_EQ(CFE_TBL_NotifyByMessage(CFE_FT_Global.TblHandle, CFE_TEST_CMD_MID, 0, 0), + UtAssert_INT32_EQ(CFE_TBL_NotifyByMessage(CFE_FT_Global.TblHandle, CFE_SB_ValueToMsgId(CFE_TEST_CMD_MID), 0, 0), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_TBL_Share(&Handle, CFE_FT_Global.TblName), CFE_ES_ERR_RESOURCEID_NOT_VALID); diff --git a/modules/core_api/fsw/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h index 8f1eeff8f..0133eb06c 100644 --- a/modules/core_api/fsw/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -827,7 +827,7 @@ static inline CFE_SB_MsgId_Atom_t CFE_SB_MsgIdToValue(CFE_SB_MsgId_t MsgId) */ static inline CFE_SB_MsgId_t CFE_SB_ValueToMsgId(CFE_SB_MsgId_Atom_t MsgIdValue) { - CFE_SB_MsgId_t Result = CFE_SB_MSGID_WRAP_VALUE(MsgIdValue); + CFE_SB_MsgId_t Result = CFE_SB_MSGID_C(MsgIdValue); return Result; } /** @} */ 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 64d800062..95a92fecc 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -63,7 +63,20 @@ * * \sa CFE_SB_ValueToMsgId() */ -#define CFE_SB_MSGID_WRAP_VALUE(val) ((CFE_SB_MsgId_t)(val)) +#define CFE_SB_MSGID_WRAP_VALUE(val) (val) + +/** + * \brief Translation macro to convert to MsgId integer values from a literal + * + * This ensures that the literal is interpreted as the CFE_SB_MsgId_t type, rather + * than the default type associated with that literal (e.g. int/unsigned int). + * + * \note Due to constraints in C99 this style of initializer can only be used + * at runtime, not for static/compile-time initializers. + * + * \sa CFE_SB_ValueToMsgId() + */ +#define CFE_SB_MSGID_C(val) ((CFE_SB_MsgId_t)CFE_SB_MSGID_WRAP_VALUE(val)) /** * \brief Translation macro to convert to MsgId integer values from opaque/abstract API values @@ -96,7 +109,7 @@ * purposes (rvalue), #CFE_SB_MSGID_RESERVED should be used instead. * However, in the current implementation, they are equivalent. */ -#define CFE_SB_INVALID_MSG_ID CFE_SB_MSGID_RESERVED +#define CFE_SB_INVALID_MSG_ID CFE_SB_MSGID_C(-1) /** * \brief Cast/Convert a generic CFE_ResourceId_t to a CFE_SB_PipeId_t diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c index b7616a27b..9728d1cf7 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c @@ -48,18 +48,19 @@ void Test_MSG_MsgId(void) UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtAssert_INT32_EQ(CFE_MSG_SetMsgId(NULL, msgid), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_INVALID_MSG_ID), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(-1)), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); - UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1)), + CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); - UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0xFFFF)), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set msg to all F's, set msgid to 0 and verify"); memset(&msg, 0xFF, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&msg, &msgid)); UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0xFFFF); - CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, 0)); + CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0))); UT_DisplayPkt(&msg, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&msg, &msgid)); UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0); @@ -69,7 +70,7 @@ void Test_MSG_MsgId(void) memset(&msg, 0, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&msg, &msgid)); UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0); - CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID)); + CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID))); UT_DisplayPkt(&msg, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&msg, &msgid)); UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); From dafe0df89035e733253998e821184e0e879fd82c Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 23 Sep 2021 10:59:27 -0600 Subject: [PATCH 007/200] Fix #1977, Functional requirements grammar cleanup --- docs/cFE_FunctionalRequirements.csv | 130 ++++++++++++++-------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/docs/cFE_FunctionalRequirements.csv b/docs/cFE_FunctionalRequirements.csv index 6545d4bf1..741a38c5d 100644 --- a/docs/cFE_FunctionalRequirements.csv +++ b/docs/cFE_FunctionalRequirements.csv @@ -19,7 +19,7 @@ ES: NOOP Event,cES1001,"Upon receipt of a Command, the cFE shall generate a NO-O ES: Valid Command Counter,cES1002,"Upon receipt of a valid Command, the cFE shall increment a valid Command counter.",The ground needs the capability to verify that the command was received and accepted by the cFE. Details of valid commands are documented in the cFE Application Developer's Guide and the cFE User's Guide. ES: Invalid Command Counter,cES1003,"Upon receipt of an invalid Command, the cFE shall increment the invalid Command counter and generate an event message.",The ground needs an indicator if a command is rejected by the cFE. Details of what makes a command invalid are documented in the cFE Application Developer's Guide and the cFE User's Guide. ES: Zero Command Counters,cES1004,"Upon receipt of a Command, the cFE shall set to zero the valid Command counter and invalid Command counter.","This command is a common feature in heritage sub-system software design. In general, command counter (valid and invalid) are reset." -ES: Start Application,cES1005,"Upon receipt of a Command, the cFE shall create the Command specified Application by defining the Application in the System Resources Definition using information from the Command specified file, and beginning execution of the Application.",A basic feature of the cFE is to be able to dynamically (while the cFE is running) start applications. This requirement allows for an application to be created and started from one of the cFE file systems. +ES: Start Application,cES1005,"Upon receipt of a Command, the cFE shall create the Command specified Application by defining the Application in the System Resources Definition using information from the Command specified file and beginning execution of the Application.",A basic feature of the cFE is to be able to dynamically (while the cFE is running) start applications. This requirement allows for an application to be created and started from one of the cFE file systems. ES: Start Application - Command Contents,cES1005.1,"The Command shall include the following parameters: - Application Path/Filename @@ -28,12 +28,12 @@ ES: Start Application - Command Contents,cES1005.1,"The Command shall include th - Application Priority - Application Stack Size - Exception Action (restart application or perform processor reset)", -ES: Start Application - Location,cES1005.2,The Command specified cFE Application file shall be in any valid cFE file system including the volatile file system and the non-volatile file system.,"The command itself does not care about where the cFE Application comes from, it is specified In the path." +ES: Start Application - Location,cES1005.2,The Command specified cFE Application file shall be in any valid cFE file system including the volatile file system and the non-volatile file system.,"The command itself does not care about where the cFE Application comes from, it is specified in the path." ES: Start Application - Reject Undefined,cES1005.3,"If the Command specified Application is undefined then the cFE shall reject the Command, increment the invalid command counter and generate an event message.",Can't start an undefined application. ES: Start Application - Reject Already Running,cES1005.4,"If the Command specified Application is already defined and executing, then the cFE shall reject the Command, increment the invalid Command counter and generate an event message.",Can't start an application that is already running. ES: Delete Application,cES1006,"Upon receipt of a Command, the cFE shall delete the Command specified Application including all child tasks.",Need to be able to stop the execution of an Application and remove its System Resources. The delete will clean-up the application's main task and all of its child tasks. Note: other cFE components are required to have cleanup routines that ES calls. ES: Delete Application - Reject Undefined,cES1006.1,"If the specified Application is undefined then the cFE shall reject the Command, increment the invalid command counter and generate an event message.",Can't delete an undefined application. -ES: Restart Application,cES1007,"Upon receipt of a Command, the cFE shall Restart the Command specified Application.","Need to be able to restart an Application. A restart involves deleting it (cleaning up) and then starting it again. This is similar to starting the cFE Application from a file system. When an Application is restarted, the only command parameter required is the application name. All other parameters including the filename are the same as the original cFE Application Create command. The restart is intended for error recovery such as an exception, and should not be used to start a new version of an Application. If a Critical Data Store Area is allocated for the Application, it is preserved, and the Application may re-connect to the Critical Data Store Area when it is running again." +ES: Restart Application,cES1007,"Upon receipt of a Command, the cFE shall Restart the Command specified Application.","Need to be able to restart an Application. A restart involves deleting it (cleaning up) and then starting it again. This is similar to starting the cFE Application from a file system. When an Application is restarted, the only command parameter required is the application name. All other parameters including the filename are the same as the original cFE Application Create command. The restart is intended for error recovery such as an exception and should not be used to start a new version of an Application. If a Critical Data Store Area is allocated for the Application, it is preserved, and the Application may re-connect to the Critical Data Store Area when it is running again." ES: Restart Application - Reject Undefined,cES1007.1,"If the Command specified Application is undefined then the cFE shall reject the Command, increment the invalid Command counter and generate an event message.",Can't restart an undefined application. ES: Restart Application - Reject On Missing File,cES1007.2,"If the original cFE Application file is not found then the cFE shall reject the Command, increment the invalid Command counter, and generate an event message.","Can't restart the Application if the original file has been removed. The command is aborted during the attempt to load, after the application has been deleted." ES: Restart Application - Delete On Non-Parameter Error,cES1007.3,"If the cFE Application Restart fails due to a non-parameter error, then the cFE shall delete the Application and generate an event message.","If the Application is already stopped and there is an error restarting it, then the cFE application will be deleted. Note non-parameter errors do not increment the command error counter, since they are detected after the request has been successfully processed." @@ -59,7 +59,7 @@ ES: System Log,cES1014,The cFE shall maintain an Executive Services System Log w ES: System Log - Timestamps,cES1014.1,Each entry in the Executive Services System Log shall be time tagged with the time that the event happened.,Need to be able to determine when the event occurred. ES: System Log - Calculate Usage,cES1014.2,The cFE shall calculate the number of bytes used and number of entries in Executive Services System Log.,"Ground operations need indication of how full the System Log is so that they can clear it, if necessary, in order to make room for new entries (or at least write it to a file to preserve it)." ES: System Log - Overwrite On Full,cES1014.2.1,If the Executive Services System Log is full and the System Log Mode is set to OVERWRITE then the cFE shall write all new entries from the top of the log.,Want to provide the capability to continuously record all new System Messages. -ES: System Log - Discard On Full,cES1014.2.2,If the Executive Services Syste Log is full and the System Log Mode is set to DISCARD then the cFE shall discard all new entries.,Want to provide capability to stop writing to the System Log in order to preserve to Log which may contain important anomalous messages. +ES: System Log - Discard On Full,cES1014.2.2,If the Executive Services System Log is full and the System Log Mode is set to DISCARD then the cFE shall discard all new entries.,Want to provide capability to stop writing to the System Log in order to preserve to Log which may contain important anomalous messages. ES: System Log - Clear On Command,cES1015,"Upon receipt of a Command, the cFE shall clear the Executive Services System Log.",Want to be able to clear the Executive Services System Log Buffer so that only the new information is saved. ES: System Log - Write To File,cES1016,"Upon receipt of a Command, the cFE shall copy the information contained in the Executive Services System Log into a Command specified file.",We did not want to count on a file system for storing the ES System errors in the event that there was a problem with the file system or the file system was not mounted yet. We did want to provide an easy ground interface for getting the data to the ground ES: System Log - Default Filename,cES1016.1,"If a file is not specified, the cFE shall use the `` filename.",Want to provide a default in the event a user does not want to have to specify one. @@ -70,7 +70,7 @@ ES: Exception and Reset Log,cES1017,"The cFE shall maintain an Executive Service - Critical system variables - ASCII string stating the reason for the reset","Want to be able to save state information prior to a restart (processor, power-on, application, task etc) to help with diagnosing problems. There is a separate requirement for the creation of a file to transfer the information to the ground." ES: Exception and Reset Log - Clear On Command,cES1018,"Upon receipt of a Command, the cFE shall clear the Executive Services Exception and Reset Log.",Want to be able to clear the Executive Services Exception and Reset Log so that only the new information is saved. -ES: Exception and Reset Log - Write To File,cES1019,"Upon receipt of a Command, the cFE shall copy the information contained in the Executive Services Exception and Reset Log Buffer into a Command specified file.","The cFE Exception and Reset Log contains a large amount of data, and is variable in size. It is easier to dump the contents to a file." +ES: Exception and Reset Log - Write To File,cES1019,"Upon receipt of a Command, the cFE shall copy the information contained in the Executive Services Exception and Reset Log Buffer into a Command specified file.",The cFE Exception and Reset Log contains a large amount of data and is variable in size. It is easier to dump the contents to a file. ES: Exception and Reset Log - Default Filename,cES1019.1,"If a file is not specified, the cFE shall use the `` filename.",Want to provide a default in the event a user does not want to have to specify one. ES: Analyzer Log,cES1021,The cFE shall maintain an Executive Services Logic Analyzer Capture Log for capturing application specified timestamps and events for off-line performance analysis.,The Logic Analyzer Capture Log is used along with a performance log API to allow the cFE and cFE Applications to save performance data that can be downloaded. ES: Analyzer Log Record Tag,cES1022,"Upon receipt of a Request, the cFE shall record the specified Logic Analyzer Capture Tag in the Logic Analyzer Capture Log.",The cFE Core and cFE Applications make specific calls to create log entries in the Logic Analyzer Capture Log. @@ -88,7 +88,7 @@ ES: Critical Data Store Write To File,cES1026,"Upon receipt of a Command, the cF 4. Table Flag",This provides a registry of the Critical Data Store. ES: Critical Data Store Write To File - Default Filename,cES1026.1,"If a file is not specified, the cFE shall use the `` filename.",Provide a default file name. ES: Critical Data Store Delete,cES1027,"Upon receipt of a Command, the cFE shall delete the Command Specified Critical Data Store.","As part of an Application clean-up, want to clean-up the allocated resources." -ES: System Log Mode,cES1028,"Upon receipt of Command, the cFE shall set the System Log Mode to the Command-specified mode, either overwrite or discard.","While in Overwrite Mode the oldest logged System message will be overwritten by the new System message when the System Log Full Flag is set to true. While in Discard Mode the new message will be discarded, preserving the contents of the full log." +ES: System Log Mode,cES1028,"Upon receipt of Command, the cFE shall set the System Log Mode to the Command-specified mode, either overwrite or discard.","While in Overwrite Mode the oldest logged System message will be overwritten by the new System message when the System Log Full Flag is set to true. While in Discard Mode the new message will be discarded, preserving the contents of the full log." ES: Analyzer Log Start,cES1029,"Upon receipt of a Command, the cFE shall start collecting Logic Analyzer Capture Log data.",Provide capability to start collection of performance data by command. ES: Analyzer Log Set Filter Mask,cES1030,"Upon receipt of a Command, the cFE shall set the Analyzer Log filter mask.",Provide capability to filter collection of performance data by command. ES: Analyzer Log Trigger Mask,cES1031,"Upon receipt of a Command, the cFE shall set the Analyzer Log trigger mask.",Provide capability to set the trigger mask for collection of performance data by command. @@ -102,34 +102,34 @@ ES: Get Task Information,cES1305,Upon receipt of a Request the cFE shall provide ES: Report Application ID By Name,cES1306,"Upon receipt of a Request, the cFE shall provide the cFE Application ID which corresponds to the specified cFE Application Name.",The Executive Services will assign an Application ID. The Application Name is specified when the cFE Application is created. This Request will provide a way to determine the cFE Application ID when the pre-determined Application Name is passed in. ES: Report Application Name,cES1307,"Upon receipt of a Request, the cFE shall provide the cFE Application Name which corresponds to the specified cFE Application ID.",The Executive Services will assign an Application ID. This Request will provide a way to determine an Application's name from its Application ID. ES: Delete Application,cES1309,"Upon receipt of a Request, the cFE shall delete the specified Application including all child tasks.",Need to be able to stop the execution of an Application and remove its System Resources. The delete will clean-up the application's main task and all of its child tasks. Note: other cFE components are required to have cleanup routines that ES calls. -ES: Delete Application - Reject Undefined,cES1309.1,"If the specified Application is undefined then the cFE shall record the error in the System Log, and return an error code.",Can't delete an undefined application. -ES: Restart Application,cES1310,Upon receipt of a Request the cFE shall Restart the specified Application.,"Need to be able to restart an Application. A restart involves deleting it (cleaning up) and then starting it again. This is similar to starting the cFE Application from a file system. When an Application is restarted, the only parameter required is the application name. All other parameters including the filename are the same as the original cFE Application Create Request. The restart is intended for error recovery such as an exception, and should not be used to start a new version of an Application. If a Critical Data Store Area is allocated for the Application, it is preserved, and the Application may re-connect to the Critical Data Store Area when it is running again." -ES: Restart Application- Reject Undefined,cES1310.1,"If the specified Application is undefined then the cFE shall record the error in the System Log, and return an error code.",Can't restart an undefined application. -ES: Restart Application - Reject On Missing File,cES1310.2,"If the original cFE Application file is not found then the cFE shall record the error in the System Log, and return an error code.","Can't restart the Application if the original file has been removed. In this case, the Application will continue without a restart." -ES: Restart Application - Delete On Non-Parameter Error,cES1310.3,"If the cFE Application Restart fails due to a non-parameter error, then the cFE shall record the error in the System Log, and return an error code.","If the Application is already stopped and there is an error restarting it, then the cFE application will be deleted." +ES: Delete Application - Reject Undefined,cES1309.1,If the specified Application is undefined then the cFE shall record the error in the System Log and return an error code.,Can't delete an undefined application. +ES: Restart Application,cES1310,Upon receipt of a Request the cFE shall Restart the specified Application.,"Need to be able to restart an Application. A restart involves deleting it (cleaning up) and then starting it again. This is similar to starting the cFE Application from a file system. When an Application is restarted, the only parameter required is the application name. All other parameters including the filename are the same as the original cFE Application Create Request. The restart is intended for error recovery such as an exception and should not be used to start a new version of an Application. If a Critical Data Store Area is allocated for the Application, it is preserved, and the Application may re-connect to the Critical Data Store Area when it is running again." +ES: Restart Application- Reject Undefined,cES1310.1,If the specified Application is undefined then the cFE shall record the error in the System Log and return an error code.,Can't restart an undefined application. +ES: Restart Application - Reject On Missing File,cES1310.2,"If the original cFE Application file is not found, then the cFE shall record the error in the System Log and return an error code.","Can't restart the Application if the original file has been removed. In this case, the Application will continue without a restart." +ES: Restart Application - Delete On Non-Parameter Error,cES1310.3,"If the cFE Application Restart fails due to a non-parameter error, then the cFE shall record the error in the System Log and return an error code.","If the Application is already stopped and there is an error restarting it, then the cFE application will be deleted." ES: Create Child Task,cES1311,"Upon receipt of a Request, the cFE shall create the specified cFE Child Task within the cFE Application that owns the task and begin execution of the task.",Each cFE Application's main task has the capability to create and start one or more child tasks. -ES: Create Child Task - Report Error,cES1311.1,"In the event that the cFE Child Task cannot be created, the cFE shall record the error in the System Log, and return an error code.",Need to keep track of the Child Task Create Failures. -ES: Create Child Task - Invalid From Child Task,cES1311.2,"In the event a child task attempts to create another child task, the cFE shall record the error in the System Log, and return an error code.",Only the cFE Application's main task can create a child task. This prevents confusion with parent/child task relationships and the allocation/deallocation of resources. +ES: Create Child Task - Report Error,cES1311.1,"In the event that the cFE Child Task cannot be created, the cFE shall record the error in the System Log and return an error code.",Need to keep track of the Child Task Create Failures. +ES: Create Child Task - Invalid From Child Task,cES1311.2,"In the event a child task attempts to create another child task, the cFE shall record the error in the System Log and return an error code.",Only the cFE Application's main task can create a child task. This prevents confusion with parent/child task relationships and the allocation/deallocation of resources. ES: Delete Child Task,cES1312,"Upon receipt of a Request, the cFE shall delete the specified cFE Child Task within the cFE Application that owns the task.","As part of a cFE Application cleanup, the Application needs to be able to delete each child task." -ES: Delete Child Task - Error If Application Main Task,cES1312.1,"If the specified task is the cFE Application Main Task, the request shall record the error in the System Log, and return an error code.",Cannot use Child Task Exit or Delete on the cFE Application Main Task. +ES: Delete Child Task - Error If Application Main Task,cES1312.1,"If the specified task is the cFE Application Main Task, the request shall record the error in the System Log and return an error code.",Cannot use Child Task Exit or Delete on the cFE Application Main Task. ES: End Child Task,cES1314,"Upon receipt of a Request, the cFE shall end execution of the calling cFE Child Task.", cFE Child Task needs to be able to exit and end execution. ES: End Child Task - Reject If Application Main Task,cES1314.1,"If the calling task is the cFE Application Main Task, the cFE shall record the error in the System Log and reject the request.",Cannot use Child Task Exit or Delete on the cFE Application Main Task. -ES: Reserve Critical Data Store,cES1315,"Upon receipt of a Request, the cFE shall reserve the Request specified amount of memory in the Critical Data Store for the cFE Application using the Request specified name.",The Critical Data Store will be used by Applications to store critical parameters that will be preserved after an application or processor restart. ES will allocate the memory for the application. A pointer or memory address will be provided to the alloc. +ES: Reserve Critical Data Store,cES1315,"Upon receipt of a Request, the cFE shall reserve the Request specified amount of memory in the Critical Data Store for the cFE Application using the Request specified name.",The Critical Data Store will be used by Applications to store critical parameters that will be preserved after an application or processor restart. ES will allocate the memory for the application. ES: Reserve Critical Data Store - Size Change,cES1315.1,"If a Critical Data Store exists for the Request specified name but has a different size than what is specified in the Request, the cFE shall remove the existing Critical Data Store and create a new one using the Request specified name and size.",Assumes that if the sizes don't match then something has changed and the CDS can't be trusted. ES: Reserve Critical Data Store - Invalid Data Integrity,cES1315.2,"If a Critical Data Store exists for the Request specified name but the Data Integrity value is invalid, the cFE shall remove the existing Critical Data Store and create a new one using the Request specified name and size.",Assumes that if the CRC is invalid then the CDS can't be trusted. ES: Copy From Critical Data Store,cES1316,"Upon receipt of a Request, the cFE shall copy the contents from the Request specified Critical Data Store to the Request specified address.",Provides the capability to restore the local data with the contents of the critical data store. ES: Copy From Critical Data Store - Invalid Data Integrity,cES1316.1,"If the Data Integrity Value is invalid, the cFE shall return an error.","Critical Data Store is verified as part of restoring, with the result indicated in the return code. Allows the API user to handle the error as appropriate per use." -ES: Copy From Critical Data Store - Non-Existent,cES1316.2,If the Request Specified Critical Data Store does not exist then the data shall not be copied.,Can't copy data if the reference is wrong. -ES: Power On Reset,cES1317,"Upon receipt of a Request, the cFE shall perform a Power On Reset of the Core Flight Executive.","Need to be able to reset the cFE in the event that there is a critical problem. The direct call is provided in the case where the normal task message passing is not working. As a result of the Power On Reset, all code and data are re-initialized and the cFE is returned to it’s default power-on state." +ES: Copy From Critical Data Store - Non-Existent,cES1316.2,"If the Request Specified Critical Data Store does not exist, then the data shall not be copied.",Can't copy data if the reference is wrong. +ES: Power On Reset,cES1317,"Upon receipt of a Request, the cFE shall perform a Power On Reset of the Core Flight Executive.","Need to be able to reset the cFE in the event that there is a critical problem. The direct call is provided in the case where the normal task message passing is not working. As a result of the Power On Reset, all code and data are re-initialized and the cFE is returned to its default power-on state." ES: Processor Reset,cES1318,"Upon receipt of a Request, the cFE shall perform a Processor Reset of the Core Flight Executive.",Need to be able to restart the cFE in the event that there is a problem with the cFE core. The direct call is provided in the case where the normal task message passing is not working. ES: Exit Application,cES1319,"Upon receipt of a Request, the cFE shall exit the calling cFE Application and delete the Applications' resources.",Need to have a cFE program exit. This request can be used for both critical errors and a planned shutdown of a cFE application. ES: Prepare Memory Pool,cES1320,"Upon receipt of a Request, the cFE shall prepare a Memory Pool for run time memory allocation/de-allocation.","The Memory Allocation interface allows the cFE Application to supply a Pool of memory, which can be used for efficient memory allocation and de-allocation." -ES: Prepare Memory Pool - Too Small,cES1320.1,"If the specified size is less than the minimum block size, the cFE shall record the error in the System Log, and return an error code.","If the size of the Pool is not valid, then an error must be returned." +ES: Prepare Memory Pool - Too Small,cES1320.1,"If the specified size is less than the minimum block size, the cFE shall record the error in the System Log and return an error code.","If the size of the Pool is not valid, then an error must be returned." ES: Allocate Memory,cES1321,"Upon receipt of a Request the cFE shall allocate a block of memory of the specified size from the specified Memory Pool, protected with a semaphore while processing.",The Memory Allocation interface allows the cFE Application to allocate a block of memory from a previously created memory pool. -ES: Allocate Memory - Invalid ID,cES1321.2,"If the specified Memory Pool identifier is invalid then the cFE shall record the error in the System Log, and return an error code.","If the handle or Memory Pool ID is not valid, then an error must be returned." -ES: Allocate Memory - Too Large,cES1321.3,"If the specified size is too large for the specified Memory Pool, the cFE shall record the error in the System Log, and return an error code.",Cannot allocate a memory block bigger than the pool. +ES: Allocate Memory - Invalid ID,cES1321.2,"If the specified Memory Pool identifier is invalid, then the cFE shall record the error in the System Log and return an error code.","If the handle or Memory Pool ID is not valid, then an error must be returned." +ES: Allocate Memory - Too Large,cES1321.3,"If the specified size is too large for the specified Memory Pool, the cFE shall record the error in the System Log and return an error code.",Cannot allocate a memory block bigger than the pool. ES: De-allocate Memory,cES1322,Upon receipt of a Request the cFE shall de-allocate the specified block of memory from the specified Memory Pool.,The Memory Allocation interface allows the cFE Application to de-allocate a block of memory from a previously created memory pool. -ES: De-allocate Memory - Invalid ID,cES1322.1,"If the specified Memory Pool identifier is invalid, then the cFE shall record the error in the System Log, and return an error code.",Need to have a valid Memory Pool identifier in order to de-allocate a block of memory. +ES: De-allocate Memory - Invalid ID,cES1322.1,"If the specified Memory Pool identifier is invalid, then the cFE shall record the error in the System Log and return an error code.",Need to have a valid Memory Pool identifier in order to de-allocate a block of memory. ES: Calculate Data Integrity Value,cES1323,"Upon receipt of a Request, the cFE shall calculate a Data Integrity value over the given range of memory using the specified algorithm. The algorithm shall be one of the following: - XOR: Exclusive OR @@ -137,7 +137,7 @@ ES: Calculate Data Integrity Value,cES1323,"Upon receipt of a Request, the cFE s - CRC32: 32 Bit Cyclic Redundancy Check",We need to provide a checksum/CRC utility. ES: Copy To Critical Data Store,cES1328,"Upon receipt of a Request, the cFE shall copy the data starting at the Request specified address to the Request specified Critical Data Store.",Applications need to periodically copy the local data into the CDS so that it can be preserved. Note that the CDS is not required to exist on-card (local address space). This provides the capability for a mission to use off-card bulk storage. ES: Copy To Critical Data Store - Calculate Data Integrity Value,cES1328.1,The cFE shall calculate a Data Integrity Value for the Request specified Critical Data Store and store it.,"Every time data is written to the CDS, a CRC must be recalculated in order to have a reference for any CDS validation. Note that Applications are responsible for determining whether the contents of a CDS Block are still logically valid." -ES: Copy To Critical Data Store - Invalid Critical Data Store,cES1328.2,If the Request Specified Critical Data Store does not exist then the data shall not be copied.,Can't copy data if the reference is wrong. +ES: Copy To Critical Data Store - Invalid Critical Data Store,cES1328.2,"If the Request Specified Critical Data Store does not exist, then the data shall not be copied.",Can't copy data if the reference is wrong. ES: Allocate Memory No Semaphore,cES1329,"Upon receipt of a Request the cFE shall allocate a block of memory of the specified size from the specified Memory Pool, without semaphore protection while processing.",The Memory Allocation interface allows the cFE Application to allocate a block of memory from a previously created memory pool. ES: Get Memory Pool Statistics,cES1330,Upon receipt of a Request the cFE shall provide the requested memory pool statistics.,Supports memory pool management. ES: Get Memory Buffer Information,cES1331,Upon receipt of a Request the cFE shall provide the requested memory buffer information.,Supports memory buffer management. @@ -156,32 +156,32 @@ ES: Get Generic Counter ID By Name,cES1343,Upon receipt of a Request the cFE sha ES: Get Library Information,cES1344,Upon receipt of a Request the cFE shall provide information for the requested library.,Allows query of library information for reporting or management. ES: Delete Memory Pool,cES1345,"Upon receipt of a Request, the cFE shall delete a Memory Pool.","Allows for management of memory resources, delete of pool once no longer needed." ES: Get Generic Counter Name,cES1346,Upon receipt of a Request the cFE shall provide the generic counter name.,Generic counter management. -ES: Power On Reset Identify Sub-Type,cES1500,"Upon a Power-on Reset, the cFE shall identify the Power On reset sub-type.",Each mission may want to further distinguish between Processor reset types in order to tailor their system's behavior. For example a mission may want to take different behavior for a watchdog time out and the execution of the processor's reset instructions. +ES: Power On Reset Identify Sub-Type,cES1500,"Upon a Power-on Reset, the cFE shall identify the Power On reset sub-type.","Each mission may want to further distinguish between Processor reset types in order to tailor their system's behavior. For example, a mission may want to take different behavior for a watchdog time out and the execution of the processor's reset instructions." ES: Power On Reset Clear System Log,cES1501,"Upon a Power-On Reset, the cFE shall clear the Executive Services System Log.",Want to be able to determine what errors are logged by the cFE. This log is not preserved on a Power-On reset. ES: Power On Reset Clear Exception and Reset Log,cES1502,"Upon a Power-On Reset, the cFE shall clear the Executive Services Exception and Reset Log.",Want to be able to get a snapshot of some critical parameters prior to a reset as well as log the resets that have occurred. ES: Power On Reset Clear Volatile File System,cES1503,"Upon a Power-On Reset, the cFE shall clear the Volatile File system.",The Volatile File system is initialized during a Power-on Reset. ES: Power On Reset Clear Critical Data Store,cES1504,"Upon a Power-On Reset, the cFE shall clear the contents of the Critical Data Store.",The purpose of the critical data store is to save data that an Application wants to preserve across a processor restart. This area will be cleared during a Power-On Reset. -ES: Power On Reset Create OS Objects,cES1505,"Upon a Power-on Reset, the cFE shall create all operating system objects required by the cFE.","This is a table driven startup that includes: Core cFE Applications, semaphores, queues, and shared memory segments. It can also contain calls to initialize device drivers and interrupts." +ES: Power On Reset Create OS Objects,cES1505,"Upon a Power-on Reset, the cFE shall create all operating system objects required by the cFE.","This is a table-driven startup that includes: Core cFE Applications, semaphores, queues, and shared memory segments. It can also contain calls to initialize device drivers and interrupts." ES: Power On Reset Mount Non-Volatile File System,cES1506,"Upon a Power-on Reset, the cFE shall mount the non-volatile file system.","Non-volatile file system contains the files for each of the cFE Applications. On a Power-On reset, the external cFE Applications are loaded from the Volatile file system." ES: Power On Reset Set Up Volatile File System,cES1507,"Upon a Power-on Reset, the cFE shall create, format and mount the volatile file system.","The volatile file system is a key part of the cFE. It is used for logs, data files and new cFE Applications." ES: Power On Reset Process Startup File,cES1508,"Upon a Power-on Reset, the cFE shall process all entries in the cFE Startup File located in the non-volatile file system.","There is a file that contains all of the Applications, Shared Libraries, and Device Drivers that are to be created and started." ES: Power On Reset Process Startup File - Start Apps,cES1508.1,The cFE shall create and start cFE Applications according to the entry in the cFE Startup File.,The cFE supports loading and creating new cFE Applications during system startup. ES: Power On Reset Process Startup File - Init Libs,cES1508.2,The cFE shall create and initialize cFE Shared Libraries according to the entry in the cFE Startup File.,The cFE supports creating and initializing cFE Shared Libraries during system startup. ES: Power On Reset Exception and Reset Log Entry,cES1509,"Upon a Power On Reset, the cFE shall make an entry in the Executive Services Exception and Reset Log, recording the Power On Reset.",One purpose of the Executive Services Exception and Reset Log is to log all resets. -ES: Processor Reset Identify Sub-Type,cES1510,"Upon a Processor Reset, the cFE shall identify the Processor reset sub-type.",Each mission may want to further distinguish between Processor reset types in order to tailor their system's behavior. For example a mission may want to take different behavior for a watchdog time out and the execution of the processor's reset instructions. +ES: Processor Reset Identify Sub-Type,cES1510,"Upon a Processor Reset, the cFE shall identify the Processor reset sub-type.","Each mission may want to further distinguish between Processor reset types in order to tailor their system's behavior. For example, a mission may want to take different behavior for a watchdog time out and the execution of the processor's reset instructions." ES: Processor Reset Preserve System Log,cES1511,"Upon a Processor Reset, the cFE shall preserve the Executive Services System Log.",Want to be able to determine what errors are logged by the cFE. This log is not preserved on a Power-On reset. -ES: Processor Reset Preserve Exception and Reset Log,cES1512,"Upon a Processor Reset, the cFE shall preserve the Executive Services Exception and Reset Log.",ES needs to retain this information to support diagnosing cause of processor reset as well as preserving information that is required to count the number of resets. -ES: Processor Reset Preserve Volatile File System,cES1513,"Upon a Processor Reset, the cFE shall preserve the Volatile File system.","During a processor reset, the Volatile File System and it's contents will be preserved." +ES: Processor Reset Preserve Exception and Reset Log,cES1512,"Upon a Processor Reset, the cFE shall preserve the Executive Services Exception and Reset Log.",ES needs to retain this information to support diagnosing cause of processor reset as well as preserving information that is required to count the number of resets. +ES: Processor Reset Preserve Volatile File System,cES1513,"Upon a Processor Reset, the cFE shall preserve the Volatile File system.","During a processor reset, the Volatile File System and its contents will be preserved." ES: Processor Reset Preserve Critical Data Store,cES1514,"Upon a Processor Reset, the cFE shall preserve the contents of the Critical Data Store.",The purpose of the critical data store is to save data that an Application wants to preserve across a processor restart. ES: Processor Reset Create OS Objects,cES1515,"Upon a Processor Reset, the cFE shall create all operating system objects required by the cFE.","Items such as tasks, semaphores, queues, and shared memory segments would be initialized." -ES: Processor Reset Create OS Objects - Platform Response On Failure,cES1515.1,"If the creation of the operating system object fails, the cFE shall perform a `` response.","The response to operating system object creation failure depends on the platform configuration, and is abstracted at the platform layer." +ES: Processor Reset Create OS Objects - Platform Response On Failure,cES1515.1,"If the creation of the operating system object fails, the cFE shall perform a `` response.",The response to operating system object creation failure depends on the platform configuration and is abstracted at the platform layer. ES: Processor Reset Mount Non-Volatile File System,cES1516,"Upon a Processor Reset, the cFE shall mount the non-volatile file system.","Non-volatile file system contains the files for each of the cFE Applications. On a Power-On reset, the external cFE Applications can be loaded from the Volatile file system." ES: Processor Reset Set Up Volatile File System,cES1517,"Upon a Processor Reset, the cFE shall check and mount the volatile file system.",Want to preserve the Volatile file system across a processor reset. ES: Processor Reset Set Up Volatile File System - Format On Failure,cES1517.1,"If the volatile file system check fails, the cFE shall format the volatile file system and create a system log entry.","If the volatile file system is corrupt, it must be reformatted to allow the cFE to function." ES: Processor Reset Process Volatile Startup File,cES1518,"Upon a Processor Reset, the cFE shall process all entries in the cFE Startup File located in the volatile file system.",There is a file that contains all of the cFE Applications and Shared Libraries that are to be loaded and started. The cFE will check to see if this file is in the volatile file system. This file facilitates restarting a processor using patches that were made. ES: Processor Reset Process Volatile Startup File - Start Apps,cES1518.1,The cFE shall create and start cFE Applications according to the entry in the cFE Startup File.,The cFE supports loading and creating new cFE Applications during system startup. ES: Processor Reset Process Volatile Startup File - Init Libs,cES1518.2,The cFE shall create and initialize Shared Libraries according to the entry in the cFE Startup File.,The cFE supports loading and initializing cFE Shared Libraries during system startup. -ES: Processor Reset Process Non-Volatile Startup File,cES1519,If the system startup file is not present in the volatile file system then the cFE shall process all entries in the cFE Startup File located in the non-volatile file system.,Need to have a default system startup file which is used if there is no system startup file in volatile memory. +ES: Processor Reset Process Non-Volatile Startup File,cES1519,"If the system startup file is not present in the volatile file system, the cFE shall process all entries in the cFE Startup File located in the non-volatile file system.",Need to have a default system startup file which is used if there is no system startup file in volatile memory. ES: Processor Reset Process Non-Volatile Startup File - Start Apps,cES1519.1,The cFE shall create and start cFE Applications according to the entry in the cFE Startup File.,The cFE supports loading and creating new cFE Applications during system startup. ES: Processor Reset Process Non-Volatile Startup File - Init Libs,cES1519.2,The cFE shall create and initialize Shared Libraries according to the entry in the cFE Startup File.,The cFE supports loading and initializing cFE Shared Libraries during system startup. ES: Processor Reset Exception and Reset Log Entry,cES1520,"Upon a Processor Reset, the cFE shall make an entry in the Executive Services Exception and Reset Log recording the Processor Reset.",The purpose of the Executive Services Exception and Reset Log is to log all resets and all exceptions that occur. @@ -225,17 +225,17 @@ EVS: Write Application Data File - Default Filename,cEVS3004.1,"If a file is not EVS: Valid Command Counter,cEVS3005,"Upon receipt of valid command, the cFE shall increment the valid command counter.",The ground needs the capability to verify that the command was received and accepted by the cFE. Details of valid commands are documented in the cFE User's Guide. EVS: Invalid Command Counter,cEVS3006,"Upon receipt of an invalid command, the cFE shall in increment the invalid command counter.",The ground needs an indicator if a command is rejected by the cFE. Details of what makes a command invalid are documented in the cFE Developer's Guide and the cFE User's Guide. EVS: Control Message By Application and Event Type,cEVS3007,"Upon receipt of Command the cFE shall enable/disable, as specified in the Command, the future generation of Event Messages for the Command-specified Application and Event Type.",When diagnosing an Application it's useful to enable its informational and diagnostic Event Messages. -EVS: Control Message By Application,cEVS3008,"Upon receipt of Command the cFE shall enable/disable, as specified in the Command, the future generation of Event Messages for the Command-specified Application.",During development and integration it can be useful to turn off an Application's Event Message's without regard of the Event Type. +EVS: Control Message By Application,cEVS3008,"Upon receipt of Command the cFE shall enable/disable, as specified in the Command, the future generation of Event Messages for the Command-specified Application.","During development and integration, it can be useful to turn off an Application's Event Message's without regard of the Event Type." EVS: Zero Application Message Sent Count,cEVS3009,"Upon receipt of Command, the cFE shall set the Command-specified Application's Event Message Sent Counter to zero.",Allow operators the ability to reset the count of application events. EVS: Zero App Filter Counter By Event ID,cEVS3010,"Upon receipt of Command, the cFE shall set an Application's Binary Filter Counter to zero for the Command-specified Event ID.",Clearing an Application's Filtered Event Message Counter is a convenient method for resetting the filter on the event. EVS: Zero App Filter Counters,cEVS3011,"Upon receipt of Command, the cFE shall set all of an Application's Binary Filter Counters to zero.",Having the ability to reset all Application Filtered Event Message Counters is a quick method for resetting all the application's event filters. Note: This command gives operators the ability to reset all exhausted event filters (i.e. send 16 and stop) so that filtered events may be generated once again. EVS: Set App Filter Mask By Event ID,cEVS3012,Upon receipt of Command the cFE shall set an Application's Binary Filter Mask to the Command-specified Event Filter for the given Application Event ID.,Allow an operator to tune the system for a particular operational environment. EVS: Clear Local Event Log,cEVS3013,"Upon receipt of Command, the cFE shall clear the Local Event Log.",Need to be able to clear the log if the event logging is operating in discard mode. -EVS: Set Event Logging Mode,cEVS3014,"Upon receipt of Command, the cFE shall set the Event Logging Mode to the Command-specified mode, either overwrite or discard.","While in Overwrite Mode the oldest logged event will be overwritten by the new event when the Event Log Full Flag is set to true. While in Discard Mode the new event will be discarded, preserving the contents of the full log. Need the ability to switch between Event Message logging modes." +EVS: Set Event Logging Mode,cEVS3014,"Upon receipt of Command, the cFE shall set the Event Logging Mode to the Command-specified mode, either overwrite or discard.","While in Overwrite Mode, the oldest logged event will be overwritten by the new event when the Event Log Full Flag is set to true. While in Discard Mode the new event will be discarded, preserving the contents of the full log. Need the ability to switch between Event Message logging modes." EVS: Write Local Event Log To File,cEVS3015,"Upon receipt of Command, the cFE shall write the contents of the Local Event Log to the Command specified file.",Allows for ground view of the log. Local Event Log is not intended for operation playback. The main purpose of the Local Event Log is for ground testing. Ground operators may view the data file for playing back stored events. EVS: Write Local Event Log To File - Default Filename,cEVS3015.1,"If a file is not specified, the cFE shall use the `` filename.",Want to provide a default in the event that a user does not want to specify one. EVS: Write Local Event Log Order,cEVS3016,The cFE shall write each Event Message from the earliest logged message to the most recently logged message.,"Ground operators like to see the progression of events in the order that they occurred. In a scenario when a time correction has been made, the earliest logged may not necessarily mean the oldest time stamp. This type of playback may not be desirable for Event Logs of considerable size. It is worthwhile for cFE users to keep Event Logs relatively small." -EVS: Control Message Port Routing,cEVS3017,"Upon receipt of Command the cFE shall enable/disable, as specified in the Command, the routing of all future Event Messages to the Command specified Event Message Port.","Event Message Output Ports may not be available or needed; therefore the ability to configure sending to an Event Message Port is useful." +EVS: Control Message Port Routing,cEVS3017,"Upon receipt of Command the cFE shall enable/disable, as specified in the Command, the routing of all future Event Messages to the Command specified Event Message Port.","Event Message Output Ports may not be available or needed; therefore, the ability to configure sending to an Event Message Port is useful." EVS: Housekeeping Message,cEVS3018,"Upon receipt of a Message, the cFE shall generate a housekeeping message that includes the following Event Services items: - Valid Command Counter @@ -251,17 +251,17 @@ EVS: Housekeeping Message,cEVS3018,"Upon receipt of a Message, the cFE shall gen - For each registered Application: o Application Event Message Sent Counter o Application Event Service Enable Status",Generate housekeeping message for system awareness and management. -EVS: Add Event Filter,cEVS3019,Upon receipt of Command the cFE shall add the specified Event Filter for the specified cFE Application and Event ID.,Want to provide the ability for filters to be added at runtime. Original implentation did not provide this capability which resulted in modifications to Applications for those events that were not registered (i.e. forgotten). +EVS: Add Event Filter,cEVS3019,Upon receipt of Command the cFE shall add the specified Event Filter for the specified cFE Application and Event ID.,Want to provide the ability for filters to be added at runtime. Original implementation did not provide this capability which resulted in modifications to Applications for those events that were not registered (i.e. forgotten). EVS: Add Event Filter - Reject Already Filtered ,cEVS3019.1,"If the Event ID is already registered for filtering, the cFE shall reject the command and generate an event message.",Filter is done on a per Event ID basis. EVS: Add Event Filter - Application Maximum,cEVS3019.2,If the maximum number of Event IDs have been registered for the specified Application then the cFE shall reject the command and generate an event message.,"In order to scale the cFE, allocations are made for each cFE Application (see cEVS3302)." EVS: Delete Event Filter,cEVS3020,Upon receipt of Command the cFE shall delete the specified Event Filter for the specified cFE Application and Event ID.,Want to be able to remove event filtering since the cFE limits the number of filters that can be registered for a given cFE Application (see cEVS3302). -EVS: Delete Event Filter - Reject Not Registered,cEVS3020.1,If the Event ID is not registered for filtering then the cFE shall reject the command and generate an event message.,Notify caller that the Filter was not registered. +EVS: Delete Event Filter - Reject Not Registered,cEVS3020.1,If the Event ID is not registered for filtering the cFE shall reject the command and generate an event message.,Notify caller that the Filter was not registered. EVS: Register App,cEVS3100,"Upon receipt of Request, the cFE shall register an Application for event service, enabling the Application Event Service Enable Status and storing the following request specified Application data: Application Event IDs (for events to be filtered) Application Binary Filter Masks (one per registered Event ID).",Supports the cFE's dynamic Application model. 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: 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: 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: +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 Event Format Mode, ONLY if the following cFE conditions are met: 1. The requesting Application's Event Service Enable Status is Enabled. 2. The requesting Application's registered message filtering algorithm indicates the message should be sent. @@ -288,10 +288,10 @@ EVS: Increment Message Sent Counter,cEVS3105,"For each created Event Message, th EVS: Increment Message Sent Counter - Retain Maximum Value,cEVS3105.1,"If the Event Message Sent Counter has reached its maximum value of (2^16)-1 the cFE shall retain the maximum value (i.e. do not rollover to zero).",Preventing a counter rollover to zero eliminates the case when a user may think no events have occurred when in fact many events have occurred. EVS: Zero App Filter Counter By Event ID,cEVS3106,"Upon receipt of a request, the cFE shall set an Application's Binary Filter Counter to zero for the Application request-specified Event ID.",Clearing an Application's Binary Filter Counter is a convenient method for resetting the filter on the event. EVS: Zero App Filter Counters,cEVS3107,"Upon receipt of a request, the cFE shall set all of an Application's Binary Filter Counters to zero for the request-specified Application.",Having the ability to reset all Application Filtered Event Message Counters is a quick method for resetting all the application's event filters. -EVS: Store Message In Event Log,cEVS3108,"For each created Event Message, the cFE shall store the Event Message in the Local Event Log in the Long Event Message Format.",It's useful to save Event Messages when external communications is unavailable. This may occur during system initialization (especially events generated from other cFE components) and during a communications failure. +EVS: Store Message In Event Log,cEVS3108,"For each created Event Message, the cFE shall store the Event Message in the Local Event Log in the Long Event Message Format.",It's useful to save Event Messages when external communications are unavailable. This may occur during system initialization (especially events generated from other cFE components) and during a communications failure. EVS: Store Message In Event Log - Set Full Flag,cEVS3108.1,"If the Local Event Log becomes full, the cFE shall set the Local Event Log Full Flag to true.",Ground operations needs to know the state of the Local Even Log. EVS: Store Message In Event Log - Increment Overflow Counter,cEVS3108.2,"If the Local Event Log is full, the cFE shall increment the Local Event Log Overflow counter.",Ground operations needs to know how many Event Messages were discarded or overwritten. -EVS: Store Message In Event Log - Log Full Behavior,cEVS3108.3,"If the Local Event Log is full, the cFE shall either (1) overwrite the oldest Event Message if the Event Logging Mode is overwrite, or (2) discard the Event Message if the Event Logging Mode is discard.",Overwriting the oldest message is useful for nominal operations because a user doesn't need to periodically clear the Log. If an error occurs when there's no communication then the Local Event Log size must be large enough to retain the Event Messages since communications was lost. Discarding the newest Event Message is useful for trouble shooting a problem. For example there may be a problem during processor initialization that occurs when there's no communications with the processor interfacing with the User. In this case the original Event Messages are critical to solving the problem so they should be preserved. Note that the Event Logging Mode can be changed via stored commanding. +EVS: Store Message In Event Log - Log Full Behavior,cEVS3108.3,"If the Local Event Log is full, the cFE shall either (1) overwrite the oldest Event Message if the Event Logging Mode is overwrite, or (2) discard the Event Message if the Event Logging Mode is discard.","Overwriting the oldest message is useful for nominal operations because a user doesn't need to periodically clear the Log. If an error occurs when there's no communication, the Local Event Log size must be large enough to retain the Event Messages since communications was lost. Discarding the newest Event Message is useful for trouble shooting a problem. For example, there may be a problem during processor initialization that occurs when there's no communications with the processor interfacing with the User. In this case the original Event Messages are critical to solving the problem so they should be preserved. Note that the Event Logging Mode can be changed via stored commanding." EVS: Message Port Routing,cEVS3109,"For each created Event Message, the cFE shall route the Event Message, formatted as an ASCII text string, to each enabled Event Message Output Port.",Debug ports are very useful for FSW development and maintenance. EVS: Initialize Format On Power On Reset,cEVS3201,"Upon a Power-on Reset, the cFE shall set SB Event Format Mode to `` default mode.","Each mission must determine what format they need, defaulted to LONG." EVS: Initialize Full Flag To False On Power On Reset,cEVS3202,"Upon a Power-on Reset, the cFE shall set the Local Event Log Full Flag to false.",Set cFE to default status across Power-on Resets. @@ -336,7 +336,7 @@ SB: Send Previous Subscriptions,cSB4013,"Upon receipt of a Message, the cFE shal SB: Create Pipe,cSB4301,"Upon receipt of a Request to create a Pipe, the cFE shall create a Pipe with the Request-specified Pipe Depth and the Request-specified name.",Run time creation of Pipes supports the cFE goals of easy Application integration and system reconfiguration. SB: Delete Pipe,cSB4302,"Upon receipt of a Request to delete a Pipe, the cFE shall Unsubscribe all messages to the Request-specified Pipe, then remove the Pipe from the Routing Information.",An Application must be capable of freeing its own resources. SB: Subscribe To Message,cSB4303,"Upon receipt of a Request to Subscribe to an SB message, the cFE shall establish a route using the Request-specified Message ID, the Request-specified Pipe ID, the Request-specified MsgId-to-Pipe limit and the Request-specified QoS.",Run time subscription supports the cFE goals of easy system integration and run time reconfigurations. -SB: Subscribe To Message - Duplicate,cSB4303.1,If the Subscription is a duplicate of a previous subscription then the cFE shall issue an event message.,"Duplicate subscriptions are still a success, however, want to notify the ground." +SB: Subscribe To Message - Duplicate,cSB4303.1,"If the Subscription is a duplicate of a previous subscription, the cFE shall issue an event message.","Duplicate subscriptions are still a success, however, want to notify the ground." SB: Unsubscribe To Message,cSB4304,"Upon receipt of a Request to Unsubscribe to an SB Message, the cFE shall remove the route corresponding to the Request-specified Message Id and the Request-specified Pipe Id from the Routing Information.","Allow an Application to dynamically change what Messages it receives. Since the ground can manipulate the state of the routing, it is not considered an error if the Message is not currently being subscribed to when an unsubscribe request is made." SB: Send Message,cSB4305,"Upon receipt of a Request to send an SB Message, the cFE shall route the SB Message to the Pipes of all Applications that have Subscribed to the SB Message.","This form of message passing, supports one-to-one, one-to-many, and many-to-one (all desired by branch members) in a flexible, low overhead manner. It has been common for telemetry packets to be sent to many destinations, such as a real-time telemetry." SB: Send Message - Message ID To Pipe Limit,cSB4305.1,The cFE shall limit the number of messages of a particular Message ID that can be sent to an Application's Pipe.,"Prevent an errant application from monopolizing a Software Bus Pipe. This feature was part of the heritage software bus and was found to be a useful diagnostic feature. When subscribing to a packet, an Application can specify a limit on the number of Messages for a particular Message ID that can be in the Pipe at one time. The term used for this is MsgId-to-Pipe Limit. @@ -395,18 +395,18 @@ SB: Initialize Routing On Power On Reset,cSB4500,Upon a Power-on Reset the cFE s SB: Initialize Routing On Processor Reset,cSB4501,Upon a Processor Reset the cFE shall initialize the Routing Information and clear all error counters,The cFE must initialize to a known state. TBL: Load Inactive Table From File,cTBL6000,Upon receipt of Command the cFE shall load an Inactive Table Image with the contents of the Command specified File.,Loading from a file allows for multiple versions of a table to be stored on board and loaded to the active table when appropriate. The file header will identify the Table that the file contents are for. TBL: Load Inactive Table From File - Partial Load,cTBL6000.1,"If the Command specified file contains only a portion of the Table, the cFE shall first load an Inactive Table Image with the contents of the Active Table Image and then load the contents of the Command specified File.","A Partial Table load capability is useful when dealing with large Tables. It helps to ensure that additional parameters are not unintentionally modified, reduces command time required to perform a Table update and is a feature that has been used on previous missions." -TBL: Load Inactive Table From File - Greater Than Max Size,cTBL6000.2,If the number of data bytes contained in the file is greater than the maximum size of the table then the load shall be aborted and an event message shall be generated.,This is a sanity check to make sure that the ground generated table load does not include more data than a table can handle. -TBL: Load Inactive Table From File - Header Size Mismatch,cTBL6000.3,If the number of bytes specified in the file's header is not equal to the number of data bytes contained in the file then the load shall be aborted and an event message be generated.,This is another sanity check to make sure that the number of bytes specified in the file header is equal to the number of data bytes in the file. -TBL: Load Inactive Table From File - Multiple Partial Loads,cTBL6000.4,The Inactive Table Image shall only be loaded with the contents of the Active Table if the Inactive Table Image has not been initialized.,Want to be able to perform successive partial table loads. The first partial load of a table requires that the inactive table image be initialized with the active table image (see cTBL6000.2). Any subsequent loads should be made with the existing contents of the Inactive Buffer. -TBL: Load Inactive Table From File - Dump Only,cTBL6000.5,If the specified table is defined as Dump Only then the command shall be rejected and an event message be generated.,Dump only tables cant be loaded. +TBL: Load Inactive Table From File - Greater Than Max Size,cTBL6000.2,"If the number of data bytes contained in the file is greater than the maximum size of the table, the load shall be aborted and an event message shall be generated.",This is a sanity check to make sure that the ground generated table load does not include more data than a table can handle. +TBL: Load Inactive Table From File - Header Size Mismatch,cTBL6000.3,"If the number of bytes specified in the file's header is not equal to the number of data bytes contained in the file, the load shall be aborted and an event message be generated.",This is another sanity check to make sure that the number of bytes specified in the file header is equal to the number of data bytes in the file. +TBL: Load Inactive Table From File - Multiple Partial Loads,cTBL6000.4,The Inactive Table Image shall only be loaded with the contents of the Active Table if the Inactive Table Image has not been initialized.,Want to be able to perform successive partial table loads. The first partial load of a table requires that the inactive table image be initialized with the active table image (see cTBL6000.2). Any subsequent loads should be made with the existing contents of the Inactive Buffer. +TBL: Load Inactive Table From File - Dump Only,cTBL6000.5,If the specified table is defined as Dump Only then the command shall be rejected and an event message be generated.,Dump only tables can't be loaded. TBL: Dump To File,cTBL6001,Upon receipt of Command the cFE shall dump the Command specified Active or Inactive Table contents to a Command specified File.,Dumping the contents of a table to a file simplifies the telemetering of Table contents. The file transfer protocol between the ground and the spacecraft is capable of handling variable sized files. The telemetering of Table contents directly to ground. TBL: Validate,cTBL6002,Upon receipt of Command the cFE shall determine the validity of the contents of either the Active or Inactive Table Image of the Command specified Table.,"Operations needs to verify the contents of an Inactive Table before committing it. Similarly, operations personnel may need to re-validate or identify the contents of an Active Table." TBL: Validate - Compute Data Integrity Check Value,cTBL6002.1,The cFE shall compute a Data Integrity Check Value on the contents of either the Active or Inactive Table Image of the Command specified Table and report the result in telemetry.,A Data Integrity Check Value can provide a quick method of validating the proper contents of a Table without performing a Table Dump and Comparison. -TBL: Validate - App Content,cTBL6002.2,The cFE shall Request an Application to validate the contents of either the Active or Inactive Table Image of the Command specified Table and report the result in telemetry.,A Table Validation function provided by the Application can verify that the data content of a Table are reasonable. +TBL: Validate - App Content,cTBL6002.2,The cFE shall Request an Application to validate the contents of either the Active or Inactive Table Image of the Command specified Table and report the result in telemetry.,A Table Validation function provided by the Application can verify that the data content of a Table is reasonable. TBL: Activate,cTBL6003,Upon receipt of Command the cFE shall make an Inactive Table Image of the Command specified Table the Active Table Image.,"A Commit Command is useful by allowing modifications and the verification of those modifications to be accomplished in the background while an Application continues to use its previous Table data. Then, upon Command, the new Table data is made Active." TBL: Activate - Validate,cTBL6003.1,The cFE shall reject an activate table command for a table that has a validation function but has not been validated.,Validation functions are there for a reason so want to prevent loading invalid tables. Inactive buffer retains the data so that the ground can dump the contents to see why the validation failed. -TBL: Activate - Validate - Failure,cTBL6003.1.1,If the Inactive Table Image fails validation then the Inactive Table Image shall not be loaded into the Active Table Image.,Prevent loading of an invalid table. Note that the Inactive Table still contains the table image so that the ground can dump it. -TBL: Activate - Validate - No Validation Function,cTBL6003.1.2,"If a Table Validation Function does not exist for the specified Table, the Table shall be considered valid.",If there is no validation function then assume the table has good data in it (no way to check otherwise). +TBL: Activate - Validate - Failure,cTBL6003.1.1,"If the Inactive Table Image fails validation, the Inactive Table Image shall not be loaded into the Active Table Image.",Prevent loading of an invalid table. Note that the Inactive Table still contains the table image so that the ground can dump it. +TBL: Activate - Validate - No Validation Function,cTBL6003.1.2,"If a Table Validation Function does not exist for the specified Table, the Table shall be considered valid.","If there is no validation function, assume the table has good data in it (no way to check otherwise)." TBL: Write Table Registry To File,cTBL6005,Upon receipt of Command the cFE shall write the contents of the Table Registry to a file.,"The Table Registry will provide a list of the Tables currently registered, their attributes (double or single-buffered, dump-only, etc), a history of what files were last loaded into the Active Table Images, what time the load occurred and whether the image has been modified via Partial Table Load." TBL: Write Table Registry To File - Default File Name,cTBL6005.1,"If a file is not specified, the cFE shall use the `` filename.",Want to provide a default in the event that a user does not want to specify one. TBL: Table Registry Message,cTBL6006,Upon receipt of Command the cFE shall telemeter the contents of the Table Registry associated with a Command specified Table.,"Operations personnel may wish to see the attributes (double or single-buffered, dump-only, etc), a history of what file(s) was/were last loaded into the Active Table Image, what time the load(s) occurred, etc." @@ -419,7 +419,7 @@ TBL: Zero Counters,cTBL6008,"Upon receipt of Command the cFE shall set the follo - Number of successful Table Validations - Number of Unsuccessful Validations - Number of Completed Validations",This command is a common feature in heritage sub-system software design. -TBL: Valid Command Counter,cTBL6009,"Upon receipt of valid command, the cFE shall increment the valid command counter.",The ground needs the capability to verify that the command was received a accepted by the cFE. Details of valid commands are documented in the cFE User's Guide. +TBL: Valid Command Counter,cTBL6009,"Upon receipt of valid command, the cFE shall increment the valid command counter.",The ground needs the capability to verify that the command was received and accepted by the cFE. Details of valid commands are documented in the cFE User's Guide. TBL: Invalid Command Counter,cTBL6010,"Upon receipt of an invalid command, the cFE shall in increment the invalid command counter.",The ground needs an indicator if a command is rejected by the cFE. Details of what makes a command invalid are documented in the cFE User's Guide. TBL: Housekeeping Message,cTBL6011,"Upon receipt of a Message, the cFE shall generate a housekeeping message that includes the following Table Services items: @@ -439,13 +439,13 @@ TBL: Abort Load,cTBL6012,"Upon receipt of Command the cFE shall abort the loadin ","The ground needs a way to clear the inactive buffer of all loads in the event, for example, that erroneous values were loaded to the table by the ground. Note that once a table is activated, it cannot be aborted (significant for double-buffer tables)." TBL: Abort Load - Release Shared Buffer,cTBL6012.1,"If the Table buffering characteristics for the specified Table indicate that it is a Single-buffered Table, then the allocated shared buffer shall be released.",The shared buffer being used for this table load should be placed back into the pool of available shared buffers. TBL: Abort Load - Mark Inactive Buffer Uninitialized,cTBL6012.2,"If the Table buffering characteristics for the specified Table indicate that it is a Double-buffered table, then the inactive buffer shall be marked as uninitialized.",Need to make sure that the table image gets re-initialized with the contents of the active buffer prior to a subsequent load after an abort command is sent (see cTBL6000.4) -TBL: Abort Load - No Loads Pending,cTBL6012.3,The Table Registry shall indicate that there are no loads pending for the specified Table.,Status of the table needs to updated to reflect that. +TBL: Abort Load - No Loads Pending,cTBL6012.3,The Table Registry shall indicate that there are no loads pending for the specified Table.,Maintain current table status in table registry. TBL: Delete CDS,cTBL6013,Upon receipt of a Command the cFE shall delete the requested table CDS data.,CDS management for a table no longer in use. TBL: Delete CDS - Table In Use,cTBL6013.1,If the specified Table is in use the command shall be rejected and an event message generated.,Reject if table is in use. -TBL: Delete CDS - Not Critical Table,cTBL6013.2,If the specified table is not a critical table the command shall be rejected and an event message generated.,Reject when not a critical table. +TBL: Delete CDS - Not Critical Table,cTBL6013.2,"If the specified table is not a critical table, the command shall be rejected and an event message generated.",Reject when not a critical table. TBL: Delete CDS - Already Deleted,cTBL6013.3,If the specified Table CDS has already been deleted the command shall be rejected and an event message generated.,Reject if table CDS has already been deleted. -TBL: Create,cTBL6300,"Upon receipt of Request, the cFE shall create a zero filled Table Image with the Request specified name, size, buffering characteristics (single or double-buffer), dump-only characteristics, criticality and Table Validation Function address.","Supports the cFE's dynamic Application model. Tables will be able to be either single or double-buffered. Double-buffering will allow instantaneous updates from the Application's point of view and will be useful for interrupt service routines, etc. However, double-buffering will consume more memory resources. The Table Validation Function is optionally provided by the Application and is called when a Command to Validate the table is made. Note that a zero filled image will not be created if the Application specifies an address for the dump-only table (see cTBL6300.1)." -TBL: Create - App Supplied Address For Dump Only,cTBL6300.1,The cFE shall allow an Application to specify an address as the one and only buffer for a dump-only Table.,"Heritage code allowed for dump only tables to come from an address instead of a true table. In this case, table services does not allocate any memory for the dump only table. This is referred to an an Application-Defined-Address-Table." +TBL: Create,cTBL6300,"Upon receipt of Request, the cFE shall create a zero filled Table Image with the Request specified name, size, buffering characteristics (single or double-buffer), dump-only characteristics, criticality and Table Validation Function address.","Supports the cFE's dynamic Application model. Tables will be able to be either single or double-buffered. Double buffering will allow instantaneous updates from the Application's point of view and will be useful for interrupt service routines, etc. However, double buffering will consume more memory resources. The Table Validation Function is optionally provided by the Application and is called when a Command to Validate the table is made. Note that a zero filled image will not be created if the Application specifies an address for the dump-only table (see cTBL6300.1)." +TBL: Create - App Supplied Address For Dump Only,cTBL6300.1,The cFE shall allow an Application to specify an address as the one and only buffer for a dump-only Table.,"Heritage code allowed for dump only tables to come from an address instead of a true table. In this case, table services does not allocate any memory for the dump only table. This is referred to an Application-Defined-Address-Table." TBL: Initialize Contents,cTBL6302,"Upon receipt of Request, the cFE shall initialize the contents of the Request specified Table Image with the contents of the Request specified File.",Supports the cFE's dynamic Application model. TBL: Initialize Contents - Greater Than Max Size,cTBL6302.1,"If the Request specified File contains more data than the size of the Request specified Table, the Table Image will not be initialized and an Event Message shall be generated.","If a File contains more data than memory allows, there is a high likelihood that the Application is expecting the data to be in a different format. Additionally, the cFE would not know whether to throw out the last part or the first part of the data." TBL: Initialize Contents - Partial,cTBL6302.2,"If the Request specified File contains less data than the size of the Request specified Table, the first portion of the Table Image will be initialized with the contents of the File and an Event Message shall be generated.",Some tables may allocate more space than is necessary at all times. The Event Message will serve as a warning but not prevent the initialization of the Table. @@ -457,7 +457,7 @@ TBL: Provide Data Address - Lock Contents,cTBL6305.1,"Upon providing a calling A TBL: Provide Data Address - Modified Notification,cTBL6305.2,"If a Table has been modified since the last Table address request, the cFE shall notify the calling Application that the Table has been modified.",An Application may need to know when the contents of a Table have been updated. TBL: Unlock,cTBL6306,"Upon receipt of Request, the cFE shall unlock the contents of the Request specified Table.","The Table Service must wait for an Application to be done with the contents of the Table before considering modifying its contents. This ensures data integrity while the Application accesses the Table contents. More than one Application can access a Table. Therefore, a reference count will be necessary to ensure that all access is complete before a Table can be modified." TBL: Update With Pending Load,cTBL6308,"Upon receipt of Request, the cFE shall update the request specified Table if a load is pending and it is unlocked.",This gives control to the Application as to when the table update occurs. -TB: Update With Pending Load - Locked,cTBL6308.1,"If a Table is locked when an update Request is made, an appropriate error code shall be returned to the calling Application and the update shall not occur.",The Application should be made aware that the table is not being updated because it is locked. +TBL: Update With Pending Load - Locked,cTBL6308.1,"If a Table is locked when an update Request is made, an appropriate error code shall be returned to the calling Application and the update shall not occur.",The Application should be made aware that the table is not being updated because it is locked. TBL: Provide Table Info,cTBL6309,"Upon receipt of Request, the cFE shall provide the following information to the calling Application for the specified Table: - Size of the table @@ -474,8 +474,8 @@ TBL: Provide Data Addresses,cTBL6311,"Upon receipt of Request, the cFE shall pro TBL: Provide Data Addresses - Lock Contents,cTBL6311.1,"Upon providing a calling Application with the addresses of a Tables' data, the cFE shall lock the contents of the Tables to prevent modification.",The Table Service must wait for an Application to be done with the contents of the Table before considering modifying its contents. This ensures data integrity while the Application accesses the Table contents. TBL: Provide Data Addresses - Modified Notification,cTBL6311.2,"If at least one Table has been modified since the last Table addresses request, the cFE shall notify the calling Application that a Table has been modified.","An Application may need to know when the contents of a Tables has been updated; the Application just won't know which one." TBL: Unlocks,cTBL6312,"Upon receipt of Request, the cFE shall unlock the contents of the Request specified Tables.",Applications may need to work with more than one table at a time. -TBL: Validate,cTBL6313,Upon receipt of a Request the cFE shall determine the validity of the contents of either the Active or Inactive Table Image of the requested Table if a validation request is pending.,"Performs table validation if a validation request is pending. This check is nominally performed during table management when validation has been requested, but can performed independent of table management." -TBL: Dump To Buffer,cTBL6314,Upon receipt of a Request the cFE shall dump the requested Table to a buffer if a dump request is pending.,"Performs table dump to a buffer if a dump request is pending. This check is nominally performed during table management when a dump has been requested, but can performed independent of table management." +TBL: Validate,cTBL6313,Upon receipt of a Request the cFE shall determine the validity of the contents of either the Active or Inactive Table Image of the requested Table if a validation request is pending.,Performs table validation if a validation request is pending. This check is nominally performed during table management when validation has been requested but can performed independent of table management. +TBL: Dump To Buffer,cTBL6314,Upon receipt of a Request the cFE shall dump the requested Table to a buffer if a dump request is pending.,Performs table dump to a buffer if a dump request is pending. This check is nominally performed during table management when a dump has been requested but can performed independent of table management. TBL: Modified,cTBL6315,"Upon receipt of a Request, the cFE shall perform the following actions on a Table: - Update critical table data in CDS @@ -490,7 +490,7 @@ TBL: Manage,cTBL6316,"Upon receipt of a Request, the cFE shall perform the follo - Update Table if request pending",Capability to process standard pending requests on a table. TBL: Free Resources On Power On Reset,cTBL6500,Upon a Power-on Reset all Table resources shall be freed.,The Table Service cannot assume the contents of any Table is legitimate after a reset. TBL: Free Resources On Processor Reset,cTBL6501,Upon a Processor Reset all Table resources shall be freed.,The Table Service cannot assume the contents of any Table is legitimate after a reset. -TBL: Free Resources On Processor Reset - Preserve Critical,cTBL6501.1,If the Table is a critical table then the contents of the Table shall be preserved.,Goal of a processor reset is preserve certain data to facilitate recovery. +TBL: Free Resources On Processor Reset - Preserve Critical,cTBL6501.1,If the Table is a critical table then the contents of the Table shall be preserved.,Goal of a processor reset is to preserve certain data to facilitate recovery. TIME: Housekeeping Message,cTIME2000,"Upon receipt of a Message, the cFE shall generate a housekeeping message that includes the following Time Services items: - Time Status @@ -500,23 +500,23 @@ TIME: Housekeeping Message,cTIME2000,"Upon receipt of a Message, the cFE shall g - STCF continuous adjustment value.",Generate housekeeping message for system awareness and management. TIME: NOOP Event,cTIME2001,Upon receipt of Command the cFE shall generate a NO-OP event message.,This command is useful as a general sub-system aliveness test. TIME: Zero Counters,cTIME2002,Upon receipt of Command the cFE shall set to zero all counters reported in Time Services telemetry.,This command is a common feature in heritage sub-system software design. -TIME: Valid Command Counter,cTIME2003,"Upon receipt of valid command, the cFE shall increment the valid command counter.",The ground needs the capability to verify that the command was received and accepted by the cFE. Details of valid commands are documented in the cFE User's Guide. +TIME: Valid Command Counter,cTIME2003,"Upon receipt of valid command, the cFE shall increment the valid command counter.",The ground needs the capability to verify that the command was received and accepted by the cFE. Details of valid commands are documented in the cFE User's Guide. TIME: Invalid Command Counter,cTIME2004,"Upon receipt of an invalid command, the cFE shall in increment the invalid command counter.",The ground needs an indicator if a command is rejected by the cFE. Details of what makes a command invalid are documented in the cFE User's Guide. TIME: Set Leap Seconds,cTIME2005,Upon receipt of Command the cFE shall set the number of Leap Seconds to the Command-specified value.,The decision to introduce a leap second in UTC is the responsibility of the International Earth Rotation Service (IERS). The count of Leap Seconds has been incremented about every 500 days since 1972. It is therefore likely that a mission will need to update. TIME: Set STCF,cTIME2006,Upon receipt of Command the cFE shall set the STCF to the Command specified value.,"The cFE must be provided with the appropriate correlation factor, that when combined with the current MET and Leap Seconds values, will result in current time. Historically this command has been referred to as 'jam loading' time." -TIME: Update STCF Given Current Time,cTIME2007,Upon receipt of Command the cFE shall compute a new value for STCF using the Command-specified value as current time.,"This command provides a useful alternative to setting the STCF explicitly, as the command does not require knowledge of the current MET value. If the default time format is TAI then the new value for STCF is the Command-specified time value less MET." +TIME: Update STCF Given Current Time,cTIME2007,Upon receipt of Command the cFE shall compute a new value for STCF using the Command-specified value as current time.,"This command provides a useful alternative to setting the STCF explicitly, as the command does not require knowledge of the current MET value. If the default time format is TAI, the new value for STCF is the Command-specified time value less MET." TIME: Delta Adjust STCF,cTIME2009,Upon receipt of Command the cFE shall make a continuous 1Hz delta adjustment to the STCF by the Command-specified value.,"Upon receipt of a Command to make a 'continuous' adjustment to the STCF, the cFE shall adjust the STCF each second by the Command-specified value. The commanded value is signed so a positive or negative adjustment may be made." -TIME: Switch Tone Signal Source,cTIME2010,Upon receipt of Command the cFE shall switch to the Command-specified Tone Signal source.,"The behavior of this command is hardware specific, but provides the capability to command Tone Signal source selection if implemented at the hardware level." +TIME: Switch Tone Signal Source,cTIME2010,Upon receipt of Command the cFE shall switch to the Command-specified Tone Signal source.,The behavior of this command is hardware specific but provides the capability to command Tone Signal source selection if implemented at the hardware level. TIME: Diagnostic Message,cTIME2011,Upon receipt of Command the cFE shall generate a Software Bus message that includes time diagnostic information.,"When testing or debugging the time application, more details about time services are required." TIME: External Time Update Mode,cTIME2012,"Upon receipt of Command the cFE Time Services shall set the External Time Update Mode to the specified value, either use or ignore Tone Signal and Data when updating time.",Historically referred to as forced flywheeling. This provides an easy way to test local time calculations and compare against external time or force internal timekeeping operationally. -TIME: External Time Update Mode - Ignore Updates,cTIME2012.1,The cFE shall propagate time internally when set to ignore external time updates.,"Ignore external time updates and update time internally when configured to do so. Will still accept Tone Signal and Data, but won't update timekeeping based on the externally provided timing information." +TIME: External Time Update Mode - Ignore Updates,cTIME2012.1,The cFE shall propagate time internally when set to ignore external time updates.,Ignore external time updates and update time internally when configured to do so. Will still accept Tone Signal and Data but won't update timekeeping based on the externally provided timing information. TIME: External Time Update Mode - Use Updates,cTIME2012.2,The cFE shall update timekeeping when a Tone Signal and Data pair have been received when set to use external time updates.,"Use external time updates to update timekeeping values when configured to do so. Timekeeping in this context is intentionally vague since it depends on system mode, configuration and hardware implementation. This requirement just covers using the external data, not how exactly it is used." -TIME: Add To SCTF,cTIME2013,Upon receipt of Command the cFE shall add the Command specified value to SCTF.,One time (aka jump) value added to SCTF supports time adjustment for time servers or time clients that are set to ignore external Tone updates. -TIME: Subtract From SCTF,cTIME2014,Upon receipt of Command the cFE shall subtract the Command specified value from SCTF.,One time (aka jump) value subtracted from SCTF supports time adjustment for time servers or time clients that are set to ignore external Tone updates. +TIME: Add To SCTF,cTIME2013,Upon receipt of Command the cFE shall add the Command specified value to SCTF.,One-time (aka jump) value added to SCTF supports time adjustment for time servers or time clients that are set to ignore external Tone updates. +TIME: Subtract From SCTF,cTIME2014,Upon receipt of Command the cFE shall subtract the Command specified value from SCTF.,One-time (aka jump) value subtracted from SCTF supports time adjustment for time servers or time clients that are set to ignore external Tone updates. TIME: Tone Data Send,cTIME2015,"Upon receipt of a Message, the cFE shall generate a message that contains Tone Data.",Enables scheduler or another app to schedule time at tone data messages. TIME: Tone Data Update,cTIME2016,"Upon receipt of a Message, the cFE shall update timekeeping if a paired Tone Signal has been received.","Once a Tone Data and Signal pair are received, timekeeping will be updated if External Data Use is enabled. Paired statement allows for time is or time was configuration (Data before or after Signal)." TIME: Tone Signal Update,cTIME2017,"Upon receipt of a Message, the cFE shall update timekeeping if paired Tone Data has been received.","Once a Tone Data and Signal pair are received, timekeeping will be updated if External Data Use is enabled. Paired statement allows for time is or time was configuration (Data before or after Signal)." -TIME: Trigger 1Hz Cycle Processing,cTIME2018,"Upon receipt of a Message, the cFE shall trigger the 1 Hz processing cycle.","Allows message triggered 1 Hz processing to support synchronization. Actually processing depends on configuration such as registered synchronization callbacks, virtualized MET, etc so it's left as generic language in this requirement." +TIME: Trigger 1Hz Cycle Processing,cTIME2018,"Upon receipt of a Message, the cFE shall trigger the 1 Hz processing cycle.","Allows message triggered 1 Hz processing to support synchronization. Processing depends on configuration such as registered synchronization callbacks, virtualized MET, etc so it's left as generic language in this requirement." TIME: Set MET,cTIME2019,"Upon receipt of a Command, the cFE shall update MET with the provided value.","Hardware and configuration dependent command allows the capability to set MET if it is supported. If not utilizing a virtual MET, the hardware will reject the command if not supported." TIME: Add to Source Time,cTIME2020,"Upon receipt of a Command, the cFE shall adjust timekeeping by adding the provided delta time.","Capability to adjust timekeeping independent of Tone and SCTF. Used to tune a system given Tone, 1Hz, or MET external dependencies. Timekeeping here remains abstract since it's dependent on configuration and mode governed by other requirements. Delta time persists until removed (independent of other external updates)." TIME: Subtract From Source Time,cTIME2021,"Upon receipt of a Command, the cFE shall adjust timekeeping by subtracting the provided delta time.","Capability to adjust timekeeping independent of Tone and SCTF. Used to tune a system given Tone, 1Hz, or MET external dependencies. Timekeeping here remains abstract since it's dependent on configuration and mode governed by other requirements. Delta time persists until removed (independent of other external updates)." @@ -542,8 +542,8 @@ TIME: Register Synchronization Callback,cTIME2318,"Upon receipt of a Request, th TIME: Unregister Synchronization Callback,cTIME2319,"Upon receipt of a Request, the cFE shall unregister the requested function for callback upon receipt of Tone Signal.",Manage synchronization of calls at receipt of Tone Signal. TIME: Get Clock State Flags,cTIME2320,"Upon receipt of a Request, the cFE shall provide the clock state flags.",Provides clock state converted to flag values. TIME: Convert MET to Spacecraft Time,cTIME2321,"Upon receipt of a Request, the cFE shall convert the provided MET to spacecraft time.",Converts the provided MET to spacecraft time based on current configuration of the system. -TIME: Trigger 1Hz Cycle Processing,cTIME2322,"Upon receipt of a Request, the cFE shall trigger the 1 Hz processing cycle.","Allows API triggered 1 Hz processing to support synchronization. Actually processing depends on configuration such as registered synchronization callbacks, virtualized MET, etc so it's left as generic language in this requirement." -TIME: Trigger Tone Signal Processing,cTIME2323,"Upon receipt of a Request, the cFE shall trigger the Tone Signal processing cycle.","Allows API triggered Tone Signal processing to support synchronization. Actually processing depends on configuration such as registered synchronization callbacks, virtualized MET, etc so it's left as generic language in this requirement." +TIME: Trigger 1Hz Cycle Processing,cTIME2322,"Upon receipt of a Request, the cFE shall trigger the 1 Hz processing cycle.","Allows API triggered 1 Hz processing to support synchronization. Processing depends on configuration such as registered synchronization callbacks, virtualized MET, etc so it's left as generic language in this requirement." +TIME: Trigger Tone Signal Processing,cTIME2323,"Upon receipt of a Request, the cFE shall trigger the Tone Signal processing cycle.","Allows API triggered Tone Signal processing to support synchronization. Processing depends on configuration such as registered synchronization callbacks, virtualized MET, etc so it's left as generic language in this requirement." TIME: Power On Reset Default Values,cTIME2500,"Upon a Power-on Reset the cFE shall set the following time elements to their `` default values: - Time Status Data @@ -555,7 +555,7 @@ TIME: Processor Reset CDS Values,cTIME2501,"Upon a Processor Reset the cFE shall - STCF - Leap Seconds","Time is a critical system resource and every effort should be made to preserve it. Following a processor reset, the presumption is that the MET h/w register is unaffected and that previously 'good' values for STCF and Leap Seconds can still be used to correct." TIME: Processor Reset Verify CDS,cTIME2502,Upon a Processor Reset the cFE shall verify the Critical Data Store used to store time values.,"Verification of potentially damaged stored data is a standard practice. Note that because time can be any value, verification potentially involves using a pattern." -TIME: Processor Reset Verify CDS - Initialize On Failure,cTIME2502.1,"If the critical data store is not valid, all of the time elements shall be initialized in the same fashion as following a power-on reset.",If the CDS can't be trusted then need to initialize to default values. +TIME: Processor Reset Verify CDS - Initialize On Failure,cTIME2502.1,"If the critical data store is not valid, all of the time elements shall be initialized in the same fashion as following a power-on reset.","If the CDS can't be trusted, initialize to default values." TIME: CDS Elements,cTIME2700,"During normal operation, the cFE shall preserve the following time elements in the `` Critical Data Store: - Time Status Data From 7320f2f126eab2c0f0224f7a1b8a0b882cd45b29 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 13 Sep 2021 10:14:17 -0400 Subject: [PATCH 008/200] Fix #1944, use 0 as the invalid CFE_SB_MsgId_t value Historically the CFE_SB_MSG_ID_INVALID constant was defined as 0xFFFFFFFF/-1, where 0 was considered valid. Although 0 is indeed valid for the first word of a CCSDS primary spacepacket header, it is not actually valid for use with SB. Because SB is now more decoupled from CCSDS header definitions, there are a number of advantages to using 0 instead of -1, as it is more passively safe: - Objects which are cleared as part of normal BSS clearing will be set invalid - Objects which are memset to zero will be set invalid In contrast, when the invalid value is nonzero, objects which are memset/cleared are valid by default, and must be actively set invalid to be safe. --- modules/cfe_testcase/src/msg_api_test.c | 2 +- modules/core_api/fsw/inc/cfe_sb_api_typedefs.h | 4 ++-- .../msg/ut-coverage/test_cfe_msg_msgid_shared.c | 2 +- modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c | 6 +++--- modules/sb/ut-coverage/sb_UT.c | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/cfe_testcase/src/msg_api_test.c b/modules/cfe_testcase/src/msg_api_test.c index ddeb29b6a..84c3fa6a3 100644 --- a/modules/cfe_testcase/src/msg_api_test.c +++ b/modules/cfe_testcase/src/msg_api_test.c @@ -50,7 +50,7 @@ void TestMsgApiBasic(void) bool _returned = false; memset(&cmd, 0xFF, sizeof(cmd)); - msgId = CFE_SB_ValueToMsgId(0); + msgId = CFE_SB_ValueToMsgId(1); /* test msg-init */ UtAssert_INT32_EQ(CFE_MSG_Init(NULL, msgId, sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); 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 95a92fecc..5669924fd 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -96,7 +96,7 @@ * This rvalue macro can be used for static/compile-time data initialization to ensure that * the initialized value does not alias to a valid MsgId object. */ -#define CFE_SB_MSGID_RESERVED CFE_SB_MSGID_WRAP_VALUE(-1) +#define CFE_SB_MSGID_RESERVED CFE_SB_MSGID_WRAP_VALUE(0) /** * \brief A literal of the CFE_SB_MsgId_t type representing an invalid ID @@ -109,7 +109,7 @@ * purposes (rvalue), #CFE_SB_MSGID_RESERVED should be used instead. * However, in the current implementation, they are equivalent. */ -#define CFE_SB_INVALID_MSG_ID CFE_SB_MSGID_C(-1) +#define CFE_SB_INVALID_MSG_ID CFE_SB_MSGID_C(0) /** * \brief Cast/Convert a generic CFE_ResourceId_t to a CFE_SB_PipeId_t diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c index 759409a3c..65151ab22 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c @@ -46,7 +46,7 @@ void Test_MSG_GetTypeFromMsgId(void) UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Bad parameter tests, Invalid message ID"); - UtAssert_INT32_EQ(CFE_MSG_GetTypeFromMsgId(CFE_SB_INVALID_MSG_ID, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetTypeFromMsgId(CFE_SB_ValueToMsgId(-1), &actual), CFE_MSG_BAD_ARGUMENT); UtPrintf("Set to all F's, test cmd and tlm"); memset(&msg, 0xFF, sizeof(msg)); diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c index 9728d1cf7..976e00059 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c @@ -56,14 +56,14 @@ void Test_MSG_MsgId(void) UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0xFFFF)), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); - UtPrintf("Set msg to all F's, set msgid to 0 and verify"); + UtPrintf("Set msg to all F's, set msgid to 1 and verify"); memset(&msg, 0xFF, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&msg, &msgid)); UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0xFFFF); - CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0))); + CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(1))); UT_DisplayPkt(&msg, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&msg, &msgid)); - UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 1); UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_HDRVER_FLAG | MSG_APID_FLAG | MSG_TYPE_FLAG | MSG_HASSEC_FLAG); UtPrintf("Set msg to all 0, set msgid to max and verify"); diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 79bf145ec..17b7e0bd6 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -91,7 +91,7 @@ const CFE_SB_MsgId_t SB_UT_LAST_VALID_MID = CFE_SB_MSGID_WRAP_VALUE(CFE_PLATFORM * This is a "borderline" value to test the limits of the validity checking * The specific value depends on how MsgId is actually defined internally */ -const CFE_SB_MsgId_t SB_UT_FIRST_VALID_MID = CFE_SB_MSGID_WRAP_VALUE(0); +const CFE_SB_MsgId_t SB_UT_FIRST_VALID_MID = CFE_SB_MSGID_WRAP_VALUE(1); /* * A MsgId value which is in the middle of the valid range @@ -1480,7 +1480,7 @@ void Test_SB_Cmds_SendPrevSubs(void) NumEvts = 2; /* one for each pipe create */ /* Two full pkts to be sent plus five entries in a partial pkt, skipping MSGID 0x0D */ - for (i = 0; i < CFE_SB_SUB_ENTRIES_PER_PKT * 2 + 5; i++) + for (i = 1; i < (CFE_SB_SUB_ENTRIES_PER_PKT * 2) + 6; i++) { /* Skip subscribing to ALLSUBS mid. This is the one we are testing. * MsgID for this in CCSDS v.1 was 0x180d so this MID did not appear in the @@ -1488,7 +1488,7 @@ void Test_SB_Cmds_SendPrevSubs(void) * testing here so it is irrelevant * For CCSDS v.2 CFE_SB_ALLSUBS_TLM_MID (0x0d) now appears in the * SB subscription list and thus we must skip adding 0x0D to the list - * as we were going from MSGID 0-45 (0x00-0x2D) + * as we were going from MSGID 1-46 (0x01-0x2E) * */ if (i != CFE_SB_ALLSUBS_TLM_MID) { @@ -1533,7 +1533,7 @@ void Test_SB_Cmds_SendPrevSubs(void) /* Round out the number to three full pkts in order to test branch path * coverage, MSGID 0x0D was skipped in previous subscription loop */ - for (; i < CFE_SB_SUB_ENTRIES_PER_PKT * 3; i++) + for (; i < (CFE_SB_SUB_ENTRIES_PER_PKT * 3) + 1; i++) { CFE_UtAssert_SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId1)); NumEvts += 1; @@ -2571,18 +2571,18 @@ void Test_Subscribe_MaxMsgIdCount(void) { if (i < CFE_PLATFORM_SB_MAX_MSG_IDS) { - CFE_UtAssert_SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(1 + i), PipeId2)); } else { - UtAssert_INT32_EQ(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId2), CFE_SB_MAX_MSGS_MET); + UtAssert_INT32_EQ(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(1 + i), PipeId2), CFE_SB_MAX_MSGS_MET); } } UtAssert_UINT32_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakMsgIdsInUse, CFE_PLATFORM_SB_MAX_MSG_IDS); CFE_UtAssert_EVENTSENT(CFE_SB_MAX_MSGS_MET_EID); - CFE_UtAssert_SUCCESS(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(0), PipeId1)); + CFE_UtAssert_SUCCESS(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(1), PipeId1)); UtAssert_UINT32_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakMsgIdsInUse, CFE_PLATFORM_SB_MAX_MSG_IDS); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId0)); From 6cf6d4cdbd747c775364d6d821dc7b6438a47a17 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 22 Sep 2021 17:16:20 -0400 Subject: [PATCH 009/200] Fix #245, use type safe value for CFE_SB_MsgId_t This makes CFE_SB_MsgId_t to be a safe wrapper around CFE_SB_MsgId_Atom_t, such that the values cannot be silently/implicitly interchanged with other integers. This enforces that the MsgId/Value conversion helpers must be used when conversion to/from integers is intended. --- modules/core_api/fsw/inc/cfe_sb_api_typedefs.h | 7 +++++-- modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) 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 5669924fd..fa5a7f2d0 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -63,7 +63,10 @@ * * \sa CFE_SB_ValueToMsgId() */ -#define CFE_SB_MSGID_WRAP_VALUE(val) (val) +#define CFE_SB_MSGID_WRAP_VALUE(val) \ + { \ + val \ + } /** * \brief Translation macro to convert to MsgId integer values from a literal @@ -88,7 +91,7 @@ * * \sa CFE_SB_MsgIdToValue() */ -#define CFE_SB_MSGID_UNWRAP_VALUE(mid) ((CFE_SB_MsgId_Atom_t)(mid)) +#define CFE_SB_MSGID_UNWRAP_VALUE(mid) ((mid).Value) /** * \brief Reserved value for CFE_SB_MsgId_t that will not match any valid MsgId diff --git a/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h index 3ccf2f8f9..bc58e23e9 100644 --- a/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h @@ -115,7 +115,10 @@ typedef uint32 CFE_SB_MsgId_Atom_t; * @note In a future version it could become a type-safe wrapper similar to the route index, * to avoid message IDs getting mixed between other integer values. */ -typedef CFE_SB_MsgId_Atom_t CFE_SB_MsgId_t; +typedef struct +{ + CFE_SB_MsgId_Atom_t Value; +} CFE_SB_MsgId_t; /** \brief CFE_SB_PipeId_t to primitive type definition * From 8e24232c8674837195bddc4e65a65501480e8fd4 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 29 Sep 2021 10:09:15 -0400 Subject: [PATCH 010/200] Fix #1982, extended header definitions and test updates Do not double-typedef the CFE_MSG types when using extended headers. This also corrects a call to UT_SetForceFail in the extended header test, which was renamed. --- .../msg/option_inc/default_cfe_msg_hdr_priext.h | 17 +++++++---------- modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) 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 3205aca87..bea3c3f0a 100644 --- a/modules/msg/option_inc/default_cfe_msg_hdr_priext.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h @@ -36,6 +36,7 @@ #include "common_types.h" #include "ccsds_hdr.h" #include "cfe_msg_sechdr.h" +#include "cfe_msg_api_typedefs.h" /* * Type Definitions @@ -60,34 +61,30 @@ typedef struct /** * \brief cFS generic base message */ -typedef union +union CFE_MSG_Message { CCSDS_SpacePacket_t CCSDS; /**< \brief CCSDS Header (Pri or Pri + Ext) */ uint8 Byte[sizeof(CCSDS_SpacePacket_t)]; /**< \brief Byte level access */ -} CFE_MSG_Message_t; +}; /** * \brief cFS command header */ -typedef struct +struct CFE_MSG_CommandHeader { - CFE_MSG_Message_t Msg; /**< \brief Base message */ CFE_MSG_CommandSecondaryHeader_t Sec; /**< \brief Secondary header */ uint8 Spare[4]; /**< /brief Pad to avoid compiler padding if payload requires 64 bit alignment */ - -} CFE_MSG_CommandHeader_t; +}; /** * \brief cFS telemetry header */ -typedef struct +struct CFE_MSG_TelemetryHeader { - CFE_MSG_Message_t Msg; /**< \brief Base message */ CFE_MSG_TelemetrySecondaryHeader_t Sec; /**< \brief Secondary header */ - -} CFE_MSG_TelemetryHeader_t; +}; #endif /* DEFAULT_CFE_MSG_HDR_PRIEXT_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c index 146b34cab..7003bc5c3 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c @@ -66,7 +66,7 @@ void Test_MSG_Init_Ext(void) is_v1 = !hassec; /* Set up return */ - UT_SetForceFail(UT_KEY(CFE_PSP_GetSpacecraftId), sc_id); + UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_GetSpacecraftId), sc_id); UtPrintf("Set to all F's, msgid value = 0"); memset(&msg, 0xFF, sizeof(msg)); From 7440e82546c6e469d0119ed7f9531e1bdbe9e692 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 20 Sep 2021 13:32:37 -0400 Subject: [PATCH 011/200] Fix #1965, add conversion macros to CFE_MSG_Message_t Use a conversion macro, rather than directly referencing a member name/heirarchy within the CFE_MSG header structures, when calling SB APIs that accept a CFE_MSG_Message_t* type. The conversion macro is specific to how the headers are actually defined. --- modules/cfe_testcase/src/msg_api_test.c | 131 +++++++++--------- modules/cfe_testcase/src/sb_sendrecv_test.c | 46 +++--- modules/es/fsw/inc/cfe_es_msg.h | 70 +++++----- modules/es/fsw/src/cfe_es_task.c | 22 +-- modules/es/fsw/src/cfe_es_task.h | 1 + modules/es/ut-coverage/es_UT.c | 2 +- modules/evs/fsw/inc/cfe_evs_msg.h | 50 +++---- modules/evs/fsw/src/cfe_evs_task.c | 6 +- modules/evs/fsw/src/cfe_evs_utils.c | 13 +- modules/evs/ut-coverage/evs_UT.c | 8 +- .../msg/option_inc/default_cfe_msg_hdr_pri.h | 15 ++ .../option_inc/default_cfe_msg_hdr_priext.h | 15 ++ .../msg/ut-coverage/test_cfe_msg_checksum.c | 2 +- modules/msg/ut-coverage/test_cfe_msg_fc.c | 2 +- modules/msg/ut-coverage/test_cfe_msg_init.c | 45 +++--- modules/msg/ut-coverage/test_cfe_msg_time.c | 2 +- modules/sb/fsw/inc/cfe_sb_msg.h | 24 ++-- modules/sb/fsw/src/cfe_sb_init.c | 2 +- modules/sb/fsw/src/cfe_sb_task.c | 21 +-- modules/sb/fsw/src/cfe_sb_util.c | 2 +- modules/sb/ut-coverage/sb_UT.c | 97 ++++++------- modules/sb/ut-coverage/sb_UT.h | 6 +- modules/tbl/fsw/inc/cfe_tbl_msg.h | 46 +++--- modules/tbl/fsw/src/cfe_tbl_internal.c | 8 +- modules/tbl/fsw/src/cfe_tbl_task.c | 7 +- modules/tbl/fsw/src/cfe_tbl_task_cmds.c | 8 +- modules/tbl/ut-coverage/tbl_UT.c | 4 +- modules/time/fsw/inc/cfe_time_msg.h | 38 ++--- modules/time/fsw/src/cfe_time_task.c | 8 +- modules/time/fsw/src/cfe_time_tone.c | 8 +- modules/time/fsw/src/cfe_time_utils.c | 12 +- 31 files changed, 379 insertions(+), 342 deletions(-) diff --git a/modules/cfe_testcase/src/msg_api_test.c b/modules/cfe_testcase/src/msg_api_test.c index 11e12f40d..688b9d6bd 100644 --- a/modules/cfe_testcase/src/msg_api_test.c +++ b/modules/cfe_testcase/src/msg_api_test.c @@ -54,75 +54,76 @@ void TestMsgApiBasic(void) /* test msg-init */ UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, msgId, 0), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1, sizeof(cmd)), - CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), msgId, 0), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ( + CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), sizeof(cmd)), + CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, msgId, sizeof(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), msgId, sizeof(cmd)), CFE_SUCCESS); /* test set-msg-size */ UtAssert_INT32_EQ(CFE_MSG_SetSize(NULL, 12), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetSize(&cmd.Msg, 0), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetSize(&cmd.Msg, UINT32_MAX), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetSize(CFE_MSG_PTR(cmd), 0), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetSize(CFE_MSG_PTR(cmd), UINT32_MAX), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetSize(&cmd.Msg, 12), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetSize(CFE_MSG_PTR(cmd), 12), CFE_SUCCESS); /* test get-msg-size */ UtAssert_INT32_EQ(CFE_MSG_GetSize(NULL, &size), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetSize(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetSize(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetSize(&cmd.Msg, &size), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSize(CFE_MSG_PTR(cmd), &size), CFE_SUCCESS); UtAssert_UINT32_EQ(size, 12); /* test get-type */ UtAssert_INT32_EQ(CFE_MSG_SetType(NULL, CFE_MSG_Type_Cmd), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetType(&cmd.Msg, CFE_MSG_Type_Invalid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Invalid), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetType(&cmd.Msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Cmd), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetType(NULL, &type), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetType(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetType(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetType(&cmd.Msg, &type), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetType(CFE_MSG_PTR(cmd), &type), CFE_SUCCESS); UtAssert_INT32_EQ(type, CFE_MSG_Type_Cmd); /* test msg set-type */ - UtAssert_INT32_EQ(CFE_MSG_SetType(&cmd.Msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Tlm), CFE_SUCCESS); /* check if set-type works like expected */ - UtAssert_INT32_EQ(CFE_MSG_GetType(&cmd.Msg, &type), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetType(CFE_MSG_PTR(cmd), &type), CFE_SUCCESS); UtAssert_INT32_EQ(type, CFE_MSG_Type_Tlm); /* test get header-version */ UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(NULL, &hdrVer), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrVer), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(CFE_MSG_PTR(cmd), &hdrVer), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); /* test set header-version */ UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(NULL, hdrVer), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(&cmd.Msg, UINT16_MAX), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(&cmd.Msg, 0), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrVer), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(CFE_MSG_PTR(cmd), UINT16_MAX), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(CFE_MSG_PTR(cmd), 0), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(CFE_MSG_PTR(cmd), &hdrVer), CFE_SUCCESS); UtAssert_True(hdrVer == 0, "hdrVer = 0"); /* test get-has-secondary-header and set-has-secondary-header*/ UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(NULL, &_expected), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(NULL, _expected), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(&cmd.Msg, _expected), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &_returned), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmd), _expected), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(CFE_MSG_PTR(cmd), &_returned), CFE_SUCCESS); UtAssert_UINT32_EQ(_expected, _returned); /* test get-apid */ UtAssert_INT32_EQ(CFE_MSG_GetApId(NULL, &appId), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetApId(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetApId(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); /* test set-apid */ - UtAssert_INT32_EQ(CFE_MSG_SetApId(&cmd.Msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetApId(CFE_MSG_PTR(cmd), 0xFFFF), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_SetApId(NULL, 0), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetApId(&cmd.Msg, 5), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetApId(&cmd.Msg, &appId), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetApId(CFE_MSG_PTR(cmd), 5), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetApId(CFE_MSG_PTR(cmd), &appId), CFE_SUCCESS); UtAssert_INT32_EQ(appId, 5); } @@ -140,30 +141,30 @@ void TestMsgApiAdvanced(void) memset(&cmd, 0xFF, sizeof(cmd)); msgId = CFE_SB_ValueToMsgId(0); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, msgId, sizeof(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), msgId, sizeof(cmd)), CFE_SUCCESS); /* test get/set-segmentation-flag */ UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(NULL, &segFlag), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(NULL, CFE_MSG_SegFlag_Continue), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&cmd.Msg, CFE_MSG_SegFlag_Invalid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(CFE_MSG_PTR(cmd), CFE_MSG_SegFlag_Invalid), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&cmd.Msg, CFE_MSG_SegFlag_Continue), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&cmd.Msg, CFE_MSG_SegFlag_First), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&cmd.Msg, CFE_MSG_SegFlag_Last), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&cmd.Msg, CFE_MSG_SegFlag_Unsegmented), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segFlag), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(CFE_MSG_PTR(cmd), CFE_MSG_SegFlag_Continue), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(CFE_MSG_PTR(cmd), CFE_MSG_SegFlag_First), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(CFE_MSG_PTR(cmd), CFE_MSG_SegFlag_Last), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(CFE_MSG_PTR(cmd), CFE_MSG_SegFlag_Unsegmented), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(CFE_MSG_PTR(cmd), &segFlag), CFE_SUCCESS); UtAssert_UINT32_EQ(segFlag, CFE_MSG_SegFlag_Unsegmented); /* test set/get-sequence-count */ UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(NULL, 2), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(&cmd.Msg, UINT16_MAX), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(CFE_MSG_PTR(cmd), UINT16_MAX), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(NULL, &seqCnt), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(&cmd.Msg, 2), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&cmd.Msg, &seqCnt), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(CFE_MSG_PTR(cmd), 2), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(CFE_MSG_PTR(cmd), &seqCnt), CFE_SUCCESS); UtAssert_INT32_EQ(seqCnt, 2); /* test get-next-sequence-count */ @@ -191,17 +192,17 @@ void TestMsgHeaderSecondaryApi(void) memset(&cmd2, 0xFF, sizeof(cmd2)); /* msg-init */ - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(&cmd.Msg, true), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetType(&cmd.Msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(1), sizeof(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmd), true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Cmd), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmdTlm.Msg, CFE_SB_ValueToMsgId(1), sizeof(cmdTlm)), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(&cmdTlm.Msg, true), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetType(&cmdTlm.Msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmdTlm), CFE_SB_ValueToMsgId(2), sizeof(cmdTlm)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmdTlm), true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmdTlm), CFE_MSG_Type_Tlm), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd2.Msg, CFE_SB_ValueToMsgId(2), sizeof(cmd2)), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(&cmd2.Msg, true), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetType(&cmd2.Msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd2), CFE_SB_ValueToMsgId(3), sizeof(cmd2)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmd2), true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd2), CFE_MSG_Type_Cmd), CFE_SUCCESS); /* test generate-checksum */ status = CFE_MSG_GenerateChecksum(NULL); @@ -212,37 +213,37 @@ void TestMsgHeaderSecondaryApi(void) else { UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(NULL), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(&cmdTlm.Msg), CFE_MSG_WRONG_MSG_TYPE); - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(&cmdTlm.Msg, &isValid), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(cmdTlm)), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmdTlm), &isValid), CFE_MSG_WRONG_MSG_TYPE); UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(NULL, &isValid), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(&cmdTlm.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmdTlm), NULL), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(&cmd.Msg, &isValid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid), CFE_SUCCESS); UtAssert_True(!isValid, "Checksum isValid (%d) = false", isValid); - UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(&cmd.Msg), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(&cmd.Msg, &isValid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid), CFE_SUCCESS); UtAssert_True(isValid, "Checksum isValid (%d) = true", isValid); } /* test get/set-fcn-code */ UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(NULL, 4), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(&cmdTlm.Msg, 4), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(CFE_MSG_PTR(cmdTlm), 4), CFE_MSG_WRONG_MSG_TYPE); - UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(NULL, &fcnCode), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(&cmdTlm.Msg, &fcnCode), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmdTlm), &fcnCode), CFE_MSG_WRONG_MSG_TYPE); - UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(&cmd.Msg, 4), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(&cmd.Msg, &fcnCode), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(CFE_MSG_PTR(cmd), 4), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmd), &fcnCode), CFE_SUCCESS); UtAssert_INT32_EQ(fcnCode, 4); /* test get/set-msg-time */ - UtAssert_INT32_EQ(CFE_MSG_SetType(&cmd.Msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Tlm), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(NULL, &msgTime), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(&cmd.Msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); - CFE_Assert_STATUS_STORE(CFE_MSG_GetMsgTime(&cmd2.Msg, &msgTime)); + CFE_Assert_STATUS_STORE(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd2), &msgTime)); if (!CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS)) { CFE_Assert_STATUS_MUST_BE(CFE_MSG_WRONG_MSG_TYPE); @@ -250,14 +251,14 @@ void TestMsgHeaderSecondaryApi(void) UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(NULL, currentTime), CFE_MSG_BAD_ARGUMENT); - CFE_Assert_STATUS_STORE(CFE_MSG_SetMsgTime(&cmd2.Msg, currentTime)); + CFE_Assert_STATUS_STORE(CFE_MSG_SetMsgTime(CFE_MSG_PTR(cmd2), currentTime)); if (!CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS)) { CFE_Assert_STATUS_MUST_BE(CFE_MSG_WRONG_MSG_TYPE); } - UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(&cmd.Msg, currentTime), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(&cmd.Msg, &msgTime), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(CFE_MSG_PTR(cmd), currentTime), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), &msgTime), CFE_SUCCESS); UtAssert_UINT32_EQ(CFE_TIME_Compare(msgTime, currentTime), CFE_TIME_EQUAL); } diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index 2f2bb4457..5dff503bf 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -39,15 +39,15 @@ /* A simple command message */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; - uint32 CmdPayload; + CFE_MSG_CommandHeader_t CommandHeader; + uint64 CmdPayload; } CFE_FT_TestCmdMessage_t; /* A simple telemetry message */ typedef struct { - CFE_MSG_TelemetryHeader_t TlmHeader; - uint32 TlmPayload; + CFE_MSG_TelemetryHeader_t TelemetryHeader; + uint64 TlmPayload; } CFE_FT_TestTlmMessage_t; /* A message intended to be (overall) larger than the CFE_MISSION_SB_MAX_SB_MSG_SIZE */ @@ -90,34 +90,34 @@ void TestBasicTransmitRecv(void) UtAssert_INT32_EQ(CFE_SB_SubscribeEx(CFE_FT_TLM_MSGID, PipeId2, CFE_SB_DEFAULT_QOS, 3), CFE_SUCCESS); /* Initialize the message content */ - UtAssert_INT32_EQ(CFE_MSG_Init(&CmdMsg.CmdHeader.Msg, CFE_FT_CMD_MSGID, sizeof(CmdMsg)), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_Init(&TlmMsg.TlmHeader.Msg, CFE_FT_TLM_MSGID, sizeof(TlmMsg)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(CmdMsg.CommandHeader), CFE_FT_CMD_MSGID, sizeof(CmdMsg)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(TlmMsg.TelemetryHeader), CFE_FT_TLM_MSGID, sizeof(TlmMsg)), CFE_SUCCESS); - CFE_MSG_SetSequenceCount(&CmdMsg.CmdHeader.Msg, 11); - CFE_MSG_SetSequenceCount(&TlmMsg.TlmHeader.Msg, 21); + CFE_MSG_SetSequenceCount(CFE_MSG_PTR(CmdMsg.CommandHeader), 11); + CFE_MSG_SetSequenceCount(CFE_MSG_PTR(TlmMsg.TelemetryHeader), 21); /* Sending with sequence update should ignore the sequence in the msg struct */ CmdMsg.CmdPayload = 0x0c0ffee; TlmMsg.TlmPayload = 0x0d00d1e; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmMsg.TlmHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmMsg.TelemetryHeader), true), CFE_SUCCESS); CmdMsg.CmdPayload = 0x1c0ffee; TlmMsg.TlmPayload = 0x1d00d1e; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmMsg.TlmHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmMsg.TelemetryHeader), true), CFE_SUCCESS); /* Sending without sequence update should use the sequence in the msg struct */ CmdMsg.CmdPayload = 0x2c0ffee; TlmMsg.TlmPayload = 0x2d00d1e; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, false), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmMsg.TlmHeader.Msg, false), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), false), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmMsg.TelemetryHeader), false), CFE_SUCCESS); /* Sending again should trigger MsgLimit errors on the pipe, however the call still returns CFE_SUCCESS */ CmdMsg.CmdPayload = 0x3c0ffee; TlmMsg.TlmPayload = 0x3d00d1e; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmMsg.TlmHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmMsg.TelemetryHeader), true), CFE_SUCCESS); /* Attempt to send a msg which does not have a valid msgid */ memset(&CFE_FT_BigMsg, 0xFF, sizeof(CFE_FT_BigMsg)); @@ -247,17 +247,17 @@ void TestMsgBroadcast(void) UtAssert_INT32_EQ(CFE_SB_SubscribeEx(CFE_FT_CMD_MSGID, PipeId4, CFE_SB_DEFAULT_QOS, 6), CFE_SUCCESS); /* Initialize the message content */ - UtAssert_INT32_EQ(CFE_MSG_Init(&CmdMsg.CmdHeader.Msg, CFE_FT_CMD_MSGID, sizeof(CmdMsg)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(CmdMsg.CommandHeader), CFE_FT_CMD_MSGID, sizeof(CmdMsg)), CFE_SUCCESS); /* Make unique content in each message. Sending should always be successful. */ CmdMsg.CmdPayload = 0xbabb1e00; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); CmdMsg.CmdPayload = 0xbabb1e01; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); CmdMsg.CmdPayload = 0xbabb1e02; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); CmdMsg.CmdPayload = 0xbabb1e03; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); /* Now receive 1st message from Pipes, actual msg should appear on all (no limit violations here) */ UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf1, PipeId1, CFE_SB_POLL), CFE_SUCCESS); @@ -326,9 +326,9 @@ void TestMsgBroadcast(void) /* Send two more messages */ CmdMsg.CmdPayload = 0xbabb1e04; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); CmdMsg.CmdPayload = 0xbabb1e05; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&CmdMsg.CmdHeader.Msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(CmdMsg.CommandHeader), true), CFE_SUCCESS); /* poll all pipes again, message should appear on all except PipeId2 (Unsubscribed) */ UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf1, PipeId1, CFE_SB_POLL), CFE_SUCCESS); diff --git a/modules/es/fsw/inc/cfe_es_msg.h b/modules/es/fsw/inc/cfe_es_msg.h index 8755f4d86..fcb64c3ed 100644 --- a/modules/es/fsw/inc/cfe_es_msg.h +++ b/modules/es/fsw/inc/cfe_es_msg.h @@ -1060,7 +1060,7 @@ */ typedef struct CFE_ES_NoArgsCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ } CFE_ES_NoArgsCmd_t; /* @@ -1093,8 +1093,8 @@ typedef struct CFE_ES_RestartCmd_Payload */ typedef struct CFE_ES_RestartCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_RestartCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_RestartCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_RestartCmd_t; /** @@ -1116,8 +1116,8 @@ typedef struct CFE_ES_FileNameCmd_Payload */ typedef struct CFE_ES_FileNameCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_FileNameCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_FileNameCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_FileNameCmd_t; /* @@ -1147,8 +1147,8 @@ typedef struct CFE_ES_OverWriteSysLogCmd_Payload */ typedef struct CFE_ES_OverWriteSysLogCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_OverWriteSysLogCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_OverWriteSysLogCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_OverWriteSysLogCmd_t; /** @@ -1179,8 +1179,8 @@ typedef struct CFE_ES_StartAppCmd_Payload */ typedef struct CFE_ES_StartApp { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_StartAppCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_StartAppCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_StartAppCmd_t; /** @@ -1199,8 +1199,8 @@ typedef struct CFE_ES_AppNameCmd_Payload */ typedef struct CFE_ES_AppNameCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_AppNameCmd_t; /* @@ -1230,8 +1230,8 @@ typedef struct CFE_ES_AppReloadCmd_Payload */ typedef struct CFE_ES_ReloadAppCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_AppReloadCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_AppReloadCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_ReloadAppCmd_t; /** @@ -1251,8 +1251,8 @@ typedef struct CFE_ES_SetMaxPRCountCmd_Payload */ typedef struct CFE_ES_SetMaxPRCountCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_SetMaxPRCountCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_SetMaxPRCountCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_SetMaxPRCountCmd_t; /** @@ -1273,8 +1273,8 @@ typedef struct CFE_ES_DeleteCDSCmd_Payload */ typedef struct CFE_ES_DeleteCDSCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_DeleteCDSCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_DeleteCDSCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_DeleteCDSCmd_t; /** @@ -1293,8 +1293,8 @@ typedef struct CFE_ES_StartPerfCmd_Payload */ typedef struct CFE_ES_StartPerfDataCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_StartPerfCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_StartPerfCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_StartPerfDataCmd_t; /** @@ -1314,8 +1314,8 @@ typedef struct CFE_ES_StopPerfCmd_Payload */ typedef struct CFE_ES_StopPerfDataCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_StopPerfCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_StopPerfCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_StopPerfDataCmd_t; /** @@ -1336,8 +1336,8 @@ typedef struct CFE_ES_SetPerfFilterMaskCmd_Payload */ typedef struct CFE_ES_SetPerfFilterMaskCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_SetPerfFilterMaskCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_SetPerfFilterMaskCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_SetPerfFilterMaskCmd_t; /** @@ -1358,8 +1358,8 @@ typedef struct CFE_ES_SetPerfTrigMaskCmd_Payload */ typedef struct CFE_ES_SetPerfTriggerMaskCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_SetPerfTrigMaskCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_SetPerfTrigMaskCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_SetPerfTriggerMaskCmd_t; /** @@ -1380,8 +1380,8 @@ typedef struct CFE_ES_SendMemPoolStatsCmd_Payload */ typedef struct CFE_ES_SendMemPoolStatsCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_SendMemPoolStatsCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_SendMemPoolStatsCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_SendMemPoolStatsCmd_t; /** @@ -1401,8 +1401,8 @@ typedef struct CFE_ES_DumpCDSRegistryCmd_Payload */ typedef struct CFE_ES_DumpCDSRegistryCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_ES_DumpCDSRegistryCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_DumpCDSRegistryCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_DumpCDSRegistryCmd_t; /*************************************************************************/ @@ -1425,8 +1425,8 @@ typedef struct CFE_ES_OneAppTlm_Payload typedef struct CFE_ES_OneAppTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_ES_OneAppTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_ES_OneAppTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_ES_OneAppTlm_t; /** @@ -1441,8 +1441,8 @@ typedef struct CFE_ES_PoolStatsTlm_Payload typedef struct CFE_ES_MemStatsTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_ES_PoolStatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_ES_PoolStatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_ES_MemStatsTlm_t; /*************************************************************************/ @@ -1549,8 +1549,8 @@ typedef struct CFE_ES_HousekeepingTlm_Payload typedef struct CFE_ES_HousekeepingTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_ES_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_ES_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_ES_HousekeepingTlm_t; diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index 31b532f38..ea29c153d 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -393,20 +393,20 @@ int32 CFE_ES_TaskInit(void) /* ** Initialize housekeeping packet (clear user data area) */ - CFE_MSG_Init(&CFE_ES_Global.TaskData.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_HK_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_ES_Global.TaskData.HkPacket.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_ES_HK_TLM_MID), sizeof(CFE_ES_Global.TaskData.HkPacket)); /* ** Initialize single application telemetry packet */ - CFE_MSG_Init(&CFE_ES_Global.TaskData.OneAppPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_APP_TLM_MID), - sizeof(CFE_ES_Global.TaskData.OneAppPacket)); + CFE_MSG_Init(CFE_MSG_PTR(CFE_ES_Global.TaskData.OneAppPacket.TelemetryHeader), + CFE_SB_ValueToMsgId(CFE_ES_APP_TLM_MID), sizeof(CFE_ES_Global.TaskData.OneAppPacket)); /* ** Initialize memory pool statistics telemetry packet */ - CFE_MSG_Init(&CFE_ES_Global.TaskData.MemStatsPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_MEMSTATS_TLM_MID), - sizeof(CFE_ES_Global.TaskData.MemStatsPacket)); + CFE_MSG_Init(CFE_MSG_PTR(CFE_ES_Global.TaskData.MemStatsPacket.TelemetryHeader), + CFE_SB_ValueToMsgId(CFE_ES_MEMSTATS_TLM_MID), sizeof(CFE_ES_Global.TaskData.MemStatsPacket)); /* ** Create Software Bus message pipe @@ -839,8 +839,8 @@ int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) /* ** Send housekeeping telemetry packet. */ - CFE_SB_TimeStampMsg(&CFE_ES_Global.TaskData.HkPacket.TlmHeader.Msg); - CFE_SB_TransmitMsg(&CFE_ES_Global.TaskData.HkPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_ES_Global.TaskData.HkPacket.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_ES_Global.TaskData.HkPacket.TelemetryHeader), true); /* ** This command does not affect the command execution counter. @@ -1235,8 +1235,8 @@ int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOneCmd_t *data) /* ** Send application status telemetry packet. */ - CFE_SB_TimeStampMsg(&CFE_ES_Global.TaskData.OneAppPacket.TlmHeader.Msg); - Result = CFE_SB_TransmitMsg(&CFE_ES_Global.TaskData.OneAppPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_ES_Global.TaskData.OneAppPacket.TelemetryHeader)); + Result = CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_ES_Global.TaskData.OneAppPacket.TelemetryHeader), true); if (Result == CFE_SUCCESS) { CFE_ES_Global.TaskData.CommandCounter++; @@ -1974,8 +1974,8 @@ int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStatsCmd_t *data) /* ** Send memory statistics telemetry packet. */ - CFE_SB_TimeStampMsg(&CFE_ES_Global.TaskData.MemStatsPacket.TlmHeader.Msg); - CFE_SB_TransmitMsg(&CFE_ES_Global.TaskData.MemStatsPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_ES_Global.TaskData.MemStatsPacket.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_ES_Global.TaskData.MemStatsPacket.TelemetryHeader), true); CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_TLM_POOL_STATS_INFO_EID, CFE_EVS_EventType_DEBUG, diff --git a/modules/es/fsw/src/cfe_es_task.h b/modules/es/fsw/src/cfe_es_task.h index c5e281cd7..1249d24b2 100644 --- a/modules/es/fsw/src/cfe_es_task.h +++ b/modules/es/fsw/src/cfe_es_task.h @@ -44,6 +44,7 @@ #include "cfe_fs_api_typedefs.h" #include "cfe_sb_api_typedefs.h" #include "cfe_es_erlog_typedef.h" +#include "cfe_msg_api_typedefs.h" /*************************************************************************/ diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index f550efd25..af1fb184d 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -2456,7 +2456,7 @@ void TestTask(void) union { CFE_MSG_Message_t Msg; - CFE_ES_NoArgsCmd_t NoArgsCmd; + CFE_MSG_CommandHeader_t NoArgsCmd; CFE_ES_ClearSysLogCmd_t ClearSysLogCmd; CFE_ES_ClearERLogCmd_t ClearERLogCmd; CFE_ES_ResetPRCountCmd_t ResetPRCountCmd; diff --git a/modules/evs/fsw/inc/cfe_evs_msg.h b/modules/evs/fsw/inc/cfe_evs_msg.h index 84a8de8ac..66f613e5d 100644 --- a/modules/evs/fsw/inc/cfe_evs_msg.h +++ b/modules/evs/fsw/inc/cfe_evs_msg.h @@ -906,7 +906,7 @@ **/ typedef struct CFE_EVS_NoArgsCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ } CFE_EVS_NoArgsCmd_t; /* @@ -934,8 +934,8 @@ typedef struct CFE_EVS_LogFileCmd_Payload */ typedef struct CFE_EVS_WriteLogDataFileCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_LogFileCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_LogFileCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_WriteLogDataFileCmd_t; /** @@ -954,8 +954,8 @@ typedef struct CFE_EVS_AppDataCmd_Payload */ typedef struct CFE_EVS_WriteAppDataFileCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_AppDataCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppDataCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_WriteAppDataFileCmd_t; /** @@ -975,8 +975,8 @@ typedef struct CFE_EVS_SetLogMode_Payload */ typedef struct CFE_EVS_SetLogModeCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_SetLogMode_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_SetLogMode_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_SetLogModeCmd_t; /** @@ -996,8 +996,8 @@ typedef struct CFE_EVS_SetEventFormatCode_Payload */ typedef struct CFE_EVS_SetEventFormatModeCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_SetEventFormatMode_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_SetEventFormatMode_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_SetEventFormatModeCmd_t; /** @@ -1018,8 +1018,8 @@ typedef struct CFE_EVS_BitMaskCmd_Payload */ typedef struct CFE_EVS_BitMaskCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_BitMaskCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_BitMaskCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_BitMaskCmd_t; /* @@ -1049,8 +1049,8 @@ typedef struct CFE_EVS_AppNameCmd_Payload */ typedef struct CFE_EVS_AppNameCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_AppNameCmd_t; /* @@ -1080,8 +1080,8 @@ typedef struct CFE_EVS_AppNameEventIDCmd_Payload */ typedef struct CFE_EVS_AppNameEventIDCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_AppNameEventIDCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameEventIDCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_AppNameEventIDCmd_t; /* @@ -1110,8 +1110,8 @@ typedef struct CFE_EVS_AppNameBitMaskCmd_Payload */ typedef struct CFE_EVS_AppNameBitMaskCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_AppNameBitMaskCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameBitMaskCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_AppNameBitMaskCmd_t; /* @@ -1141,8 +1141,8 @@ typedef struct CFE_EVS_AppNameEventIDMaskCmd_Payload */ typedef struct CFE_EVS_AppNameEventIDMaskCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_AppNameEventIDMaskCmd_t; /* @@ -1214,8 +1214,8 @@ typedef struct CFE_EVS_HousekeepingTlm_Payload typedef struct CFE_EVS_HousekeepingTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_EVS_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_EVS_HousekeepingTlm_t; /** Telemetry packet structures */ @@ -1260,15 +1260,15 @@ typedef struct CFE_EVS_ShortEventTlm_Payload typedef struct CFE_EVS_LongEventTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_EVS_LongEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_LongEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_EVS_LongEventTlm_t; typedef struct CFE_EVS_ShortEventTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_EVS_ShortEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_ShortEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_EVS_ShortEventTlm_t; diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index cd19e038f..27b0763e9 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -72,7 +72,7 @@ int32 CFE_EVS_EarlyInit(void) memset(&CFE_EVS_Global, 0, sizeof(CFE_EVS_Global)); /* Initialize housekeeping packet */ - CFE_MSG_Init(&CFE_EVS_Global.EVS_TlmPkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_EVS_HK_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_EVS_Global.EVS_TlmPkt.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_EVS_HK_TLM_MID), sizeof(CFE_EVS_Global.EVS_TlmPkt)); /* Elements stored in the hk packet that have non-zero default values */ @@ -672,9 +672,9 @@ int32 CFE_EVS_ReportHousekeepingCmd(const CFE_MSG_CommandHeader_t *data) AppTlmDataPtr->AppMessageSentCounter = 0; } - CFE_SB_TimeStampMsg(&CFE_EVS_Global.EVS_TlmPkt.TlmHeader.Msg); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_EVS_Global.EVS_TlmPkt.TelemetryHeader)); - CFE_SB_TransmitMsg(&CFE_EVS_Global.EVS_TlmPkt.TlmHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_EVS_Global.EVS_TlmPkt.TelemetryHeader), true); return CFE_STATUS_NO_COUNTER_INCREMENT; } diff --git a/modules/evs/fsw/src/cfe_evs_utils.c b/modules/evs/fsw/src/cfe_evs_utils.c index 669dc9cc8..a03e03e8b 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.c +++ b/modules/evs/fsw/src/cfe_evs_utils.c @@ -361,7 +361,8 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 int ExpandedLength; /* Initialize EVS event packets */ - CFE_MSG_Init(&LongEventTlm.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), sizeof(LongEventTlm)); + CFE_MSG_Init(CFE_MSG_PTR(LongEventTlm.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), + sizeof(LongEventTlm)); LongEventTlm.Payload.PacketID.EventID = EventID; LongEventTlm.Payload.PacketID.EventType = EventType; @@ -388,7 +389,7 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 LongEventTlm.Payload.PacketID.ProcessorID = CFE_PSP_GetProcessorId(); /* Set the packet timestamp */ - CFE_MSG_SetMsgTime(&LongEventTlm.TlmHeader.Msg, *TimeStamp); + CFE_MSG_SetMsgTime(CFE_MSG_PTR(LongEventTlm.TelemetryHeader), *TimeStamp); /* Write event to the event log */ EVS_AddLog(&LongEventTlm); @@ -399,7 +400,7 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 if (CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode == CFE_EVS_MsgFormat_LONG) { /* Send long event via SoftwareBus */ - CFE_SB_TransmitMsg(&LongEventTlm.TlmHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(LongEventTlm.TelemetryHeader), true); } else if (CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode == CFE_EVS_MsgFormat_SHORT) { @@ -409,11 +410,11 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 * * This goes out on a separate message ID. */ - CFE_MSG_Init(&ShortEventTlm.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_EVS_SHORT_EVENT_MSG_MID), + CFE_MSG_Init(CFE_MSG_PTR(ShortEventTlm.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_EVS_SHORT_EVENT_MSG_MID), sizeof(ShortEventTlm)); - CFE_MSG_SetMsgTime(&ShortEventTlm.TlmHeader.Msg, *TimeStamp); + CFE_MSG_SetMsgTime(CFE_MSG_PTR(ShortEventTlm.TelemetryHeader), *TimeStamp); ShortEventTlm.Payload.PacketID = LongEventTlm.Payload.PacketID; - CFE_SB_TransmitMsg(&ShortEventTlm.TlmHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(ShortEventTlm.TelemetryHeader), true); } /* Increment message send counters (prevent rollover) */ diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 3303c5d8f..748a71753 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -853,7 +853,7 @@ void Test_Logging(void) char tmpString[100]; union { - CFE_EVS_NoArgsCmd_t cmd; + CFE_MSG_CommandHeader_t cmd; CFE_EVS_SetLogModeCmd_t modecmd; CFE_EVS_WriteLogDataFileCmd_t logfilecmd; } CmdBuf; @@ -1003,7 +1003,7 @@ void Test_WriteApp(void) { union { - CFE_EVS_NoArgsCmd_t cmd; + CFE_MSG_CommandHeader_t cmd; CFE_EVS_WriteAppDataFileCmd_t AppDataCmd; CFE_EVS_AppNameBitMaskCmd_t appbitcmd; } CmdBuf; @@ -1683,7 +1683,7 @@ void Test_FilterCmd(void) */ void Test_InvalidCmd(void) { - CFE_EVS_NoArgsCmd_t cmd; + CFE_MSG_CommandHeader_t cmd; UtPrintf("Begin Test Invalid Command"); @@ -1816,7 +1816,7 @@ void Test_Misc(void) union { CFE_MSG_Message_t msg; - CFE_EVS_NoArgsCmd_t cmd; + CFE_MSG_CommandHeader_t cmd; CFE_EVS_SetLogModeCmd_t modecmd; CFE_EVS_WriteLogDataFileCmd_t writelogdatacmd; } PktBuf; 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 dbc7336ee..f62aaf1c1 100644 --- a/modules/msg/option_inc/default_cfe_msg_hdr_pri.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_pri.h @@ -38,6 +38,21 @@ #include "cfe_msg_sechdr.h" #include "cfe_msg_api_typedefs.h" +/*****************************************************************************/ +/** + * \brief Convert from a CFE_MSG_TelemetryHeader_t or CFE_MSG_CommandHeader_t to a CFE_MSG_Message_t + * + * \par Description + * Given a pointer to a secondary header structure, return a pointer + * to the CFE_MSG_Message_t (base header/primary header) object. + * + * \par Notes + * Implemented as a macro, so it should work with both Command and Telemetry headers, as well as + * both const and non-const headers. The const-ness of the pointer type should be preserved. + * + */ +#define CFE_MSG_PTR(shdr) (&((shdr).Msg)) + /* * Type Definitions */ 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 3205aca87..1e08ee8c5 100644 --- a/modules/msg/option_inc/default_cfe_msg_hdr_priext.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h @@ -37,6 +37,21 @@ #include "ccsds_hdr.h" #include "cfe_msg_sechdr.h" +/*****************************************************************************/ +/** + * \brief Convert from a CFE_MSG_TelemetryHeader_t or CFE_MSG_CommandHeader_t to a CFE_MSG_Message_t + * + * \par Description + * Given a pointer to a secondary header structure, return a pointer + * to the CFE_MSG_Message_t (base header/primary header) object. + * + * \par Notes + * Implemented as a macro, so it should work with both Command and Telemetry headers, as well as + * both const and non-const headers. The const-ness of the pointer type should be preserved. + * + */ +#define CFE_MSG_PTR(shdr) (&((shdr).Msg)) + /* * Type Definitions */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_checksum.c b/modules/msg/ut-coverage/test_cfe_msg_checksum.c index 3dd45579b..8ea0768d5 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_checksum.c +++ b/modules/msg/ut-coverage/test_cfe_msg_checksum.c @@ -37,7 +37,7 @@ void Test_MSG_Checksum(void) { CFE_MSG_CommandHeader_t cmd; - CFE_MSG_Message_t * msgptr = &cmd.Msg; + CFE_MSG_Message_t * msgptr = CFE_MSG_PTR(cmd); bool actual; UtPrintf("Bad parameter tests, Null pointers"); diff --git a/modules/msg/ut-coverage/test_cfe_msg_fc.c b/modules/msg/ut-coverage/test_cfe_msg_fc.c index e9763e2c2..e1aef17d5 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_fc.c +++ b/modules/msg/ut-coverage/test_cfe_msg_fc.c @@ -42,7 +42,7 @@ void Test_MSG_FcnCode(void) { CFE_MSG_CommandHeader_t cmd; - CFE_MSG_Message_t * msgptr = &cmd.Msg; + CFE_MSG_Message_t * msgptr = CFE_MSG_PTR(cmd); CFE_MSG_FcnCode_t input[] = {0, TEST_FCNCODE_MAX / 2, TEST_FCNCODE_MAX}; CFE_MSG_FcnCode_t actual = TEST_FCNCODE_MAX; int i; diff --git a/modules/msg/ut-coverage/test_cfe_msg_init.c b/modules/msg/ut-coverage/test_cfe_msg_init.c index 4364c16d3..bfa67591e 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_init.c +++ b/modules/msg/ut-coverage/test_cfe_msg_init.c @@ -55,27 +55,28 @@ void Test_MSG_Init(void) UtPrintf("Bad parameter tests, Null pointer, invalid size, invalid msgid"); UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(0), 0), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), sizeof(cmd)), - CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(-1), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(0), 0), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ( + CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), sizeof(cmd)), + CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(-1), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); UtPrintf("Set to all F's, msgid value = 0"); memset(&cmd, 0xFF, sizeof(cmd)); msgidval_exp = 0; - CFE_UtAssert_SUCCESS(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(cmd))); - UT_DisplayPkt(&cmd.Msg, 0); - CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&cmd.Msg, &msgid_act)); + CFE_UtAssert_SUCCESS(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(msgidval_exp), sizeof(cmd))); + UT_DisplayPkt(CFE_MSG_PTR(cmd), 0); + CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(CFE_MSG_PTR(cmd), &msgid_act)); UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); - CFE_UtAssert_SUCCESS(CFE_MSG_GetSize(&cmd.Msg, &size)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetSize(CFE_MSG_PTR(cmd), &size)); CFE_UtAssert_MEMOFFSET_EQ(size, sizeof(cmd)); - CFE_UtAssert_SUCCESS(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segflag)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetSegmentationFlag(CFE_MSG_PTR(cmd), &segflag)); UtAssert_INT32_EQ(segflag, CFE_MSG_SegFlag_Unsegmented); - CFE_UtAssert_SUCCESS(CFE_MSG_GetApId(&cmd.Msg, &apid)); - CFE_UtAssert_SUCCESS(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver)); - CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &hassec)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetApId(CFE_MSG_PTR(cmd), &apid)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetHeaderVersion(CFE_MSG_PTR(cmd), &hdrver)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(CFE_MSG_PTR(cmd), &hassec)); /* A zero msgid will set hassec to false for v1 */ is_v1 = !hassec; @@ -92,25 +93,25 @@ void Test_MSG_Init(void) } /* Confirm the rest of the fields not already explicitly checked */ - UtAssert_UINT32_EQ(Test_MSG_Pri_NotZero(&cmd.Msg) & ~(MSG_APID_FLAG | MSG_HDRVER_FLAG | MSG_HASSEC_FLAG), + UtAssert_UINT32_EQ(Test_MSG_Pri_NotZero(CFE_MSG_PTR(cmd)) & ~(MSG_APID_FLAG | MSG_HDRVER_FLAG | MSG_HASSEC_FLAG), MSG_LENGTH_FLAG | MSG_SEGMENT_FLAG); UtPrintf("Set to all 0, max msgid value"); memset(&cmd, 0, sizeof(cmd)); msgidval_exp = CFE_PLATFORM_SB_HIGHEST_VALID_MSGID; - CFE_UtAssert_SUCCESS(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(cmd))); - UT_DisplayPkt(&cmd.Msg, 0); - CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&cmd.Msg, &msgid_act)); + CFE_UtAssert_SUCCESS(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(msgidval_exp), sizeof(cmd))); + UT_DisplayPkt(CFE_MSG_PTR(cmd), 0); + CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(CFE_MSG_PTR(cmd), &msgid_act)); UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); - CFE_UtAssert_SUCCESS(CFE_MSG_GetSize(&cmd.Msg, &size)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetSize(CFE_MSG_PTR(cmd), &size)); UtAssert_INT32_EQ(size, sizeof(cmd)); - CFE_UtAssert_SUCCESS(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segflag)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetSegmentationFlag(CFE_MSG_PTR(cmd), &segflag)); UtAssert_INT32_EQ(segflag, CFE_MSG_SegFlag_Unsegmented); - CFE_UtAssert_SUCCESS(CFE_MSG_GetApId(&cmd.Msg, &apid)); - CFE_UtAssert_SUCCESS(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver)); - CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &hassec)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetApId(CFE_MSG_PTR(cmd), &apid)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetHeaderVersion(CFE_MSG_PTR(cmd), &hdrver)); + CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(CFE_MSG_PTR(cmd), &hassec)); UtAssert_BOOL_TRUE(hassec); if (!is_v1) { @@ -123,6 +124,6 @@ void Test_MSG_Init(void) UtAssert_INT32_EQ(hdrver, 0); } - UtAssert_UINT32_EQ(Test_MSG_Pri_NotZero(&cmd.Msg) & ~MSG_HDRVER_FLAG, + UtAssert_UINT32_EQ(Test_MSG_Pri_NotZero(CFE_MSG_PTR(cmd)) & ~MSG_HDRVER_FLAG, MSG_APID_FLAG | MSG_HASSEC_FLAG | MSG_TYPE_FLAG | MSG_LENGTH_FLAG | MSG_SEGMENT_FLAG); } diff --git a/modules/msg/ut-coverage/test_cfe_msg_time.c b/modules/msg/ut-coverage/test_cfe_msg_time.c index 05d3317a6..a64401efe 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_time.c +++ b/modules/msg/ut-coverage/test_cfe_msg_time.c @@ -37,7 +37,7 @@ void Test_MSG_Time(void) { CFE_MSG_TelemetryHeader_t tlm; - CFE_MSG_Message_t * msgptr = &tlm.Msg; + CFE_MSG_Message_t * msgptr = CFE_MSG_PTR(tlm); CFE_TIME_SysTime_t input[] = {{0, 0}, {0x12345678, 0xABCDEF12}, {0xFFFFFFFF, 0xFFFFFFFF}}; CFE_TIME_SysTime_t actual = {0xFFFFFFFF, 0xFFFFFFFF}; int i; diff --git a/modules/sb/fsw/inc/cfe_sb_msg.h b/modules/sb/fsw/inc/cfe_sb_msg.h index eb505f81d..a2c385788 100644 --- a/modules/sb/fsw/inc/cfe_sb_msg.h +++ b/modules/sb/fsw/inc/cfe_sb_msg.h @@ -504,8 +504,8 @@ typedef struct CFE_SB_WriteFileInfoCmd_Payload */ typedef struct CFE_SB_WriteFileInfoCmd { - CFE_MSG_CommandHeader_t Hdr; /**< \brief Command header */ - CFE_SB_WriteFileInfoCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_SB_WriteFileInfoCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_SB_WriteFileInfoCmd_t; /* @@ -536,8 +536,8 @@ typedef struct CFE_SB_RouteCmd_Payload */ typedef struct CFE_SB_RouteCmd { - CFE_MSG_CommandHeader_t Hdr; /**< \brief Command header */ - CFE_SB_RouteCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_SB_RouteCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_SB_RouteCmd_t; /* @@ -599,8 +599,8 @@ typedef struct CFE_SB_HousekeepingTlm_Payload typedef struct CFE_SB_HousekeepingTlm { - CFE_MSG_TelemetryHeader_t Hdr; /**< \brief Telemetry header */ - CFE_SB_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_SB_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_HousekeepingTlm_t; /** @@ -705,8 +705,8 @@ typedef struct CFE_SB_StatsTlm_Payload typedef struct CFE_SB_StatsTlm { - CFE_MSG_TelemetryHeader_t Hdr; /**< \brief Telemetry header */ - CFE_SB_StatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_SB_StatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_StatsTlm_t; /** @@ -757,8 +757,8 @@ typedef struct CFE_SB_SingleSubscriptionTlm_Payload typedef struct CFE_SB_SingleSubscriptionTlm { - CFE_MSG_TelemetryHeader_t Hdr; /**< \brief Telemetry header */ - CFE_SB_SingleSubscriptionTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_SB_SingleSubscriptionTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_SingleSubscriptionTlm_t; /** @@ -798,8 +798,8 @@ typedef struct CFE_SB_AllSubscriptionsTlm_Payload typedef struct CFE_SB_AllSubscriptionsTlm { - CFE_MSG_TelemetryHeader_t Hdr; /**< \brief Telemetry header */ - CFE_SB_AllSubscriptionsTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_SB_AllSubscriptionsTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_AllSubscriptionsTlm_t; #endif /* CFE_SB_MSG_H */ diff --git a/modules/sb/fsw/src/cfe_sb_init.c b/modules/sb/fsw/src/cfe_sb_init.c index 1daa95834..82179e6f2 100644 --- a/modules/sb/fsw/src/cfe_sb_init.c +++ b/modules/sb/fsw/src/cfe_sb_init.c @@ -89,7 +89,7 @@ int32 CFE_SB_EarlyInit(void) CFE_SBR_Init(); /* Initialize the SB Statistics Pkt */ - CFE_MSG_Init(&CFE_SB_Global.StatTlmMsg.Hdr.Msg, CFE_SB_ValueToMsgId(CFE_SB_STATS_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_SB_Global.StatTlmMsg.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_SB_STATS_TLM_MID), sizeof(CFE_SB_Global.StatTlmMsg)); return Stat; diff --git a/modules/sb/fsw/src/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c index 6f8da5897..92205ff88 100644 --- a/modules/sb/fsw/src/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -204,10 +204,10 @@ int32 CFE_SB_AppInit(void) CFE_ES_WriteToSysLog("%s: Registered %d events for filtering\n", __func__, (int)CfgFileEventsToFilter); - CFE_MSG_Init(&CFE_SB_Global.HKTlmMsg.Hdr.Msg, CFE_SB_ValueToMsgId(CFE_SB_HK_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_SB_Global.HKTlmMsg.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_SB_HK_TLM_MID), sizeof(CFE_SB_Global.HKTlmMsg)); - CFE_MSG_Init(&CFE_SB_Global.PrevSubMsg.Hdr.Msg, CFE_SB_ValueToMsgId(CFE_SB_ALLSUBS_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_SB_Global.PrevSubMsg.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_SB_ALLSUBS_TLM_MID), sizeof(CFE_SB_Global.PrevSubMsg)); /* Populate the fixed fields in the HK Tlm Msg */ @@ -535,8 +535,8 @@ int32 CFE_SB_SendHKTlmCmd(const CFE_MSG_CommandHeader_t *data) CFE_SB_UnlockSharedData(__FILE__, __LINE__); - CFE_SB_TimeStampMsg(&CFE_SB_Global.HKTlmMsg.Hdr.Msg); - CFE_SB_TransmitMsg(&CFE_SB_Global.HKTlmMsg.Hdr.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_SB_Global.HKTlmMsg.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_SB_Global.HKTlmMsg.TelemetryHeader), true); return CFE_SUCCESS; } @@ -757,8 +757,8 @@ int32 CFE_SB_SendStatsCmd(const CFE_SB_SendSbStatsCmd_t *data) --PipeStatCount; } - CFE_SB_TimeStampMsg(&CFE_SB_Global.StatTlmMsg.Hdr.Msg); - CFE_SB_TransmitMsg(&CFE_SB_Global.StatTlmMsg.Hdr.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_SB_Global.StatTlmMsg.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_SB_Global.StatTlmMsg.TelemetryHeader), true); CFE_EVS_SendEvent(CFE_SB_SND_STATS_EID, CFE_EVS_EventType_DEBUG, "Software Bus Statistics packet sent"); @@ -865,14 +865,15 @@ int32 CFE_SB_SendSubscriptionReport(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId if (CFE_SB_Global.SubscriptionReporting == CFE_SB_ENABLE) { - CFE_MSG_Init(&SubRptMsg.Hdr.Msg, CFE_SB_ValueToMsgId(CFE_SB_ONESUB_TLM_MID), sizeof(SubRptMsg)); + CFE_MSG_Init(CFE_MSG_PTR(SubRptMsg.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_SB_ONESUB_TLM_MID), + sizeof(SubRptMsg)); SubRptMsg.Payload.MsgId = MsgId; SubRptMsg.Payload.Pipe = PipeId; SubRptMsg.Payload.Qos = Quality; SubRptMsg.Payload.SubType = CFE_SB_SUBSCRIPTION; - Status = CFE_SB_TransmitMsg(&SubRptMsg.Hdr.Msg, true); + Status = CFE_SB_TransmitMsg(CFE_MSG_PTR(SubRptMsg.TelemetryHeader), true); CFE_EVS_SendEventWithAppID(CFE_SB_SUBSCRIPTION_RPT_EID, CFE_EVS_EventType_DEBUG, CFE_SB_Global.AppId, "Sending Subscription Report Msg=0x%x,Pipe=%lu,Stat=0x%x", (unsigned int)CFE_SB_MsgIdToValue(MsgId), CFE_RESOURCEID_TO_ULONG(PipeId), @@ -1334,7 +1335,7 @@ void CFE_SB_SendRouteSub(CFE_SBR_RouteId_t RouteId, void *ArgPtr) if (CFE_SB_Global.PrevSubMsg.Payload.Entries >= CFE_SB_SUB_ENTRIES_PER_PKT) { CFE_SB_UnlockSharedData(__func__, __LINE__); - status = CFE_SB_TransmitMsg(&CFE_SB_Global.PrevSubMsg.Hdr.Msg, true); + status = CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_SB_Global.PrevSubMsg.TelemetryHeader), true); CFE_EVS_SendEvent(CFE_SB_FULL_SUB_PKT_EID, CFE_EVS_EventType_DEBUG, "Full Sub Pkt %d Sent,Entries=%d,Stat=0x%x\n", (int)CFE_SB_Global.PrevSubMsg.Payload.PktSegment, @@ -1385,7 +1386,7 @@ int32 CFE_SB_SendPrevSubsCmd(const CFE_SB_SendPrevSubsCmd_t *data) /* if pkt has any number of entries, send it as a partial pkt */ if (CFE_SB_Global.PrevSubMsg.Payload.Entries > 0) { - status = CFE_SB_TransmitMsg(&CFE_SB_Global.PrevSubMsg.Hdr.Msg, true); + status = CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_SB_Global.PrevSubMsg.TelemetryHeader), true); CFE_EVS_SendEvent(CFE_SB_PART_SUB_PKT_EID, CFE_EVS_EventType_DEBUG, "Partial Sub Pkt %d Sent,Entries=%d,Stat=0x%x", (int)CFE_SB_Global.PrevSubMsg.Payload.PktSegment, diff --git a/modules/sb/fsw/src/cfe_sb_util.c b/modules/sb/fsw/src/cfe_sb_util.c index 1a46605c1..ea1ef0bf8 100644 --- a/modules/sb/fsw/src/cfe_sb_util.c +++ b/modules/sb/fsw/src/cfe_sb_util.c @@ -63,7 +63,7 @@ size_t CFE_SB_MsgHdrSize(const CFE_MSG_Message_t *MsgPtr) /* Since all cFE messages must have a secondary hdr this check is not needed */ if (!hassechdr) { - size = sizeof(CCSDS_SpacePacket_t); + size = sizeof(CFE_MSG_Message_t); } else if (type == CFE_MSG_Type_Cmd) { diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 5027f9705..50381f3df 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -3071,7 +3071,7 @@ void Test_TransmitMsg_NoSubscribers(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_EVENTCOUNT(1); @@ -3092,7 +3092,7 @@ void Test_TransmitMsg_MaxMsgSizePlusOne(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter = 0; - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true), CFE_SB_MSG_TOO_BIG); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true), CFE_SB_MSG_TOO_BIG); CFE_UtAssert_EVENTCOUNT(1); @@ -3119,7 +3119,7 @@ void Test_TransmitMsg_BasicSend(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_EVENTCOUNT(2); @@ -3165,7 +3165,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 1); UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 1); UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); @@ -3173,7 +3173,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, false)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), false)); /* Assert sequence count wasn't set */ UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 1); @@ -3184,7 +3184,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 2); UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 2); @@ -3199,7 +3199,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); /* increment to 3 */ + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); /* increment to 3 */ UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 3); UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 3); @@ -3210,7 +3210,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); /* increment to 4 */ + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); /* increment to 4 */ UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 4); UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 4); @@ -3238,7 +3238,7 @@ void Test_TransmitMsg_QueuePutError(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_EVENTCOUNT(4); @@ -3267,7 +3267,7 @@ void Test_TransmitMsg_PipeFull(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* This send should pass */ - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); /* Tell the QueuePut stub to return OS_QUEUE_FULL on its next call */ UT_SetDeferredRetcode(UT_KEY(OS_QueuePut), 1, OS_QUEUE_FULL); @@ -3277,7 +3277,7 @@ void Test_TransmitMsg_PipeFull(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* Pipe overflow causes TransmitMsg to return CFE_SUCCESS */ - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_EVENTCOUNT(4); @@ -3309,7 +3309,7 @@ void Test_TransmitMsg_MsgLimitExceeded(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* First send should pass */ - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); @@ -3318,7 +3318,7 @@ void Test_TransmitMsg_MsgLimitExceeded(void) /* This send should produce a MsgId to Pipe Limit Exceeded message, but * return success */ - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_EVENTCOUNT(4); @@ -3349,7 +3349,7 @@ void Test_TransmitMsg_GetPoolBufErr(void) * allocation failed) */ UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 1, CFE_ES_ERR_MEM_BLOCK_SIZE); - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true), CFE_SB_BUF_ALOC_ERR); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true), CFE_SB_BUF_ALOC_ERR); CFE_UtAssert_EVENTCOUNT(3); CFE_UtAssert_EVENTSENT(CFE_SB_GET_BUF_ERR_EID); @@ -3359,7 +3359,7 @@ void Test_TransmitMsg_GetPoolBufErr(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 1, CFE_ES_ERR_MEM_BLOCK_SIZE); UT_SetDeferredRetcode(UT_KEY(CFE_ES_TaskID_ToIndex), 1, -1); - UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true), CFE_SB_BUF_ALOC_ERR); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true), CFE_SB_BUF_ALOC_ERR); /* Confirm no additional events sent */ CFE_UtAssert_EVENTCOUNT(3); @@ -3621,7 +3621,7 @@ void Test_TransmitMsg_DisabledDestination(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_EVENTCOUNT(2); @@ -3680,7 +3680,7 @@ void Test_TransmitMsgValidate_MaxMsgSizePlusOne(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UtAssert_INT32_EQ(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn), + UtAssert_INT32_EQ(CFE_SB_TransmitMsgValidate(CFE_MSG_PTR(TlmPkt.TelemetryHeader), &MsgIdRtn, &SizeRtn, &RouteIdRtn), CFE_SB_MSG_TOO_BIG); CFE_UtAssert_MSGID_EQ(MsgIdRtn, MsgId); UtAssert_INT32_EQ(SizeRtn, Size); @@ -3705,7 +3705,8 @@ void Test_TransmitMsgValidate_NoSubscribers(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn)); + CFE_UtAssert_SUCCESS( + CFE_SB_TransmitMsgValidate(CFE_MSG_PTR(TlmPkt.TelemetryHeader), &MsgIdRtn, &SizeRtn, &RouteIdRtn)); CFE_UtAssert_MSGID_EQ(MsgIdRtn, MsgId); UtAssert_INT32_EQ(SizeRtn, Size); UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(RouteIdRtn)); @@ -3728,7 +3729,7 @@ void Test_TransmitMsgValidate_InvalidMsgId(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UtAssert_INT32_EQ(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn), + UtAssert_INT32_EQ(CFE_SB_TransmitMsgValidate(CFE_MSG_PTR(TlmPkt.TelemetryHeader), &MsgIdRtn, &SizeRtn, &RouteIdRtn), CFE_SB_BAD_ARGUMENT); CFE_UtAssert_EVENTCOUNT(1); CFE_UtAssert_EVENTSENT(CFE_SB_SEND_INV_MSGID_EID); @@ -3943,7 +3944,7 @@ void Test_ReceiveBuffer_PendForever(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); - CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_SUCCESS(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_PEND_FOREVER)); @@ -4114,42 +4115,42 @@ void Test_CFE_SB_GetUserData(void) CFE_MSG_Type_t type = CFE_MSG_Type_Invalid; struct { - CFE_MSG_CommandHeader_t cmd; + CFE_MSG_CommandHeader_t CommandHeader; uint8 payload; } cmd_uint8; struct { - CFE_MSG_CommandHeader_t cmd; + CFE_MSG_CommandHeader_t CommandHeader; uint16 payload; } cmd_uint16; struct { - CFE_MSG_CommandHeader_t cmd; + CFE_MSG_CommandHeader_t CommandHeader; uint32 payload; } cmd_uint32; struct { - CFE_MSG_CommandHeader_t cmd; + CFE_MSG_CommandHeader_t CommandHeader; uint64 payload; } cmd_uint64; struct { - CFE_MSG_TelemetryHeader_t tlm; + CFE_MSG_TelemetryHeader_t TelemetryHeader; uint8 payload; } tlm_uint8; struct { - CFE_MSG_TelemetryHeader_t tlm; + CFE_MSG_TelemetryHeader_t TelemetryHeader; uint16 payload; } tlm_uint16; struct { - CFE_MSG_TelemetryHeader_t tlm; + CFE_MSG_TelemetryHeader_t TelemetryHeader; uint32 payload; } tlm_uint32; struct { - CFE_MSG_TelemetryHeader_t tlm; + CFE_MSG_TelemetryHeader_t TelemetryHeader; uint64 payload; } tlm_uint64; @@ -4159,7 +4160,7 @@ void Test_CFE_SB_GetUserData(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); /* Expected return */ - expected = (uint8 *)&msg + sizeof(CCSDS_SpacePacket_t); + expected = (uint8 *)&msg + sizeof(CFE_MSG_Message_t); UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&msg), expected); /* Commands */ @@ -4167,31 +4168,31 @@ void Test_CFE_SB_GetUserData(void) type = CFE_MSG_Type_Cmd; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&cmd_uint8.cmd.Msg), &(cmd_uint8.payload)); + UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(CFE_MSG_PTR(cmd_uint8.CommandHeader)), &(cmd_uint8.payload)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&cmd_uint16.cmd.Msg), &(cmd_uint16.payload)); + UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(CFE_MSG_PTR(cmd_uint16.CommandHeader)), &(cmd_uint16.payload)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&cmd_uint32.cmd.Msg), &(cmd_uint32.payload)); + UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(CFE_MSG_PTR(cmd_uint32.CommandHeader)), &(cmd_uint32.payload)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&cmd_uint64.cmd.Msg), &(cmd_uint64.payload)); + UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(CFE_MSG_PTR(cmd_uint64.CommandHeader)), &(cmd_uint64.payload)); /* Telemetry */ type = CFE_MSG_Type_Tlm; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&tlm_uint8.tlm.Msg), &(tlm_uint8.payload)); + UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(CFE_MSG_PTR(tlm_uint8.TelemetryHeader)), &(tlm_uint8.payload)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&tlm_uint16.tlm.Msg), &(tlm_uint16.payload)); + UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(CFE_MSG_PTR(tlm_uint16.TelemetryHeader)), &(tlm_uint16.payload)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&tlm_uint32.tlm.Msg), &(tlm_uint32.payload)); + UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(CFE_MSG_PTR(tlm_uint32.TelemetryHeader)), &(tlm_uint32.payload)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(&tlm_uint64.tlm.Msg), &(tlm_uint64.payload)); + UtAssert_ADDRESS_EQ(CFE_SB_GetUserData(CFE_MSG_PTR(tlm_uint64.TelemetryHeader)), &(tlm_uint64.payload)); /* Bad inputs */ UtAssert_NULL(CFE_SB_GetUserData(NULL)); @@ -4212,7 +4213,7 @@ void Test_CFE_SB_SetGetUserDataLength(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &size, sizeof(size), false); - UtAssert_INT32_EQ(CFE_SB_GetUserDataLength(&msg), size - sizeof(CCSDS_SpacePacket_t)); + UtAssert_INT32_EQ(CFE_SB_GetUserDataLength(&msg), size - sizeof(CFE_MSG_Message_t)); /* * Note, this function currently has a type mismatch - it attempts to @@ -4541,7 +4542,7 @@ void Test_SB_TransmitMsgPaths_Nominal(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_EVENTCOUNT(3); @@ -4569,14 +4570,14 @@ void Test_SB_TransmitMsgPaths_LimitErr(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* First send should pass */ - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_MSGID_LIM_ERR_EID_BIT); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_SB_Global.StopRecurseFlags[1] = 0; CFE_UtAssert_EVENTNOTSENT(CFE_SB_MSGID_LIM_ERR_EID); @@ -4604,7 +4605,7 @@ void Test_SB_TransmitMsgPaths_FullErr(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* This send should pass */ - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); @@ -4613,7 +4614,7 @@ void Test_SB_TransmitMsgPaths_FullErr(void) /* Tell the QueuePut stub to return OS_QUEUE_FULL on its next call */ UT_SetDeferredRetcode(UT_KEY(OS_QueuePut), 1, OS_QUEUE_FULL); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_Q_FULL_ERR_EID_BIT); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_SB_Global.StopRecurseFlags[1] = 0; CFE_UtAssert_EVENTNOTSENT(CFE_SB_Q_FULL_ERR_EID_BIT); @@ -4643,14 +4644,14 @@ void Test_SB_TransmitMsgPaths_WriteErr(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_Q_WR_ERR_EID_BIT); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_SB_Global.StopRecurseFlags[1] = 0; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_EVENTCOUNT(2); @@ -4682,7 +4683,7 @@ void Test_SB_TransmitMsgPaths_IgnoreOpt(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* Test skipping this pipe and the send should pass */ - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); UtAssert_STUB_COUNT(OS_QueuePut, 0); /* Set up and send again without matching ApId and it should transmit */ @@ -4695,7 +4696,7 @@ void Test_SB_TransmitMsgPaths_IgnoreOpt(void) /* Also hit case where not the peak depth */ PipeDscPtr->PeakQueueDepth += 2; - CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); UtAssert_STUB_COUNT(OS_QueuePut, 1); /* Set AppId back so it can be deleted */ @@ -4725,7 +4726,7 @@ void Test_ReceiveBuffer_UnsubResubPath(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); CFE_UtAssert_SETUP(CFE_SB_Unsubscribe(MsgId, PipeId)); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index 01529e0b1..a6a2b9767 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -49,7 +49,7 @@ */ typedef struct { - CFE_MSG_CommandHeader_t Hdr; + CFE_MSG_CommandHeader_t CommandHeader; uint32 Cmd32Param1; uint16 Cmd16Param1; uint16 Cmd16Param2; @@ -61,7 +61,7 @@ typedef struct typedef struct { - CFE_MSG_TelemetryHeader_t Hdr; + CFE_MSG_TelemetryHeader_t TelemetryHeader; uint32 Tlm32Param1; uint16 Tlm16Param1; uint16 Tlm16Param2; @@ -73,7 +73,7 @@ typedef struct typedef struct { - CFE_MSG_Message_t Pri; + CFE_MSG_Message_t Message; uint8 Tlm8Param1; uint8 Tlm8Param2; uint32 Tlm32Param1; diff --git a/modules/tbl/fsw/inc/cfe_tbl_msg.h b/modules/tbl/fsw/inc/cfe_tbl_msg.h index 7ea480fb5..3350d7505 100644 --- a/modules/tbl/fsw/inc/cfe_tbl_msg.h +++ b/modules/tbl/fsw/inc/cfe_tbl_msg.h @@ -491,7 +491,7 @@ */ typedef struct CFE_TBL_NoArgsCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ } CFE_TBL_NoArgsCmd_t; /* @@ -518,8 +518,8 @@ typedef struct CFE_TBL_LoadCmd_Payload */ typedef struct CFE_TBL_LoadCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_LoadCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_LoadCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_LoadCmd_t; /** @@ -548,8 +548,8 @@ typedef struct CFE_TBL_DumpCmd_Payload */ typedef struct CFE_TBL_DumpCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_DumpCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_DumpCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_DumpCmd_t; /** @@ -575,8 +575,8 @@ typedef struct CFE_TBL_ValidateCmd_Payload */ typedef struct CFE_TBL_ValidateCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_ValidateCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_ValidateCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_ValidateCmd_t; /** @@ -596,8 +596,8 @@ typedef struct CFE_TBL_ActivateCmd_Payload */ typedef struct CFE_TBL_ActivateCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_ActivateCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_ActivateCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_ActivateCmd_t; /** @@ -618,8 +618,8 @@ typedef struct CFE_TBL_DumpRegistryCmd_Payload */ typedef struct CFE_TBL_DumpRegistryCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_DumpRegistryCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_DumpRegistryCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_DumpRegistryCmd_t; /** @@ -641,8 +641,8 @@ typedef struct CFE_TBL_SendRegistryCmd_Payload */ typedef struct CFE_TBL_SendRegistryCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_SendRegistryCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_SendRegistryCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_SendRegistryCmd_t; /** @@ -664,8 +664,8 @@ typedef struct CFE_TBL_DelCDSCmd_Payload */ typedef struct CFE_TBL_DeleteCDSCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_DelCDSCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_DelCDSCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_DeleteCDSCmd_t; /** @@ -685,8 +685,8 @@ typedef struct CFE_TBL_AbortLoadCmd_Payload */ typedef struct CFE_TBL_AbortLoadCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_AbortLoadCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_AbortLoadCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_AbortLoadCmd_t; /*************************************************************************/ @@ -712,8 +712,8 @@ typedef struct CFE_TBL_NotifyCmd_Payload */ typedef struct CFE_TBL_NotifyCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TBL_NotifyCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TBL_NotifyCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_NotifyCmd_t; /*************************************************************************/ @@ -784,8 +784,8 @@ typedef struct CFE_TBL_HousekeepingTlm_Payload typedef struct CFE_TBL_HousekeepingTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_TBL_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_TBL_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TBL_HousekeepingTlm_t; /** @@ -831,8 +831,8 @@ typedef struct CFE_TBL_TblRegPacket_Payload typedef struct CFE_TBL_TableRegistryTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_TBL_TblRegPacket_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_TBL_TblRegPacket_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TBL_TableRegistryTlm_t; #endif /* CFE_TBL_MSG_H */ diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index 63b85f3aa..230f71ade 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -1423,16 +1423,16 @@ int32 CFE_TBL_SendNotificationMsg(CFE_TBL_RegistryRec_t *RegRecPtr) if (RegRecPtr->NotifyByMsg) { /* Set the message ID */ - CFE_MSG_SetMsgId(&CFE_TBL_Global.NotifyMsg.CmdHeader.Msg, RegRecPtr->NotificationMsgId); + CFE_MSG_SetMsgId(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), RegRecPtr->NotificationMsgId); /* Set the command code */ - CFE_MSG_SetFcnCode(&CFE_TBL_Global.NotifyMsg.CmdHeader.Msg, RegRecPtr->NotificationCC); + CFE_MSG_SetFcnCode(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), RegRecPtr->NotificationCC); /* Set the command parameter */ CFE_TBL_Global.NotifyMsg.Payload.Parameter = RegRecPtr->NotificationParam; - CFE_SB_TimeStampMsg(&CFE_TBL_Global.NotifyMsg.CmdHeader.Msg); - Status = CFE_SB_TransmitMsg(&CFE_TBL_Global.NotifyMsg.CmdHeader.Msg, false); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader)); + Status = CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), false); if (Status != CFE_SUCCESS) { diff --git a/modules/tbl/fsw/src/cfe_tbl_task.c b/modules/tbl/fsw/src/cfe_tbl_task.c index dc941abc5..86ee8ea82 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.c +++ b/modules/tbl/fsw/src/cfe_tbl_task.c @@ -238,14 +238,15 @@ void CFE_TBL_InitData(void) CFE_ES_GetAppID(&CFE_TBL_Global.TableTaskAppId); /* Initialize Packet Headers */ - CFE_MSG_Init(&CFE_TBL_Global.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TBL_HK_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TBL_Global.HkPacket.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_TBL_HK_TLM_MID), sizeof(CFE_TBL_Global.HkPacket)); - CFE_MSG_Init(&CFE_TBL_Global.TblRegPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TBL_REG_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TBL_Global.TblRegPacket.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_TBL_REG_TLM_MID), sizeof(CFE_TBL_Global.TblRegPacket)); /* Message ID is set when sent, so OK as 0 here */ - CFE_MSG_Init(&CFE_TBL_Global.NotifyMsg.CmdHeader.Msg, CFE_SB_ValueToMsgId(0), sizeof(CFE_TBL_Global.NotifyMsg)); + CFE_MSG_Init(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), CFE_SB_ValueToMsgId(0), + sizeof(CFE_TBL_Global.NotifyMsg)); } /*---------------------------------------------------------------- diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c index 8cf5195d3..0d7745a03 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -62,8 +62,8 @@ int32 CFE_TBL_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) /* ** Send housekeeping telemetry packet */ - CFE_SB_TimeStampMsg(&CFE_TBL_Global.HkPacket.TlmHeader.Msg); - Status = CFE_SB_TransmitMsg(&CFE_TBL_Global.HkPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_TBL_Global.HkPacket.TelemetryHeader)); + Status = CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TBL_Global.HkPacket.TelemetryHeader), true); if (Status != CFE_SUCCESS) { @@ -79,8 +79,8 @@ int32 CFE_TBL_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) /* ** Send Table Registry Info Packet */ - CFE_SB_TimeStampMsg(&CFE_TBL_Global.TblRegPacket.TlmHeader.Msg); - CFE_SB_TransmitMsg(&CFE_TBL_Global.TblRegPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_TBL_Global.TblRegPacket.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TBL_Global.TblRegPacket.TelemetryHeader), true); /* Once the data has been sent, clear the index so that we don't send it again and again */ CFE_TBL_Global.HkTlmTblRegIndex = CFE_TBL_NOT_FOUND; diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index ef73dfd08..907209c5a 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -229,8 +229,8 @@ void Test_CFE_TBL_TaskInit(void) uint32 ExitCode; union { - CFE_TBL_NoArgsCmd_t NoArgsCmd; - CFE_MSG_Message_t Msg; + CFE_MSG_CommandHeader_t NoArgsCmd; + CFE_MSG_Message_t Msg; } CmdBuf; CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; CFE_MSG_FcnCode_t FcnCode = 0; diff --git a/modules/time/fsw/inc/cfe_time_msg.h b/modules/time/fsw/inc/cfe_time_msg.h index 9810dcd12..37da3d41f 100644 --- a/modules/time/fsw/inc/cfe_time_msg.h +++ b/modules/time/fsw/inc/cfe_time_msg.h @@ -730,7 +730,7 @@ */ typedef struct CFE_TIME_NoArgsCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ } CFE_TIME_NoArgsCmd_t; @@ -759,8 +759,8 @@ typedef struct CFE_TIME_LeapsCmd_Payload */ typedef struct CFE_TIME_SetLeapSecondsCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TIME_LeapsCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_LeapsCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_SetLeapSecondsCmd_t; /** @@ -779,8 +779,8 @@ typedef struct CFE_TIME_StateCmd_Payload */ typedef struct CFE_TIME_SetStateCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TIME_StateCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_StateCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_SetStateCmd_t; /** @@ -798,8 +798,8 @@ typedef struct CFE_TIME_SourceCmd_Payload */ typedef struct CFE_TIME_SetSourceCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TIME_SourceCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_SourceCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_SetSourceCmd_t; /** @@ -817,8 +817,8 @@ typedef struct CFE_TIME_SignalCmd_Payload */ typedef struct CFE_TIME_SetSignalCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TIME_SignalCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_SignalCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_SetSignalCmd_t; /** @@ -835,8 +835,8 @@ typedef struct CFE_TIME_TimeCmd_Payload */ typedef struct CFE_TIME_TimeCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TIME_TimeCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_TimeCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_TimeCmd_t; /* @@ -867,8 +867,8 @@ typedef struct CFE_TIME_OneHzAdjustmentCmd_Payload */ typedef struct CFE_TIME_OneHzAdjustmentCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TIME_OneHzAdjustmentCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_OneHzAdjustmentCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_OneHzAdjustmentCmd_t; /* @@ -895,8 +895,8 @@ typedef struct CFE_TIME_ToneDataCmd_Payload */ typedef struct CFE_TIME_ToneDataCmd { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ - CFE_TIME_ToneDataCmd_Payload_t Payload; /**< \brief Command payload */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_ToneDataCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_ToneDataCmd_t; /*************************************************************************/ @@ -965,8 +965,8 @@ typedef struct CFE_TIME_HousekeepingTlm_Payload typedef struct CFE_TIME_HousekeepingTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_TIME_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_TIME_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TIME_HousekeepingTlm_t; /*************************************************************************/ @@ -1122,8 +1122,8 @@ typedef struct CFE_TIME_DiagnosticTlm_Payload typedef struct CFE_TIME_DiagnosticTlm { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ - CFE_TIME_DiagnosticTlm_Payload_t Payload; /**< \brief Telemetry payload */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_TIME_DiagnosticTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TIME_DiagnosticTlm_t; #endif /* CFE_TIME_MSG_H */ diff --git a/modules/time/fsw/src/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c index 87915e3aa..363167632 100644 --- a/modules/time/fsw/src/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -583,8 +583,8 @@ int32 CFE_TIME_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) /* ** Send housekeeping telemetry packet... */ - CFE_SB_TimeStampMsg(&CFE_TIME_Global.HkPacket.TlmHeader.Msg); - CFE_SB_TransmitMsg(&CFE_TIME_Global.HkPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_TIME_Global.HkPacket.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.HkPacket.TelemetryHeader), true); /* ** Note: we only increment the command execution counter when @@ -772,8 +772,8 @@ int32 CFE_TIME_SendDiagnosticTlm(const CFE_TIME_SendDiagnosticCmd_t *data) /* ** Send diagnostics telemetry packet... */ - CFE_SB_TimeStampMsg(&CFE_TIME_Global.DiagPacket.TlmHeader.Msg); - CFE_SB_TransmitMsg(&CFE_TIME_Global.DiagPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_TIME_Global.DiagPacket.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.DiagPacket.TelemetryHeader), true); CFE_EVS_SendEvent(CFE_TIME_DIAG_EID, CFE_EVS_EventType_DEBUG, "Request diagnostics command"); diff --git a/modules/time/fsw/src/cfe_time_tone.c b/modules/time/fsw/src/cfe_time_tone.c index bddb2de65..f43fe82bb 100644 --- a/modules/time/fsw/src/cfe_time_tone.c +++ b/modules/time/fsw/src/cfe_time_tone.c @@ -154,7 +154,7 @@ void CFE_TIME_ToneSend(void) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CmdHeader.Msg, false); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), false); /* ** Count of "time at the tone" commands sent with internal data... @@ -1125,7 +1125,7 @@ void CFE_TIME_Tone1HzTask(void) /* ** Send tone signal command packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneSignalCmd.CmdHeader.Msg, false); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneSignalCmd.CommandHeader), false); #if (CFE_MISSION_TIME_CFG_FAKE_TONE == true) /* @@ -1133,7 +1133,7 @@ void CFE_TIME_Tone1HzTask(void) ** to send the tone to other time clients. ** (this is done by scheduler in non-fake mode) */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneSendCmd.CmdHeader.Msg, false); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneSendCmd.CommandHeader), false); #endif /* @@ -1336,7 +1336,7 @@ void CFE_TIME_Local1HzTask(void) ** This used to be optional in previous CFE versions, but it is now required ** as TIME subscribes to this itself to do state machine tasks. */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.Local1HzCmd.CmdHeader.Msg, false); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.Local1HzCmd.CommandHeader), false); CFE_TIME_Global.LocalTaskCounter++; diff --git a/modules/time/fsw/src/cfe_time_utils.c b/modules/time/fsw/src/cfe_time_utils.c index 0e8aafee8..8d7ff46a5 100644 --- a/modules/time/fsw/src/cfe_time_utils.c +++ b/modules/time/fsw/src/cfe_time_utils.c @@ -333,26 +333,26 @@ void CFE_TIME_InitData(void) /* ** Initialize housekeeping packet (clear user data area)... */ - CFE_MSG_Init(&CFE_TIME_Global.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_HK_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.HkPacket.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_TIME_HK_TLM_MID), sizeof(CFE_TIME_Global.HkPacket)); /* ** Initialize diagnostic packet (clear user data area)... */ - CFE_MSG_Init(&CFE_TIME_Global.DiagPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_DIAG_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.DiagPacket.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_TIME_DIAG_TLM_MID), sizeof(CFE_TIME_Global.DiagPacket)); /* ** Initialize "time at the tone" signal command packet... */ - CFE_MSG_Init(&CFE_TIME_Global.ToneSignalCmd.CmdHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_TONE_CMD_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.ToneSignalCmd.CommandHeader), CFE_SB_ValueToMsgId(CFE_TIME_TONE_CMD_MID), sizeof(CFE_TIME_Global.ToneSignalCmd)); /* ** Initialize "time at the tone" data command packet... */ #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - CFE_MSG_Init(&CFE_TIME_Global.ToneDataCmd.CmdHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_DATA_CMD_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), CFE_SB_ValueToMsgId(CFE_TIME_DATA_CMD_MID), sizeof(CFE_TIME_Global.ToneDataCmd)); #endif @@ -360,14 +360,14 @@ void CFE_TIME_InitData(void) ** Initialize simulated tone send message ("fake tone" mode only)... */ #if (CFE_MISSION_TIME_CFG_FAKE_TONE == true) - CFE_MSG_Init(&CFE_TIME_Global.ToneSendCmd.CmdHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_SEND_CMD_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.ToneSendCmd.CommandHeader), CFE_SB_ValueToMsgId(CFE_TIME_SEND_CMD_MID), sizeof(CFE_TIME_Global.ToneSendCmd)); #endif /* ** Initialize local 1Hz "wake-up" command packet (optional)... */ - CFE_MSG_Init(&CFE_TIME_Global.Local1HzCmd.CmdHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.Local1HzCmd.CommandHeader), CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), sizeof(CFE_TIME_Global.Local1HzCmd)); return; From df5e143dcaf36ae89463edf1316ebf0c0823e776 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 27 Sep 2021 13:46:20 -0400 Subject: [PATCH 012/200] Fix #1979, implement abstract config registry module Adds a new module called "config" that tracks simple key/value pairs. All values are const. As a proof of concept, all version information is mirrored into this key store, and ES is updated to use this instead of the GLOBAL_CONFIGDATA when generating events. --- cmake/mission_defaults.cmake | 2 +- modules/config/CMakeLists.txt | 29 ++ modules/config/cmake/cfe_config_ids.h.in | 22 ++ modules/config/cmake/cfe_config_map.c.in | 8 + modules/config/fsw/src/cfe_config_get.c | 175 +++++++++++ modules/config/fsw/src/cfe_config_init.c | 229 ++++++++++++++ modules/config/fsw/src/cfe_config_lookup.c | 69 +++++ modules/config/fsw/src/cfe_config_map.h | 43 +++ modules/config/fsw/src/cfe_config_priv.h | 100 ++++++ modules/config/fsw/src/cfe_config_set.c | 92 ++++++ modules/config/fsw/src/cfe_config_table.h | 56 ++++ modules/config/mission_build.cmake | 61 ++++ modules/config/ut-coverage/CMakeLists.txt | 22 ++ modules/config/ut-coverage/test_cfe_config.c | 285 ++++++++++++++++++ modules/core_api/fsw/inc/cfe_config.h | 124 ++++++++ .../fsw/inc/cfe_config_api_typedefs.h | 55 ++++ modules/core_api/ut-stubs/CMakeLists.txt | 2 + .../ut-stubs/src/cfe_config_handlers.c | 96 ++++++ .../core_api/ut-stubs/src/cfe_config_stubs.c | 124 ++++++++ .../fsw/inc/cfe_config_core_internal.h | 53 ++++ modules/core_private/ut-stubs/CMakeLists.txt | 1 + .../src/cfe_config_core_internal_stubs.c | 68 +++++ modules/es/fsw/src/cfe_es_objtab.c | 5 +- modules/es/fsw/src/cfe_es_task.c | 123 ++------ .../fsw/inc/cfe_core_resourceid_basevalues.h | 11 +- 25 files changed, 1754 insertions(+), 101 deletions(-) create mode 100644 modules/config/CMakeLists.txt create mode 100644 modules/config/cmake/cfe_config_ids.h.in create mode 100644 modules/config/cmake/cfe_config_map.c.in create mode 100644 modules/config/fsw/src/cfe_config_get.c create mode 100644 modules/config/fsw/src/cfe_config_init.c create mode 100644 modules/config/fsw/src/cfe_config_lookup.c create mode 100644 modules/config/fsw/src/cfe_config_map.h create mode 100644 modules/config/fsw/src/cfe_config_priv.h create mode 100644 modules/config/fsw/src/cfe_config_set.c create mode 100644 modules/config/fsw/src/cfe_config_table.h create mode 100644 modules/config/mission_build.cmake create mode 100644 modules/config/ut-coverage/CMakeLists.txt create mode 100644 modules/config/ut-coverage/test_cfe_config.c create mode 100644 modules/core_api/fsw/inc/cfe_config.h create mode 100644 modules/core_api/fsw/inc/cfe_config_api_typedefs.h create mode 100644 modules/core_api/ut-stubs/src/cfe_config_handlers.c create mode 100644 modules/core_api/ut-stubs/src/cfe_config_stubs.c create mode 100644 modules/core_private/fsw/inc/cfe_config_core_internal.h create mode 100644 modules/core_private/ut-stubs/src/cfe_config_core_internal_stubs.c rename modules/{core_private => resourceid}/fsw/inc/cfe_core_resourceid_basevalues.h (92%) diff --git a/cmake/mission_defaults.cmake b/cmake/mission_defaults.cmake index 7b288e5e8..c7871c5ce 100644 --- a/cmake/mission_defaults.cmake +++ b/cmake/mission_defaults.cmake @@ -35,6 +35,7 @@ set(MISSION_CORE_MODULES "msg" "sbr" "resourceid" + "config" ) # The "MISSION_GLOBAL_APPLIST" is a set of apps/libs that will be built @@ -75,4 +76,3 @@ list(APPEND MISSION_GLOBAL_APPLIST cfe_assert) if (ENABLE_UNIT_TESTS) list(APPEND MISSION_GLOBAL_APPLIST cfe_testcase) endif (ENABLE_UNIT_TESTS) - diff --git a/modules/config/CMakeLists.txt b/modules/config/CMakeLists.txt new file mode 100644 index 000000000..6c8ddf1f0 --- /dev/null +++ b/modules/config/CMakeLists.txt @@ -0,0 +1,29 @@ +################################################################## +# +# cFE Configuration Service (CONFIG) module CMake build recipe +# +################################################################## + +project(CFE_CONFIG C) + +# Executive services source files +set(config_SOURCES + fsw/src/cfe_config_init.c + fsw/src/cfe_config_lookup.c + fsw/src/cfe_config_get.c + fsw/src/cfe_config_set.c +) +add_library(config STATIC + ${config_SOURCES} + ${MISSION_BINARY_DIR}/src/cfe_config_map.c +) + +# need to include the "src" dir explicitly here, in order to compile +# the generated tables under ${MISSION_BINARY_DIR} +target_include_directories(config PRIVATE fsw/src) +target_link_libraries(config PRIVATE core_private) + +# Add unit test coverage subdirectory +if (ENABLE_UNIT_TESTS) + add_subdirectory(ut-coverage) +endif (ENABLE_UNIT_TESTS) diff --git a/modules/config/cmake/cfe_config_ids.h.in b/modules/config/cmake/cfe_config_ids.h.in new file mode 100644 index 000000000..ab7f2d2bc --- /dev/null +++ b/modules/config/cmake/cfe_config_ids.h.in @@ -0,0 +1,22 @@ +/* This file is auto-generated from CMake build system. Do not manually edit! */ +#ifndef CFE_CONFIG_IDS_H +#define CFE_CONFIG_IDS_H + +#include "cfe_config_api_typedefs.h" +#include "cfe_resourceid.h" +#include "cfe_core_resourceid_basevalues.h" + +/* Value offsets from base (needed for macros; do not use directly) */ +enum CFE_ConfigIdOffset +{ +@GENERATED_ENUM_OFFSET_LIST@ + CFE_ConfigIdOffset_MAX +}; + +/* + * Set of actual CONFIGID constants - + * these may be used in application code + */ +@GENERATED_CONSTANT_DEFINE_LIST@ + +#endif /* CFE_CONFIG_IDS_H */ diff --git a/modules/config/cmake/cfe_config_map.c.in b/modules/config/cmake/cfe_config_map.c.in new file mode 100644 index 000000000..b15ea89ba --- /dev/null +++ b/modules/config/cmake/cfe_config_map.c.in @@ -0,0 +1,8 @@ +/* This file is auto-generated from CMake build system. Do not manually edit! */ +#include "cfe_config_map.h" + +/* Map of configuration key IDs to printable names */ +const CFE_Config_IdNameEntry_t CFE_CONFIG_IDNAME_MAP[CFE_ConfigIdOffset_MAX] = +{ +@GENERATED_IDNAME_MAP_LIST@ +}; diff --git a/modules/config/fsw/src/cfe_config_get.c b/modules/config/fsw/src/cfe_config_get.c new file mode 100644 index 000000000..f1dc11f65 --- /dev/null +++ b/modules/config/fsw/src/cfe_config_get.c @@ -0,0 +1,175 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * API definition for configuration registry + * + * This defines the "getter" functions, which are publicly available + */ + +/* +** Required header files. +*/ +#include "cfe_config_priv.h" +#include "cfe_config_map.h" + +#include + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_GetValue + * + * Defined per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +uint32 CFE_Config_GetValue(CFE_ConfigId_t ConfigId) +{ + const CFE_Config_ValueEntry_t *Entry; + + Entry = CFE_Config_LocateConfigRecordByID(ConfigId); + if (Entry == NULL || Entry->ActualType != CFE_ConfigType_VALUE) + { + return 0; + } + + return Entry->Datum.AsInteger; +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_GetObjPointer + * + * Defined per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +const void *CFE_Config_GetObjPointer(CFE_ConfigId_t ConfigId) +{ + const CFE_Config_ValueEntry_t *Entry; + + Entry = CFE_Config_LocateConfigRecordByID(ConfigId); + if (Entry == NULL || (Entry->ActualType != CFE_ConfigType_POINTER && Entry->ActualType != CFE_ConfigType_STRING)) + { + return NULL; + } + + return Entry->Datum.AsPointer; +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_GetObjPointer + * + * Defined per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +const char *CFE_Config_GetString(CFE_ConfigId_t ConfigId) +{ + const CFE_Config_ValueEntry_t *Entry; + + Entry = CFE_Config_LocateConfigRecordByID(ConfigId); + if (Entry == NULL || Entry->ActualType != CFE_ConfigType_STRING) + { + return CFE_Config_Global.UnknownString; + } + + return Entry->Datum.AsPointer; +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_GetName + * + * Defined per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +const char *CFE_Config_GetName(CFE_ConfigId_t ConfigId) +{ + uint32 OffsetVal; + + OffsetVal = CFE_Config_IdToOffset(ConfigId); + + if (OffsetVal >= CFE_ConfigIdOffset_MAX) + { + return CFE_Config_Global.UnknownString; + } + + return CFE_CONFIG_IDNAME_MAP[OffsetVal].Name; +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_GetIdByName + * + * Defined per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +CFE_ConfigId_t CFE_Config_GetIdByName(const char *Name) +{ + const CFE_Config_IdNameEntry_t *NamePtr; + uint32 OffsetVal; + + NamePtr = CFE_CONFIG_IDNAME_MAP; + for (OffsetVal = 0; OffsetVal < CFE_ConfigIdOffset_MAX; ++OffsetVal) + { + if (NamePtr->Name != NULL && strcmp(NamePtr->Name, Name) == 0) + { + break; + } + ++NamePtr; + } + + if (OffsetVal >= CFE_ConfigIdOffset_MAX) + { + return CFE_CONFIGID_UNDEFINED; + } + + return CFE_Config_OffsetToId(OffsetVal); +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_GetIdByName + * + * Defined per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_Config_IterateAll(void *Arg, CFE_Config_Callback_t Callback) +{ + const CFE_Config_IdNameEntry_t *NamePtr; + uint32 OffsetVal; + + NamePtr = CFE_CONFIG_IDNAME_MAP; + for (OffsetVal = 0; OffsetVal < CFE_ConfigIdOffset_MAX; ++OffsetVal) + { + if (CFE_Config_Global.Table[OffsetVal].ActualType != CFE_ConfigType_UNDEFINED) + { + Callback(Arg, CFE_Config_OffsetToId(OffsetVal), NamePtr->Name); + } + ++NamePtr; + } +} diff --git a/modules/config/fsw/src/cfe_config_init.c b/modules/config/fsw/src/cfe_config_init.c new file mode 100644 index 000000000..4539ae6a1 --- /dev/null +++ b/modules/config/fsw/src/cfe_config_init.c @@ -0,0 +1,229 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * Initialization for CFE configuration registry + */ + +#include "cfe_config_priv.h" +#include "cfe_error.h" +#include "cfe_version.h" +#include "target_config.h" + +#include "cfe_config_map.h" +#include "cfe_config_ids.h" + +#include +#include +#include + +/* The define names are uppercase while the module names are likely lowercase */ +/* C99 does not have a standard "strcasecmp" - must do it manually */ +bool CFE_Config_StrCaseEq(const char *c1, const char *c2) +{ + while (*c1 != 0 && *c2 != 0) + { + if (toupper((unsigned char)*c1) != toupper((unsigned char)*c2)) + { + break; + } + ++c1; + ++c2; + } + + return (*c1 == 0 && *c2 == 0); +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_FindTargetKeyValue + * + * Internal helper routine only, not part of API. + * + * Find value for given config key + * + *-----------------------------------------------------------------*/ +const char *CFE_Config_FindTargetKeyValue(CFE_ConfigKeyValue_t *ConfigList, const char *KeyName) +{ + const char *ValuePtr; + + ValuePtr = NULL; + if (KeyName != NULL && ConfigList != NULL) + { + while (ConfigList->Key != NULL) + { + if (CFE_Config_StrCaseEq(KeyName, ConfigList->Key)) + { + ValuePtr = ConfigList->Value; + break; + } + ++ConfigList; + } + } + + return ValuePtr; +} + +const char *CFE_Config_IsModuleInList(CFE_ConfigName_t *ModuleListPtr, const char *ModuleName) +{ + const char *Result; + + Result = NULL; + while (ModuleListPtr != NULL && ModuleListPtr->Name != NULL) + { + if (CFE_Config_StrCaseEq(ModuleListPtr->Name, ModuleName)) + { + Result = ModuleListPtr->Name; + break; + } + ++ModuleListPtr; + } + + return Result; +} + +const char *CFE_Config_IsPspModule(CFE_StaticModuleLoadEntry_t *PspModuleList, const char *ModuleName) +{ + const char * Result; + CFE_StaticModuleLoadEntry_t *ModuleListPtr; + + ModuleListPtr = PspModuleList; + Result = NULL; + while (ModuleListPtr != NULL && ModuleListPtr->Name != NULL) + { + if (CFE_Config_StrCaseEq(ModuleListPtr->Name, ModuleName)) + { + Result = ModuleListPtr->Name; + break; + } + ++ModuleListPtr; + } + + return Result; +} + +const char *CFE_Config_FindStaticModName(CFE_ConfigName_t *ModuleListSet[], size_t SetLength, const char *ModuleName) +{ + const char *Result; + size_t i; + + Result = NULL; + for (i = 0; i < SetLength; ++i) + { + Result = CFE_Config_IsModuleInList(ModuleListSet[i], ModuleName); + if (Result != NULL) + { + break; + } + } + + return Result; +} + +void CFE_Config_SetupModuleVersions(CFE_ConfigName_t *ModuleListSet[], size_t SetLength, + CFE_ConfigKeyValue_t *ActiveList) +{ + const char * ModName; + const char * KeyVal; + uint32 OffsetVal; + const CFE_Config_IdNameEntry_t *NamePtr; + + static const char IDNAME_PREFIX[] = "MOD_SRCVER_"; + + NamePtr = CFE_CONFIG_IDNAME_MAP; + for (OffsetVal = 0; OffsetVal < CFE_ConfigIdOffset_MAX; ++OffsetVal) + { + if (NamePtr->Name != NULL && strncmp(NamePtr->Name, IDNAME_PREFIX, sizeof(IDNAME_PREFIX) - 1) == 0) + { + ModName = NamePtr->Name + sizeof(IDNAME_PREFIX) - 1; + + /* skip modules which are not statically linked (version depends on dynamic load) */ + ModName = CFE_Config_FindStaticModName(ModuleListSet, SetLength, ModName); + if (ModName != NULL) + { + KeyVal = CFE_Config_FindTargetKeyValue(ActiveList, ModName); + if (KeyVal != NULL) + { + CFE_Config_SetString(CFE_Config_OffsetToId(OffsetVal), KeyVal); + } + } + } + ++NamePtr; + } +} + +void CFE_Config_SetupBasicBuildInfo(void) +{ + const char *KeyVal; + + /* Global mission name */ + CFE_Config_SetString(CFE_CONFIGID_MISSION_NAME, GLOBAL_CONFIGDATA.MissionName); + KeyVal = CFE_Config_FindTargetKeyValue(GLOBAL_CONFIGDATA.ModuleVersionList, "MISSION"); + CFE_Config_SetString(CFE_CONFIGID_MISSION_SRCVER, KeyVal); + + /* propagate the version numbers from version.h */ + CFE_Config_SetValue(CFE_CONFIGID_CORE_VERSION_MAJOR, CFE_MAJOR_VERSION); + CFE_Config_SetValue(CFE_CONFIGID_CORE_VERSION_MINOR, CFE_MINOR_VERSION); + CFE_Config_SetValue(CFE_CONFIGID_CORE_VERSION_REVISION, CFE_REVISION); + CFE_Config_SetValue(CFE_CONFIGID_CORE_VERSION_MISSION_REV, CFE_MISSION_REV); + CFE_Config_SetValue(CFE_CONFIGID_CORE_VERSION_BUILDNUM, CFE_BUILD_NUMBER); + + CFE_Config_SetString(CFE_CONFIGID_CORE_VERSION_BASELINE, CFE_BUILD_BASELINE); + CFE_Config_SetString(CFE_CONFIGID_CORE_VERSION_DESCRIPTION, CFE_VERSION_STRING); + + /* + * Initialize values from the "target_config" CFE internal object + */ + KeyVal = CFE_Config_FindTargetKeyValue(GLOBAL_CONFIGDATA.BuildEnvironment, "BUILDDATE"); + CFE_Config_SetString(CFE_CONFIGID_CORE_BUILDINFO_DATE, KeyVal); + KeyVal = CFE_Config_FindTargetKeyValue(GLOBAL_CONFIGDATA.BuildEnvironment, "BUILDUSER"); + CFE_Config_SetString(CFE_CONFIGID_CORE_BUILDINFO_USER, KeyVal); + KeyVal = CFE_Config_FindTargetKeyValue(GLOBAL_CONFIGDATA.BuildEnvironment, "BUILDHOST"); + CFE_Config_SetString(CFE_CONFIGID_CORE_BUILDINFO_HOST, KeyVal); +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_Init + * + * CFE core internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +int32 CFE_Config_Init(void) +{ + /* Clear the table, just in case it was not already cleared from initial program loading */ + memset(&CFE_Config_Global, 0, sizeof(CFE_Config_Global)); + + CFE_ConfigName_t *ModuleListSet[2] = {GLOBAL_CONFIGDATA.CoreModuleList, GLOBAL_CONFIGDATA.StaticAppList}; + + /* + * Create a fixed string that can be returned in place of NULL for string returns, + * this makes it safer/easier to use with printf-style calls + */ + CFE_Config_Global.UnknownString = "[unknown]"; + + CFE_Config_SetupBasicBuildInfo(); + CFE_Config_SetupModuleVersions(ModuleListSet, 2, GLOBAL_CONFIGDATA.ModuleVersionList); + + return CFE_SUCCESS; +} diff --git a/modules/config/fsw/src/cfe_config_lookup.c b/modules/config/fsw/src/cfe_config_lookup.c new file mode 100644 index 000000000..16a3cb426 --- /dev/null +++ b/modules/config/fsw/src/cfe_config_lookup.c @@ -0,0 +1,69 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: +** cfe_es_api.c +** +** Purpose: +** This file implements the cFE Executive Services API functions. +** +** References: +** Flight Software Branch C Coding Standard Version 1.0a +** cFE Flight Software Application Developers Guide +** +** Notes: +** +*/ + +/* +** Required header files. +*/ +#include "cfe_config_priv.h" + +#include "cfe_resourceid.h" +#include "cfe_core_resourceid_basevalues.h" + +/* + * Instantiate the global table + */ +CFE_Config_Global_t CFE_Config_Global; + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_LocateConfigRecordByID + * + * Application scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +CFE_Config_ValueEntry_t *CFE_Config_LocateConfigRecordByID(CFE_ConfigId_t ConfigId) +{ + uint32 OffsetVal; + + OffsetVal = CFE_Config_IdToOffset(ConfigId); + + if (OffsetVal >= CFE_ConfigIdOffset_MAX) + { + return NULL; + } + + return &CFE_Config_Global.Table[OffsetVal]; +} diff --git a/modules/config/fsw/src/cfe_config_map.h b/modules/config/fsw/src/cfe_config_map.h new file mode 100644 index 000000000..212bdd1f1 --- /dev/null +++ b/modules/config/fsw/src/cfe_config_map.h @@ -0,0 +1,43 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * This file contains the CFE configuration registry global data definitions. + */ + +#ifndef CFE_CONFIG_MAP_H +#define CFE_CONFIG_MAP_H + +/* +** Includes +*/ +#include "common_types.h" +#include "cfe_config_ids.h" + +typedef struct CFE_Config_IdNameEntry +{ + const char *Name; +} CFE_Config_IdNameEntry_t; + +extern const CFE_Config_IdNameEntry_t CFE_CONFIG_IDNAME_MAP[]; + +#endif /* CFE_CONFIG_MAP_H */ diff --git a/modules/config/fsw/src/cfe_config_priv.h b/modules/config/fsw/src/cfe_config_priv.h new file mode 100644 index 000000000..56da3a560 --- /dev/null +++ b/modules/config/fsw/src/cfe_config_priv.h @@ -0,0 +1,100 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * This file contains the CFE configuration registry global data definitions. + */ + +#ifndef CFE_CONFIG_PRIV_H +#define CFE_CONFIG_PRIV_H + +/* +** Includes +*/ +#include "cfe_config_core_internal.h" +#include "cfe_config_table.h" +#include "cfe_config.h" +#include "target_config.h" + +/* + * Actual definition of the config registry table + * + * Note this object is instantiated by a bit of generated code from CMake - + * The final length depends on the number of config keys in use in the mission + */ +typedef struct +{ + const char * UnknownString; + CFE_Config_ValueEntry_t Table[CFE_ConfigIdOffset_MAX]; +} CFE_Config_Global_t; + +extern CFE_Config_Global_t CFE_Config_Global; + +/* + ****************************** + * INTERNAL FUNCTION CALLS + ****************************** + */ + +/** + * @brief Converts a configuration ID to a table index + * + * This function is intended for internal use only, and does not perform + * any error checks. It uses a simpler conversion than other ID conversions. + */ +static inline uint32 CFE_Config_IdToOffset(CFE_ConfigId_t ConfigId) +{ + uint32 OffsetVal; + + OffsetVal = CFE_RESOURCEID_TO_ULONG(ConfigId); + OffsetVal -= CFE_CONFIGID_BASE; + + return OffsetVal; +} + +/** + * @brief Converts a table index to a configuration ID + * + * This function is intended for internal use only, and does not perform + * any error checks. It uses a simpler conversion than other ID conversions. + */ +static inline CFE_ConfigId_t CFE_Config_OffsetToId(uint32 OffsetVal) +{ + return CFE_CONFIGID_C(CFE_ResourceId_FromInteger(CFE_CONFIGID_BASE + OffsetVal)); +} + +bool CFE_Config_StrCaseEq(const char *c1, const char *c2); +const char *CFE_Config_FindTargetKeyValue(CFE_ConfigKeyValue_t *ConfigList, const char *KeyName); +const char *CFE_Config_IsModuleInList(CFE_ConfigName_t *ModuleListPtr, const char *ModuleName); +const char *CFE_Config_IsPspModule(CFE_StaticModuleLoadEntry_t *PspModuleList, const char *ModuleName); +const char *CFE_Config_FindStaticModName(CFE_ConfigName_t *ModuleListSet[], size_t SetLength, const char *ModuleName); + +void CFE_Config_SetupModuleVersions(CFE_ConfigName_t *ModuleListSet[], size_t SetLength, + CFE_ConfigKeyValue_t *ActiveList); +void CFE_Config_SetupBasicBuildInfo(void); + +/** + * @brief Gets the value record associated with a config ID + */ +CFE_Config_ValueEntry_t *CFE_Config_LocateConfigRecordByID(CFE_ConfigId_t ConfigId); + +#endif /* CFE_CONFIG_PRIV_H */ diff --git a/modules/config/fsw/src/cfe_config_set.c b/modules/config/fsw/src/cfe_config_set.c new file mode 100644 index 000000000..d2b374e9e --- /dev/null +++ b/modules/config/fsw/src/cfe_config_set.c @@ -0,0 +1,92 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * API definition for configuration registry + * + * This defines the "setter" functions, which are reserved for CFE core internal use during startup. + */ + +/* +** Required header files. +*/ +#include "cfe_config_priv.h" + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_SetValue + * + * CFE core internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_Config_SetValue(CFE_ConfigId_t ConfigId, uint32 Value) +{ + CFE_Config_ValueEntry_t *Entry; + + Entry = CFE_Config_LocateConfigRecordByID(ConfigId); + if (Entry != NULL) + { + Entry->ActualType = CFE_ConfigType_VALUE; + Entry->Datum.AsInteger = Value; + } +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_SetObjPointer + * + * CFE core internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_Config_SetObjPointer(CFE_ConfigId_t ConfigId, const void *Ptr) +{ + CFE_Config_ValueEntry_t *Entry; + + Entry = CFE_Config_LocateConfigRecordByID(ConfigId); + if (Entry != NULL) + { + Entry->ActualType = CFE_ConfigType_POINTER; + Entry->Datum.AsPointer = Ptr; + } +} + +/*---------------------------------------------------------------- + * + * Function: CFE_Config_SetString + * + * CFE core internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_Config_SetString(CFE_ConfigId_t ConfigId, const char *Ptr) +{ + CFE_Config_ValueEntry_t *Entry; + + Entry = CFE_Config_LocateConfigRecordByID(ConfigId); + if (Entry != NULL) + { + Entry->ActualType = CFE_ConfigType_STRING; + Entry->Datum.AsPointer = Ptr; + } +} diff --git a/modules/config/fsw/src/cfe_config_table.h b/modules/config/fsw/src/cfe_config_table.h new file mode 100644 index 000000000..d3e7583fb --- /dev/null +++ b/modules/config/fsw/src/cfe_config_table.h @@ -0,0 +1,56 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * This file contains the CFE configuration registry global data definitions. + */ + +#ifndef CFE_CONFIG_TABLE_H +#define CFE_CONFIG_TABLE_H + +/* +** Includes +*/ +#include "common_types.h" +#include "cfe_config_ids.h" + +typedef enum CFE_ConfigType +{ + CFE_ConfigType_UNDEFINED, + CFE_ConfigType_VALUE, /**< Value is an unsigned int */ + CFE_ConfigType_STRING, /**< Value is a string pointer */ + CFE_ConfigType_POINTER, /**< Value is a non-string object pointer */ +} CFE_ConfigType_t; + +typedef union CFE_Config_ValueBuffer +{ + uint32 AsInteger; + const void *AsPointer; +} CFE_Config_ValueBuffer_t; + +typedef struct CFE_Config_ValueEntry +{ + CFE_ConfigType_t ActualType; + CFE_Config_ValueBuffer_t Datum; +} CFE_Config_ValueEntry_t; + +#endif /* CFE_CONFIG_TABLE_H */ diff --git a/modules/config/mission_build.cmake b/modules/config/mission_build.cmake new file mode 100644 index 000000000..a5a6d4551 --- /dev/null +++ b/modules/config/mission_build.cmake @@ -0,0 +1,61 @@ +########################################################### +# +# CFE configuration mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# Generate the complete list of configuration ids +set(CFE_CONFIG_IDS) +set(GENERATED_ENUM_OFFSET_LIST) +set(GENERATED_CONSTANT_DEFINE_LIST) +set(GENERATED_IDNAME_MAP_LIST) + +# Append the set of version description config keys +list(APPEND CFE_CONFIG_IDS + MISSION_NAME + MISSION_SRCVER + + CORE_VERSION_MAJOR + CORE_VERSION_MINOR + CORE_VERSION_REVISION + CORE_VERSION_MISSION_REV + CORE_VERSION_BUILDNUM + CORE_VERSION_BASELINE + CORE_VERSION_DESCRIPTION + + CORE_BUILDINFO_DATE + CORE_BUILDINFO_USER + CORE_BUILDINFO_HOST +) + +# Generate config ID for source version of modules that are included in the build +# NOTE: the presence in this list does not necesarily mean it will have a value at runtime, +# which may be the case for dynamic apps which are not loaded, for instance. +foreach(DEP ${MISSION_CORE_INTERFACES} ${MISSION_APPS} ${MISSION_CORE_MODULES} ${MISSION_PSPMODULES}) + string(TOUPPER "${DEP}" DEPNAME) + list(APPEND CFE_CONFIG_IDS MOD_SRCVER_${DEPNAME}) +endforeach() + +# Append any mission-defined config keys +# this may further extend the list of IDs +include(${MISSIONCONFIG}/config_ids_custom.cmake OPTIONAL) + +foreach(CFGID ${CFE_CONFIG_IDS}) + list(APPEND GENERATED_ENUM_OFFSET_LIST " CFE_ConfigIdOffset_${CFGID},\n") + list(APPEND GENERATED_IDNAME_MAP_LIST " [CFE_ConfigIdOffset_${CFGID}] = { \"${CFGID}\" },\n") + list(APPEND GENERATED_CONSTANT_DEFINE_LIST "#define CFE_CONFIGID_${CFGID} CFE_CONFIGID_C(CFE_ResourceId_FromInteger(CFE_CONFIGID_BASE + CFE_ConfigIdOffset_${CFGID}))\n") +endforeach() + +string(CONCAT GENERATED_ENUM_OFFSET_LIST ${GENERATED_ENUM_OFFSET_LIST}) +string(CONCAT GENERATED_CONSTANT_DEFINE_LIST ${GENERATED_CONSTANT_DEFINE_LIST}) +string(CONCAT GENERATED_IDNAME_MAP_LIST ${GENERATED_IDNAME_MAP_LIST}) + +# Write header file for config IDs +configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake/cfe_config_ids.h.in ${CMAKE_BINARY_DIR}/inc/cfe_config_ids.h) + +# Write constant map list for config IDs +configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake/cfe_config_map.c.in ${CMAKE_BINARY_DIR}/src/cfe_config_map.c) diff --git a/modules/config/ut-coverage/CMakeLists.txt b/modules/config/ut-coverage/CMakeLists.txt new file mode 100644 index 000000000..bb4ba20b4 --- /dev/null +++ b/modules/config/ut-coverage/CMakeLists.txt @@ -0,0 +1,22 @@ +################################################################## +# +# cFE unit test CMake build recipe +# +################################################################## + +set(UT_SOURCES) +foreach(SRC ${config_SOURCES}) + list(APPEND UT_SOURCES "${CFE_CONFIG_SOURCE_DIR}/${SRC}") +endforeach() + +add_cfe_coverage_test(config ALL + "test_cfe_config.c" + "${UT_SOURCES}" +) + +# This permits UT test cases to directly access private headers in the fsw/src dir +target_include_directories(coverage-config-ALL-testrunner PRIVATE + ${CFE_CONFIG_SOURCE_DIR}/fsw/src +) + +target_link_libraries(coverage-config-ALL-testrunner ut_core_private_stubs) diff --git a/modules/config/ut-coverage/test_cfe_config.c b/modules/config/ut-coverage/test_cfe_config.c new file mode 100644 index 000000000..c4edf3f7b --- /dev/null +++ b/modules/config/ut-coverage/test_cfe_config.c @@ -0,0 +1,285 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* + * Includes + */ +#include "cfe_config.h" +#include "cfe_config_priv.h" +#include "cfe_config_map.h" + +#include "utassert.h" +#include "utstubs.h" +#include "uttest.h" + +#include "ut_support.h" + +const CFE_Config_IdNameEntry_t CFE_CONFIG_IDNAME_MAP[CFE_ConfigIdOffset_MAX] = {{"UT_CHECK_1"}, + {"UT_CHECK_2"}, + {"UT_CHECK_3"}, + {"UT_CHECK_4"}, + {"MOD_SRCVER_COREMODULE1"}, + {"MOD_SRCVER_COREMODULE2"}}; + +#define CFE_CONFIGID_UT_CHECK_1 CFE_CONFIGID_C(CFE_RESOURCEID_WRAP(CFE_CONFIGID_BASE + 0)) +#define CFE_CONFIGID_UT_CHECK_2 CFE_CONFIGID_C(CFE_RESOURCEID_WRAP(CFE_CONFIGID_BASE + 1)) +#define CFE_CONFIGID_UT_CHECK_3 CFE_CONFIGID_C(CFE_RESOURCEID_WRAP(CFE_CONFIGID_BASE + 2)) +#define CFE_CONFIGID_UT_CHECK_4 CFE_CONFIGID_C(CFE_RESOURCEID_WRAP(CFE_CONFIGID_BASE + 3)) + +const char UT_UNKNOWN_STR[] = "UT-Unknown"; +const char UT_VALUE_STR[] = "UT-Value"; +const struct +{ + uint16 val; +} UT_TEST_OBJ = {456}; + +CFE_StaticModuleLoadEntry_t UT_PspModuleListSet[3] = {{"pspmodule1"}, {"pspmodule2"}, {NULL}}; +CFE_ConfigName_t UT_StaticModuleSet[3] = {{"staticmodule1"}, {"staticmodule2"}, {NULL}}; +CFE_ConfigName_t UT_CoreModuleSet[3] = {{"coremodule1"}, {"coremodule2"}, {NULL}}; +CFE_ConfigName_t * UT_ModuleListSet[2] = {UT_CoreModuleSet, UT_StaticModuleSet}; +CFE_ConfigKeyValue_t UT_ActiveList[3] = {{"coremodule1", "ut1"}, {"staticmodule2", "ut2"}, {NULL, NULL}}; + +void Test_CFE_Config_GetValue(void) +{ + /* + * Test case for: + * uint32 CFE_Config_GetValue(CFE_ConfigId_t ConfigId) + */ + UtAssert_UINT32_EQ(CFE_Config_GetValue(CFE_CONFIGID_UNDEFINED), 0); + UtAssert_UINT32_EQ(CFE_Config_GetValue(CFE_CONFIGID_UT_CHECK_1), 123); + UtAssert_UINT32_EQ(CFE_Config_GetValue(CFE_CONFIGID_UT_CHECK_2), 0); + UtAssert_UINT32_EQ(CFE_Config_GetValue(CFE_CONFIGID_UT_CHECK_3), 0); + UtAssert_UINT32_EQ(CFE_Config_GetValue(CFE_CONFIGID_UT_CHECK_4), 0); +} + +void Test_CFE_Config_GetObjPointer(void) +{ + /* + * Test case for: + * const void *CFE_Config_GetObjPointer(CFE_ConfigId_t ConfigId) + */ + UtAssert_NULL(CFE_Config_GetObjPointer(CFE_CONFIGID_UNDEFINED)); + UtAssert_NULL(CFE_Config_GetObjPointer(CFE_CONFIGID_UT_CHECK_1)); + UtAssert_ADDRESS_EQ(CFE_Config_GetObjPointer(CFE_CONFIGID_UT_CHECK_2), &UT_TEST_OBJ); + UtAssert_ADDRESS_EQ(CFE_Config_GetObjPointer(CFE_CONFIGID_UT_CHECK_3), UT_VALUE_STR); + UtAssert_NULL(CFE_Config_GetObjPointer(CFE_CONFIGID_UT_CHECK_4)); +} + +void Test_CFE_Config_GetString(void) +{ + /* + * Test case for: + * const char *CFE_Config_GetString(CFE_ConfigId_t ConfigId) + */ + UtAssert_ADDRESS_EQ(CFE_Config_GetString(CFE_CONFIGID_UNDEFINED), UT_UNKNOWN_STR); + UtAssert_ADDRESS_EQ(CFE_Config_GetString(CFE_CONFIGID_UT_CHECK_1), UT_UNKNOWN_STR); + UtAssert_ADDRESS_EQ(CFE_Config_GetString(CFE_CONFIGID_UT_CHECK_2), UT_UNKNOWN_STR); + UtAssert_ADDRESS_EQ(CFE_Config_GetString(CFE_CONFIGID_UT_CHECK_3), UT_VALUE_STR); + UtAssert_ADDRESS_EQ(CFE_Config_GetString(CFE_CONFIGID_UT_CHECK_4), UT_UNKNOWN_STR); +} + +void Test_CFE_Config_SetValue(void) +{ + /* + * Test case for: + * void CFE_Config_SetValue(CFE_ConfigId_t ConfigId, uint32 Value) + */ + UtAssert_VOIDCALL(CFE_Config_SetValue(CFE_CONFIGID_UNDEFINED, 789)); + UtAssert_VOIDCALL(CFE_Config_SetValue(CFE_CONFIGID_UT_CHECK_4, 789)); + UtAssert_UINT32_EQ(CFE_Config_GetValue(CFE_CONFIGID_UNDEFINED), 0); + UtAssert_UINT32_EQ(CFE_Config_GetValue(CFE_CONFIGID_UT_CHECK_4), 789); +} + +void Test_CFE_Config_SetObjPointer(void) +{ + /* + * Test case for: + * void CFE_Config_SetObjPointer(CFE_ConfigId_t ConfigId, const void *Ptr) + */ + static const char TESTOBJ[] = "TEST-OBJ"; + + UtAssert_VOIDCALL(CFE_Config_SetObjPointer(CFE_CONFIGID_UNDEFINED, TESTOBJ)); + UtAssert_VOIDCALL(CFE_Config_SetObjPointer(CFE_CONFIGID_UT_CHECK_4, TESTOBJ)); + UtAssert_NULL(CFE_Config_GetObjPointer(CFE_CONFIGID_UNDEFINED)); + UtAssert_ADDRESS_EQ(CFE_Config_GetObjPointer(CFE_CONFIGID_UT_CHECK_4), TESTOBJ); +} + +void Test_CFE_Config_SetString(void) +{ + /* + * Test case for: + * void CFE_Config_SetString(CFE_ConfigId_t ConfigId, const char *Ptr) + */ + static const char TESTSTR[] = "TEST-STRING"; + + UtAssert_VOIDCALL(CFE_Config_SetString(CFE_CONFIGID_UNDEFINED, TESTSTR)); + UtAssert_VOIDCALL(CFE_Config_SetString(CFE_CONFIGID_UT_CHECK_4, TESTSTR)); + UtAssert_ADDRESS_EQ(CFE_Config_GetString(CFE_CONFIGID_UNDEFINED), UT_UNKNOWN_STR); + UtAssert_ADDRESS_EQ(CFE_Config_GetString(CFE_CONFIGID_UT_CHECK_4), TESTSTR); +} + +void Test_CFE_Config_GetName(void) +{ + /* + * Test case for: + * const char *CFE_Config_GetName(CFE_ConfigId_t ConfigId) + */ + UtAssert_STRINGBUF_EQ(CFE_Config_GetName(CFE_CONFIGID_UT_CHECK_1), -1, "UT_CHECK_1", -1); + UtAssert_STRINGBUF_EQ(CFE_Config_GetName(CFE_CONFIGID_UNDEFINED), -1, UT_UNKNOWN_STR, -1); +} + +void Test_CFE_Config_GetIdByName(void) +{ + /* + * Test case for: + * CFE_ConfigId_t CFE_Config_GetIdByName(const char *Name) + */ + CFE_UtAssert_RESOURCEID_EQ(CFE_Config_GetIdByName("UT_CHECK_2"), CFE_CONFIGID_UT_CHECK_2); + CFE_UtAssert_RESOURCEID_EQ(CFE_Config_GetIdByName("INVALID"), CFE_CONFIGID_UNDEFINED); +} + +void UT_Callback(void *Arg, CFE_ConfigId_t Id, const char *Name) +{ + uint32 *Count = Arg; + + ++(*Count); + + UtAssert_NOT_NULL(Name); +} + +void Test_CFE_Config_IterateAll(void) +{ + /* + * Test case for: + * void CFE_Config_IterateAll(void *Arg, CFE_Config_Callback_t Callback) + */ + uint32 Count; + + Count = 0; + CFE_Config_IterateAll(&Count, UT_Callback); + + /* Callback should only be given for configured/set entities */ + UtAssert_UINT32_EQ(Count, 3); +} + +void Test_CFE_Config_StrCaseEq(void) +{ + /* + * Test case for: + * bool CFE_Config_StrCaseEq(const char *c1, const char *c2) + */ + UtAssert_BOOL_FALSE(CFE_Config_StrCaseEq("xx", "yy")); + UtAssert_BOOL_TRUE(CFE_Config_StrCaseEq("STR", "STR")); + UtAssert_BOOL_TRUE(CFE_Config_StrCaseEq("STR", "str")); + UtAssert_BOOL_TRUE(CFE_Config_StrCaseEq("StR", "sTr")); + UtAssert_BOOL_FALSE(CFE_Config_StrCaseEq("St", "sTr")); + UtAssert_BOOL_FALSE(CFE_Config_StrCaseEq("StR", "sT")); +} + +void Test_CFE_Config_FindTargetKeyValue(void) +{ + /* + * Test case for: + * const char *CFE_Config_FindTargetKeyValue(const CFE_ConfigKeyValue_t *ConfigList, const char *KeyName) + */ + + UtAssert_NOT_NULL(CFE_Config_FindTargetKeyValue(UT_ActiveList, "staticmodule2")); + UtAssert_NULL(CFE_Config_FindTargetKeyValue(UT_ActiveList, "nonexisting")); + UtAssert_NULL(CFE_Config_FindTargetKeyValue(UT_ActiveList, NULL)); + UtAssert_NULL(CFE_Config_FindTargetKeyValue(NULL, "staticmodule2")); +} + +void Test_CFE_Config_IsPspModule(void) +{ + /* + * Test case for: + * const char *CFE_Config_IsPspModule(const char *ModuleName) + */ + UtAssert_STRINGBUF_EQ(CFE_Config_IsPspModule(UT_PspModuleListSet, "pspmodule1"), -1, "pspmodule1", -1); + UtAssert_STRINGBUF_EQ(CFE_Config_IsPspModule(UT_PspModuleListSet, "pspmodule2"), -1, "pspmodule2", -1); + UtAssert_NULL(CFE_Config_IsPspModule(UT_PspModuleListSet, "notapspmodule")); + UtAssert_NULL(CFE_Config_IsPspModule(NULL, "notapspmodule")); +} + +void Test_CFE_Config_FindStaticModName(void) +{ + /* + * Test case for: + * const char *CFE_Config_FindStaticModName(const char *ModuleName) + */ + UtAssert_STRINGBUF_EQ(CFE_Config_FindStaticModName(UT_ModuleListSet, 2, "staticmodule2"), -1, "staticmodule2", -1); + UtAssert_STRINGBUF_EQ(CFE_Config_FindStaticModName(UT_ModuleListSet, 2, "coremodule2"), -1, "coremodule2", -1); + UtAssert_NULL(CFE_Config_FindStaticModName(UT_ModuleListSet, 2, "notastaticmodule")); +} + +void Test_CFE_Config_SetupModuleVersions(void) +{ + /* + * Test case for: + * void CFE_Config_SetupModuleVersions(void) + */ + UtAssert_VOIDCALL(CFE_Config_SetupModuleVersions(UT_ModuleListSet, 2, UT_ActiveList)); +} + +void Test_CFE_Config_Init(void) +{ + /* + * Test case for: + * int32 CFE_Config_Init(void) + */ + UtAssert_INT32_EQ(CFE_Config_Init(), CFE_SUCCESS); +} + +void Test_CFE_Config_Setup(void) +{ + memset(&CFE_Config_Global, 0, sizeof(CFE_Config_Global)); + + CFE_Config_Global.UnknownString = UT_UNKNOWN_STR; + + /* Set up one entry of each type */ + CFE_Config_Global.Table[0].ActualType = CFE_ConfigType_VALUE; + CFE_Config_Global.Table[0].Datum.AsInteger = 123; + CFE_Config_Global.Table[1].ActualType = CFE_ConfigType_POINTER; + CFE_Config_Global.Table[1].Datum.AsPointer = &UT_TEST_OBJ; + CFE_Config_Global.Table[2].ActualType = CFE_ConfigType_STRING; + CFE_Config_Global.Table[2].Datum.AsPointer = UT_VALUE_STR; + + /* NOTE: Leaves last entry unset */ +} + +void UtTest_Setup(void) +{ + UtTest_Add(Test_CFE_Config_GetValue, Test_CFE_Config_Setup, NULL, "Test CFE_Config_GetValue()"); + UtTest_Add(Test_CFE_Config_GetObjPointer, Test_CFE_Config_Setup, NULL, "Test CFE_Config_GetObjPointer()"); + UtTest_Add(Test_CFE_Config_GetString, Test_CFE_Config_Setup, NULL, "Test CFE_Config_GetString()"); + UtTest_Add(Test_CFE_Config_SetValue, Test_CFE_Config_Setup, NULL, "Test CFE_Config_SetValue()"); + UtTest_Add(Test_CFE_Config_SetObjPointer, Test_CFE_Config_Setup, NULL, "Test CFE_Config_SetObjPointer()"); + UtTest_Add(Test_CFE_Config_SetString, Test_CFE_Config_Setup, NULL, "Test CFE_Config_SetString()"); + UtTest_Add(Test_CFE_Config_GetName, Test_CFE_Config_Setup, NULL, "Test CFE_Config_GetName()"); + UtTest_Add(Test_CFE_Config_GetIdByName, Test_CFE_Config_Setup, NULL, "Test CFE_Config_GetIdByName()"); + UtTest_Add(Test_CFE_Config_IterateAll, Test_CFE_Config_Setup, NULL, "Test CFE_Config_IterateAll()"); + UtTest_Add(Test_CFE_Config_StrCaseEq, Test_CFE_Config_Setup, NULL, "Test CFE_Config_StrCaseEq()"); + UtTest_Add(Test_CFE_Config_FindTargetKeyValue, Test_CFE_Config_Setup, NULL, "Test CFE_Config_FindTargetKeyValue()"); + UtTest_Add(Test_CFE_Config_IsPspModule, Test_CFE_Config_Setup, NULL, "Test CFE_Config_IsPspModule()"); + UtTest_Add(Test_CFE_Config_FindStaticModName, Test_CFE_Config_Setup, NULL, "Test CFE_Config_FindStaticModName()"); + UtTest_Add(Test_CFE_Config_SetupModuleVersions, Test_CFE_Config_Setup, NULL, + "Test CFE_Config_SetupModuleVersions()"); + UtTest_Add(Test_CFE_Config_Init, Test_CFE_Config_Setup, NULL, "Test CFE_Config_Init()"); +} diff --git a/modules/core_api/fsw/inc/cfe_config.h b/modules/core_api/fsw/inc/cfe_config.h new file mode 100644 index 000000000..57bd4c2b2 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_config.h @@ -0,0 +1,124 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * Title: cFE Status Code Definition Header File + * + * Purpose: + * Common source of cFE API return status codes. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + */ + +#ifndef CFE_CONFIG_H +#define CFE_CONFIG_H + +/* Include Files */ +#include "common_types.h" +#include "cfe_config_api_typedefs.h" +#include "cfe_config_ids.h" + +/** + * @brief Obtain an integer value correlating to an CFE configuration ID + * + * Retreives the integer value associated with the specified key. + * + * If no value has been set, or the key is not valid, this returns 0. + * + * @param[in] ConfigId Configuration ID/Key to look up + * + * @return Value associated with key + * @retval 0 if key is not defined or not set + */ +uint32 CFE_Config_GetValue(CFE_ConfigId_t ConfigId); + +/** + * @brief Obtain a pointer value correlating to an CFE configuration ID + * + * Retreives the pointer value associated with the specified key. + * + * If no value has been set, or the key is not valid, this returns NULL. + * + * @param[in] ConfigId Configuration ID/Key to look up + * + * @return Value associated with key + * @retval NULL if key is not defined or not set + */ +const void *CFE_Config_GetObjPointer(CFE_ConfigId_t ConfigId); + +/** + * @brief Obtain a string value correlating to an CFE configuration ID + * + * Retreives the string value associated with the specified key. + * + * If no value has been set, or the key is not valid, this returns the + * special string "UNDEFINED" + * + * @note This function does not return NULL, so it can be used directly + * in printf-style calls. + * + * @param[in] ConfigId Configuration ID/Key to look up + * + * @return String value associated with key + */ +const char *CFE_Config_GetString(CFE_ConfigId_t ConfigId); + +/** + * @brief Obtain the name of a CFE configuration ID + * + * Retreives the printable name associated with the specified key. + * + * @note This function does not return NULL. + * + * If the ID is not valid/known, then the implementation returns the + * special string '[unknown]' rather than NULL, so this function may + * be more easily used in printf() style calls. + * + * @param[in] ConfigId Configuration ID/Key to look up + * + * @return Name associated with key + */ +const char *CFE_Config_GetName(CFE_ConfigId_t ConfigId); + +/** + * @brief Obtain the ID value associated with a configuration name + * + * @param[in] Name The name of the ID to look up + * + * @return ID associated with name + * @retval CFE_CONFIGID_UNDEFINED if the name did not correspond to a key + */ +CFE_ConfigId_t CFE_Config_GetIdByName(const char *Name); + +/** + * @brief Iterate all known name/ID value pairs + * + * @param[in] Arg User-supplied opaque argument to pass to callback + * @param[in] Callback User-supplied callback function to invoke for each ID + */ +void CFE_Config_IterateAll(void *Arg, CFE_Config_Callback_t Callback); + +#endif /* CFE_CONFIG_H */ diff --git a/modules/core_api/fsw/inc/cfe_config_api_typedefs.h b/modules/core_api/fsw/inc/cfe_config_api_typedefs.h new file mode 100644 index 000000000..7f1ac1eef --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_config_api_typedefs.h @@ -0,0 +1,55 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * Title: cFE Status Code Definition Header File + * + * Purpose: + * Common source of cFE API return status codes. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + */ + +#ifndef CFE_CONFIG_API_TYPEDEFS_H +#define CFE_CONFIG_API_TYPEDEFS_H + +/* Include Files */ +#include "common_types.h" +#include "cfe_resourceid_api_typedefs.h" + +/** + * @brief A type for Configuration IDs + * + * This is the type that is used for any API accepting or returning a configuration key ID + */ +typedef CFE_RESOURCEID_BASE_TYPE CFE_ConfigId_t; + +#define CFE_CONFIGID_C(val) ((CFE_ConfigId_t)CFE_RESOURCEID_WRAP(val)) +#define CFE_CONFIGID_UNDEFINED CFE_CONFIGID_C(CFE_RESOURCEID_UNDEFINED) + +typedef void (*CFE_Config_Callback_t)(void *Arg, CFE_ConfigId_t Id, const char *Name); + +#endif /* CFE_CONFIG_API_TYPEDEFS_H */ diff --git a/modules/core_api/ut-stubs/CMakeLists.txt b/modules/core_api/ut-stubs/CMakeLists.txt index 3d74005e5..315c993c8 100644 --- a/modules/core_api/ut-stubs/CMakeLists.txt +++ b/modules/core_api/ut-stubs/CMakeLists.txt @@ -16,6 +16,8 @@ include_directories(${osal_MISSION_DIR}/ut_assert/inc) # Create the generic stubs library # add_library(ut_core_api_stubs STATIC + src/cfe_config_handlers.c + src/cfe_config_stubs.c src/cfe_es_handlers.c src/cfe_es_stubs.c src/cfe_evs_handlers.c diff --git a/modules/core_api/ut-stubs/src/cfe_config_handlers.c b/modules/core_api/ut-stubs/src/cfe_config_handlers.c new file mode 100644 index 000000000..956addd35 --- /dev/null +++ b/modules/core_api/ut-stubs/src/cfe_config_handlers.c @@ -0,0 +1,96 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: ut_config_handlers.c +** +** Purpose: +** Unit test handlers for Configuration Service routines +** +** Notes: +** Mostly implement a NULL default return where needed, as this is not done +** automatically by UT assert. +** +*/ + +/* +** Includes +*/ +#include +#include "cfe_config.h" + +#include "utstubs.h" +#include "utassert.h" + +/* +** Functions +*/ + +/*------------------------------------------------------------ + * + * Default handler for CFE_Config_GetString coverage stub function + * + *------------------------------------------------------------*/ +void UT_DefaultHandler_CFE_Config_GetString(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) +{ + int32 status; + const char FIXED_BUFFER[] = "UT"; + void * Buffer; + + Buffer = NULL; + UT_Stub_GetInt32StatusCode(Context, &status); + + if (status >= 0) + { + UT_GetDataBuffer(FuncKey, &Buffer, NULL, NULL); + + /* + * The public API has a contract _not_ to return a NULL + * pointer, so this should be mimiced by the UT stub + */ + if (Buffer == NULL) + { + Buffer = (void *)FIXED_BUFFER; + } + } + + UT_Stub_SetReturnValue(FuncKey, Buffer); +} + +/*------------------------------------------------------------ + * + * Default handler for CFE_Config_GetObjPointer coverage stub function + * + *------------------------------------------------------------*/ +void UT_DefaultHandler_CFE_Config_GetObjPointer(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) +{ + int32 status; + void *Buffer; + + Buffer = NULL; + UT_Stub_GetInt32StatusCode(Context, &status); + + if (status >= 0) + { + UT_GetDataBuffer(FuncKey, &Buffer, NULL, NULL); + } + + UT_Stub_SetReturnValue(FuncKey, Buffer); +} diff --git a/modules/core_api/ut-stubs/src/cfe_config_stubs.c b/modules/core_api/ut-stubs/src/cfe_config_stubs.c new file mode 100644 index 000000000..45ad8c9ee --- /dev/null +++ b/modules/core_api/ut-stubs/src/cfe_config_stubs.c @@ -0,0 +1,124 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * Auto-Generated stub implementations for functions defined in cfe_config header + */ + +#include "cfe_config.h" +#include "utgenstub.h" + +extern void UT_DefaultHandler_CFE_Config_GetObjPointer(void *, UT_EntryKey_t, const UT_StubContext_t *); +extern void UT_DefaultHandler_CFE_Config_GetString(void *, UT_EntryKey_t, const UT_StubContext_t *); + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_GetIdByName() + * ---------------------------------------------------- + */ +CFE_ConfigId_t CFE_Config_GetIdByName(const char *Name) +{ + UT_GenStub_SetupReturnBuffer(CFE_Config_GetIdByName, CFE_ConfigId_t); + + UT_GenStub_AddParam(CFE_Config_GetIdByName, const char *, Name); + + UT_GenStub_Execute(CFE_Config_GetIdByName, Basic, NULL); + + return UT_GenStub_GetReturnValue(CFE_Config_GetIdByName, CFE_ConfigId_t); +} + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_GetName() + * ---------------------------------------------------- + */ +const char *CFE_Config_GetName(CFE_ConfigId_t ConfigId) +{ + UT_GenStub_SetupReturnBuffer(CFE_Config_GetName, const char *); + + UT_GenStub_AddParam(CFE_Config_GetName, CFE_ConfigId_t, ConfigId); + + UT_GenStub_Execute(CFE_Config_GetName, Basic, NULL); + + return UT_GenStub_GetReturnValue(CFE_Config_GetName, const char *); +} + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_GetObjPointer() + * ---------------------------------------------------- + */ +const void *CFE_Config_GetObjPointer(CFE_ConfigId_t ConfigId) +{ + UT_GenStub_SetupReturnBuffer(CFE_Config_GetObjPointer, const void *); + + UT_GenStub_AddParam(CFE_Config_GetObjPointer, CFE_ConfigId_t, ConfigId); + + UT_GenStub_Execute(CFE_Config_GetObjPointer, Basic, UT_DefaultHandler_CFE_Config_GetObjPointer); + + return UT_GenStub_GetReturnValue(CFE_Config_GetObjPointer, const void *); +} + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_GetString() + * ---------------------------------------------------- + */ +const char *CFE_Config_GetString(CFE_ConfigId_t ConfigId) +{ + UT_GenStub_SetupReturnBuffer(CFE_Config_GetString, const char *); + + UT_GenStub_AddParam(CFE_Config_GetString, CFE_ConfigId_t, ConfigId); + + UT_GenStub_Execute(CFE_Config_GetString, Basic, UT_DefaultHandler_CFE_Config_GetString); + + return UT_GenStub_GetReturnValue(CFE_Config_GetString, const char *); +} + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_GetValue() + * ---------------------------------------------------- + */ +uint32 CFE_Config_GetValue(CFE_ConfigId_t ConfigId) +{ + UT_GenStub_SetupReturnBuffer(CFE_Config_GetValue, uint32); + + UT_GenStub_AddParam(CFE_Config_GetValue, CFE_ConfigId_t, ConfigId); + + UT_GenStub_Execute(CFE_Config_GetValue, Basic, NULL); + + return UT_GenStub_GetReturnValue(CFE_Config_GetValue, uint32); +} + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_IterateAll() + * ---------------------------------------------------- + */ +void CFE_Config_IterateAll(void *Arg, CFE_Config_Callback_t Callback) +{ + UT_GenStub_AddParam(CFE_Config_IterateAll, void *, Arg); + UT_GenStub_AddParam(CFE_Config_IterateAll, CFE_Config_Callback_t, Callback); + + UT_GenStub_Execute(CFE_Config_IterateAll, Basic, NULL); +} diff --git a/modules/core_private/fsw/inc/cfe_config_core_internal.h b/modules/core_private/fsw/inc/cfe_config_core_internal.h new file mode 100644 index 000000000..06dd01f16 --- /dev/null +++ b/modules/core_private/fsw/inc/cfe_config_core_internal.h @@ -0,0 +1,53 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * cFE Internal configuration APIs + * + * The internal APIs prototyped within this file are only intended to be invoked from + * other CFE core apps. They still need to be prototyped in the shared header such that + * they can be called from other core modules, but applications should not call these. + */ + +#ifndef CFE_CONFIG_CORE_INTERNAL_H +#define CFE_CONFIG_CORE_INTERNAL_H + +#include "cfe_config_api_typedefs.h" + +#include "common_types.h" + +/** @defgroup CFEAPIConfigCoreInternal cFE Internal configuration APIs, internal to CFE core + * @{ + */ + +int32 CFE_Config_Init(void); + +/* + * The "Set" API is only used during init phase + */ +void CFE_Config_SetValue(CFE_ConfigId_t ConfigId, uint32 Value); +void CFE_Config_SetString(CFE_ConfigId_t ConfigId, const char *Ptr); +void CFE_Config_SetObjPointer(CFE_ConfigId_t ConfigId, const void *Ptr); + +/**@}*/ + +#endif /* CFE_CONFIG_CORE_INTERNAL_H */ diff --git a/modules/core_private/ut-stubs/CMakeLists.txt b/modules/core_private/ut-stubs/CMakeLists.txt index 7e55ac114..e83aa2da2 100644 --- a/modules/core_private/ut-stubs/CMakeLists.txt +++ b/modules/core_private/ut-stubs/CMakeLists.txt @@ -13,6 +13,7 @@ # Create the generic stubs library # add_library(ut_core_private_stubs STATIC + src/cfe_config_core_internal_stubs.c src/cfe_es_core_internal_handlers.c src/cfe_es_core_internal_stubs.c src/cfe_evs_core_internal_stubs.c diff --git a/modules/core_private/ut-stubs/src/cfe_config_core_internal_stubs.c b/modules/core_private/ut-stubs/src/cfe_config_core_internal_stubs.c new file mode 100644 index 000000000..051a4269d --- /dev/null +++ b/modules/core_private/ut-stubs/src/cfe_config_core_internal_stubs.c @@ -0,0 +1,68 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file + * + * Auto-Generated stub implementations for functions defined in cfe_config_core_internal header + */ + +#include "cfe_config_core_internal.h" +#include "utgenstub.h" + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_Init() + * ---------------------------------------------------- + */ +int32 CFE_Config_Init(void) +{ + UT_GenStub_SetupReturnBuffer(CFE_Config_Init, int32); + + UT_GenStub_Execute(CFE_Config_Init, Basic, NULL); + + return UT_GenStub_GetReturnValue(CFE_Config_Init, int32); +} + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_SetValue() + * ---------------------------------------------------- + */ +void CFE_Config_SetValue(CFE_ConfigId_t ConfigId, uint32 Value) +{ + UT_GenStub_AddParam(CFE_Config_SetValue, CFE_ConfigId_t, ConfigId); + UT_GenStub_AddParam(CFE_Config_SetValue, uint32, Value); + + UT_GenStub_Execute(CFE_Config_SetValue, Basic, NULL); +} + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_Config_SetPointer() + * ---------------------------------------------------- + */ +void CFE_Config_SetPointer(CFE_ConfigId_t ConfigId, const void *Ptr) +{ + UT_GenStub_AddParam(CFE_Config_SetPointer, CFE_ConfigId_t, ConfigId); + UT_GenStub_AddParam(CFE_Config_SetPointer, const void *, Ptr); + + UT_GenStub_Execute(CFE_Config_SetPointer, Basic, NULL); +} diff --git a/modules/es/fsw/src/cfe_es_objtab.c b/modules/es/fsw/src/cfe_es_objtab.c index 6bf370f3b..d3ddc6a05 100644 --- a/modules/es/fsw/src/cfe_es_objtab.c +++ b/modules/es/fsw/src/cfe_es_objtab.c @@ -44,6 +44,7 @@ #include "cfe_sb_core_internal.h" #include "cfe_tbl_core_internal.h" #include "cfe_time_core_internal.h" +#include "cfe_config_core_internal.h" /* ** @@ -58,7 +59,9 @@ CFE_ES_ObjectTable_t CFE_ES_ObjectTable[CFE_PLATFORM_ES_OBJECT_TABLE_SIZE] = { {.ObjectType = CFE_ES_NULL_ENTRY}, {.ObjectType = CFE_ES_NULL_ENTRY}, {.ObjectType = CFE_ES_NULL_ENTRY}, - {.ObjectType = CFE_ES_NULL_ENTRY}, + + /* Initialize the configuration registry early, so it can be used by core apps */ + {.ObjectType = CFE_ES_FUNCTION_CALL, .ObjectName = "CFE_Config_Init", .FuncPtrUnion.FunctionPtr = CFE_Config_Init}, /* ** cFE core early initialization calls. These must be done before the tasks start diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index 31b532f38..186b4e49a 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -41,6 +41,8 @@ #include "target_config.h" #include "cfe_es_verify.h" +#include "cfe_config.h" + #include /* @@ -179,65 +181,44 @@ void CFE_ES_TaskMain(void) /*---------------------------------------------------------------- * - * Function: CFE_ES_FindConfigKeyValue + * Function: CFE_ES_GenerateSingleVersionEvent * * Internal helper routine only, not part of API. * - * Find value for given config key + * Send a single CFE_ES_VERSION_INF_EID event for a component/module * *-----------------------------------------------------------------*/ -const char *CFE_ES_FindConfigKeyValue(const CFE_ConfigKeyValue_t *ConfigList, const char *KeyName) +int32 CFE_ES_GenerateSingleVersionEvent(const char *ModuleType, const char *ModuleName, CFE_ConfigId_t Id) { - const char *ValuePtr; + int32 Status; - ValuePtr = NULL; - if (KeyName != NULL && ConfigList != NULL) - { - while (ConfigList->Key != NULL) - { - if (strcmp(KeyName, ConfigList->Key) == 0) - { - ValuePtr = ConfigList->Value; - break; - } - - ++ConfigList; - } - } + /* + * Advertise the mission version information + * NOTE: CFE_Config_GetString() does not return NULL, so its OK to use inside an arg list + */ + Status = CFE_EVS_SendEvent(CFE_ES_VERSION_INF_EID, CFE_EVS_EventType_INFORMATION, "Version Info: %s %s, version %s", + ModuleType, ModuleName, CFE_Config_GetString(Id)); - return ValuePtr; + return Status; } /*---------------------------------------------------------------- * - * Function: CFE_ES_GenerateSingleVersionEvent + * Function: CFE_ES_ModSrcVerCallback * * Internal helper routine only, not part of API. * - * Send a single CFE_ES_VERSION_INF_EID event for a component/module + * Callback for iterating all configuration keys * *-----------------------------------------------------------------*/ -int32 CFE_ES_GenerateSingleVersionEvent(const char *ModuleType, const char *ModuleName) +void CFE_ES_ModSrcVerCallback(void *Arg, CFE_ConfigId_t Id, const char *Name) { - int32 Status; - const char *VersionString; - - /* The mission version which should appear in the version list under the mission name */ - VersionString = CFE_ES_FindConfigKeyValue(GLOBAL_CONFIGDATA.ModuleVersionList, ModuleName); + static const char IDNAME_PREFIX[] = "MOD_SRCVER_"; - /* If NULL that means the source code was either uncontrolled or there was no way to determine its version */ - if (VersionString == NULL) + if (strncmp(Name, IDNAME_PREFIX, sizeof(IDNAME_PREFIX) - 1) == 0) { - VersionString = "[unknown]"; + CFE_ES_GenerateSingleVersionEvent("Module", &Name[sizeof(IDNAME_PREFIX) - 1], Id); } - - /* - * Advertise the mission version information - */ - Status = CFE_EVS_SendEvent(CFE_ES_VERSION_INF_EID, CFE_EVS_EventType_INFORMATION, "Version Info: %s %s, version %s", - ModuleType, ModuleName, VersionString); - - return Status; } /*---------------------------------------------------------------- @@ -251,55 +232,18 @@ int32 CFE_ES_GenerateSingleVersionEvent(const char *ModuleType, const char *Modu *-----------------------------------------------------------------*/ void CFE_ES_GenerateVersionEvents(void) { - int32 Status; - CFE_ConfigName_t * ModuleNamePtr; - CFE_StaticModuleLoadEntry_t *StaticModulePtr; + int32 Status; /* * Advertise the mission version information */ - Status = CFE_ES_GenerateSingleVersionEvent("Mission", GLOBAL_CONFIGDATA.MissionName); + Status = CFE_ES_GenerateSingleVersionEvent("Mission", GLOBAL_CONFIGDATA.MissionName, CFE_CONFIGID_MISSION_SRCVER); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("%s: Error sending mission version event:RC=0x%08X\n", __func__, (unsigned int)Status); } - /* - * Also Advertise the version information for all statically-linked core modules. - * Send a separate CFE_ES_VERSION_INF_EID for every component. - */ - ModuleNamePtr = GLOBAL_CONFIGDATA.CoreModuleList; - if (ModuleNamePtr != NULL) - { - while (Status == CFE_SUCCESS && ModuleNamePtr->Name != NULL) - { - Status = CFE_ES_GenerateSingleVersionEvent("Core Module", ModuleNamePtr->Name); - if (Status != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("%s: Error sending core module version event:RC=0x%08X\n", __func__, - (unsigned int)Status); - } - ++ModuleNamePtr; - } - } - - /* - * Advertise PSP module versions - */ - StaticModulePtr = GLOBAL_CONFIGDATA.PspModuleList; - if (StaticModulePtr != NULL) - { - while (Status == CFE_SUCCESS && StaticModulePtr->Name != NULL) - { - Status = CFE_ES_GenerateSingleVersionEvent("PSP Module", StaticModulePtr->Name); - if (Status != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("%s: Error sending PSP module version event:RC=0x%08X\n", __func__, - (unsigned int)Status); - } - ++StaticModulePtr; - } - } + CFE_Config_IterateAll(NULL, CFE_ES_ModSrcVerCallback); } /*---------------------------------------------------------------- @@ -318,25 +262,10 @@ void CFE_ES_GenerateBuildInfoEvents(void) const char *BuildUser; const char *BuildHost; - BuildDate = CFE_ES_FindConfigKeyValue(GLOBAL_CONFIGDATA.BuildEnvironment, "BUILDDATE"); - BuildUser = CFE_ES_FindConfigKeyValue(GLOBAL_CONFIGDATA.BuildEnvironment, "BUILDUSER"); - BuildHost = CFE_ES_FindConfigKeyValue(GLOBAL_CONFIGDATA.BuildEnvironment, "BUILDHOST"); - - /* Ensure all strings are set to something non-NULL */ - if (BuildDate == NULL) - { - BuildDate = "[unknown]"; - } - - if (BuildUser == NULL) - { - BuildUser = "[unknown]"; - } - - if (BuildHost == NULL) - { - BuildHost = "[unknown]"; - } + /* NOTE: The config APIs using "GetString" will not return NULL */ + BuildDate = CFE_Config_GetString(CFE_CONFIGID_CORE_BUILDINFO_DATE); + BuildUser = CFE_Config_GetString(CFE_CONFIGID_CORE_BUILDINFO_USER); + BuildHost = CFE_Config_GetString(CFE_CONFIGID_CORE_BUILDINFO_HOST); Status = CFE_EVS_SendEvent(CFE_ES_BUILD_INF_EID, CFE_EVS_EventType_INFORMATION, "Build %s by %s@%s, config %s", BuildDate, BuildUser, BuildHost, GLOBAL_CONFIGDATA.Config); diff --git a/modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h b/modules/resourceid/fsw/inc/cfe_core_resourceid_basevalues.h similarity index 92% rename from modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h rename to modules/resourceid/fsw/inc/cfe_core_resourceid_basevalues.h index 8991a1d78..79d676b9c 100644 --- a/modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h +++ b/modules/resourceid/fsw/inc/cfe_core_resourceid_basevalues.h @@ -68,7 +68,11 @@ enum CFE_RESOURCEID_ES_CDSBLOCKID_BASE_OFFSET = OS_OBJECT_TYPE_USER + 5, /* SB managed resources */ - CFE_RESOURCEID_SB_PIPEID_RESOURCE_BASE_OFFSET = OS_OBJECT_TYPE_USER + 6 + CFE_RESOURCEID_SB_PIPEID_RESOURCE_BASE_OFFSET = OS_OBJECT_TYPE_USER + 6, + + /* configuration registry */ + CFE_RESOURCEID_CONFIGID_BASE_OFFSET = OS_OBJECT_TYPE_USER + 7, + }; /* @@ -87,7 +91,10 @@ enum CFE_ES_CDSBLOCKID_BASE = CFE_RESOURCEID_MAKE_BASE(CFE_RESOURCEID_ES_CDSBLOCKID_BASE_OFFSET), /* SB managed resources */ - CFE_SB_PIPEID_BASE = CFE_RESOURCEID_MAKE_BASE(CFE_RESOURCEID_SB_PIPEID_RESOURCE_BASE_OFFSET) + CFE_SB_PIPEID_BASE = CFE_RESOURCEID_MAKE_BASE(CFE_RESOURCEID_SB_PIPEID_RESOURCE_BASE_OFFSET), + + /* configuration registry */ + CFE_CONFIGID_BASE = CFE_RESOURCEID_MAKE_BASE(CFE_RESOURCEID_CONFIGID_BASE_OFFSET), }; /** @} */ From 2f4a7fd7941400f9df498cc6f4b8f046f80c461b Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 1 Oct 2021 11:00:01 -0400 Subject: [PATCH 013/200] Fix #1984, avoid aliasing warnings Use an actual `void*` value when invoking functions that output an opaque pointer value. If necessary the value of this pointer can then be assigned to the real pointer type to dereference. --- .../cfe_testcase/src/tbl_content_mang_test.c | 25 ++++++++---- .../core_api/ut-stubs/src/cfe_es_handlers.c | 39 +++++++++++-------- .../core_api/ut-stubs/src/cfe_fs_handlers.c | 18 +++++++-- .../core_api/ut-stubs/src/cfe_sb_handlers.c | 21 ++++++---- .../core_private/ut-stubs/src/ut_support.c | 6 ++- modules/es/ut-coverage/es_UT.c | 33 +++++++++------- modules/sb/ut-coverage/sb_UT.c | 12 ++++-- modules/tbl/ut-coverage/tbl_UT.c | 27 ++++++------- 8 files changed, 111 insertions(+), 70 deletions(-) diff --git a/modules/cfe_testcase/src/tbl_content_mang_test.c b/modules/cfe_testcase/src/tbl_content_mang_test.c index c0a133aea..77e85c23c 100644 --- a/modules/cfe_testcase/src/tbl_content_mang_test.c +++ b/modules/cfe_testcase/src/tbl_content_mang_test.c @@ -68,6 +68,7 @@ void TestLoad(void) TBL_TEST_Table_t TestTable = {0xd00d, 0xdad}; TBL_TEST_Table_t *TablePtr; CFE_TBL_Handle_t OtherHandle; + void * TempPtr; UtPrintf("Testing: CFE_TBL_Load"); @@ -107,7 +108,8 @@ void TestLoad(void) UtAssert_INT32_EQ(CFE_TBL_Load(CFE_FT_Global.TblHandle, CFE_TBL_SRC_FILE, TESTTBL_NOMINAL_FILE), CFE_SUCCESS); /* confirm content (football) */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TablePtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TempPtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED); + TablePtr = TempPtr; UtAssert_UINT32_EQ(TablePtr->Int1, 0xf007); UtAssert_UINT32_EQ(TablePtr->Int2, 0xba11); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_SUCCESS); @@ -117,7 +119,8 @@ void TestLoad(void) CFE_TBL_ERR_FILE_TOO_LARGE); /* confirm content again (note content should not have been updated) */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TablePtr, CFE_FT_Global.TblHandle), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TempPtr, CFE_FT_Global.TblHandle), CFE_SUCCESS); + TablePtr = TempPtr; UtAssert_UINT32_EQ(TablePtr->Int1, 0xf007); UtAssert_UINT32_EQ(TablePtr->Int2, 0xba11); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_SUCCESS); @@ -126,7 +129,8 @@ void TestLoad(void) UtAssert_INT32_EQ(CFE_TBL_Load(CFE_FT_Global.TblHandle, CFE_TBL_SRC_FILE, TESTTBL_ALTERNATE_FILE), CFE_SUCCESS); /* confirm content again (changed to alternate data) */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TablePtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TempPtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED); + TablePtr = TempPtr; UtAssert_UINT32_EQ(TablePtr->Int1, 0xdead); UtAssert_UINT32_EQ(TablePtr->Int2, 0xbeef); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_SUCCESS); @@ -136,7 +140,8 @@ void TestLoad(void) CFE_TBL_ERR_LOAD_INCOMPLETE); /* confirm content again (should not be changed) */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TablePtr, CFE_FT_Global.TblHandle), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TempPtr, CFE_FT_Global.TblHandle), CFE_SUCCESS); + TablePtr = TempPtr; UtAssert_UINT32_EQ(TablePtr->Int1, 0xdead); UtAssert_UINT32_EQ(TablePtr->Int2, 0xbeef); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_SUCCESS); @@ -145,13 +150,15 @@ void TestLoad(void) UtAssert_INT32_EQ(CFE_TBL_Load(OtherHandle, CFE_TBL_SRC_FILE, TESTTBL_OTHERTBL_FILE), CFE_SUCCESS); /* confirm content of first table again (should not be changed) */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TablePtr, CFE_FT_Global.TblHandle), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TempPtr, CFE_FT_Global.TblHandle), CFE_SUCCESS); + TablePtr = TempPtr; UtAssert_UINT32_EQ(TablePtr->Int1, 0xdead); UtAssert_UINT32_EQ(TablePtr->Int2, 0xbeef); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_SUCCESS); /* confirm content of other table (boatload) */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TablePtr, OtherHandle), CFE_TBL_INFO_UPDATED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TempPtr, OtherHandle), CFE_TBL_INFO_UPDATED); + TablePtr = TempPtr; UtAssert_UINT32_EQ(TablePtr->Int1, 0xb0a7); UtAssert_UINT32_EQ(TablePtr->Int2, 0x10ad); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(OtherHandle), CFE_SUCCESS); @@ -161,7 +168,8 @@ void TestLoad(void) /* confirm content again (reported as updated from partial load) */ /* Should have updated the first word only */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TablePtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TempPtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED); + TablePtr = TempPtr; UtAssert_UINT32_EQ(TablePtr->Int1, 0x5555); UtAssert_UINT32_EQ(TablePtr->Int2, 0xbeef); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_SUCCESS); @@ -171,7 +179,8 @@ void TestLoad(void) /* confirm content again (reported as updated from partial load) */ /* Should have updated the second word only */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TablePtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TempPtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED); + TablePtr = TempPtr; UtAssert_UINT32_EQ(TablePtr->Int1, 0x5555); UtAssert_UINT32_EQ(TablePtr->Int2, 0x6666); UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_SUCCESS); diff --git a/modules/core_api/ut-stubs/src/cfe_es_handlers.c b/modules/core_api/ut-stubs/src/cfe_es_handlers.c index f240b58bf..08cc6a17e 100644 --- a/modules/core_api/ut-stubs/src/cfe_es_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_es_handlers.c @@ -125,7 +125,7 @@ void UT_DefaultHandler_CFE_ES_GetAppID(void *UserObj, UT_EntryKey_t FuncKey, con { CFE_ES_AppId_t *AppIdPtr = UT_Hook_GetArgValueByName(Context, "AppIdPtr", CFE_ES_AppId_t *); int32 status; - CFE_ES_AppId_t *IdBuff; + void * IdBuff; size_t BuffSize; size_t Position; @@ -133,10 +133,10 @@ void UT_DefaultHandler_CFE_ES_GetAppID(void *UserObj, UT_EntryKey_t FuncKey, con if (status >= 0) { - UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppID), (void **)&IdBuff, &BuffSize, &Position); + UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppID), &IdBuff, &BuffSize, &Position); if (IdBuff != NULL && BuffSize == sizeof(*AppIdPtr)) { - *AppIdPtr = *IdBuff; + memcpy(AppIdPtr, IdBuff, sizeof(*AppIdPtr)); } else { @@ -159,7 +159,7 @@ void UT_DefaultHandler_CFE_ES_GetTaskID(void *UserObj, UT_EntryKey_t FuncKey, co { CFE_ES_TaskId_t *TaskIdPtr = UT_Hook_GetArgValueByName(Context, "TaskIdPtr", CFE_ES_TaskId_t *); int32 status; - CFE_ES_TaskId_t *IdBuff; + void * IdBuff; size_t BuffSize; size_t Position; @@ -167,10 +167,10 @@ void UT_DefaultHandler_CFE_ES_GetTaskID(void *UserObj, UT_EntryKey_t FuncKey, co if (status >= 0) { - UT_GetDataBuffer(UT_KEY(CFE_ES_GetTaskID), (void **)&IdBuff, &BuffSize, &Position); + UT_GetDataBuffer(UT_KEY(CFE_ES_GetTaskID), &IdBuff, &BuffSize, &Position); if (IdBuff != NULL && BuffSize == sizeof(*TaskIdPtr)) { - *TaskIdPtr = *IdBuff; + memcpy(TaskIdPtr, IdBuff, sizeof(*TaskIdPtr)); } else { @@ -194,11 +194,11 @@ void UT_DefaultHandler_CFE_ES_GetAppIDByName(void *UserObj, UT_EntryKey_t FuncKe CFE_ES_AppId_t *AppIdPtr = UT_Hook_GetArgValueByName(Context, "AppIdPtr", CFE_ES_AppId_t *); const char * AppName = UT_Hook_GetArgValueByName(Context, "AppName", const char *); - size_t UserBuffSize; - size_t BuffPosition; - const char * NameBuff; - CFE_ES_AppId_t *IdBuff; - int32 status; + size_t UserBuffSize; + size_t BuffPosition; + void * NameBuff; + void * IdBuff; + int32 status; UT_Stub_GetInt32StatusCode(Context, &status); @@ -207,15 +207,15 @@ void UT_DefaultHandler_CFE_ES_GetAppIDByName(void *UserObj, UT_EntryKey_t FuncKe if (UT_Stub_CopyToLocal(UT_KEY(CFE_ES_GetAppIDByName), AppIdPtr, sizeof(*AppIdPtr)) < sizeof(*AppIdPtr)) { IdBuff = NULL; - UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppName), (void **)&NameBuff, &UserBuffSize, &BuffPosition); - if (NameBuff != NULL && UserBuffSize > 0 && strncmp(NameBuff, AppName, UserBuffSize) == 0) + UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppName), &NameBuff, &UserBuffSize, &BuffPosition); + if (NameBuff != NULL && UserBuffSize > 0 && strncmp((const char *)NameBuff, AppName, UserBuffSize) == 0) { - UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppID), (void **)&IdBuff, &UserBuffSize, &BuffPosition); + UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppID), &IdBuff, &UserBuffSize, &BuffPosition); } if (IdBuff != NULL && UserBuffSize == sizeof(*AppIdPtr)) { - *AppIdPtr = *IdBuff; + memcpy(AppIdPtr, IdBuff, sizeof(*AppIdPtr)); } else { @@ -243,18 +243,23 @@ void UT_DefaultHandler_CFE_ES_GetAppName(void *UserObj, UT_EntryKey_t FuncKey, c size_t UserBuffSize; size_t BuffPosition; const char *NameBuff; + void * TempBuff; int32 status; UT_Stub_GetInt32StatusCode(Context, &status); if (status >= 0 && BufferLength > 0) { - UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppName), (void **)&NameBuff, &UserBuffSize, &BuffPosition); - if (NameBuff == NULL || UserBuffSize == 0) + UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppName), &TempBuff, &UserBuffSize, &BuffPosition); + if (TempBuff == NULL || UserBuffSize == 0) { NameBuff = "UT"; UserBuffSize = 2; } + else + { + NameBuff = TempBuff; + } if (UserBuffSize < BufferLength) { diff --git a/modules/core_api/ut-stubs/src/cfe_fs_handlers.c b/modules/core_api/ut-stubs/src/cfe_fs_handlers.c index 42b70e6d0..86e18fec9 100644 --- a/modules/core_api/ut-stubs/src/cfe_fs_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_fs_handlers.c @@ -50,6 +50,7 @@ void UT_DefaultHandler_CFE_FS_GetDefaultMountPoint(void *UserObj, UT_EntryKey_t { int32 Status; static const char DEFAULT_MOUNTPOINT[] = "/ut"; + void * TempBuff; const char * Result; UT_Stub_GetInt32StatusCode(Context, &Status); @@ -58,11 +59,15 @@ void UT_DefaultHandler_CFE_FS_GetDefaultMountPoint(void *UserObj, UT_EntryKey_t if (Status == CFE_SUCCESS) { /* If the test case supplied a buffer, return it, otherwise return fixed value */ - UT_GetDataBuffer(UT_KEY(CFE_FS_GetDefaultMountPoint), (void **)&Result, NULL, NULL); - if (Result == NULL) + UT_GetDataBuffer(UT_KEY(CFE_FS_GetDefaultMountPoint), &TempBuff, NULL, NULL); + if (TempBuff == NULL) { Result = DEFAULT_MOUNTPOINT; } + else + { + Result = TempBuff; + } } UT_Stub_SetReturnValue(FuncKey, Result); @@ -77,6 +82,7 @@ void UT_DefaultHandler_CFE_FS_GetDefaultExtension(void *UserObj, UT_EntryKey_t F { int32 Status; static const char DEFAULT_EXTENSION[] = ".ut"; + void * TempBuff; const char * Result; UT_Stub_GetInt32StatusCode(Context, &Status); @@ -85,11 +91,15 @@ void UT_DefaultHandler_CFE_FS_GetDefaultExtension(void *UserObj, UT_EntryKey_t F if (Status == CFE_SUCCESS) { /* If the test case supplied a buffer, return it, otherwise return fixed value */ - UT_GetDataBuffer(UT_KEY(CFE_FS_GetDefaultExtension), (void **)&Result, NULL, NULL); - if (Result == NULL) + UT_GetDataBuffer(UT_KEY(CFE_FS_GetDefaultExtension), &TempBuff, NULL, NULL); + if (TempBuff == NULL) { Result = DEFAULT_EXTENSION; } + else + { + Result = TempBuff; + } } UT_Stub_SetReturnValue(FuncKey, Result); diff --git a/modules/core_api/ut-stubs/src/cfe_sb_handlers.c b/modules/core_api/ut-stubs/src/cfe_sb_handlers.c index bd47cd9ae..2e245748e 100644 --- a/modules/core_api/ut-stubs/src/cfe_sb_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_sb_handlers.c @@ -50,12 +50,12 @@ typedef struct static CFE_SB_StubMsg_MetaData_t *CFE_SB_StubMsg_GetMetaData(const CFE_MSG_Message_t *MsgPtr) { - CFE_SB_StubMsg_MetaData_t *MetaPtr; - CFE_SB_StubMsg_MetaData_t DefaultMeta; - size_t MetaSize; - UT_EntryKey_t MsgKey = (UT_EntryKey_t)MsgPtr; + void * MetaPtr; + CFE_SB_StubMsg_MetaData_t DefaultMeta; + size_t MetaSize; + UT_EntryKey_t MsgKey = (UT_EntryKey_t)MsgPtr; - UT_GetDataBuffer(MsgKey, (void **)&MetaPtr, &MetaSize, NULL); + UT_GetDataBuffer(MsgKey, &MetaPtr, &MetaSize, NULL); if (MetaPtr == NULL || MetaSize != sizeof(DefaultMeta)) { memset(&DefaultMeta, 0, sizeof(DefaultMeta)); @@ -64,7 +64,7 @@ static CFE_SB_StubMsg_MetaData_t *CFE_SB_StubMsg_GetMetaData(const CFE_MSG_Messa UT_SetDataBuffer(MsgKey, &DefaultMeta, sizeof(DefaultMeta), true); /* Because "allocate copy" is true above, this gets a pointer to the copy */ - UT_GetDataBuffer(MsgKey, (void **)&MetaPtr, &MetaSize, NULL); + UT_GetDataBuffer(MsgKey, &MetaPtr, &MetaSize, NULL); } return MetaPtr; @@ -123,6 +123,7 @@ void UT_DefaultHandler_CFE_SB_GetPipeName(void *UserObj, UT_EntryKey_t FuncKey, size_t UserBuffSize; size_t BuffPosition; + void * TempBuff; const char *NameBuff; int32 status; @@ -130,12 +131,16 @@ void UT_DefaultHandler_CFE_SB_GetPipeName(void *UserObj, UT_EntryKey_t FuncKey, if (status >= 0 && PipeNameSize > 0) { - UT_GetDataBuffer(UT_KEY(CFE_SB_GetPipeName), (void **)&NameBuff, &UserBuffSize, &BuffPosition); - if (NameBuff == NULL || UserBuffSize == 0) + UT_GetDataBuffer(UT_KEY(CFE_SB_GetPipeName), &TempBuff, &UserBuffSize, &BuffPosition); + if (TempBuff == NULL || UserBuffSize == 0) { NameBuff = "UT"; UserBuffSize = 2; } + else + { + NameBuff = TempBuff; + } if (UserBuffSize < PipeNameSize) { diff --git a/modules/core_private/ut-stubs/src/ut_support.c b/modules/core_private/ut-stubs/src/ut_support.c index 5f50655fa..65f8d95f5 100644 --- a/modules/core_private/ut-stubs/src/ut_support.c +++ b/modules/core_private/ut-stubs/src/ut_support.c @@ -372,11 +372,13 @@ static bool UT_CheckEventHistoryFromFunc(UT_EntryKey_t Func, uint16 EventIDToSea bool Result = false; size_t Position; size_t MaxSize; + void * TempBuff; uint16 *EvBuf; - UT_GetDataBuffer(Func, (void **)&EvBuf, &MaxSize, &Position); - if (EvBuf != NULL && MaxSize > 0) + UT_GetDataBuffer(Func, &TempBuff, &MaxSize, &Position); + if (TempBuff != NULL && MaxSize > 0) { + EvBuf = TempBuff; Position /= sizeof(*EvBuf); while (Position > 0) { diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index f550efd25..1c8b14a70 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -700,6 +700,7 @@ void TestStartupErrorPaths(void) OS_statvfs_t StatBuf; CFE_ES_TaskRecord_t * TaskRecPtr; CFE_ES_AppRecord_t * AppRecPtr; + void * TempBuff; UtPrintf("Begin Test Startup Error Paths"); @@ -709,7 +710,8 @@ void TestStartupErrorPaths(void) * is part of CFE_ES_Global which is zeroed out as part of test reset. Formerly * this was a separate global which was not cleared with the other globals. */ - UT_GetDataBuffer(UT_KEY(CFE_PSP_GetResetArea), (void **)&ES_UT_PersistentResetData, NULL, NULL); + UT_GetDataBuffer(UT_KEY(CFE_PSP_GetResetArea), &TempBuff, NULL, NULL); + ES_UT_PersistentResetData = TempBuff; /* Set up the startup script for reading */ strncpy(StartupScript, @@ -3522,11 +3524,14 @@ void TestPerf(void) UtPrintf("Begin Test Performance Log"); CFE_ES_PerfData_t *Perf; + void * TempBuff; /* ** Set the pointer to the data area */ - UT_GetDataBuffer(UT_KEY(CFE_PSP_GetResetArea), (void **)&ES_UT_PersistentResetData, NULL, NULL); + UT_GetDataBuffer(UT_KEY(CFE_PSP_GetResetArea), &TempBuff, NULL, NULL); + ES_UT_PersistentResetData = TempBuff; + Perf = &ES_UT_PersistentResetData->Perf; /* Test successful performance mask and value initialization */ @@ -4651,7 +4656,7 @@ void TestGenericCounterAPI(void) void TestCDS() { size_t CdsSize; - uint8 * CdsPtr; + void * CdsPtr; char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN + 4]; CFE_ES_CDSHandle_t CDSHandle; CFE_ES_CDS_RegRec_t *UtCDSRegRecPtr; @@ -4842,7 +4847,7 @@ void TestCDS() /* Reset back to a sufficient CDS size */ UT_SetCDSSize(128 * 1024); - UT_GetDataBuffer(UT_KEY(CFE_PSP_ReadFromCDS), (void **)&CdsPtr, &CdsSize, NULL); + UT_GetDataBuffer(UT_KEY(CFE_PSP_ReadFromCDS), &CdsPtr, &CdsSize, NULL); /* Test CDS initialization with rebuilding not possible */ ES_ResetUnitTest(); @@ -4858,11 +4863,11 @@ void TestCDS() UtAssert_INT32_EQ(CFE_ES_ValidateCDS(), CFE_ES_CDS_ACCESS_ERROR); /* Test CDS validation with CDS read end check failure */ - memset(CdsPtr + CdsSize - CFE_ES_CDS_SIGNATURE_LEN, 'x', CFE_ES_CDS_SIGNATURE_LEN); + memset((unsigned char *)CdsPtr + CdsSize - CFE_ES_CDS_SIGNATURE_LEN, 'x', CFE_ES_CDS_SIGNATURE_LEN); UtAssert_INT32_EQ(CFE_ES_ValidateCDS(), CFE_ES_CDS_INVALID); /* Test CDS validation with CDS read begin check failure */ - UT_GetDataBuffer(UT_KEY(CFE_PSP_ReadFromCDS), (void **)&CdsPtr, &CdsSize, NULL); + UT_GetDataBuffer(UT_KEY(CFE_PSP_ReadFromCDS), &CdsPtr, &CdsSize, NULL); memset(CdsPtr, 'x', CFE_ES_CDS_SIGNATURE_LEN); UtAssert_INT32_EQ(CFE_ES_ValidateCDS(), CFE_ES_CDS_INVALID); @@ -4880,9 +4885,9 @@ void TestCDS() /* Test rebuilding the CDS where the registry is not the same size */ ES_ResetUnitTest(); - UT_GetDataBuffer(UT_KEY(CFE_PSP_ReadFromCDS), (void **)&CdsPtr, &CdsSize, NULL); + UT_GetDataBuffer(UT_KEY(CFE_PSP_ReadFromCDS), &CdsPtr, &CdsSize, NULL); TempSize = CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES + 1; - memcpy(CdsPtr + CDS_REG_SIZE_OFFSET, &TempSize, sizeof(TempSize)); + memcpy((unsigned char *)CdsPtr + CDS_REG_SIZE_OFFSET, &TempSize, sizeof(TempSize)); UtAssert_INT32_EQ(CFE_ES_RebuildCDS(), CFE_ES_CDS_INVALID); /* Test clearing CDS where size is an odd number (requires partial write) */ @@ -5003,7 +5008,7 @@ void TestCDSMempool(void) CFE_ES_CDSHandle_t BlockHandle; size_t SavedSize; size_t SavedOffset; - uint8 * CdsPtr; + void * CdsPtr; UtPrintf("Begin Test CDS memory pool"); @@ -5097,10 +5102,10 @@ void TestCDSMempool(void) UtAssert_INT32_EQ(CFE_ES_CDSBlockRead(&Data, BlockHandle), CFE_ES_CDS_ACCESS_ERROR); /* Corrupt the data as to cause a CRC mismatch */ - UT_GetDataBuffer(UT_KEY(CFE_PSP_ReadFromCDS), (void **)&CdsPtr, NULL, NULL); - CdsPtr[UtCdsRegRecPtr->BlockOffset] ^= 0x02; /* Bit flip */ + UT_GetDataBuffer(UT_KEY(CFE_PSP_ReadFromCDS), &CdsPtr, NULL, NULL); + *((unsigned char *)CdsPtr + UtCdsRegRecPtr->BlockOffset) ^= 0x02; /* Bit flip */ UtAssert_INT32_EQ(CFE_ES_CDSBlockRead(&Data, BlockHandle), CFE_ES_CDS_BLOCK_CRC_ERR); - CdsPtr[UtCdsRegRecPtr->BlockOffset] ^= 0x02; /* Fix Bit */ + *((unsigned char *)CdsPtr + UtCdsRegRecPtr->BlockOffset) ^= 0x02; /* Fix Bit */ /* Set up again with a CDS that is too small to get branch coverage */ /* Test CDS block access */ @@ -5189,7 +5194,7 @@ void TestESMempool(void) * types are in use, underneath the wrapper(s) lies a uint32 eventually. * This is intentionally a type-UNSAFE access to this value. */ - *((uint32 *)&PoolPtr->PoolID) ^= 10; /* cause it to fail validation */ + *((unsigned char *)&PoolPtr->PoolID) ^= 10; /* cause it to fail validation */ UtAssert_BOOL_FALSE(CFE_ES_ValidateHandle(PoolID2)); @@ -5223,7 +5228,7 @@ void TestESMempool(void) UtAssert_INT32_EQ(CFE_ES_GetPoolBufInfo(PoolID2, addressp2), CFE_ES_ERR_RESOURCEID_NOT_VALID); /* Undo the previous memory corruption */ - *((uint32 *)&PoolPtr->PoolID) ^= 10; /* Repair Pool2 ID */ + *((unsigned char *)&PoolPtr->PoolID) ^= 10; /* Repair Pool2 ID */ /* Test returning a pool buffer using an invalid memory block */ UtAssert_INT32_EQ(CFE_ES_PutPoolBuf(PoolID2, CFE_ES_MEMPOOLBUF_C((cpuaddr)addressp2 - 40)), diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 79bf145ec..41919639c 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -133,12 +133,16 @@ CFE_ResourceId_t UT_SB_MakePipeIdForIndex(uint32 ArrayIdx) */ CFE_ES_AppId_t UT_SB_AppID_Modify(CFE_ES_AppId_t InitialID, int32 Modifier) { - CFE_ES_AppId_t TempValue = InitialID; + CFE_ES_AppId_t OutValue; + uint32 InValue; - /* Underneath the wrapper(s) the IDs are 32-bit integer values, so it can be cast */ - *((uint32 *)&TempValue) += Modifier; + InValue = CFE_RESOURCEID_TO_ULONG(InitialID); + InValue += Modifier; - return TempValue; + /* Underneath the wrapper(s) the IDs are 32-bit integer values, so it can be copied */ + memcpy(&OutValue, &InValue, sizeof(OutValue)); + + return OutValue; } /* diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index ef73dfd08..413a84879 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -2045,7 +2045,7 @@ void Test_CFE_TBL_Load(void) UT_Table1_t TestTable1; CFE_FS_Header_t StdFileHeader; CFE_TBL_File_Hdr_t TblFileHeader; - UT_Table1_t * App2TblPtr; + void * App2TblPtr; CFE_TBL_RegistryRec_t * RegRecPtr; CFE_TBL_AccessDescriptor_t *AccessDescPtr; @@ -2236,7 +2236,7 @@ void Test_CFE_TBL_Load(void) CFE_UtAssert_EVENTCOUNT(0); /* a. Test setup part 2 */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&App2TblPtr, App2TblHandle1), CFE_TBL_INFO_UPDATED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&App2TblPtr, App2TblHandle1), CFE_TBL_INFO_UPDATED); CFE_UtAssert_EVENTCOUNT(0); /* c. Perform test */ @@ -2258,8 +2258,8 @@ void Test_CFE_TBL_Load(void) */ void Test_CFE_TBL_GetAddress(void) { - UT_Table1_t *App3TblPtr; - UT_Table1_t *App2TblPtr; + void *App3TblPtr; + void *App2TblPtr; UtPrintf("Begin Test Get Address"); @@ -2272,19 +2272,18 @@ void Test_CFE_TBL_GetAddress(void) */ UT_InitData(); UT_SetAppID(UT_TBL_APPID_3); - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&App3TblPtr, App2TblHandle1), CFE_TBL_ERR_NO_ACCESS); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&App3TblPtr, App2TblHandle1), CFE_TBL_ERR_NO_ACCESS); CFE_UtAssert_EVENTCOUNT(0); /* Test attempt to get the address with an invalid application ID */ UT_InitData(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetAppID), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&App3TblPtr, App2TblHandle1), CFE_ES_ERR_RESOURCEID_NOT_VALID); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&App3TblPtr, App2TblHandle1), CFE_ES_ERR_RESOURCEID_NOT_VALID); CFE_UtAssert_EVENTCOUNT(0); /* Test attempt to get the address with an invalid handle */ UT_InitData(); - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&App3TblPtr, CFE_PLATFORM_TBL_MAX_NUM_HANDLES), - CFE_TBL_ERR_INVALID_HANDLE); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&App3TblPtr, CFE_PLATFORM_TBL_MAX_NUM_HANDLES), CFE_TBL_ERR_INVALID_HANDLE); CFE_UtAssert_EVENTCOUNT(0); /* Attempt to get the address of an unregistered (unowned) table */ @@ -2297,7 +2296,7 @@ void Test_CFE_TBL_GetAddress(void) /* b. Perform test */ UT_InitData(); UT_SetAppID(UT_TBL_APPID_2); - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&App2TblPtr, App2TblHandle1), CFE_TBL_ERR_UNREGISTERED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&App2TblPtr, App2TblHandle1), CFE_TBL_ERR_UNREGISTERED); CFE_UtAssert_EVENTCOUNT(0); } @@ -2528,7 +2527,7 @@ void Test_CFE_TBL_Manage(void) CFE_TBL_RegistryRec_t * RegRecPtr; CFE_TBL_LoadBuff_t * WorkingBufferPtr; UT_Table1_t TestTable1; - UT_Table1_t * App2TblPtr; + void * App2TblPtr; CFE_TBL_AccessDescriptor_t *AccessDescPtr; CFE_TBL_Handle_t AccessIterator; @@ -2712,7 +2711,7 @@ void Test_CFE_TBL_Manage(void) CFE_UtAssert_EVENTCOUNT(0); /* a. Test setup - part 2 */ - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&App2TblPtr, App2TblHandle1), CFE_TBL_ERR_NEVER_LOADED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&App2TblPtr, App2TblHandle1), CFE_TBL_ERR_NEVER_LOADED); CFE_UtAssert_EVENTCOUNT(0); /* c. Perform test */ @@ -3025,6 +3024,7 @@ void Test_CFE_TBL_TblMod(void) UT_TempFile_t File; uint32 Index; CFE_TBL_Info_t TblInfo1; + void * TblDataAddr; UT_Table1_t * TblDataPtr; char MyFilename[OS_MAX_PATH_LEN]; CFE_TBL_AccessDescriptor_t *AccessDescPtr; @@ -3087,7 +3087,8 @@ void Test_CFE_TBL_TblMod(void) CFE_UtAssert_EVENTSENT(CFE_TBL_LOAD_SUCCESS_INF_EID); /* Modify the contents of the table */ - CFE_TBL_GetAddress((void **)&TblDataPtr, App1TblHandle1); + CFE_TBL_GetAddress(&TblDataAddr, App1TblHandle1); + TblDataPtr = TblDataAddr; TblDataPtr->TblElement1 ^= 0xFFFFFFFF; File.TblData.TblElement1 ^= 0xFFFFFFFF; @@ -3164,7 +3165,7 @@ void Test_CFE_TBL_TblMod(void) CFE_UtAssert_SUCCESS(CFE_TBL_GetInfo(&TblInfo1, "ut_cfe_tbl.UT_Table2")); UtAssert_INT32_EQ(TblInfo1.TimeOfLastUpdate.Seconds, TblInfo1.TimeOfLastUpdate.Subseconds); UtAssert_UINT32_EQ(TblInfo1.Crc, ExpectedCrc); - UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TblDataPtr, App1TblHandle1), CFE_TBL_INFO_UPDATED); + UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TblDataAddr, App1TblHandle1), CFE_TBL_INFO_UPDATED); /* * LastFileLoaded (limited by mission) can be bigger than MyFilename (limited by osal), From 813744d39c7191e6cb61876079b78abd3e02d096 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 6 Oct 2021 09:30:23 -0400 Subject: [PATCH 014/200] Fix #1988, consolidate repeated MSG stub setup in sb_UT Utilize the common setup/wrapper functions in ut_support.c whenever possible MSG dispatching in the generic handler. --- .../core_private/ut-stubs/inc/ut_support.h | 21 + .../core_private/ut-stubs/src/ut_support.c | 54 +- modules/sb/ut-coverage/sb_UT.c | 532 ++++++------------ 3 files changed, 246 insertions(+), 361 deletions(-) diff --git a/modules/core_private/ut-stubs/inc/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h index 8e65cfe0f..873ba9253 100644 --- a/modules/core_private/ut-stubs/inc/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -214,6 +214,27 @@ void UT_ResetCDS(void); /* Reset pool buffer array index */ void UT_ResetPoolBufferIndex(void); +/*****************************************************************************/ +/** +** \brief Sets up stubs to follow the intended path through a dispatch call +** +** \par Description +** Configures the MSG stubs appropriately so the intended command handler +** is called when invoking a "TaskPipe" handler function. +** +** DispatchReq should point to the intended MsgId + command code to set up. +** +** If DispatchReq is NULL, then any existing stub config is cleared/reset. +** +** If ExpectFailureEvent is set true, then it sets a second stub registration +** for both MsgId and FcnCode to account for failure event reporting +** +** \returns +** This function does not return a value. +******************************************************************************/ +void UT_SetupBasicMsgDispatch(const UT_TaskPipeDispatchId_t *DispatchReq, CFE_MSG_Size_t MsgSize, + bool ExpectFailureEvent); + /*****************************************************************************/ /** ** \brief Send a message via the software bus diff --git a/modules/core_private/ut-stubs/src/ut_support.c b/modules/core_private/ut-stubs/src/ut_support.c index 5f50655fa..d4eac6971 100644 --- a/modules/core_private/ut-stubs/src/ut_support.c +++ b/modules/core_private/ut-stubs/src/ut_support.c @@ -197,6 +197,41 @@ void UT_ResetPoolBufferIndex(void) UT_SetDataBuffer(UT_KEY(CFE_ES_GetPoolBuf), &UT_CFE_ES_MemoryPool, sizeof(UT_CFE_ES_MemoryPool), false); } +/* +** Sets up the MSG stubs in preparation to invoke a "TaskPipe" dispatch function +** +** This is part of the general UT_CallTaskPipe process, but split off to support use cases +** where the task pipe is reached through other means. +*/ +void UT_SetupBasicMsgDispatch(const UT_TaskPipeDispatchId_t *DispatchReq, CFE_MSG_Size_t MsgSize, + bool ExpectFailureEvent) +{ + if (DispatchReq != NULL) + { + /* Set up for the typical task pipe related calls */ + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), (void *)&DispatchReq->MsgId, sizeof(DispatchReq->MsgId), true); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &MsgSize, sizeof(MsgSize), true); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), (void *)&DispatchReq->CommandCode, + sizeof(DispatchReq->CommandCode), true); + + /* If a failure event is being set up, also set for MsgId/FcnCode retrieval as part of failure event reporting + */ + if (ExpectFailureEvent) + { + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), (void *)&DispatchReq->MsgId, sizeof(DispatchReq->MsgId), true); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), (void *)&DispatchReq->CommandCode, + sizeof(DispatchReq->CommandCode), true); + } + } + else + { + /* Clear any stub config that may have been already set */ + UT_ResetState(UT_KEY(CFE_MSG_GetMsgId)); + UT_ResetState(UT_KEY(CFE_MSG_GetSize)); + UT_ResetState(UT_KEY(CFE_MSG_GetFcnCode)); + } +} + /* ** Calls the specified "task pipe" function ** @@ -215,22 +250,19 @@ void UT_CallTaskPipe(void (*TaskPipeFunc)(CFE_SB_Buffer_t *), CFE_MSG_Message_t /* Copy message into aligned SB buffer */ memcpy(SBBuf.Bytes, MsgPtr, MsgSize); - /* Set up for the typical task pipe related calls */ - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &DispatchId.MsgId, sizeof(DispatchId.MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &MsgSize, sizeof(MsgSize), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &DispatchId.CommandCode, sizeof(DispatchId.CommandCode), false); - - /* If 0 size passed in, set buffers for calls in the command length failure reporting */ - if (MsgSize == 0) - { - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &DispatchId.MsgId, sizeof(DispatchId.MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &DispatchId.CommandCode, sizeof(DispatchId.CommandCode), false); - } + /* Passing MsgSize == 0 indicates intent to perform a size validation failure */ + UT_SetupBasicMsgDispatch(&DispatchId, MsgSize, (MsgSize == 0)); /* * Finally, call the actual task pipe requested. */ TaskPipeFunc(&SBBuf.Buf); + + /* + * UN-set the stub config, as some values may point to values on stack. + * This removes any pointers to stack values that may not have been consumed during the call + */ + UT_SetupBasicMsgDispatch(NULL, 0, false); } int32 UT_SoftwareBusSnapshotHook(void *UserObj, int32 StubRetcode, uint32 CallCount, const UT_StubContext_t *Context) diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 79bf145ec..d2c7708c1 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -77,6 +77,49 @@ const CFE_SB_MsgId_t SB_UT_TLM_MID4 = CFE_SB_MSGID_WRAP_VALUE(SB_UT_TLM_MID_VALU const CFE_SB_MsgId_t SB_UT_TLM_MID5 = CFE_SB_MSGID_WRAP_VALUE(SB_UT_TLM_MID_VALUE_BASE + 5); const CFE_SB_MsgId_t SB_UT_TLM_MID6 = CFE_SB_MSGID_WRAP_VALUE(SB_UT_TLM_MID_VALUE_BASE + 6); +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_NOOP_CC = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), + .CommandCode = CFE_SB_NOOP_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), + .CommandCode = CFE_SB_RESET_COUNTERS_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_SEND_SB_STATS_CC = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), + .CommandCode = CFE_SB_SEND_SB_STATS_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), .CommandCode = CFE_SB_WRITE_ROUTING_INFO_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), + .CommandCode = CFE_SB_WRITE_PIPE_INFO_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), + .CommandCode = CFE_SB_WRITE_MAP_INFO_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), + .CommandCode = CFE_SB_ENABLE_ROUTE_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), + .CommandCode = CFE_SB_DISABLE_ROUTE_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_SEND_HK = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SEND_HK_MID)}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_SUB_RPT_CTL_SEND_PREV_SUBS_CC = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SUB_RPT_CTRL_MID), .CommandCode = CFE_SB_SEND_PREV_SUBS_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_SUB_RPT_CTL_ENABLE_SUB_REPORTING_CC = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SUB_RPT_CTRL_MID), .CommandCode = CFE_SB_ENABLE_SUB_REPORTING_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_SUB_RPT_CTL_DISABLE_SUB_REPORTING_CC = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SUB_RPT_CTRL_MID), .CommandCode = CFE_SB_DISABLE_SUB_REPORTING_CC}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_CMD_BAD_FCNCODE = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_CMD_MID), + .CommandCode = 99}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_SUB_RPT_CTRL_BAD_FCNCODE = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SUB_RPT_CTRL_MID), .CommandCode = 99}; + +const UT_TaskPipeDispatchId_t UT_TPID_CFE_SB_BAD_MSGID = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(SB_UT_TLM_MID_VALUE_BASE)}; + /* * A MsgId value which still qualifies as valid * @@ -390,9 +433,7 @@ void Test_SB_Main_Nominal(void) CFE_SB_BufferD_t Desc; uint8 Data[sizeof(CFE_SB_NoopCmd_t) + offsetof(CFE_SB_BufferD_t, Content)]; } Buffer; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_NOOP_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(CFE_SB_NoopCmd_t); + CFE_MSG_Size_t Size = sizeof(CFE_SB_NoopCmd_t); memset(&Buffer, 0, sizeof(Buffer)); Buffer.Desc.UseCount = 1; @@ -404,9 +445,7 @@ void Test_SB_Main_Nominal(void) UT_SetDeferredRetcode(UT_KEY(OS_QueueGet), 2, OS_QUEUE_EMPTY); /* For the first pass it will call CFE_SB_ProcessCmdPacket which needs to decode it */ - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_CMD_NOOP_CC, Size, false); CFE_SB_TaskMain(); @@ -482,26 +521,14 @@ void Test_SB_Cmds_Noop(void) CFE_SB_Buffer_t SBBuf; CFE_SB_NoopCmd_t Cmd; } Noop; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_NOOP_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(Noop.Cmd); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&Noop.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &Noop.SBBuf.Msg, sizeof(Noop.Cmd), UT_TPID_CFE_SB_CMD_NOOP_CC); CFE_UtAssert_EVENTCOUNT(1); CFE_UtAssert_EVENTSENT(CFE_SB_CMD0_RCVD_EID); - --Size; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&Noop.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &Noop.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); } /* end Test_SB_Cmds_Noop */ @@ -516,26 +543,15 @@ void Test_SB_Cmds_RstCtrs(void) CFE_SB_Buffer_t SBBuf; CFE_SB_ResetCountersCmd_t Cmd; } ResetCounters; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_RESET_COUNTERS_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(ResetCounters.Cmd); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&ResetCounters.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &ResetCounters.SBBuf.Msg, sizeof(ResetCounters.Cmd), + UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTCOUNT(1); CFE_UtAssert_EVENTSENT(CFE_SB_CMD1_RCVD_EID); - --Size; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&ResetCounters.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &ResetCounters.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); } /* Test_SB_Cmds_RstCtrs */ @@ -550,32 +566,26 @@ void Test_SB_Cmds_Stats(void) CFE_SB_Buffer_t SBBuf; CFE_SB_SendSbStatsCmd_t Cmd; } SendSbStats; - CFE_MSG_FcnCode_t FcnCode; - CFE_SB_MsgId_t MsgId; - CFE_MSG_Size_t Size; - CFE_SB_PipeId_t PipeId1; - CFE_SB_PipeId_t PipeId2; - CFE_SB_PipeId_t PipeId3; + CFE_SB_MsgId_t MsgId; + CFE_MSG_Size_t Size; + CFE_SB_PipeId_t PipeId1; + CFE_SB_PipeId_t PipeId2; + CFE_SB_PipeId_t PipeId3; /* Make the pipe table non-empty so the stats command writes something */ CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, 4, "TestPipe1")); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, 4, "TestPipe2")); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, 4, "TestPipe3")); + /* Generic command processing - The dispatch must be set up FIRST */ + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_CMD_SEND_SB_STATS_CC, sizeof(SendSbStats.Cmd), false); + /* For internal TransmitMsg call */ MsgId = CFE_SB_ValueToMsgId(CFE_SB_STATS_TLM_MID); Size = sizeof(CFE_SB_Global.StatTlmMsg); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - /* For Generic command processing */ - MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - Size = sizeof(SendSbStats.Cmd); - FcnCode = CFE_SB_SEND_SB_STATS_CC; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&SendSbStats.SBBuf); /* No subs event and command processing event */ @@ -583,13 +593,7 @@ void Test_SB_Cmds_Stats(void) CFE_UtAssert_EVENTSENT(CFE_SB_SND_STATS_EID); - --Size; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&SendSbStats.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &SendSbStats.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_SEND_SB_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -608,19 +612,14 @@ void Test_SB_Cmds_RoutingInfoDef(void) CFE_SB_Buffer_t SBBuf; CFE_SB_WriteRoutingInfoCmd_t Cmd; } WriteRoutingInfo; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_WRITE_ROUTING_INFO_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(WriteRoutingInfo.Cmd); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); WriteRoutingInfo.Cmd.Payload.Filename[0] = '\0'; /* Make some routing info by calling CFE_SB_AppInit */ CFE_UtAssert_SETUP(CFE_SB_AppInit()); - CFE_SB_ProcessCmdPipePkt(&WriteRoutingInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTCOUNT(5); @@ -629,21 +628,13 @@ void Test_SB_Cmds_RoutingInfoDef(void) CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - CFE_SB_ProcessCmdPipePkt(&WriteRoutingInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); - --Size; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&WriteRoutingInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); @@ -660,19 +651,14 @@ void Test_SB_Cmds_RoutingInfoAlreadyPending(void) CFE_SB_Buffer_t SBBuf; CFE_SB_WriteRoutingInfoCmd_t Cmd; } WriteRoutingInfo; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_WRITE_ROUTING_INFO_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(WriteRoutingInfo.Cmd); UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpIsPending), true); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); strncpy(WriteRoutingInfo.Cmd.Payload.Filename, "RoutingTstFile", sizeof(WriteRoutingInfo.Cmd.Payload.Filename) - 1); WriteRoutingInfo.Cmd.Payload.Filename[sizeof(WriteRoutingInfo.Cmd.Payload.Filename) - 1] = '\0'; - CFE_SB_ProcessCmdPipePkt(&WriteRoutingInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -767,17 +753,11 @@ void Test_SB_Cmds_PipeInfoDef(void) CFE_SB_Buffer_t SBBuf; CFE_SB_WritePipeInfoCmd_t Cmd; } WritePipeInfo; - CFE_SB_PipeId_t PipeId1; - CFE_SB_PipeId_t PipeId2; - CFE_SB_PipeId_t PipeId3; - uint16 PipeDepth = 10; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_WRITE_PIPE_INFO_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(WritePipeInfo.Cmd); + CFE_SB_PipeId_t PipeId1; + CFE_SB_PipeId_t PipeId2; + CFE_SB_PipeId_t PipeId3; + uint16 PipeDepth = 10; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); WritePipeInfo.Cmd.Payload.Filename[0] = '\0'; /* Create some pipe info */ @@ -785,27 +765,20 @@ void Test_SB_Cmds_PipeInfoDef(void) CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); - CFE_SB_ProcessCmdPipePkt(&WritePipeInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTCOUNT(3); CFE_UtAssert_EVENTSENT(CFE_SB_PIPE_ADDED_EID); /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - CFE_SB_ProcessCmdPipePkt(&WritePipeInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); - --Size; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&WritePipeInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -824,19 +797,14 @@ void Test_SB_Cmds_PipeInfoAlreadyPending(void) CFE_SB_Buffer_t SBBuf; CFE_SB_WritePipeInfoCmd_t Cmd; } WritePipeInfo; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_WRITE_PIPE_INFO_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(WritePipeInfo.Cmd); UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpIsPending), true); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); strncpy(WritePipeInfo.Cmd.Payload.Filename, "PipeTstFile", sizeof(WritePipeInfo.Cmd.Payload.Filename) - 1); WritePipeInfo.Cmd.Payload.Filename[sizeof(WritePipeInfo.Cmd.Payload.Filename) - 1] = '\0'; - CFE_SB_ProcessCmdPipePkt(&WritePipeInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -974,23 +942,17 @@ void Test_SB_Cmds_MapInfoDef(void) CFE_SB_Buffer_t SBBuf; CFE_SB_WriteMapInfoCmd_t Cmd; } WriteMapInfo; - CFE_SB_PipeId_t PipeId1; - CFE_SB_PipeId_t PipeId2; - CFE_SB_PipeId_t PipeId3; - CFE_SB_MsgId_t MsgId0 = SB_UT_TLM_MID1; - CFE_SB_MsgId_t MsgId1 = SB_UT_TLM_MID2; - CFE_SB_MsgId_t MsgId2 = SB_UT_TLM_MID3; - CFE_SB_MsgId_t MsgId3 = SB_UT_TLM_MID4; - CFE_SB_MsgId_t MsgId4 = SB_UT_TLM_MID5; - CFE_SB_MsgId_t MsgId5 = SB_UT_TLM_MID6; - uint16 PipeDepth = 10; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_WRITE_MAP_INFO_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(WriteMapInfo.Cmd); + CFE_SB_PipeId_t PipeId1; + CFE_SB_PipeId_t PipeId2; + CFE_SB_PipeId_t PipeId3; + CFE_SB_MsgId_t MsgId0 = SB_UT_TLM_MID1; + CFE_SB_MsgId_t MsgId1 = SB_UT_TLM_MID2; + CFE_SB_MsgId_t MsgId2 = SB_UT_TLM_MID3; + CFE_SB_MsgId_t MsgId3 = SB_UT_TLM_MID4; + CFE_SB_MsgId_t MsgId4 = SB_UT_TLM_MID5; + CFE_SB_MsgId_t MsgId5 = SB_UT_TLM_MID6; + uint16 PipeDepth = 10; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); WriteMapInfo.Cmd.Payload.Filename[0] = '\0'; /* Create some map info */ @@ -1005,7 +967,8 @@ void Test_SB_Cmds_MapInfoDef(void) CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); - CFE_SB_ProcessCmdPipePkt(&WriteMapInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTCOUNT(10); @@ -1014,20 +977,13 @@ void Test_SB_Cmds_MapInfoDef(void) CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - CFE_SB_ProcessCmdPipePkt(&WriteMapInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); - --Size; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&WriteMapInfo.SBBuf); + /* Bad Size */ + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -1046,19 +1002,14 @@ void Test_SB_Cmds_MapInfoAlreadyPending(void) CFE_SB_Buffer_t SBBuf; CFE_SB_WriteMapInfoCmd_t Cmd; } WriteMapInfo; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_WRITE_MAP_INFO_CC; - CFE_SB_MsgId_t MsgId = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(WriteMapInfo.Cmd); UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpIsPending), true); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); strncpy(WriteMapInfo.Cmd.Payload.Filename, "MapTstFile", sizeof(WriteMapInfo.Cmd.Payload.Filename) - 1); WriteMapInfo.Cmd.Payload.Filename[sizeof(WriteMapInfo.Cmd.Payload.Filename) - 1] = '\0'; - CFE_SB_ProcessCmdPipePkt(&WriteMapInfo.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1077,23 +1028,17 @@ void Test_SB_Cmds_EnRouteValParam(void) CFE_SB_Buffer_t SBBuf; CFE_SB_EnableRouteCmd_t Cmd; } EnableRoute; - CFE_SB_PipeId_t PipeId; - CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; - uint16 PipeDepth = 5; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_ENABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(EnableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + CFE_SB_PipeId_t PipeId; + CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; + uint16 PipeDepth = 5; CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "EnRouteTestPipe")); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); EnableRoute.Cmd.Payload.MsgId = MsgId; EnableRoute.Cmd.Payload.Pipe = PipeId; - CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(3); @@ -1103,13 +1048,8 @@ void Test_SB_Cmds_EnRouteValParam(void) CFE_UtAssert_EVENTSENT(CFE_SB_ENBL_RTE2_EID); - --Size; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); + /* Bad Size */ + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); @@ -1126,17 +1066,10 @@ void Test_SB_Cmds_EnRouteNonExist(void) CFE_SB_Buffer_t SBBuf; CFE_SB_EnableRouteCmd_t Cmd; } EnableRoute; - CFE_SB_PipeId_t PipeId1; - CFE_SB_PipeId_t PipeId2; - CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; - uint16 PipeDepth = 5; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_ENABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(EnableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + CFE_SB_PipeId_t PipeId1; + CFE_SB_PipeId_t PipeId2; + CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; + uint16 PipeDepth = 5; CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "EnRouteTestPipe1")); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "EnRouteTestPipe2")); @@ -1144,7 +1077,8 @@ void Test_SB_Cmds_EnRouteNonExist(void) EnableRoute.Cmd.Payload.MsgId = MsgId; EnableRoute.Cmd.Payload.Pipe = PipeId2; - CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(4); @@ -1167,18 +1101,12 @@ void Test_SB_Cmds_EnRouteInvParam(void) CFE_SB_Buffer_t SBBuf; CFE_SB_EnableRouteCmd_t Cmd; } EnableRoute; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_ENABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(EnableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); EnableRoute.Cmd.Payload.MsgId = SB_UT_LAST_VALID_MID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1196,18 +1124,12 @@ void Test_SB_Cmds_EnRouteInvParam2(void) CFE_SB_Buffer_t SBBuf; CFE_SB_EnableRouteCmd_t Cmd; } EnableRoute; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_ENABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(EnableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); EnableRoute.Cmd.Payload.MsgId = CFE_SB_INVALID_MSG_ID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1226,18 +1148,12 @@ void Test_SB_Cmds_EnRouteInvParam3(void) CFE_SB_Buffer_t SBBuf; CFE_SB_EnableRouteCmd_t Cmd; } EnableRoute; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_ENABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(EnableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); EnableRoute.Cmd.Payload.MsgId = SB_UT_ALTERNATE_INVALID_MID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_0; - CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1255,23 +1171,17 @@ void Test_SB_Cmds_DisRouteValParam(void) CFE_SB_Buffer_t SBBuf; CFE_SB_DisableRouteCmd_t Cmd; } DisableRoute; - CFE_SB_PipeId_t PipeId; - CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; - uint16 PipeDepth = 5; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_DISABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(DisableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + CFE_SB_PipeId_t PipeId; + CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; + uint16 PipeDepth = 5; CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "DisRouteTestPipe")); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); DisableRoute.Cmd.Payload.MsgId = MsgId; DisableRoute.Cmd.Payload.Pipe = PipeId; - CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(3); @@ -1281,13 +1191,8 @@ void Test_SB_Cmds_DisRouteValParam(void) CFE_UtAssert_EVENTSENT(CFE_SB_DSBL_RTE2_EID); - --Size; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); + /* Bad Size */ + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); @@ -1304,16 +1209,9 @@ void Test_SB_Cmds_DisRouteNonExist(void) CFE_SB_Buffer_t SBBuf; CFE_SB_DisableRouteCmd_t Cmd; } DisableRoute; - CFE_SB_PipeId_t PipeId1, PipeId2; - CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; - uint16 PipeDepth = 5; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_DISABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(DisableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + CFE_SB_PipeId_t PipeId1, PipeId2; + CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; + uint16 PipeDepth = 5; CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "DisRouteTestPipe1")); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "DisRouteTestPipe2")); @@ -1321,7 +1219,8 @@ void Test_SB_Cmds_DisRouteNonExist(void) DisableRoute.Cmd.Payload.MsgId = MsgId; DisableRoute.Cmd.Payload.Pipe = PipeId2; - CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(4); @@ -1344,18 +1243,12 @@ void Test_SB_Cmds_DisRouteInvParam(void) CFE_SB_Buffer_t SBBuf; CFE_SB_DisableRouteCmd_t Cmd; } DisableRoute; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_DISABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(DisableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); DisableRoute.Cmd.Payload.MsgId = SB_UT_LAST_VALID_MID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1373,18 +1266,12 @@ void Test_SB_Cmds_DisRouteInvParam2(void) CFE_SB_Buffer_t SBBuf; CFE_SB_DisableRouteCmd_t Cmd; } DisableRoute; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_DISABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(DisableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); DisableRoute.Cmd.Payload.MsgId = CFE_SB_INVALID_MSG_ID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1403,18 +1290,12 @@ void Test_SB_Cmds_DisRouteInvParam3(void) CFE_SB_Buffer_t SBBuf; CFE_SB_DisableRouteCmd_t Cmd; } DisableRoute; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_DISABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(DisableRoute.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); DisableRoute.Cmd.Payload.MsgId = SB_UT_ALTERNATE_INVALID_MID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_0; - CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1435,16 +1316,15 @@ void Test_SB_Cmds_SendHK(void) CFE_SB_MsgId_t MsgIdCmd; CFE_MSG_Size_t Size; + /* For HK command processing - set up FIRST */ + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SEND_HK, sizeof(Housekeeping.Cmd), false); + /* For internal TransmitMsg call */ MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_HK_TLM_MID); Size = sizeof(CFE_SB_Global.HKTlmMsg); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - /* For HK command processing */ - MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_SEND_HK_MID); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - CFE_SB_ProcessCmdPipePkt(&Housekeeping.SBBuf); CFE_UtAssert_EVENTCOUNT(1); @@ -1464,16 +1344,15 @@ void Test_SB_Cmds_SendPrevSubs(void) CFE_SB_Buffer_t SBBuf; CFE_SB_SendPrevSubsCmd_t Cmd; } SendPrevSubs; - CFE_SB_PipeId_t PipeId1; - CFE_SB_PipeId_t PipeId2; - CFE_SB_MsgId_t MsgId = SB_UT_BARE_TLM_MID3; - uint16 MsgLim = 4; - uint16 PipeDepth = 50; - int32 i; - int32 NumEvts; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_SEND_PREV_SUBS_CC; - CFE_SB_MsgId_t MsgIdCmd; - CFE_MSG_Size_t Size; + CFE_SB_PipeId_t PipeId1; + CFE_SB_PipeId_t PipeId2; + CFE_SB_MsgId_t MsgId = SB_UT_BARE_TLM_MID3; + uint16 MsgLim = 4; + uint16 PipeDepth = 50; + int32 i; + int32 NumEvts; + CFE_MSG_Size_t Size; + CFE_SB_MsgId_t MsgIdCmd; CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); @@ -1499,6 +1378,9 @@ void Test_SB_Cmds_SendPrevSubs(void) CFE_UtAssert_SETUP(CFE_SB_SubscribeLocal(MsgId, PipeId2, MsgLim)); + /* Set up for dispatch FIRST */ + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SUB_RPT_CTL_SEND_PREV_SUBS_CC, sizeof(SendPrevSubs.Cmd), false); + /* For 3 internal TransmitMsg calls */ MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_ALLSUBS_TLM_MID); Size = sizeof(CFE_SB_Global.PrevSubMsg); @@ -1509,13 +1391,6 @@ void Test_SB_Cmds_SendPrevSubs(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - /* Set buffers for gets */ - MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_SUB_RPT_CTRL_MID); - Size = sizeof(SendPrevSubs.Cmd); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&SendPrevSubs.SBBuf); NumEvts += 7; /* +1 for the subscribe, +6 for the SEND_PREV_SUBS_CC */ @@ -1542,6 +1417,9 @@ void Test_SB_Cmds_SendPrevSubs(void) /* Additional unique local route to hit while loop destptr == NULL branch */ CFE_UtAssert_SETUP(CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(i), PipeId2, MsgLim)); + /* Set up for dispatch FIRST */ + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SUB_RPT_CTL_SEND_PREV_SUBS_CC, sizeof(SendPrevSubs.Cmd), false); + /* For 3 internal TransmitMsg calls */ MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_ALLSUBS_TLM_MID); Size = sizeof(CFE_SB_Global.PrevSubMsg); @@ -1552,13 +1430,6 @@ void Test_SB_Cmds_SendPrevSubs(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - /* Set buffers for gets */ - MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_SUB_RPT_CTRL_MID); - Size = sizeof(SendPrevSubs.Cmd); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&SendPrevSubs.SBBuf); NumEvts += 7; /* +1 for the local subscribe, +6 for the SEND_PREV_SUBS_CC */ @@ -1580,13 +1451,9 @@ void Test_SB_Cmds_SendPrevSubs(void) /* Test error paths in the CFE_SB_SEND_PREV_SUBS_CC handling */ UT_ClearEventHistory(); - Size = sizeof(SendPrevSubs.Cmd) - 1; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&SendPrevSubs.SBBuf); + + /* Bad Size */ + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &SendPrevSubs.SBBuf.Msg, 0, UT_TPID_CFE_SB_SUB_RPT_CTL_SEND_PREV_SUBS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -1605,27 +1472,18 @@ void Test_SB_Cmds_SubRptOn(void) CFE_SB_Buffer_t SBBuf; CFE_SB_EnableSubReportingCmd_t Cmd; } EnableSubReporting; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_ENABLE_SUB_REPORTING_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_SUB_RPT_CTRL_MID); - CFE_MSG_Size_t Size = sizeof(EnableSubReporting.Cmd); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&EnableSubReporting.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableSubReporting.SBBuf.Msg, sizeof(EnableSubReporting.Cmd), + UT_TPID_CFE_SB_SUB_RPT_CTL_ENABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTCOUNT(0); /* Test error paths in the CFE_SB_ENABLE_SUB_REPORTING_CC handling */ UT_ClearEventHistory(); - Size = sizeof(EnableSubReporting.Cmd) - 1; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&EnableSubReporting.SBBuf); + + /* Bad Size */ + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableSubReporting.SBBuf.Msg, 0, + UT_TPID_CFE_SB_SUB_RPT_CTL_ENABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -1641,27 +1499,18 @@ void Test_SB_Cmds_SubRptOff(void) CFE_SB_Buffer_t SBBuf; CFE_SB_DisableSubReportingCmd_t Cmd; } DisableSubReporting; - CFE_MSG_FcnCode_t FcnCode = CFE_SB_DISABLE_SUB_REPORTING_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_SUB_RPT_CTRL_MID); - CFE_MSG_Size_t Size = sizeof(DisableSubReporting.Cmd); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - - CFE_SB_ProcessCmdPipePkt(&DisableSubReporting.SBBuf); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableSubReporting.SBBuf.Msg, sizeof(DisableSubReporting.Cmd), + UT_TPID_CFE_SB_SUB_RPT_CTL_DISABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTCOUNT(0); /* Test error paths in the CFE_SB_DISABLE_SUB_REPORTING_CC handling */ UT_ClearEventHistory(); - Size = sizeof(DisableSubReporting.Cmd) - 1; - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - CFE_SB_ProcessCmdPipePkt(&DisableSubReporting.SBBuf); + + /* Bad Size */ + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableSubReporting.SBBuf.Msg, 0, + UT_TPID_CFE_SB_SUB_RPT_CTL_DISABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -1672,20 +1521,12 @@ void Test_SB_Cmds_SubRptOff(void) */ void Test_SB_Cmds_CmdUnexpCmdCode(void) { - CFE_MSG_FcnCode_t FcnCode = 99; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - - /* Use a command code known to be invalid */ + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_CMD_BAD_FCNCODE, sizeof(CFE_MSG_CommandHeader_t), true); CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL); CFE_UtAssert_EVENTCOUNT(1); CFE_UtAssert_EVENTSENT(CFE_SB_BAD_CMD_CODE_EID); - MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_SUB_RPT_CTRL_MID); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SUB_RPT_CTRL_BAD_FCNCODE, sizeof(CFE_MSG_CommandHeader_t), true); CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL); } /* end Test_SB_Cmds_UnexpCmdCode */ @@ -1698,18 +1539,14 @@ void Test_SB_Cmds_BadCmdLength(void) /* * Just choosing "EnableRoute" command here as it has a non-empty payload */ - CFE_MSG_FcnCode_t FcnCode = CFE_SB_ENABLE_ROUTE_CC; - CFE_SB_MsgId_t MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_CMD_MID); - CFE_MSG_Size_t Size = sizeof(CFE_SB_EnableRouteCmd_t) - 1; - /* Second GetMsgId and GetFcnCode are for reporting */ - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - - CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL); + /* + * Note the length validation failure paths have already been checked + * in the other command processor tests. The only thing unique about + * this dedicated test is that it does so with a non-zero size + */ + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC, sizeof(CFE_SB_EnableRouteCmd_t) - 1, true); + CFE_SB_ProcessCmdPipePkt(NULL); CFE_UtAssert_EVENTCOUNT(1); @@ -1722,11 +1559,8 @@ void Test_SB_Cmds_BadCmdLength(void) */ void Test_SB_Cmds_UnexpMsgId(void) { - CFE_SB_MsgId_t MsgIdCmd = SB_UT_TLM_MID; - - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); - - CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL); + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_BAD_MSGID, sizeof(CFE_MSG_CommandHeader_t), true); + CFE_SB_ProcessCmdPipePkt(NULL); CFE_UtAssert_EVENTCOUNT(1); @@ -4512,16 +4346,15 @@ void Test_SB_TransmitMsgPaths_Nominal(void) CFE_MSG_Size_t Size; CFE_MSG_Type_t Type; + /* Set up for dispatch FIRST */ + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SEND_HK, sizeof(Housekeeping.Cmd), false); + /* For internal send message call */ MsgId = CFE_SB_ValueToMsgId(CFE_SB_HK_TLM_MID); Size = sizeof(CFE_SB_Global.HKTlmMsg); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - /* For HK command processing */ - MsgId = CFE_SB_ValueToMsgId(CFE_SB_SEND_HK_MID); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - /* Repress sending the no subscriptions event and process request */ CFE_SB_Global.HKTlmMsg.Payload.NoSubscribersCounter = 0; CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_SEND_NO_SUBS_EID_BIT); @@ -4535,16 +4368,15 @@ void Test_SB_TransmitMsgPaths_Nominal(void) CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter = 0; CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_GET_BUF_ERR_EID_BIT); + /* Set up for dispatch FIRST */ + UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SEND_HK, sizeof(Housekeeping.Cmd), false); + /* For internal send message call */ MsgId = CFE_SB_ValueToMsgId(CFE_SB_HK_TLM_MID); Size = sizeof(CFE_SB_Global.HKTlmMsg); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - /* For HK command processing */ - MsgId = CFE_SB_ValueToMsgId(CFE_SB_SEND_HK_MID); - UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 1, CFE_ES_ERR_MEM_BLOCK_SIZE); CFE_SB_ProcessCmdPipePkt(&Housekeeping.SBBuf); UtAssert_INT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 0); From 612a3d84da43fdb50824f0aaacf440e218d497e0 Mon Sep 17 00:00:00 2001 From: Zachary Gonzalez Date: Sat, 16 Oct 2021 12:29:47 -0500 Subject: [PATCH 015/200] Fix #1928, checking against IsNewOffset only --- modules/es/fsw/src/cfe_es_cds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/es/fsw/src/cfe_es_cds.c b/modules/es/fsw/src/cfe_es_cds.c index f173dec77..0b4231b9e 100644 --- a/modules/es/fsw/src/cfe_es_cds.c +++ b/modules/es/fsw/src/cfe_es_cds.c @@ -426,7 +426,7 @@ int32 CFE_ES_RegisterCDSEx(CFE_ES_CDSHandle_t *HandlePtr, size_t UserBlockSize, CFE_ES_CDSBlockRecordSetUsed(RegRecPtr, PendingBlockId); } - if (Status == CFE_SUCCESS && (IsNewOffset || IsNewEntry)) + if (Status == CFE_SUCCESS && IsNewOffset) { /* If we succeeded at creating a CDS, save updated registry in the CDS */ RegUpdateStatus = CFE_ES_UpdateCDSRegistry(); From 933f10fa6ffe6fcf6e3f3a8481702bf4d3287797 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Mon, 18 Oct 2021 12:08:29 -0400 Subject: [PATCH 016/200] IC:2021-10-05, v6.8.0-rc1+dev1030 --- README.md | 6 ++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cd7904dfc..ff01c8f11 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ The detailed cFE user's guide can be viewed at and + ### Development Build: v6.8.0-rc1+dev1024 - CFE_Assert macro names diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 89e724785..eac498eef 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 1024 /**< @brief Development: Number of development commits since baseline */ +#define CFE_BUILD_NUMBER 1030 /**< @brief Development: Number of development commits since baseline */ #define CFE_BUILD_BASELINE "v6.8.0-rc1" /**< @brief Development: Reference git tag for build number */ /* Version Macro Definitions updated for official releases only */ From e91275edc244d5e4915a1f04472f7e130512adde Mon Sep 17 00:00:00 2001 From: pavll Date: Mon, 30 Aug 2021 11:21:31 +0200 Subject: [PATCH 017/200] Fix #1300, Add CFE_ES_MemAddOff structure --- docs/src/mnem_maps/cfe_es_tlm_mnem_map | 6 --- modules/cfe_testcase/src/es_info_test.c | 37 +++++++++--------- .../core_api/fsw/inc/cfe_es_extern_typedefs.h | 39 +++++++++++-------- modules/es/eds/cfe_es.xml | 30 -------------- modules/es/fsw/src/cfe_es_apps.c | 14 +++---- 5 files changed, 49 insertions(+), 77 deletions(-) diff --git a/docs/src/mnem_maps/cfe_es_tlm_mnem_map b/docs/src/mnem_maps/cfe_es_tlm_mnem_map index e76b8701d..e847477a9 100644 --- a/docs/src/mnem_maps/cfe_es_tlm_mnem_map +++ b/docs/src/mnem_maps/cfe_es_tlm_mnem_map @@ -68,12 +68,6 @@ ES_APPFILENAME=$sc_$cpu_ES_AppFilename[OS_MAX_PATH_LEN] \ ES_STACKSIZE=$sc_$cpu_ES_StackSize \ ES_MODULEID=$sc_$cpu_ES_ModuleID \ ES_ADDRVALID=$sc_$cpu_ES_AddrsValid \ -ES_CODEADDR=$sc_$cpu_ES_CodeAddress \ -ES_CODESIZE=$sc_$cpu_ES_CodeSize \ -ES_DATAADDR=$sc_$cpu_ES_DataAddress \ -ES_DATASIZE=$sc_$cpu_ES_DataSize \ -ES_BSSADDR=$sc_$cpu_ES_BSSAddress \ -ES_BSSSIZE=$sc_$cpu_ES_BSSSize \ ES_STARTADDR=$sc_$cpu_ES_StartAddr \ ES_EXCEPTNACTN=$sc_$cpu_ES_ExceptnActn \ ES_PRIORITY=$sc_$cpu_ES_Priority \ diff --git a/modules/cfe_testcase/src/es_info_test.c b/modules/cfe_testcase/src/es_info_test.c index 27990fbde..632cdce67 100644 --- a/modules/cfe_testcase/src/es_info_test.c +++ b/modules/cfe_testcase/src/es_info_test.c @@ -79,19 +79,20 @@ void TestAppInfo(void) if (TestAppInfo.AddressesAreValid) { - UtAssert_True(TestAppInfo.AddressesAreValid > 0, "Test App Info -> AddrsValid? = %d", + UtAssert_True(TestAppInfo.AddressesAreValid > 0, "Test App Info -> Addrs.Valid? = %d", (int)TestAppInfo.AddressesAreValid); - UtAssert_True(TestAppInfo.CodeAddress > 0, "Test App Info -> CodeAddress = %ld", - (unsigned long)TestAppInfo.CodeAddress); - UtAssert_True(TestAppInfo.CodeSize > 0, "Test App Info -> CodeSize = %ld", - (unsigned long)TestAppInfo.CodeSize); - UtAssert_True(TestAppInfo.DataAddress > 0, "Test App Info -> DataAddress = %ld", - (unsigned long)TestAppInfo.DataAddress); - UtAssert_True(TestAppInfo.DataSize > 0, "Test App Info -> DataSize = %ld", - (unsigned long)TestAppInfo.DataSize); - UtAssert_True(TestAppInfo.BSSAddress > 0, "Test App Info -> BSSAddress = %ld", - (unsigned long)TestAppInfo.BSSAddress); - UtAssert_True(TestAppInfo.BSSSize > 0, "Test App Info -> BSSSize = %ld", (unsigned long)TestAppInfo.BSSSize); + UtAssert_True(TestAppInfo.Code.Address > 0, "Test App Info -> Code.Address = %ld", + (unsigned long)TestAppInfo.Code.Address); + UtAssert_True(TestAppInfo.Code.Size > 0, "Test App Info -> Code.Size = %ld", + (unsigned long)TestAppInfo.Code.Size); + UtAssert_True(TestAppInfo.Data.Address > 0, "Test App Info -> Data.Address = %ld", + (unsigned long)TestAppInfo.Data.Address); + UtAssert_True(TestAppInfo.Data.Size > 0, "Test App Info -> Data.Size = %ld", + (unsigned long)TestAppInfo.Data.Size); + UtAssert_True(TestAppInfo.BSS.Address > 0, "Test App Info -> BSS.Address = %ld", + (unsigned long)TestAppInfo.BSS.Address); + UtAssert_True(TestAppInfo.BSS.Size > 0, "Test App Info -> BSS.Size = %ld", + (unsigned long)TestAppInfo.BSS.Size); } else { @@ -190,12 +191,12 @@ void TestLibInfo(void) { UtAssert_True(LibInfo.AddressesAreValid > 0, "Lib Info -> AddrsValid? = %ld", (unsigned long)LibInfo.AddressesAreValid); - UtAssert_True(LibInfo.CodeAddress > 0, "Lib Info -> CodeAddress = %ld", (unsigned long)LibInfo.CodeAddress); - UtAssert_True(LibInfo.CodeSize > 0, "Lib Info -> CodeSize = %ld", (unsigned long)LibInfo.CodeSize); - UtAssert_True(LibInfo.DataAddress > 0, "Lib Info -> DataAddress = %ld", (unsigned long)LibInfo.DataAddress); - UtAssert_True(LibInfo.DataSize > 0, "Lib Info -> DataSize = %ld", (unsigned long)LibInfo.DataSize); - UtAssert_True(LibInfo.BSSAddress > 0, "Lib Info -> BSSAddress = %ld", (unsigned long)LibInfo.BSSAddress); - UtAssert_True(LibInfo.BSSSize > 0, "Lib Info -> BSSSize = %ld", (unsigned long)LibInfo.BSSSize); + UtAssert_True(LibInfo.Code.Address > 0, "Lib Info -> CodeAddress = %ld", (unsigned long)LibInfo.Code.Address); + UtAssert_True(LibInfo.Code.Size > 0, "Lib Info -> Code.Size = %ld", (unsigned long)LibInfo.Code.Size); + UtAssert_True(LibInfo.Data.Address > 0, "Lib Info -> Data.Address = %ld", (unsigned long)LibInfo.Data.Address); + UtAssert_True(LibInfo.Data.Size > 0, "Lib Info -> Data.Size = %ld", (unsigned long)LibInfo.Data.Size); + UtAssert_True(LibInfo.BSS.Address > 0, "Lib Info -> BSS.Address = %ld", (unsigned long)LibInfo.BSS.Address); + UtAssert_True(LibInfo.BSS.Size > 0, "Lib Info -> BSS.Size = %ld", (unsigned long)LibInfo.BSS.Size); } else { diff --git a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h index 0d1949c27..ed0043c96 100644 --- a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h @@ -427,6 +427,19 @@ typedef uint32 CFE_ES_MemAddress_t; */ #define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x)&0xFFFFFFFF)) +/** + * Memory Address and Memory Offset combination + * + * A combination of #CFE_ES_MemAddress_t and #CFE_ES_MemOffset_t, since they are often used together. + */ +typedef struct CFE_ES_MemAddOff +{ + CFE_ES_MemAddress_t Address; + + CFE_ES_MemOffset_t Size; + +} CFE_ES_MemAddOff_t; + /* * Data Structures shared between API and Message (CMD/TLM) interfaces */ @@ -455,22 +468,16 @@ typedef struct CFE_ES_AppInfo char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \cfetlmmnemonic \ES_APPFILENAME \brief The Filename of the file containing the Application */ - CFE_ES_MemOffset_t StackSize; /**< \cfetlmmnemonic \ES_STACKSIZE - \brief The Stack Size of the Application */ - uint32 AddressesAreValid; /**< \cfetlmmnemonic \ES_ADDRVALID - \brief Indicates that the Code, Data, and BSS addresses/sizes are valid */ - CFE_ES_MemAddress_t CodeAddress; /**< \cfetlmmnemonic \ES_CODEADDR - \brief The Address of the Application Code Segment*/ - CFE_ES_MemOffset_t CodeSize; /**< \cfetlmmnemonic \ES_CODESIZE - \brief The Code Size of the Application */ - CFE_ES_MemAddress_t DataAddress; /**< \cfetlmmnemonic \ES_DATAADDR - \brief The Address of the Application Data Segment*/ - CFE_ES_MemOffset_t DataSize; /**< \cfetlmmnemonic \ES_DATASIZE - \brief The Data Size of the Application */ - CFE_ES_MemAddress_t BSSAddress; /**< \cfetlmmnemonic \ES_BSSADDR - \brief The Address of the Application BSS Segment*/ - CFE_ES_MemOffset_t BSSSize; /**< \cfetlmmnemonic \ES_BSSSIZE - \brief The BSS Size of the Application */ + CFE_ES_MemOffset_t StackSize; /**< \cfetlmmnemonic \ES_STACKSIZE + \brief The Stack Size of the Application */ + uint32 AddressesAreValid; /**< \cfetlmmnemonic \ES_ADDRVALID + \brief Indicates that the Code, Data, and BSS addresses/sizes are valid */ + CFE_ES_MemAddOff_t Code; + + CFE_ES_MemAddOff_t Data; + + CFE_ES_MemAddOff_t BSS; + CFE_ES_MemAddress_t StartAddress; /**< \cfetlmmnemonic \ES_STARTADDR \brief The Start Address of the Application */ CFE_ES_ExceptionAction_Enum_t ExceptionAction; /**< \cfetlmmnemonic \ES_EXCEPTNACTN diff --git a/modules/es/eds/cfe_es.xml b/modules/es/eds/cfe_es.xml index 2e4bdf978..f32537039 100644 --- a/modules/es/eds/cfe_es.xml +++ b/modules/es/eds/cfe_es.xml @@ -173,36 +173,6 @@ \cfetlmmnemonic \ES_ADDRVALID - - - \cfetlmmnemonic \ES_CODEADDR - - - - - \cfetlmmnemonic \ES_CODESIZE - - - - - \cfetlmmnemonic \ES_DATAADDR - - - - - \cfetlmmnemonic \ES_DATASIZE - - - - - \cfetlmmnemonic \ES_BSSADDR - - - - - \cfetlmmnemonic \ES_BSSSIZE - - \cfetlmmnemonic \ES_STARTADDR diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 8d583fcb3..35e8f3cb0 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -1791,7 +1791,7 @@ void CFE_ES_CopyModuleAddressInfo(osal_id_t ModuleId, CFE_ES_AppInfo_t *AppInfoP if (OsStatus == OS_SUCCESS) { AppInfoPtr->AddressesAreValid = - (sizeof(ModuleInfo.addr.code_address) <= sizeof(AppInfoPtr->CodeAddress)) && ModuleInfo.addr.valid; + (sizeof(ModuleInfo.addr.code_address) <= sizeof(AppInfoPtr->Code.Address)) && ModuleInfo.addr.valid; } else { @@ -1803,10 +1803,10 @@ void CFE_ES_CopyModuleAddressInfo(osal_id_t ModuleId, CFE_ES_AppInfo_t *AppInfoP * Convert the internal size and address to the telemetry format. * (The telemetry format may be a different bitwidth than the native processor) */ - AppInfoPtr->CodeAddress = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.code_address); - AppInfoPtr->CodeSize = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.code_size); - AppInfoPtr->DataAddress = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.data_address); - AppInfoPtr->DataSize = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.data_size); - AppInfoPtr->BSSAddress = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.bss_address); - AppInfoPtr->BSSSize = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.bss_size); + AppInfoPtr->Code.Address = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.code_address); + AppInfoPtr->Code.Size = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.code_size); + AppInfoPtr->Data.Address = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.data_address); + AppInfoPtr->Data.Size = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.data_size); + AppInfoPtr->BSS.Address = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.bss_address); + AppInfoPtr->BSS.Size = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.bss_size); } From 9c86dd4020327e52d894f1266d7b98d32dc6d34a Mon Sep 17 00:00:00 2001 From: ArielSAdamsNASA Date: Wed, 27 Oct 2021 12:59:23 -0500 Subject: [PATCH 018/200] Fix #2009, Reuse CodeQL, Static Analysis, and Format Check --- .github/workflows/codeql-build.yml | 118 ++------------------------ .github/workflows/format-check.yml | 46 +--------- .github/workflows/static-analysis.yml | 51 +---------- 3 files changed, 14 insertions(+), 201 deletions(-) diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 3eb1cd3b6..21b4a1db4 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -3,115 +3,11 @@ name: "CodeQL Analysis" on: push: pull_request: - -env: - SIMULATION: native - ENABLE_UNIT_TESTS: true - OMIT_DEPRECATED: true - 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-Security-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: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: c - config-file: nasa/cFS/.github/codeql/codeql-security.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 - - 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 + codeql: + name: CodeQL Analysis + uses: nasa/cFS/.github/workflows/codeql-build.yml@main + with: + make-prep: 'make prep' + make: 'make -C build/native/default_cpu1 core_api core_private es evs fs msg resourceid sb sbr tbl time' \ No newline at end of file diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index ec48a19f0..bf12f09e2 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -1,51 +1,11 @@ name: Format Check -# Run on main push and pull requests +# Run on all push and pull requests on: push: pull_request: jobs: - - static-analysis: + format-check: name: Run format check - runs-on: ubuntu-18.04 - timeout-minutes: 15 - - steps: - - - name: Install format checker - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' - sudo apt-get update && sudo apt-get install clang-format-10 - - - name: Checkout bundle - uses: actions/checkout@v2 - with: - repository: nasa/cFS - - - name: Checkout - uses: actions/checkout@v2 - with: - path: repo - - - name: Generate format differences - run: | - cd repo - find . -name "*.[ch]" -exec clang-format-10 -i -style=file {} + - git diff > $GITHUB_WORKSPACE/style_differences.txt - - - name: Archive Static Analysis Artifacts - uses: actions/upload-artifact@v2 - with: - name: style_differences - path: style_differences.txt - - - name: Error on differences - run: | - if [[ -s style_differences.txt ]]; - then - cat style_differences.txt - exit -1 - fi + uses: nasa/cFS/.github/workflows/format-check.yml@main \ No newline at end of file diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 9baebd176..017f54bb8 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,56 +1,13 @@ name: Static Analysis -# Run this workflow every time a new commit pushed to your repository +# Run on all push and pull requests on: push: - branches: - - main pull_request: jobs: - static-analysis: name: Run cppcheck - runs-on: ubuntu-18.04 - timeout-minutes: 15 - - strategy: - fail-fast: false - matrix: - cppcheck: [all, cfe] - - steps: - - - name: Install cppcheck - run: sudo apt-get install cppcheck -y - - # Checks out a copy of the cfs bundle - - name: Checkout code - uses: actions/checkout@v2 - with: - submodules: true - - - name: Run bundle cppcheck - if: ${{matrix.cppcheck =='all'}} - run: cppcheck --force --inline-suppr . 2> ${{matrix.cppcheck}}_cppcheck_err.txt - - # Run strict static analysis for embedded portions of cfe - - name: cfe strict cppcheck - if: ${{matrix.cppcheck =='cfe'}} - run: | - all_fsw_modules="core_api core_private es evs fs msg resourceid sb sbr tbl time" - /bin/bash ./.github/workflows/run_fsw_cppcheck.sh ${all_fsw_modules} 2> ${{matrix.cppcheck}}_cppcheck_err.txt - - - name: Archive Static Analysis Artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{matrix.cppcheck}}-cppcheck-err - path: ./*cppcheck_err.txt - - - name: Check for errors - run: | - if [[ -s ${{matrix.cppcheck}}_cppcheck_err.txt ]]; - then - cat ${{matrix.cppcheck}}_cppcheck_err.txt - exit -1 - fi + uses: nasa/cFS/.github/workflows/static-analysis.yml@main + with: + strict-dir-list: './modules/core_api/fsw ./modules/core_private/fsw ./modules/es/fsw ./modules/evs/fsw ./modules/fs/fsw ./modules/msg/fsw ./modules/resourceid/fsw ./modules/sb/fsw ./modules/sbr/fsw ./modules/tbl/fsw ./modules/time/fsw -UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER' \ No newline at end of file From 92cc55e588116f8af8dbf49bc98c4886f7f022c5 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 16 Sep 2021 13:50:16 -0400 Subject: [PATCH 019/200] Fix #1952, patch for recursive event loop Adds CFE_SB_RequestToSendEvent/CFE_SB_FinishSendEvent wrappers around all events generated by CFE_SB_TransmitMsgValidate. This is avoids the potential for a recursive loop if configured improperly. --- modules/sb/fsw/src/cfe_sb_api.c | 42 +++++++++++++++++++++++--------- modules/sb/fsw/src/cfe_sb_priv.h | 14 ++++++----- modules/sb/ut-coverage/sb_UT.c | 31 +++++++++++++++++++++++ 3 files changed, 69 insertions(+), 18 deletions(-) diff --git a/modules/sb/fsw/src/cfe_sb_api.c b/modules/sb/fsw/src/cfe_sb_api.c index fb5f119be..e40f74b6f 100644 --- a/modules/sb/fsw/src/cfe_sb_api.c +++ b/modules/sb/fsw/src/cfe_sb_api.c @@ -1503,24 +1503,42 @@ int32 CFE_SB_TransmitMsgValidate(const CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t switch (PendingEventID) { case CFE_SB_SEND_BAD_ARG_EID: - CFE_EVS_SendEventWithAppID(CFE_SB_SEND_BAD_ARG_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId, - "Send Err:Bad input argument,Arg 0x%lx,App %s", (unsigned long)MsgPtr, - CFE_SB_GetAppTskName(TskId, FullName)); + if (CFE_SB_RequestToSendEvent(TskId, CFE_SB_SEND_BAD_ARG_EID_BIT) == CFE_SB_GRANTED) + { + CFE_EVS_SendEventWithAppID(CFE_SB_SEND_BAD_ARG_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId, + "Send Err:Bad input argument,Arg 0x%lx,App %s", (unsigned long)MsgPtr, + CFE_SB_GetAppTskName(TskId, FullName)); + + /* clear the bit so the task may send this event again */ + CFE_SB_FinishSendEvent(TskId, CFE_SB_SEND_BAD_ARG_EID_BIT); + } break; case CFE_SB_SEND_INV_MSGID_EID: - CFE_EVS_SendEventWithAppID(CFE_SB_SEND_INV_MSGID_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId, - "Send Err:Invalid MsgId(0x%x)in msg,App %s", - (unsigned int)CFE_SB_MsgIdToValue(*MsgIdPtr), - CFE_SB_GetAppTskName(TskId, FullName)); + if (CFE_SB_RequestToSendEvent(TskId, CFE_SB_SEND_INV_MSGID_EID_BIT) == CFE_SB_GRANTED) + { + CFE_EVS_SendEventWithAppID(CFE_SB_SEND_INV_MSGID_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId, + "Send Err:Invalid MsgId(0x%x)in msg,App %s", + (unsigned int)CFE_SB_MsgIdToValue(*MsgIdPtr), + CFE_SB_GetAppTskName(TskId, FullName)); + + /* clear the bit so the task may send this event again */ + CFE_SB_FinishSendEvent(TskId, CFE_SB_SEND_INV_MSGID_EID_BIT); + } break; case CFE_SB_MSG_TOO_BIG_EID: - CFE_EVS_SendEventWithAppID(CFE_SB_MSG_TOO_BIG_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId, - "Send Err:Msg Too Big MsgId=0x%x,app=%s,size=%d,MaxSz=%d", - (unsigned int)CFE_SB_MsgIdToValue(*MsgIdPtr), - CFE_SB_GetAppTskName(TskId, FullName), (int)*SizePtr, - CFE_MISSION_SB_MAX_SB_MSG_SIZE); + if (CFE_SB_RequestToSendEvent(TskId, CFE_SB_MSG_TOO_BIG_EID_BIT) == CFE_SB_GRANTED) + { + CFE_EVS_SendEventWithAppID(CFE_SB_MSG_TOO_BIG_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId, + "Send Err:Msg Too Big MsgId=0x%x,app=%s,size=%d,MaxSz=%d", + (unsigned int)CFE_SB_MsgIdToValue(*MsgIdPtr), + CFE_SB_GetAppTskName(TskId, FullName), (int)*SizePtr, + CFE_MISSION_SB_MAX_SB_MSG_SIZE); + + /* clear the bit so the task may send this event again */ + CFE_SB_FinishSendEvent(TskId, CFE_SB_MSG_TOO_BIG_EID_BIT); + } break; case CFE_SB_SEND_NO_SUBS_EID: diff --git a/modules/sb/fsw/src/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h index 54df50a38..1e781f83e 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -90,12 +90,14 @@ #define CFE_SB_FILE_IO_ERR (-5) /* bit map for stopping recursive event problem */ -#define CFE_SB_SEND_NO_SUBS_EID_BIT 0 -#define CFE_SB_GET_BUF_ERR_EID_BIT 1 -#define CFE_SB_MSGID_LIM_ERR_EID_BIT 2 -#define CFE_SB_Q_FULL_ERR_EID_BIT 3 -#define CFE_SB_Q_WR_ERR_EID_BIT 4 - +#define CFE_SB_SEND_NO_SUBS_EID_BIT 0 +#define CFE_SB_GET_BUF_ERR_EID_BIT 1 +#define CFE_SB_MSGID_LIM_ERR_EID_BIT 2 +#define CFE_SB_Q_FULL_ERR_EID_BIT 3 +#define CFE_SB_Q_WR_ERR_EID_BIT 4 +#define CFE_SB_SEND_BAD_ARG_EID_BIT 5 +#define CFE_SB_SEND_INV_MSGID_EID_BIT 6 +#define CFE_SB_MSG_TOO_BIG_EID_BIT 7 /* ** Type Definitions */ diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 5027f9705..93ed20c2c 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -4545,6 +4545,37 @@ void Test_SB_TransmitMsgPaths_Nominal(void) CFE_UtAssert_EVENTCOUNT(3); + /* + * Test Additional paths within CFE_SB_TransmitMsgValidate that skip sending events to avoid a loop + * For all of these they should skip sending the event but still increment the MsgSendErrorCounter + */ + + /* CFE_SB_MSG_TOO_BIG_EID loop filter */ + CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter = 0; + Size = CFE_MISSION_SB_MAX_SB_MSG_SIZE + 1; + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); + CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_MSG_TOO_BIG_EID_BIT); + CFE_SB_TransmitMsg(&Housekeeping.SBBuf.Msg, true); + CFE_UtAssert_EVENTNOTSENT(CFE_SB_MSG_TOO_BIG_EID); + UtAssert_UINT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 1); + + /* CFE_SB_SEND_INV_MSGID_EID loop filter */ + CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter = 0; + MsgId = CFE_SB_INVALID_MSG_ID; + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); + CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_SEND_INV_MSGID_EID_BIT); + CFE_SB_TransmitMsg(&Housekeeping.SBBuf.Msg, true); + CFE_UtAssert_EVENTNOTSENT(CFE_SB_SEND_INV_MSGID_EID); + UtAssert_UINT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 1); + + /* CFE_SB_SEND_BAD_ARG_EID loop filter */ + CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter = 0; + CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_SEND_BAD_ARG_EID_BIT); + CFE_SB_TransmitMsg(NULL, true); + CFE_UtAssert_EVENTNOTSENT(CFE_SB_SEND_BAD_ARG_EID); + UtAssert_UINT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 1); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_TransmitMsgPaths */ From 052152303e5f04425e0e9b61489e3d63aecca043 Mon Sep 17 00:00:00 2001 From: pavll Date: Wed, 3 Nov 2021 22:43:01 +0100 Subject: [PATCH 020/200] Fix #1997, Mismatched foreach in cmake function --- cmake/mission_build.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 98bf76b2a..4edf379e1 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -359,7 +359,7 @@ function(prepare) ) foreach(APP ${MISSION_DEPS}) list(APPEND VARLIST "${APP}_MISSION_DIR") - endforeach(APP ${MISSION_APPS}) + endforeach() foreach(SYSVAR ${TGTSYS_LIST}) list(APPEND VARLIST "BUILD_CONFIG_${SYSVAR}") From 3a122b6a7c9a173ca3d4f10c9f3e080dc4ad8343 Mon Sep 17 00:00:00 2001 From: Adrien Chardon Date: Thu, 4 Nov 2021 15:48:56 +0100 Subject: [PATCH 021/200] cFE Application Developers Guide.md: specify language for improved code highlighting --- docs/cFE Application Developers Guide.md | 99 ++++++++++++------------ 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index 9cee9706e..ba31cc0c8 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -501,7 +501,7 @@ headers, while files listed in the second table (without suffix) should be used Finally, to simplify application headers, a single "all-inclusive" cFE header is also provided: -``` +```c #include "cfe.h" /* Define cFE API prototypes and data types */ ``` @@ -779,7 +779,7 @@ clock tick. This can also be used to calculate the appropriate number of system clock ticks for a specific delta time. An example can be seen below: -``` +```c uint32 ConvertSecs2Ticks(uint32 Seconds) { uint32 NumOfTicks,TickDurationInMicroSec; @@ -839,20 +839,20 @@ success, the OS_BinSemCreate function sets the sem_id parameter to the ID of the newly-created resource. This ID is used in all other functions that use the binary semaphore. -``` +```c int32 OS_BinSemCreate(uint32 *xxx_SEM_ID, const char *xxx_SEM_NAME, uint32 sem_initial_value, uint32 options); ``` There are two options for pending on a binary semaphore: -``` +```c int32 OS_BinSemTake( uint32 xxx_SEM_ID ); ``` which waits indefinitely for a semaphore to become available, and -``` +```c int32 OS_BinSemTimedWait( uint32 xxx_SEM_ID , uint32 timeout_in_milliseconds ); ``` @@ -861,7 +861,7 @@ has not become available. A binary semaphore is given by using this function: -``` +```c int32 OS_BinSemGive( uint32 xxx_SEM_ID ); ``` @@ -886,25 +886,26 @@ Upon success, the OS_CountSemCreate function sets the sem_id parameter to the ID of the newly-created resource. This ID is used in all other functions that use the binary semaphore. -``` +```c int32 OS_CountSemCreate(uint32 *xxx_SEM_ID, const char *xxx_SEM_NAME, uint32 sem_initial_value, uint32 options); ``` There are two options for pending on a counting semaphore: -``` +```c int32 OS_CountSemTake( uint32 xxx_SEM_ID ); ``` which waits indefinitely for a semaphore to become available, and -``` +```c int32 OS_CountSemTimedWait( uint32 xxx_SEM_ID , uint32 timeout_in_milliseconds ); ``` + A counting semaphore is given by using this function: -``` +```c int32 OS_CountSemGive( uint32 xxx_SEM_ID ); ``` @@ -940,7 +941,7 @@ being done in the protected region. The Take and Give functions should have the same level of indentation, and there should be exactly one entry point and one exit point to the protected region. -``` +```c int32 OS_MutSemTake( uint32 xxx_MUT_ID ); /* protected region */ @@ -965,25 +966,25 @@ of the entire system. An application creates a mutex by calling: -``` +```c int32 OS_MutSemCreate (uint32 *sem_id, const char *sem_name, uint32 options); ``` and deletes it by calling: -``` +```c int32 OS_MutSemDelete (uint32 sem_id); ``` An application takes a mutex by calling: -``` +```c int32 OS_MutSemTake( uint32 xxx_MUT_ID ); ``` and gives it by calling: -``` +```c int32 OS_MutSemGive( uint32 xxx_MUT_ID ); ``` @@ -1009,7 +1010,7 @@ Similar to interrupt service routines, handlers can be associated with specific exceptions. The following function specifies a handler for an exception: -``` +```c OS_ExcAttachHandler( uint32 ExceptionNumber, void *ExceptionHandler, int32 Param ); ``` @@ -1017,14 +1018,14 @@ The ExceptionHandler is a function that will be called when the exception is detected and should have a prototype that looks like the following: -``` +```c void ExceptionHandler( int32 Param ); ``` There are addition functions for enabling/masking and disabling/unmasking specific exceptions. These are as follows: -``` +```c OS_ExcEnable( uint32 ExceptionNumber ); OS_ExcDisable( uint32 ExceptionNumber ); ``` @@ -1035,7 +1036,7 @@ In addition to the exception handlers identified above, a similar paradigm exists for handling floating point processor exceptions. The following function specifies a handler for an FPU exception: -``` +```c OS_FPUExcAttachHandler( uint32 ExceptionNumber, void *ExceptionHandler, int32 Param ); ``` @@ -1043,14 +1044,14 @@ The ExceptionHandler is a function that will be called when the exception is detected and should have a prototype that looks like the following: -``` +```c void ExceptionHandler( int32 Param ); ``` There are addition functions for enabling/masking and disabling/unmasking specific exceptions. These are as follows: -``` +```c OS_FPUExcEnable( uint32 ExceptionNumber ); OS_FPUExcDisable( uint32 ExceptionNumber ); ``` @@ -1367,7 +1368,7 @@ significant Event that cannot be recorded using the CFE_EVS_SendEvent function, then the Developer can use the CFE_ES_WriteToSysLog function. This function has the following prototype: -``` +```c int32 CFE_ES_WriteToSysLog(const char *pSpecString, ...); ``` @@ -2313,7 +2314,7 @@ used to uniquely identify an application event. The Event ID is defined and supplied to the EVS by the application requesting services. The hexadecimal bit mask represents the filtering frequency for the event. -``` +```c typedef struct { uint16 EventID, @@ -2342,7 +2343,7 @@ section 7.4) regardless of whether the message was sent. An example of an Application registering with Event Services and specifying its binary filters is shown below: -``` +```c FILE: sample_app.h ... @@ -2415,7 +2416,7 @@ reset the filter counter for a specified Event ID. The latter function resets all event filter counters for the Application. An example of resetting a specific Event ID filter counter is shown below: -``` +```c FILE: sample_app.c { @@ -2434,7 +2435,7 @@ or the CFE_EVS_SendTimedEvent() function, which are both analogous to the C printf() function in how strings are formatted. An example of each function call is shown below: -``` +```c CFE_EVS_SendEvent(EventID, EventType, "Unknown stream on cmd pipe: 0x%04X", sid); ``` @@ -2451,7 +2452,7 @@ sent. The other function that can be called to send an event message is shown below: -``` +```c CFE_EVS_SendTimedEvent(PktTime, EventID, EventType, "CSS Data Bad: 0x%04X", CssData); ``` @@ -2644,7 +2645,7 @@ it should use the CFE_TBL_Share API instead. The CFE_TBL_Share API will locate the specified Table by name and return a Table Handle to the calling Application. An example of Table sharing is shown below: -``` +```c FILE: SAMPLE_app.c CFE_TBL_Handle_t MyTableHandle; /* Handle to MyTable */ @@ -2679,7 +2680,7 @@ Application can obtain a pointer to the start of the data within the Table using the CFE_TBL_GetAddress or CFE_TBL_GetAddresses APIs. An example of this is shown in Section 8.5.1. -``` +```c { int32 Status = CFE_SUCCESS; SAMPLE_MyTable_t *MyTblPtr; @@ -2772,7 +2773,7 @@ assigning and creating a validation function is a fairly simple process. To use the function, the Application should periodically identify when a Table Validation Request has been made as shown below: -``` +```c { int32 Status = CFE_SUCCESS; boolean FinishedManaging = FALSE; @@ -2821,7 +2822,7 @@ the Table with default values or when the Application is changing modes and wishes to use a different parameter set. An example of this can be seen below: -``` +```c FILE: sample_app.c CFE_TBL_Handle_t MyTableHandle /* Handle to MyTable */ @@ -2847,7 +2848,7 @@ SAMPLE_MyTable_t MyTblInitData = { 0x1234, 0x5678, { 2, 3, 4, ... }, ...}; If a developer wishes to load the table from a file rather than from a memory image, the code would look something like the following: -``` +```c { int32 Status; @@ -2898,6 +2899,7 @@ A typical layout of table-related files within an application (xx) is shown below. Note that this does not show all of an application's files, just those related to tables. +``` xx |----fsw |----src @@ -2910,27 +2912,28 @@ xx | |----platform_inc |----xx_platform_cfg.h +``` -The xx_app.h file is included in this layout only because table handles are -typically stored in an application's AppData_t structure. +The `xx_app.h` file is included in this layout only because table handles are +typically stored in an application's `AppData_t` structure. -The file xx_tbldefs.h (sometimes just named xx_tbl.h) typically contains the +The file `xx_tbldefs.h` (sometimes just named `xx_tbl.h`) typically contains the structure definition of a single table entry. This file is included in the -xx_table1.c file where the table itself is defined. It may also contain +`xx_table1.c` file where the table itself is defined. It may also contain declarations for table-related utility functions. -The xx_tbl.c file typically contains table-related utility functions. For +The `xx_tbl.c` file typically contains table-related utility functions. For instance, many applications define table initialization and validation functions in this file. -The xx_table1.c file is the source code for a table itself. +The `xx_table1.c` file is the source code for a table itself. -The xx_platform_cfg.h file contains configuration parameters for applications, +The `xx_platform_cfg.h` file contains configuration parameters for applications, and there are typically several configuration parameters associated with tables. ### 8.5.1 Table Files Example -``` +```c FILE: xx_app.h ... @@ -2945,7 +2948,7 @@ XX_AppData_t XX_AppData; ... ``` -``` +```c FILE: xx_tbldefs.h ... @@ -2968,7 +2971,7 @@ int32 XX_ValidateTable(void *TableData); ... ``` -``` +```c FILE: xx_tbl.c #include xx_tbldefs.h @@ -3028,7 +3031,7 @@ int32 XX_ValidateTable(void *TableData) } ``` -``` +```c FILE: xx_table1.c #include "cfe.h" @@ -3054,7 +3057,7 @@ XX_MyTable_t XX_MyTable = }; ``` -``` +```c FILE: xx_platform_cfg.h #define XX_APP_NAME "XX" @@ -3071,7 +3074,7 @@ In order to build application tables with the CMake build system, the application is structured with a "Tables" directory, another "aux_source_directory" may need to be added as well. -``` +```cmake aux_source_directory(fsw/tables APP_TABLE_FILES) # Create the app module @@ -3106,7 +3109,7 @@ standard file header. The structure of the standard file header is as follows: -``` +```c typedef struct { uint32 ContentType; /* Identifies the content type (magic #=’cFE1’) */ @@ -3215,7 +3218,7 @@ integer represents the number of seconds and the second integer represents the number of `2^-32` seconds. The data structure for this representation of time is as follows: -``` +```c typedef struct { uint32 Seconds; /* Number of seconds */ uint32 Subseconds; /* Number of 2^(-32) subseconds */ @@ -3420,7 +3423,7 @@ the first time in the subtraction. Otherwise, as shown above, the delta time between two absolute times could either be 5 hours or 7 hours. An example of a delta time computation function is shown below: -``` +```c CFE_TIME_SysTime_t ComputeDeltaTime(CFE_TIME_SysTime_t TimeA, CFE_TIME_SysTime_t TimeB) { From ed8d92723dd4df66f80642477de92f3c38e1684a Mon Sep 17 00:00:00 2001 From: pavll Date: Tue, 9 Nov 2021 11:12:14 +0100 Subject: [PATCH 022/200] Fix #1823, FS Functional test --- modules/cfe_testcase/src/fs_util_test.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/cfe_testcase/src/fs_util_test.c b/modules/cfe_testcase/src/fs_util_test.c index e378fc862..2435078d7 100644 --- a/modules/cfe_testcase/src/fs_util_test.c +++ b/modules/cfe_testcase/src/fs_util_test.c @@ -37,8 +37,26 @@ void TestFileCategory(void) { UtPrintf("Testing: CFE_FS_GetDefaultMountPoint, CFE_FS_GetDefaultExtension"); - UtAssert_NULL(CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_UNKNOWN)); - UtAssert_NULL(CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_UNKNOWN)); + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_UNKNOWN); + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_UNKNOWN); + + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_DYNAMIC_MODULE); + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_DYNAMIC_MODULE); + + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP); + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP); + + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_TEXT_LOG); + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_TEXT_LOG); + + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_SCRIPT); + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_SCRIPT); + + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_TEMP); + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_TEMP); + + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_MAX); + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_MAX); } void TestInputFile(void) From e52ac7a6c6c573b180156f20ffd316abc4d063f4 Mon Sep 17 00:00:00 2001 From: Zachary Gonzalez Date: Wed, 20 Oct 2021 16:35:41 -0500 Subject: [PATCH 023/200] Fix #1537, Replace hardcoded message limit in TIME - Uses CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT --- modules/time/fsw/src/cfe_time_task.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/time/fsw/src/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c index 87915e3aa..d174e846f 100644 --- a/modules/time/fsw/src/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -200,7 +200,8 @@ int32 CFE_TIME_TaskInit(void) #endif #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_TONE_CMD_MID), CFE_TIME_Global.CmdPipe, 4); + Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_TONE_CMD_MID), CFE_TIME_Global.CmdPipe, + CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT); #endif if (Status != CFE_SUCCESS) { @@ -216,7 +217,8 @@ int32 CFE_TIME_TaskInit(void) #endif #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_DATA_CMD_MID), CFE_TIME_Global.CmdPipe, 4); + Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_DATA_CMD_MID), CFE_TIME_Global.CmdPipe, + CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT); #endif if (Status != CFE_SUCCESS) { @@ -232,7 +234,8 @@ int32 CFE_TIME_TaskInit(void) #endif #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), CFE_TIME_Global.CmdPipe, 4); + Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), CFE_TIME_Global.CmdPipe, + CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT); #endif if (Status != CFE_SUCCESS) From 5a1d138b19a9c74b8a8f4d7f82884d5c7abd65f6 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Wed, 17 Nov 2021 21:31:21 -0500 Subject: [PATCH 024/200] Update build baseline and bump to v7.0.0-rc4+dev39 - Set new build baseline for cFS-Caelum-rc4: v7.0.0-rc4 - Standardize development indicators in cfe_version.h to use 0xFF in MissionRev to indicate development version --- README.md | 19 +++++++++++++++++++ modules/core_api/fsw/inc/cfe_version.h | 21 ++++++++++++++------- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ff01c8f11..42d420523 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,25 @@ The detailed cFE user's guide can be viewed at and + ### Development Build: v6.8.0-rc1+dev1030 - Grammatical cleanup of requirements diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index eac498eef..81bd120a9 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -28,14 +28,21 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 1030 /**< @brief Development: Number of development commits since baseline */ -#define CFE_BUILD_BASELINE "v6.8.0-rc1" /**< @brief Development: Reference git tag for build number */ +#define CFE_BUILD_NUMBER 39 /**< @brief Development: Number of development commits since baseline */ +#define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* Version Macro Definitions updated for official releases only */ -#define CFE_MAJOR_VERSION 6 /**< @brief Major release version (Former for Revision == 99) */ -#define CFE_MINOR_VERSION 7 /**< @brief Minor release version (Former for Revision == 99) */ -#define CFE_REVISION 99 /**< @brief Revision, 99 indicates development */ -#define CFE_MISSION_REV 0 /**< @brief Mission revision, reserved for mission use */ +#define CFE_MAJOR_VERSION 6 /**< @brief Major release version (Former for Revision == 99) */ +#define CFE_MINOR_VERSION 7 /**< @brief Minor release version (Former for Revision == 99) */ +#define CFE_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision number. */ + +/*! + * @brief Mission revision. + * + * Set to 0 on OFFICIAL releases, and set to 255 (0xFF) on development versions. + * Values 1-254 are reserved for mission use to denote patches/customizations as needed. + */ +#define CFE_MISSION_REV 0xFF #define CFE_STR_HELPER(x) #x /**< @brief Convert argument to string */ #define CFE_STR(x) CFE_STR_HELPER(x) /**< @brief Expand macro before conversion */ @@ -55,6 +62,6 @@ * and official releases. */ #define CFE_VERSION_STRING \ - " cFE DEVELOPMENT BUILD " CFE_SRC_VERSION " (Codename: Bootes), Last Official Release: cfe v6.7.0" + " cFE DEVELOPMENT BUILD " CFE_SRC_VERSION " (Codename: Draco), Last Official Release: cfe v6.7.0" #endif /* CFE_VERSION_H */ From 5981da47e67e22daf0f1abbe659f68f6ca370039 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 18 Jan 2022 08:40:58 -0700 Subject: [PATCH 025/200] Fix #2022, Limit SBR UT loops --- .../sbr/ut-coverage/test_cfe_sbr_map_direct.c | 47 ++++++++++++++++--- .../sbr/ut-coverage/test_cfe_sbr_map_hash.c | 26 ++++++++-- 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c index 0cc2f8fbb..b5349ac9d 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c @@ -31,10 +31,17 @@ #include "cfe_sbr_priv.h" #include +/* + * Reasonable limit on loops in case CFE_PLATFORM_SB_HIGHEST_VALID_MSGID is large + * Can be set equal to the configured highest if user requires it + */ +#define CFE_SBR_UT_LIMIT_HIGHEST_MSGID 0x1FFF + void Test_SBR_Map_Direct(void) { CFE_SB_MsgId_Atom_t msgidx; + CFE_SB_MsgId_Atom_t msgid_limit; CFE_SBR_RouteId_t routeid; CFE_SB_MsgId_t msgid; uint32 count; @@ -50,16 +57,29 @@ void Test_SBR_Map_Direct(void) /* Force valid msgid responses */ UT_SetDefaultReturnValue(UT_KEY(CFE_SB_IsValidMsgId), true); - UtPrintf("Check that all entries are set invalid"); + /* Limit message id loops */ + if (CFE_PLATFORM_SB_HIGHEST_VALID_MSGID > CFE_SBR_UT_LIMIT_HIGHEST_MSGID) + { + msgid_limit = CFE_SBR_UT_LIMIT_HIGHEST_MSGID; + UtPrintf("Limiting msgid ut loops to 0x%08X of 0x%08X", (unsigned int)msgid_limit, + (unsigned int)CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + } + else + { + msgid_limit = CFE_PLATFORM_SB_HIGHEST_VALID_MSGID; + UtPrintf("Testing full msgid range in ut up to 0x%08X", (unsigned int)msgid_limit); + } + + UtPrintf("Check that entries are set invalid"); count = 0; - for (msgidx = 0; msgidx <= CFE_PLATFORM_SB_HIGHEST_VALID_MSGID; msgidx++) + for (msgidx = 0; msgidx <= msgid_limit; msgidx++) { if (!CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(msgidx)))) { count++; } } - UtAssert_INT32_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1); + UtAssert_INT32_EQ(count, msgid_limit + 1); UtPrintf("Set/Get a range of ids "); routeid = CFE_SBR_ValueToRouteId(CFE_PLATFORM_SB_MAX_MSG_IDS + 1); @@ -72,16 +92,29 @@ void Test_SBR_Map_Direct(void) UtAssert_INT32_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); UtAssert_INT32_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); - UtPrintf("Check there is now 1 valid entry in map"); + /* Get number of valid routes in range */ count = 0; - for (msgidx = 0; msgidx <= CFE_PLATFORM_SB_HIGHEST_VALID_MSGID; msgidx++) + for (msgidx = 0; msgidx <= msgid_limit; msgidx++) { - if (!CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(msgidx)))) + if (CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(msgidx)))) { count++; } } - UtAssert_INT32_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + + /* Check result based on range checked */ + if (msgid_limit == CFE_PLATFORM_SB_HIGHEST_VALID_MSGID) + { + /* Full range, 1 valid */ + UtPrintf("Check there is 1 valid entry in map"); + UtAssert_INT32_EQ(count, 1); + } + else + { + /* Limited range, up to 1 valid */ + UtPrintf("Up to 1 valid entry in limited range check"); + UtAssert_INT32_LTEQ(count, 1); + } UtPrintf("Set back to invalid and check again"); routeid = CFE_SBR_INVALID_ROUTE_ID; diff --git a/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c index dd8d4e3ed..16e4b50ea 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c @@ -37,6 +37,12 @@ /* Unhash magic number */ #define CFE_SBR_UNHASH_MAGIC (0x119de1f3) +/* + * Reasonable limit on loops in case CFE_PLATFORM_SB_HIGHEST_VALID_MSGID is large + * Can be set equal to the configured highest if user requires it + */ +#define CFE_SBR_UT_LIMIT_HIGHEST_MSGID 0x1FFF + /****************************************************************************** * Local helper to unhash */ @@ -54,6 +60,7 @@ void Test_SBR_Map_Hash(void) { CFE_SB_MsgId_Atom_t msgidx; + CFE_SB_MsgId_Atom_t msgid_limit; CFE_SBR_RouteId_t routeid[3]; CFE_SB_MsgId_t msgid[3]; uint32 count; @@ -69,16 +76,29 @@ void Test_SBR_Map_Hash(void) /* Force valid msgid responses */ UT_SetDefaultReturnValue(UT_KEY(CFE_SB_IsValidMsgId), true); - UtPrintf("Check that all entries are set invalid"); + /* Limit message id loops */ + if (CFE_PLATFORM_SB_HIGHEST_VALID_MSGID > CFE_SBR_UT_LIMIT_HIGHEST_MSGID) + { + msgid_limit = CFE_SBR_UT_LIMIT_HIGHEST_MSGID; + UtPrintf("Limiting msgid ut loops to 0x%08X of 0x%08X", (unsigned int)msgid_limit, + (unsigned int)CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + } + else + { + msgid_limit = CFE_PLATFORM_SB_HIGHEST_VALID_MSGID; + UtPrintf("Testing full msgid range in ut up to 0x%08X", (unsigned int)msgid_limit); + } + + UtPrintf("Check that entries are set invalid"); count = 0; - for (msgidx = 0; msgidx <= CFE_PLATFORM_SB_HIGHEST_VALID_MSGID; msgidx++) + for (msgidx = 0; msgidx <= msgid_limit; msgidx++) { if (!CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(msgidx)))) { count++; } } - UtAssert_INT32_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1); + UtAssert_INT32_EQ(count, msgid_limit + 1); /* Note AddRoute required for hash logic to work since it depends on MsgId in routing table */ UtPrintf("Add routes and check with a rollover and a skip"); From 3eaf3eae027d068b61a4ee4b40aae3f0817fa280 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 18 Jan 2022 10:53:02 -0500 Subject: [PATCH 026/200] Fix #2024, osal_id_t type conversion in es_UT.c Corrects the implicit type conversion from an osal_id_t to an integer, making it explicit by using the OS_ObjectIdToInteger() conversion function. --- modules/es/ut-coverage/es_UT.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 245487995..b30b6679c 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -4519,7 +4519,7 @@ void TestAPI(void) /* Hit error case for NULL TaskRecPtr */ ES_ResetUnitTest(); - UT_SetDeferredRetcode(UT_KEY(OS_TaskGetId), 1, OS_OBJECT_ID_UNDEFINED); + UT_SetDeferredRetcode(UT_KEY(OS_TaskGetId), 1, OS_ObjectIdToInteger(OS_OBJECT_ID_UNDEFINED)); UtAssert_INT32_EQ(CFE_ES_GetTaskID(&TaskId), CFE_ES_ERR_RESOURCEID_NOT_VALID); } From fbbd5a9180ccd5bbfc36e40a1ea530a1d30ddc8a Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 18 Jan 2022 13:36:02 -0700 Subject: [PATCH 027/200] Fix #2026, CFE_FS_ParseInputFileNameEx avoid uninit var --- modules/core_api/ut-stubs/src/cfe_fs_handlers.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/core_api/ut-stubs/src/cfe_fs_handlers.c b/modules/core_api/ut-stubs/src/cfe_fs_handlers.c index 86e18fec9..b27763125 100644 --- a/modules/core_api/ut-stubs/src/cfe_fs_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_fs_handlers.c @@ -161,6 +161,7 @@ void UT_DefaultHandler_CFE_FS_ParseInputFileNameEx(void *UserObj, UT_EntryKey_t { char * OutputBuffer = UT_Hook_GetArgValueByName(Context, "OutputBuffer", char *); size_t OutputBufSize = UT_Hook_GetArgValueByName(Context, "OutputBufSize", size_t); + const char *InputBuffer = UT_Hook_GetArgValueByName(Context, "InputBuffer", const char *); const char *DefaultInput = UT_Hook_GetArgValueByName(Context, "DefaultInput", const char *); int32 status; @@ -169,10 +170,18 @@ void UT_DefaultHandler_CFE_FS_ParseInputFileNameEx(void *UserObj, UT_EntryKey_t /* Copy any specific output supplied by test case */ if (status >= 0 && UT_Stub_CopyToLocal(UT_KEY(CFE_FS_ParseInputFileNameEx), OutputBuffer, OutputBufSize) == 0 && - OutputBufSize > 0 && DefaultInput != NULL) + OutputBufSize > 0) { - /* Otherwise fall back to simple copy */ - strncpy(OutputBuffer, DefaultInput, OutputBufSize); + if (DefaultInput != NULL) + { + /* Use default if set */ + strncpy(OutputBuffer, DefaultInput, OutputBufSize); + } + else + { + /* Fall back to copy input to avoid uninitialized output */ + strncpy(OutputBuffer, InputBuffer, OutputBufSize); + } } } From 3333827efd9fd04ffab3b4166057fb5f9891d354 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 18 Jan 2022 13:47:54 -0700 Subject: [PATCH 028/200] Fix #2028, Initialize BlockData in ES UT --- modules/es/ut-coverage/es_UT.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 245487995..0ebcef1ec 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -4670,6 +4670,8 @@ void TestCDS() UtPrintf("Begin Test CDS"); + memset(BlockData, 0, sizeof(BlockData)); + /* Test init with a mutex create failure */ UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_ERROR); UtAssert_INT32_EQ(CFE_ES_CDS_EarlyInit(), CFE_STATUS_EXTERNAL_RESOURCE_FAIL); From f5982166196fa362542eb8ee293c97ee4f09556b Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 18 Jan 2022 16:58:38 -0500 Subject: [PATCH 029/200] Fix #2030, array length calculation for perf structs Cleans up the array length calculation for perf structs to not assume a specific base element type (uint32). This also makes the definitions much more readable. --- modules/es/fsw/src/cfe_es_task.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index 4703763f1..4298a76c7 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -48,13 +48,16 @@ /* ** Defines */ +#define CFE_ES_PERF_MASK_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) + #define CFE_ES_PERF_TRIGGERMASK_INT_SIZE \ - (sizeof(CFE_ES_Global.ResetDataPtr->Perf.MetaData.TriggerMask) / sizeof(uint32)) + CFE_ES_PERF_MASK_ARRAY_SIZE(CFE_ES_Global.ResetDataPtr->Perf.MetaData.TriggerMask) #define CFE_ES_PERF_TRIGGERMASK_EXT_SIZE \ - (sizeof(CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask) / sizeof(uint32)) -#define CFE_ES_PERF_FILTERMASK_INT_SIZE (sizeof(CFE_ES_Global.ResetDataPtr->Perf.MetaData.FilterMask) / sizeof(uint32)) + CFE_ES_PERF_MASK_ARRAY_SIZE(CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask) +#define CFE_ES_PERF_FILTERMASK_INT_SIZE \ + CFE_ES_PERF_MASK_ARRAY_SIZE(CFE_ES_Global.ResetDataPtr->Perf.MetaData.FilterMask) #define CFE_ES_PERF_FILTERMASK_EXT_SIZE \ - (sizeof(CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask) / sizeof(uint32)) + CFE_ES_PERF_MASK_ARRAY_SIZE(CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask) /* ** This define should be put in the OS API headers -- Right now it matches what the OS API uses From 3cd97e9c68baa5f094a21e060e6680ec2397a464 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 20 Jan 2022 08:59:25 -0700 Subject: [PATCH 030/200] Fix #2032, Add CFE_ES_AppInfo_t element documentation --- .../core_api/fsw/inc/cfe_es_extern_typedefs.h | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h index ed0043c96..2233f5f79 100644 --- a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h @@ -434,10 +434,8 @@ typedef uint32 CFE_ES_MemAddress_t; */ typedef struct CFE_ES_MemAddOff { - CFE_ES_MemAddress_t Address; - - CFE_ES_MemOffset_t Size; - + CFE_ES_MemAddress_t Address; /**< \brief Code section address */ + CFE_ES_MemOffset_t Size; /**< \brief Code section size */ } CFE_ES_MemAddOff_t; /* @@ -468,16 +466,13 @@ typedef struct CFE_ES_AppInfo char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \cfetlmmnemonic \ES_APPFILENAME \brief The Filename of the file containing the Application */ - CFE_ES_MemOffset_t StackSize; /**< \cfetlmmnemonic \ES_STACKSIZE - \brief The Stack Size of the Application */ - uint32 AddressesAreValid; /**< \cfetlmmnemonic \ES_ADDRVALID - \brief Indicates that the Code, Data, and BSS addresses/sizes are valid */ - CFE_ES_MemAddOff_t Code; - - CFE_ES_MemAddOff_t Data; - - CFE_ES_MemAddOff_t BSS; - + CFE_ES_MemOffset_t StackSize; /**< \cfetlmmnemonic \ES_STACKSIZE + \brief The Stack Size of the Application */ + uint32 AddressesAreValid; /**< \cfetlmmnemonic \ES_ADDRVALID + \brief Indicates that the Code, Data, and BSS addresses/sizes are valid */ + CFE_ES_MemAddOff_t Code; /**< \brief code section address/size structure */ + CFE_ES_MemAddOff_t Data; /**< \brief Data section address/size structure */ + CFE_ES_MemAddOff_t BSS; /**< \brief BSS section address/size structure */ CFE_ES_MemAddress_t StartAddress; /**< \cfetlmmnemonic \ES_STARTADDR \brief The Start Address of the Application */ CFE_ES_ExceptionAction_Enum_t ExceptionAction; /**< \cfetlmmnemonic \ES_EXCEPTNACTN From b4fb004e58f4da0cbb1de562fc9829ad54fd554d Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:49:45 -0500 Subject: [PATCH 031/200] Bump to v7.0.0-rc4+dev60 --- README.md | 15 ++++++++++++++- modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42d420523..a96f9e56a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,20 @@ This is a collection of services and associated framework to be located in the ` The detailed cFE user's guide can be viewed at . -## Version History +## Changelog + +### Development Build: v7.0.0-rc4+dev60 + +- Add CFE_ES_AppInfo_t element documentation +- Add FS Functional test +- Fix mismatched foreach in cmake function +- Improved code highlighting in cFE Application Developers Guide +- CFE_FS_ParseInputFileNameEx avoid uninit var +- Fix array length calculation for perf structs +- Limit SBR UT loops +- Initialize BlockData in ES UT +- Fix `osal_id_t` type conversion in `es_UT.c` +- See and ### Development Build: v7.0.0-rc4+dev39 diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 81bd120a9..d6322dde2 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 39 /**< @brief Development: Number of development commits since baseline */ +#define CFE_BUILD_NUMBER 60 /**< @brief Development: Number of development commits since baseline */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* Version Macro Definitions updated for official releases only */ From 45c0ae6d8f8ca396f4fed3a9e887a660886310f1 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 25 Jan 2022 16:04:54 -0700 Subject: [PATCH 032/200] Fix #2036, Revert breaking change to CFE_ES_AppInfo_t structure --- docs/src/mnem_maps/cfe_es_tlm_mnem_map | 6 +++ modules/cfe_testcase/src/es_info_test.c | 37 +++++++++---------- .../core_api/fsw/inc/cfe_es_extern_typedefs.h | 26 ++++++------- modules/es/eds/cfe_es.xml | 30 +++++++++++++++ modules/es/fsw/src/cfe_es_apps.c | 14 +++---- 5 files changed, 73 insertions(+), 40 deletions(-) diff --git a/docs/src/mnem_maps/cfe_es_tlm_mnem_map b/docs/src/mnem_maps/cfe_es_tlm_mnem_map index e847477a9..e76b8701d 100644 --- a/docs/src/mnem_maps/cfe_es_tlm_mnem_map +++ b/docs/src/mnem_maps/cfe_es_tlm_mnem_map @@ -68,6 +68,12 @@ ES_APPFILENAME=$sc_$cpu_ES_AppFilename[OS_MAX_PATH_LEN] \ ES_STACKSIZE=$sc_$cpu_ES_StackSize \ ES_MODULEID=$sc_$cpu_ES_ModuleID \ ES_ADDRVALID=$sc_$cpu_ES_AddrsValid \ +ES_CODEADDR=$sc_$cpu_ES_CodeAddress \ +ES_CODESIZE=$sc_$cpu_ES_CodeSize \ +ES_DATAADDR=$sc_$cpu_ES_DataAddress \ +ES_DATASIZE=$sc_$cpu_ES_DataSize \ +ES_BSSADDR=$sc_$cpu_ES_BSSAddress \ +ES_BSSSIZE=$sc_$cpu_ES_BSSSize \ ES_STARTADDR=$sc_$cpu_ES_StartAddr \ ES_EXCEPTNACTN=$sc_$cpu_ES_ExceptnActn \ ES_PRIORITY=$sc_$cpu_ES_Priority \ diff --git a/modules/cfe_testcase/src/es_info_test.c b/modules/cfe_testcase/src/es_info_test.c index 632cdce67..27990fbde 100644 --- a/modules/cfe_testcase/src/es_info_test.c +++ b/modules/cfe_testcase/src/es_info_test.c @@ -79,20 +79,19 @@ void TestAppInfo(void) if (TestAppInfo.AddressesAreValid) { - UtAssert_True(TestAppInfo.AddressesAreValid > 0, "Test App Info -> Addrs.Valid? = %d", + UtAssert_True(TestAppInfo.AddressesAreValid > 0, "Test App Info -> AddrsValid? = %d", (int)TestAppInfo.AddressesAreValid); - UtAssert_True(TestAppInfo.Code.Address > 0, "Test App Info -> Code.Address = %ld", - (unsigned long)TestAppInfo.Code.Address); - UtAssert_True(TestAppInfo.Code.Size > 0, "Test App Info -> Code.Size = %ld", - (unsigned long)TestAppInfo.Code.Size); - UtAssert_True(TestAppInfo.Data.Address > 0, "Test App Info -> Data.Address = %ld", - (unsigned long)TestAppInfo.Data.Address); - UtAssert_True(TestAppInfo.Data.Size > 0, "Test App Info -> Data.Size = %ld", - (unsigned long)TestAppInfo.Data.Size); - UtAssert_True(TestAppInfo.BSS.Address > 0, "Test App Info -> BSS.Address = %ld", - (unsigned long)TestAppInfo.BSS.Address); - UtAssert_True(TestAppInfo.BSS.Size > 0, "Test App Info -> BSS.Size = %ld", - (unsigned long)TestAppInfo.BSS.Size); + UtAssert_True(TestAppInfo.CodeAddress > 0, "Test App Info -> CodeAddress = %ld", + (unsigned long)TestAppInfo.CodeAddress); + UtAssert_True(TestAppInfo.CodeSize > 0, "Test App Info -> CodeSize = %ld", + (unsigned long)TestAppInfo.CodeSize); + UtAssert_True(TestAppInfo.DataAddress > 0, "Test App Info -> DataAddress = %ld", + (unsigned long)TestAppInfo.DataAddress); + UtAssert_True(TestAppInfo.DataSize > 0, "Test App Info -> DataSize = %ld", + (unsigned long)TestAppInfo.DataSize); + UtAssert_True(TestAppInfo.BSSAddress > 0, "Test App Info -> BSSAddress = %ld", + (unsigned long)TestAppInfo.BSSAddress); + UtAssert_True(TestAppInfo.BSSSize > 0, "Test App Info -> BSSSize = %ld", (unsigned long)TestAppInfo.BSSSize); } else { @@ -191,12 +190,12 @@ void TestLibInfo(void) { UtAssert_True(LibInfo.AddressesAreValid > 0, "Lib Info -> AddrsValid? = %ld", (unsigned long)LibInfo.AddressesAreValid); - UtAssert_True(LibInfo.Code.Address > 0, "Lib Info -> CodeAddress = %ld", (unsigned long)LibInfo.Code.Address); - UtAssert_True(LibInfo.Code.Size > 0, "Lib Info -> Code.Size = %ld", (unsigned long)LibInfo.Code.Size); - UtAssert_True(LibInfo.Data.Address > 0, "Lib Info -> Data.Address = %ld", (unsigned long)LibInfo.Data.Address); - UtAssert_True(LibInfo.Data.Size > 0, "Lib Info -> Data.Size = %ld", (unsigned long)LibInfo.Data.Size); - UtAssert_True(LibInfo.BSS.Address > 0, "Lib Info -> BSS.Address = %ld", (unsigned long)LibInfo.BSS.Address); - UtAssert_True(LibInfo.BSS.Size > 0, "Lib Info -> BSS.Size = %ld", (unsigned long)LibInfo.BSS.Size); + UtAssert_True(LibInfo.CodeAddress > 0, "Lib Info -> CodeAddress = %ld", (unsigned long)LibInfo.CodeAddress); + UtAssert_True(LibInfo.CodeSize > 0, "Lib Info -> CodeSize = %ld", (unsigned long)LibInfo.CodeSize); + UtAssert_True(LibInfo.DataAddress > 0, "Lib Info -> DataAddress = %ld", (unsigned long)LibInfo.DataAddress); + UtAssert_True(LibInfo.DataSize > 0, "Lib Info -> DataSize = %ld", (unsigned long)LibInfo.DataSize); + UtAssert_True(LibInfo.BSSAddress > 0, "Lib Info -> BSSAddress = %ld", (unsigned long)LibInfo.BSSAddress); + UtAssert_True(LibInfo.BSSSize > 0, "Lib Info -> BSSSize = %ld", (unsigned long)LibInfo.BSSSize); } else { diff --git a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h index 2233f5f79..0d1949c27 100644 --- a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h @@ -427,17 +427,6 @@ typedef uint32 CFE_ES_MemAddress_t; */ #define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x)&0xFFFFFFFF)) -/** - * Memory Address and Memory Offset combination - * - * A combination of #CFE_ES_MemAddress_t and #CFE_ES_MemOffset_t, since they are often used together. - */ -typedef struct CFE_ES_MemAddOff -{ - CFE_ES_MemAddress_t Address; /**< \brief Code section address */ - CFE_ES_MemOffset_t Size; /**< \brief Code section size */ -} CFE_ES_MemAddOff_t; - /* * Data Structures shared between API and Message (CMD/TLM) interfaces */ @@ -470,9 +459,18 @@ typedef struct CFE_ES_AppInfo \brief The Stack Size of the Application */ uint32 AddressesAreValid; /**< \cfetlmmnemonic \ES_ADDRVALID \brief Indicates that the Code, Data, and BSS addresses/sizes are valid */ - CFE_ES_MemAddOff_t Code; /**< \brief code section address/size structure */ - CFE_ES_MemAddOff_t Data; /**< \brief Data section address/size structure */ - CFE_ES_MemAddOff_t BSS; /**< \brief BSS section address/size structure */ + CFE_ES_MemAddress_t CodeAddress; /**< \cfetlmmnemonic \ES_CODEADDR + \brief The Address of the Application Code Segment*/ + CFE_ES_MemOffset_t CodeSize; /**< \cfetlmmnemonic \ES_CODESIZE + \brief The Code Size of the Application */ + CFE_ES_MemAddress_t DataAddress; /**< \cfetlmmnemonic \ES_DATAADDR + \brief The Address of the Application Data Segment*/ + CFE_ES_MemOffset_t DataSize; /**< \cfetlmmnemonic \ES_DATASIZE + \brief The Data Size of the Application */ + CFE_ES_MemAddress_t BSSAddress; /**< \cfetlmmnemonic \ES_BSSADDR + \brief The Address of the Application BSS Segment*/ + CFE_ES_MemOffset_t BSSSize; /**< \cfetlmmnemonic \ES_BSSSIZE + \brief The BSS Size of the Application */ CFE_ES_MemAddress_t StartAddress; /**< \cfetlmmnemonic \ES_STARTADDR \brief The Start Address of the Application */ CFE_ES_ExceptionAction_Enum_t ExceptionAction; /**< \cfetlmmnemonic \ES_EXCEPTNACTN diff --git a/modules/es/eds/cfe_es.xml b/modules/es/eds/cfe_es.xml index f32537039..2e4bdf978 100644 --- a/modules/es/eds/cfe_es.xml +++ b/modules/es/eds/cfe_es.xml @@ -173,6 +173,36 @@ \cfetlmmnemonic \ES_ADDRVALID + + + \cfetlmmnemonic \ES_CODEADDR + + + + + \cfetlmmnemonic \ES_CODESIZE + + + + + \cfetlmmnemonic \ES_DATAADDR + + + + + \cfetlmmnemonic \ES_DATASIZE + + + + + \cfetlmmnemonic \ES_BSSADDR + + + + + \cfetlmmnemonic \ES_BSSSIZE + + \cfetlmmnemonic \ES_STARTADDR diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 35e8f3cb0..8d583fcb3 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -1791,7 +1791,7 @@ void CFE_ES_CopyModuleAddressInfo(osal_id_t ModuleId, CFE_ES_AppInfo_t *AppInfoP if (OsStatus == OS_SUCCESS) { AppInfoPtr->AddressesAreValid = - (sizeof(ModuleInfo.addr.code_address) <= sizeof(AppInfoPtr->Code.Address)) && ModuleInfo.addr.valid; + (sizeof(ModuleInfo.addr.code_address) <= sizeof(AppInfoPtr->CodeAddress)) && ModuleInfo.addr.valid; } else { @@ -1803,10 +1803,10 @@ void CFE_ES_CopyModuleAddressInfo(osal_id_t ModuleId, CFE_ES_AppInfo_t *AppInfoP * Convert the internal size and address to the telemetry format. * (The telemetry format may be a different bitwidth than the native processor) */ - AppInfoPtr->Code.Address = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.code_address); - AppInfoPtr->Code.Size = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.code_size); - AppInfoPtr->Data.Address = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.data_address); - AppInfoPtr->Data.Size = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.data_size); - AppInfoPtr->BSS.Address = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.bss_address); - AppInfoPtr->BSS.Size = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.bss_size); + AppInfoPtr->CodeAddress = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.code_address); + AppInfoPtr->CodeSize = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.code_size); + AppInfoPtr->DataAddress = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.data_address); + AppInfoPtr->DataSize = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.data_size); + AppInfoPtr->BSSAddress = CFE_ES_MEMADDRESS_C(ModuleInfo.addr.bss_address); + AppInfoPtr->BSSSize = CFE_ES_MEMOFFSET_C(ModuleInfo.addr.bss_size); } From a5f27e8fa5a41085d48464cac53aeb5aae683a32 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Fri, 28 Jan 2022 18:00:55 -0700 Subject: [PATCH 033/200] Fix #2040, Improve CFE_SB_IsValidMsgId handler If no return value override is set test against CFE_SB_INVALID_MSG_ID --- modules/core_api/ut-stubs/src/cfe_sb_handlers.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/core_api/ut-stubs/src/cfe_sb_handlers.c b/modules/core_api/ut-stubs/src/cfe_sb_handlers.c index 2e245748e..5e0ec1bf9 100644 --- a/modules/core_api/ut-stubs/src/cfe_sb_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_sb_handlers.c @@ -398,12 +398,19 @@ void UT_DefaultHandler_CFE_SB_GetUserDataLength(void *UserObj, UT_EntryKey_t Fun *------------------------------------------------------------*/ void UT_DefaultHandler_CFE_SB_IsValidMsgId(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) { - int32 status; - bool return_value; - - UT_Stub_GetInt32StatusCode(Context, &status); + int32 status; + bool return_value; + CFE_SB_MsgId_t MsgId = UT_Hook_GetArgValueByName(Context, "MsgId", CFE_SB_MsgId_t); - return_value = status; + if (UT_Stub_GetInt32StatusCode(Context, &status)) + { + return_value = status; + } + else + { + /* The only invalid value UT's should be using is CFE_SB_INVALID_MSG_ID */ + return_value = !CFE_SB_MsgId_Equal(MsgId, CFE_SB_INVALID_MSG_ID); + } UT_Stub_SetReturnValue(FuncKey, return_value); } From df5d2c0f5807e5cceedcb9c928e5ea412db5b42f Mon Sep 17 00:00:00 2001 From: paulober <44974737+paulober@users.noreply.github.com> Date: Sun, 30 Jan 2022 13:21:40 +0100 Subject: [PATCH 034/200] Fix #2039, Replace CFE_SB_ValueToMsgId(0) with CFE_SB_INVALID_MSG_ID --- modules/cfe_testcase/src/message_id_test.c | 2 +- modules/cfe_testcase/src/msg_api_test.c | 4 ++-- modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c | 2 +- modules/msg/ut-coverage/test_cfe_msg_init.c | 4 ++-- modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c | 2 +- modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c | 6 +++--- modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c | 6 +++--- modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c | 6 +++--- modules/tbl/fsw/src/cfe_tbl_task.c | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/cfe_testcase/src/message_id_test.c b/modules/cfe_testcase/src/message_id_test.c index 2956c2895..28e53bbca 100644 --- a/modules/cfe_testcase/src/message_id_test.c +++ b/modules/cfe_testcase/src/message_id_test.c @@ -67,7 +67,7 @@ void TestMsgId(void) void TestGetTypeFromMsgId(void) { UtPrintf("Testing: CFE_MSG_GetTypeFromMsgId"); - CFE_SB_MsgId_t msgid = CFE_SB_ValueToMsgId(0); + CFE_SB_MsgId_t msgid = CFE_SB_INVALID_MSG_ID; CFE_MSG_Type_t msgtype; int32 status; diff --git a/modules/cfe_testcase/src/msg_api_test.c b/modules/cfe_testcase/src/msg_api_test.c index 9d1452e8b..ddf098070 100644 --- a/modules/cfe_testcase/src/msg_api_test.c +++ b/modules/cfe_testcase/src/msg_api_test.c @@ -53,7 +53,7 @@ void TestMsgApiBasic(void) msgId = CFE_SB_ValueToMsgId(1); /* test msg-init */ - UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_INVALID_MSG_ID, sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), msgId, 0), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ( CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), sizeof(cmd)), @@ -139,7 +139,7 @@ void TestMsgApiAdvanced(void) CFE_MSG_SequenceCount_t seqCnt; memset(&cmd, 0xFF, sizeof(cmd)); - msgId = CFE_SB_ValueToMsgId(0); + msgId = CFE_SB_INVALID_MSG_ID; UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), msgId, sizeof(cmd)), CFE_SUCCESS); diff --git a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c index 7003bc5c3..5767403e1 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c @@ -61,7 +61,7 @@ void Test_MSG_Init_Ext(void) /* Get msgid version by checking if msgid sets "has secondary" field*/ memset(&msg, 0xFF, sizeof(msg)); - CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0))); + CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_INVALID_MSG_ID)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec)); is_v1 = !hassec; diff --git a/modules/msg/ut-coverage/test_cfe_msg_init.c b/modules/msg/ut-coverage/test_cfe_msg_init.c index bfa67591e..5d9aa201e 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_init.c +++ b/modules/msg/ut-coverage/test_cfe_msg_init.c @@ -54,8 +54,8 @@ void Test_MSG_Init(void) bool is_v1; UtPrintf("Bad parameter tests, Null pointer, invalid size, invalid msgid"); - UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(0), 0), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_INVALID_MSG_ID, sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_INVALID_MSG_ID, 0), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ( CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c index 65151ab22..5ed169d71 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c @@ -37,7 +37,7 @@ void Test_MSG_GetTypeFromMsgId(void) { CFE_MSG_Message_t msg; - CFE_SB_MsgId_t msgid = CFE_SB_ValueToMsgId(0); + CFE_SB_MsgId_t msgid = CFE_SB_INVALID_MSG_ID; CFE_MSG_Type_t actual = CFE_MSG_Type_Invalid; UtPrintf("Bad parameter tests, Null pointer"); diff --git a/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c index b5349ac9d..6e5cc0451 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c @@ -48,8 +48,8 @@ void Test_SBR_Map_Direct(void) uint32 i; UtPrintf("Invalid msg checks"); - UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); - UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0)))); + UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_INVALID_MSG_ID, CFE_SBR_ValueToRouteId(0)), 0); + UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_INVALID_MSG_ID))); UtPrintf("Initialize map"); CFE_SBR_Init_Map(); @@ -83,7 +83,7 @@ void Test_SBR_Map_Direct(void) UtPrintf("Set/Get a range of ids "); routeid = CFE_SBR_ValueToRouteId(CFE_PLATFORM_SB_MAX_MSG_IDS + 1); - msgid = CFE_SB_ValueToMsgId(0); + msgid = CFE_SB_INVALID_MSG_ID; UtAssert_INT32_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); UtAssert_INT32_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); diff --git a/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c index 16e4b50ea..f7f20fc08 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c @@ -67,8 +67,8 @@ void Test_SBR_Map_Hash(void) uint32 collisions; UtPrintf("Invalid msg checks"); - UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); - UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0)))); + UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_INVALID_MSG_ID, CFE_SBR_ValueToRouteId(0)), 0); + UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_INVALID_MSG_ID))); UtPrintf("Initialize routing and map"); CFE_SBR_Init(); @@ -102,7 +102,7 @@ void Test_SBR_Map_Hash(void) /* Note AddRoute required for hash logic to work since it depends on MsgId in routing table */ UtPrintf("Add routes and check with a rollover and a skip"); - msgid[0] = CFE_SB_ValueToMsgId(0); + msgid[0] = CFE_SB_INVALID_MSG_ID; msgid[1] = Test_SBR_Unhash(0xFFFFFFFF); msgid[2] = Test_SBR_Unhash(0x7FFFFFFF); routeid[0] = CFE_SBR_AddRoute(msgid[0], &collisions); diff --git a/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c b/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c index fe0247557..f7a1557ad 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c @@ -51,8 +51,8 @@ void Test_SBR_Route_Unsort_General(void) CFE_SBR_Init(); UtPrintf("Invalid msg checks"); - UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), NULL))); - UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), &collisions))); + UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_INVALID_MSG_ID, NULL))); + UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_INVALID_MSG_ID, &collisions))); UtAssert_INT32_EQ(collisions, 0); /* @@ -159,7 +159,7 @@ void Test_SBR_Route_Unsort_GetSet(void) UtAssert_INT32_EQ(count, 0); UtPrintf("Add routes and initialize values for testing"); - msgid[0] = CFE_SB_ValueToMsgId(0); + msgid[0] = CFE_SB_INVALID_MSG_ID; msgid[1] = CFE_SB_ValueToMsgId(1); msgid[2] = CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); diff --git a/modules/tbl/fsw/src/cfe_tbl_task.c b/modules/tbl/fsw/src/cfe_tbl_task.c index 86ee8ea82..84cea795d 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.c +++ b/modules/tbl/fsw/src/cfe_tbl_task.c @@ -245,7 +245,7 @@ void CFE_TBL_InitData(void) sizeof(CFE_TBL_Global.TblRegPacket)); /* Message ID is set when sent, so OK as 0 here */ - CFE_MSG_Init(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), CFE_SB_ValueToMsgId(0), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), CFE_SB_INVALID_MSG_ID, sizeof(CFE_TBL_Global.NotifyMsg)); } From 81b3a9ca32af1184160e9ca3f6ad554a45deed74 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Mon, 24 Jan 2022 11:46:52 -0500 Subject: [PATCH 035/200] Fix #2034, Fix git error in CodeQL workflow - Add new parameters to match updated cFS-CodeQL workflow interface introduced in nasa/cFS#413 - Add file-exclusion checks to Action trigger so workflow doesn't run if only changes in commit or pull request are to documentation --- .github/workflows/codeql-build.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 21b4a1db4..8cce99cb4 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -2,12 +2,21 @@ name: "CodeQL Analysis" on: push: + paths-ignore: + - '**/*.md' + - '**/*.txt' + - '**/*.dox' + pull_request: - + paths-ignore: + - '**/*.md' + - '**/*.txt' + - '**/*.dox' + jobs: codeql: - name: CodeQL Analysis - uses: nasa/cFS/.github/workflows/codeql-build.yml@main + uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main with: - make-prep: 'make prep' - make: 'make -C build/native/default_cpu1 core_api core_private es evs fs msg resourceid sb sbr tbl time' \ No newline at end of file + component-path: cfe + make: make -j8 + test: true From a022e0f2aec9af93040b91aeb6e68990cc8c02e4 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Thu, 3 Feb 2022 15:42:52 -0500 Subject: [PATCH 036/200] Bump to v7.0.0-rc4+dev70 --- README.md | 8 ++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a96f9e56a..e5218e484 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ The detailed cFE user's guide can be viewed at and + + ### Development Build: v7.0.0-rc4+dev60 - Add CFE_ES_AppInfo_t element documentation diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index d6322dde2..7d127dd50 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 60 /**< @brief Development: Number of development commits since baseline */ +#define CFE_BUILD_NUMBER 70 /**< @brief Development: Number of development commits since baseline */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* Version Macro Definitions updated for official releases only */ From f166a0a5a5c70bcfb91a5b67a9d518707f8088f1 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 10 Feb 2022 07:30:34 -0700 Subject: [PATCH 037/200] Fix #2047, Add CFE_ES_CreateChildTask default handler --- .../core_api/ut-stubs/src/cfe_es_handlers.c | 34 +++++++++++++++++++ modules/core_api/ut-stubs/src/cfe_es_stubs.c | 3 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/modules/core_api/ut-stubs/src/cfe_es_handlers.c b/modules/core_api/ut-stubs/src/cfe_es_handlers.c index 08cc6a17e..956ae12a6 100644 --- a/modules/core_api/ut-stubs/src/cfe_es_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_es_handlers.c @@ -116,6 +116,40 @@ static const cpuaddr UT_ESPOOL_ALIGN_MASK = ((cpuaddr) & ((struct UT_AlignTest * ** Functions */ +/*------------------------------------------------------------ + * + * Default handler for CFE_ES_CreateChildTask coverage stub function + * + *------------------------------------------------------------*/ +void UT_DefaultHandler_CFE_ES_CreateChildTask(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) +{ + CFE_ES_TaskId_t *TaskIdPtr = UT_Hook_GetArgValueByName(Context, "TaskIdPtr", CFE_ES_TaskId_t *); + int32 status; + void * IdBuff; + size_t BuffSize; + size_t Position; + + UT_Stub_GetInt32StatusCode(Context, &status); + + if (status >= 0) + { + UT_GetDataBuffer(UT_KEY(CFE_ES_GetAppID), &IdBuff, &BuffSize, &Position); + if (IdBuff != NULL && BuffSize == sizeof(*TaskIdPtr)) + { + memcpy(TaskIdPtr, IdBuff, sizeof(*TaskIdPtr)); + } + else + { + *TaskIdPtr = CFE_UT_ES_DEFAULT_TASKID; + } + } + + if (status < 0) + { + *TaskIdPtr = CFE_ES_TASKID_UNDEFINED; + } +} + /*------------------------------------------------------------ * * Default handler for CFE_ES_GetAppID coverage stub function diff --git a/modules/core_api/ut-stubs/src/cfe_es_stubs.c b/modules/core_api/ut-stubs/src/cfe_es_stubs.c index 5a1a75c2c..bfdb92d2c 100644 --- a/modules/core_api/ut-stubs/src/cfe_es_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_es_stubs.c @@ -31,6 +31,7 @@ void UT_DefaultHandler_CFE_ES_AppID_ToIndex(void *, UT_EntryKey_t, const UT_StubContext_t *); void UT_DefaultHandler_CFE_ES_CopyToCDS(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_ES_CreateChildTask(void *, UT_EntryKey_t, const UT_StubContext_t *); void UT_DefaultHandler_CFE_ES_ExitApp(void *, UT_EntryKey_t, const UT_StubContext_t *); void UT_DefaultHandler_CFE_ES_GetAppID(void *, UT_EntryKey_t, const UT_StubContext_t *); void UT_DefaultHandler_CFE_ES_GetAppIDByName(void *, UT_EntryKey_t, const UT_StubContext_t *); @@ -146,7 +147,7 @@ CFE_Status_t CFE_ES_CreateChildTask(CFE_ES_TaskId_t *TaskIdPtr, const char *Task UT_GenStub_AddParam(CFE_ES_CreateChildTask, CFE_ES_TaskPriority_Atom_t, Priority); UT_GenStub_AddParam(CFE_ES_CreateChildTask, uint32, Flags); - UT_GenStub_Execute(CFE_ES_CreateChildTask, Basic, NULL); + UT_GenStub_Execute(CFE_ES_CreateChildTask, Basic, UT_DefaultHandler_CFE_ES_CreateChildTask); return UT_GenStub_GetReturnValue(CFE_ES_CreateChildTask, CFE_Status_t); } From 48bb886e199906590fc6c2224ebae34850e57725 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 17 Feb 2022 14:22:47 -0700 Subject: [PATCH 038/200] Fix #2049, Remove explicit filename doxygen comments --- cmake/target/src/target_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/target/src/target_config.c b/cmake/target/src/target_config.c index ac974c3ca..8b7e0d52c 100644 --- a/cmake/target/src/target_config.c +++ b/cmake/target/src/target_config.c @@ -19,7 +19,7 @@ */ /** - * \file target_config.c + * \file * * Created on: Dec 3, 2013 * Created by: joseph.p.hickey@nasa.gov From 30a4c4e835712955f6776a207678941950ac0a08 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 17 Feb 2022 16:12:43 -0700 Subject: [PATCH 039/200] Fix #2051, Resolve doxygen doc warnings and enforce in CI --- .github/workflows/build-documentation.yml | 9 +++++++++ cmake/cfe-common.doxyfile.in | 4 ++++ modules/sb/fsw/src/cfe_sb_priv.h | 6 +++--- modules/tbl/fsw/src/cfe_tbl_task.h | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 717c2e41d..86e646a16 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -60,6 +60,7 @@ jobs: - name: Build Docs run: | make doc > make_doc_stdout.txt 2> make_doc_stderr.txt + mv build/docs/detaildesign-warnings.log detaildesign-warnings.log # Upload documentation logs as artifacts - name: Archive Documentation Build Logs @@ -69,6 +70,7 @@ jobs: path: | make_doc_stdout.txt make_doc_stderr.txt + detaildesign-warnings.log - name: Error Check run: | @@ -77,6 +79,13 @@ jobs: exit -1 fi + - name: Warning Check + run: | + if [[ -s detaildesign-warnings.log ]]; then + cat detaildesign-warnings.log + exit -1 + fi + build-usersguide: #Continue if check-for-duplicates found no duplicates. Always runs for pull-requests. needs: check-for-duplicates diff --git a/cmake/cfe-common.doxyfile.in b/cmake/cfe-common.doxyfile.in index 68944bb60..87294c067 100644 --- a/cmake/cfe-common.doxyfile.in +++ b/cmake/cfe-common.doxyfile.in @@ -80,6 +80,10 @@ EXCLUDE_PATTERNS += "*/ut-stubs/*" EXCLUDE_PATTERNS += "*/ut-coverage/*" EXCLUDE_PATTERNS += "*/unit-test*/*" +# Exclude contributing guides and readme's since they stand alone as repo documentation +EXCLUDE_PATTERNS += "*/CONTRIBUTING.md" +EXCLUDE_PATTERNS += "*/README.md" + #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- diff --git a/modules/sb/fsw/src/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h index f46669726..5c19c72f4 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -693,7 +693,7 @@ int32 CFE_SB_ZeroCopyBufferValidate(CFE_SB_Buffer_t *BufPtr, CFE_SB_BufferD_t ** * \note Assumes destination pointer is valid * * \param[in] RouteId The route ID to add destination node to - * \param[in] DestPtr Pointer to the destination to add + * \param[in] NewNode Pointer to the destination to add */ int32 CFE_SB_AddDestNode(CFE_SBR_RouteId_t RouteId, CFE_SB_DestinationD_t *NewNode); @@ -705,8 +705,8 @@ int32 CFE_SB_AddDestNode(CFE_SBR_RouteId_t RouteId, CFE_SB_DestinationD_t *NewNo * * \note Assumes destination pointer is valid and in route * - * \param[in] RouteId The route ID to remove destination node from - * \param[in] DestPtr Pointer to the destination to remove + * \param[in] RouteId The route ID to remove destination node from + * \param[in] NodeToRemove Pointer to the destination to remove */ void CFE_SB_RemoveDestNode(CFE_SBR_RouteId_t RouteId, CFE_SB_DestinationD_t *NodeToRemove); diff --git a/modules/tbl/fsw/src/cfe_tbl_task.h b/modules/tbl/fsw/src/cfe_tbl_task.h index ed0fb49ea..6e40ba10e 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.h +++ b/modules/tbl/fsw/src/cfe_tbl_task.h @@ -402,7 +402,7 @@ int32 CFE_TBL_TaskInit(void); ** \par Assumptions, External Events, and Notes: ** None ** -** \param[in] MessagePtr a pointer to the message received from the command pipe +** \param[in] SBBufPtr Pointer to the message received from the command pipe ** */ void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); From d40525390e6e509a4d2094d8b0601718285ee018 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 23 Feb 2022 07:54:19 -0700 Subject: [PATCH 040/200] Fix #2054, Missing SB include for v2 msgid --- modules/msg/fsw/src/cfe_msg_msgid_v2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/msg/fsw/src/cfe_msg_msgid_v2.c b/modules/msg/fsw/src/cfe_msg_msgid_v2.c index c3093dca5..67b6f4f21 100644 --- a/modules/msg/fsw/src/cfe_msg_msgid_v2.c +++ b/modules/msg/fsw/src/cfe_msg_msgid_v2.c @@ -40,6 +40,7 @@ #include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_error.h" +#include "cfe_sb.h" #include "cfe_platform_cfg.h" /* cFS MsgId definitions */ From e48c04920ec39bc8de6d2e6ad514b65ba04b1edc Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:18:16 -0500 Subject: [PATCH 041/200] Bump to v7.0.0-rc4+dev80 Part of IC:Caelum+dev4, nasa/cFS#432 **Includes** PR #2056 - Missing SB include for v2 msgid PR #2052 - Resolve doxygen doc warnings and enforce in CI PR #2050 - Remove explicit filename doxygen comments PR #2048 - Add CFE_ES_CreateChildTask default handler --- README.md | 8 ++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e5218e484..34583defe 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ The detailed cFE user's guide can be viewed at and + ### Development Build: v7.0.0-rc4+dev70 - Improve CFE_SB_IsValidMsgId handler diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 7d127dd50..77d468f48 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 70 /**< @brief Development: Number of development commits since baseline */ +#define CFE_BUILD_NUMBER 80 /**< @brief Development: Number of development commits since baseline */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* Version Macro Definitions updated for official releases only */ From 68fb06eaccd18b9047253310d3cc1e4bdb5b0046 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 23 Feb 2022 07:36:30 -0700 Subject: [PATCH 042/200] Fix #2055, Refactor doxygen mainpage into frontpage --- cmake/cfe-common.doxyfile.in | 96 +++--------------------- cmake/cfe-usersguide.doxyfile.in | 18 ++--- cmake/mission-detaildesign.doxyfile.in | 24 +++++- cmake/mission_build.cmake | 8 +- docs/src/{main.dox => cfe_frontpage.dox} | 2 +- docs/src/ddd_main.dox | 58 -------------- 6 files changed, 42 insertions(+), 164 deletions(-) rename docs/src/{main.dox => cfe_frontpage.dox} (99%) delete mode 100644 docs/src/ddd_main.dox diff --git a/cmake/cfe-common.doxyfile.in b/cmake/cfe-common.doxyfile.in index 87294c067..c620a3795 100644 --- a/cmake/cfe-common.doxyfile.in +++ b/cmake/cfe-common.doxyfile.in @@ -1,19 +1,9 @@ #--------------------------------------------------------------------------- -# Project related configuration options, shared for all cFE doxygen outputs +# CFE common setup for including in stand alone or mission documentation #--------------------------------------------------------------------------- -@INCLUDE_PATH = @MISSION_SOURCE_DIR@ -ABBREVIATE_BRIEF = "The $name class " \ - "The $name widget " \ - "The $name file " \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -TAB_SIZE = 8 + +PREDEFINED += @CFEDOC_PREDEFINED@ + ALIASES += "cfeescfg=\xrefitem cfeescfg \"Purpose\" \"cFE Executive Services Configuration Parameters\" " \ "cfeevscfg=\xrefitem cfeevscfg \"Purpose\" \"cFE Event Services Configuration Parameters\" " \ "cfetblcfg=\xrefitem cfetblcfg \"Purpose\" \"cFE Table Services Configuration Parameters\" " \ @@ -34,33 +24,11 @@ ALIASES += "cfeescfg=\xrefitem cfeescfg \"Purpose\" \"cFE Executiv "cfecmdmnemonic=\xrefitem cfecmdmnems \"Command Mnemonic(s)\" \"cFE Command Mnemonic Cross Reference\" " \ "cfetlmmnemonic=\xrefitem cfetlmmnems \"Telemetry Mnemonic(s)\" \"cFE Telemetry Mnemonic Cross Reference\" " -ALIASES += nonnull="(must not be null)" -ALIASES += nonzero="(must not be zero)" -ALIASES += covtest="(return value only verified in coverage test)" - -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 -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -WARN_NO_PARAMDOC = YES -#--------------------------------------------------------------------------- -# 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 IMAGE_PATH += @MISSION_SOURCE_DIR@/cfe/docs/src + +# Front documentation material +INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfe_frontpage.dox INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfe_glossary.dox INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfs_versions.dox INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfe_api.dox @@ -71,55 +39,13 @@ INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfe_tbl.dox INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfe_time.dox INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfe_xref.dox -FILE_PATTERNS = *.c *.cpp *.cc *.C *.h *.hh *.hpp *.H *.dox *.md -RECURSIVE = YES -EXAMPLE_PATTERNS = * - -# Exclude coverage tests, stubs and associated framework from the documentation -EXCLUDE_PATTERNS += "*/ut-stubs/*" -EXCLUDE_PATTERNS += "*/ut-coverage/*" -EXCLUDE_PATTERNS += "*/unit-test*/*" +# Public headers +INPUT += @MISSION_USERGUIDE_HEADERFILES@ -# Exclude contributing guides and readme's since they stand alone as repo documentation -EXCLUDE_PATTERNS += "*/CONTRIBUTING.md" -EXCLUDE_PATTERNS += "*/README.md" +# Strip mission from path +STRIP_FROM_PATH += @MISSION_SOURCE_DIR@ -#--------------------------------------------------------------------------- -# 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 -#--------------------------------------------------------------------------- # CFE mnemonic mappings -#--------------------------------------------------------------------------- @INCLUDE = @MISSION_SOURCE_DIR@/cfe/docs/src/mnem_maps/cfe_es_cmd_mnem_map @INCLUDE = @MISSION_SOURCE_DIR@/cfe/docs/src/mnem_maps/cfe_es_tlm_mnem_map @INCLUDE = @MISSION_SOURCE_DIR@/cfe/docs/src/mnem_maps/cfe_tbl_cmd_mnem_map diff --git a/cmake/cfe-usersguide.doxyfile.in b/cmake/cfe-usersguide.doxyfile.in index 04606557e..eb950b381 100644 --- a/cmake/cfe-usersguide.doxyfile.in +++ b/cmake/cfe-usersguide.doxyfile.in @@ -2,26 +2,20 @@ # Doxygen Configuration options to generate the "cFE Users Guide" #--------------------------------------------------------------------------- -# Start with the main page so document ordering is established -INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/main.dox +# Allow overrides +@INCLUDE_PATH = @MISSION_SOURCE_DIR@ -# Common definitions, some of which are extended or overridden here. +# Common configuration and default settings @INCLUDE = @MISSION_BINARY_DIR@/docs/cfe-common.doxyfile +@INCLUDE = @MISSION_SOURCE_DIR@/osal/docs/src/default-settings.doxyfile + +# Document specific settings PROJECT_NAME = "Core Flight Executive Users Guide" OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/docs/users_guide WARN_LOGFILE = @CMAKE_BINARY_DIR@/docs/cfe-usersguide-warnings.log -GENERATE_LATEX = YES # For purposes of the user guide, reference the "stock" mission configuration # Although missions may override these files, for the users guide we are mainly # interested in the documentation of those items. STRIP_FROM_PATH += @MISSION_SOURCE_DIR@/cfe/cmake/sample_defs INPUT += @MISSION_SOURCE_DIR@/cfe/cmake/sample_defs - -PREDEFINED += @USERGUIDE_PREDEFINED@ - -# Bring in the cFE header files for the documentation of the various API calls -INPUT += @MISSION_USERGUIDE_HEADERFILES@ - -# Resolve references -INPUT += @MISSION_SOURCE_DIR@/psp/fsw/inc diff --git a/cmake/mission-detaildesign.doxyfile.in b/cmake/mission-detaildesign.doxyfile.in index 88793edf2..9085fcfe9 100644 --- a/cmake/mission-detaildesign.doxyfile.in +++ b/cmake/mission-detaildesign.doxyfile.in @@ -1,19 +1,35 @@ #--------------------------------------------------------------------------- -# Doxygen options to generate the complete mission documentation +# Sample doxygen setup for generating mission documentation #--------------------------------------------------------------------------- -# Start with the common definitions, some of which are extended or overridden here. +# Allow overrides +@INCLUDE_PATH = @MISSION_SOURCE_DIR@ + +# Common configuration and default settings @INCLUDE = @MISSION_BINARY_DIR@/docs/cfe-common.doxyfile +@INCLUDE = @MISSION_SOURCE_DIR@/osal/docs/src/default-settings.doxyfile + +# Example detailed design setup PROJECT_NAME = "@MISSION_NAME@" PROJECT_BRIEF = "Core Flight System project built using \"@MISSIONCONFIG@\" configuration" OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/docs/detaildesign WARN_LOGFILE = @CMAKE_BINARY_DIR@/docs/detaildesign-warnings.log +# Include mission defs directory INPUT += @MISSION_DEFS@ STRIP_FROM_PATH += @MISSION_DEFS@ -#--------------------------------------------------------------------------- # The user content doxyfile contains paths to the mission-specific applications -#--------------------------------------------------------------------------- @DETAILDESIGN_DOXYFILE_USER_CONTENT@ @TGTSYSTEM_DOXYFILE_USER_CONTENT@ + +# Exclude coverage tests, stubs and associated framework from the documentation +EXCLUDE_PATTERNS += "*/ut-stubs/*" +EXCLUDE_PATTERNS += "*/ut-coverage/*" +EXCLUDE_PATTERNS += "*/unit-test*/*" + +# Exclude stand alone repo documentation +EXCLUDE_PATTERNS += "*/CODE_OF_CONDUCT.md" +EXCLUDE_PATTERNS += "*/CONTRIBUTING.md" +EXCLUDE_PATTERNS += "*/README.md" +EXCLUDE_PATTERNS += "*/SECURITY.md" diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 4edf379e1..13da95f84 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -280,10 +280,6 @@ function(prepare) string(CONCAT DETAILDESIGN_DOXYFILE_USER_CONTENT ${DETAILDESIGN_DOXYFILE_USER_CONTENT}) string(CONCAT TGTSYSTEM_DOXYFILE_USER_CONTENT ${TGTSYSTEM_DOXYFILE_USER_CONTENT}) - configure_file("${CFE_SOURCE_DIR}/cmake/cfe-common.doxyfile.in" - "${CMAKE_BINARY_DIR}/docs/cfe-common.doxyfile" - @ONLY) - # Generate an "empty" osconfig.h file for doxygen purposes # this does not have the actual user-defined values, but will # have the documentation associated with each macro definition. @@ -307,6 +303,10 @@ function(prepare) string(REPLACE ";" " \\\n" MISSION_USERGUIDE_HEADERFILES "${MISSION_USERGUIDE_HEADERFILES}") + configure_file("${CFE_SOURCE_DIR}/cmake/cfe-common.doxyfile.in" + "${CMAKE_BINARY_DIR}/docs/cfe-common.doxyfile" + @ONLY) + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/docs/detaildesign") configure_file("${CFE_SOURCE_DIR}/cmake/mission-detaildesign.doxyfile.in" "${CMAKE_BINARY_DIR}/docs/detaildesign/Doxyfile" diff --git a/docs/src/main.dox b/docs/src/cfe_frontpage.dox similarity index 99% rename from docs/src/main.dox rename to docs/src/cfe_frontpage.dox index e6a7150f9..391ecae92 100644 --- a/docs/src/main.dox +++ b/docs/src/cfe_frontpage.dox @@ -1,5 +1,5 @@ /** - \mainpage Core Flight Executive Documentation + \page cfefrontpage Core Flight Executive Documentation
  • General Information and Concepts diff --git a/docs/src/ddd_main.dox b/docs/src/ddd_main.dox deleted file mode 100644 index fabe2707f..000000000 --- a/docs/src/ddd_main.dox +++ /dev/null @@ -1,58 +0,0 @@ -/** - \mainpage Core Flight Executive Documentation - -
      -
    • Executive Services (ES)
      -
        -
      • \subpage cfeesovr
        -
      • \subpage cfeescmds
        -
      • \subpage cfeestlm
        -
      • \subpage cfe_es_events.h "ES Event Message Reference"
        -
      • \subpage cfeescfg
        -
      -
    • Events Services (EVS)
      -
        -
      • \subpage cfeevsovr
        -
      • \subpage cfeevscmds
        -
      • \subpage cfeevstlm
        -
      • \subpage cfe_evs_events.h "EVS Event Message Reference"
        -
      • \subpage cfeevscfg
        -
      -
    • Software Bus Services (SB)
      -
        -
      • \subpage cfesbovr
        -
      • \subpage cfesbcmds
        -
      • \subpage cfesbtlm
        -
      • \subpage cfe_sb_events.h "SB Event Message Reference"
        -
      • \subpage cfesbcfg
        -
      -
    • Table Services (TBL)
      -
        -
      • \subpage cfetblovr
        -
      • \subpage cfetblcmds
        -
      • \subpage cfetbltlm
        -
      • \subpage cfe_tbl_events.h "TBL Event Message Reference"
        -
      • \subpage cfetblcfg
        -
      -
    • Time Services (TIME)
      -
        -
      • \subpage cfetimeovr
        -
      • \subpage cfetimecmds
        -
      • \subpage cfetimetlm
        -
      • \subpage cfe_time_events.h "TIME Event Message Reference"
        -
      • \subpage cfetimecfg
        -
      -
    • \subpage cfeevents
      -
    • \subpage cfecmdmnems
      -
    • \subpage cfetlmmnems
      -
    • \subpage cfeapi
      -
    - -

    Other Core Flight Executive Reference Material

    -
      -
    • \subpage cfeappdevguide
      -
    • \subpage cfedeployguide
      -
    - -**/ - From 198ae7dd0695750d155762d7bbaf21f0400470dc Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 16 Mar 2022 06:51:13 -0600 Subject: [PATCH 043/200] Fix #2064, Use osal-common.doxygen to resolve OSAL Doxygen refs --- cmake/cfe-usersguide.doxyfile.in | 8 +++++--- cmake/mission-detaildesign.doxyfile.in | 1 - cmake/mission_build.cmake | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmake/cfe-usersguide.doxyfile.in b/cmake/cfe-usersguide.doxyfile.in index eb950b381..fa6466dd3 100644 --- a/cmake/cfe-usersguide.doxyfile.in +++ b/cmake/cfe-usersguide.doxyfile.in @@ -5,14 +5,16 @@ # Allow overrides @INCLUDE_PATH = @MISSION_SOURCE_DIR@ -# Common configuration and default settings +# Common setup @INCLUDE = @MISSION_BINARY_DIR@/docs/cfe-common.doxyfile -@INCLUDE = @MISSION_SOURCE_DIR@/osal/docs/src/default-settings.doxyfile + +# Include osal to resolve references and provide default settings +@INCLUDE = @MISSION_BINARY_DIR@/docs/osal-common.doxyfile # Document specific settings PROJECT_NAME = "Core Flight Executive Users Guide" OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/docs/users_guide -WARN_LOGFILE = @CMAKE_BINARY_DIR@/docs/cfe-usersguide-warnings.log +WARN_LOGFILE = @CMAKE_BINARY_DIR@/docs/users_guide/cfe-usersguide-warnings.log # For purposes of the user guide, reference the "stock" mission configuration # Although missions may override these files, for the users guide we are mainly diff --git a/cmake/mission-detaildesign.doxyfile.in b/cmake/mission-detaildesign.doxyfile.in index 9085fcfe9..f6d40029f 100644 --- a/cmake/mission-detaildesign.doxyfile.in +++ b/cmake/mission-detaildesign.doxyfile.in @@ -7,7 +7,6 @@ # Common configuration and default settings @INCLUDE = @MISSION_BINARY_DIR@/docs/cfe-common.doxyfile -@INCLUDE = @MISSION_SOURCE_DIR@/osal/docs/src/default-settings.doxyfile # Example detailed design setup PROJECT_NAME = "@MISSION_NAME@" diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 13da95f84..8d96f8046 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -290,7 +290,6 @@ function(prepare) # NOTE: the userguide is built against the headers of the default core apps. Even if # an alternate version of the module is in use, it should adhere to the same interface. set(SUBMODULE_HEADER_PATHS - "${osal_MISSION_DIR}/src/os/inc/*.h" "${psp_MISSION_DIR}/psp/fsw/inc/*.h" ) foreach(MODULE core_api ${MISSION_CORE_MODULES}) @@ -298,7 +297,6 @@ function(prepare) endforeach() file(GLOB MISSION_USERGUIDE_HEADERFILES ${SUBMODULE_HEADER_PATHS} - "${CMAKE_BINARY_DIR}/docs/osconfig-example.h" ) string(REPLACE ";" " \\\n" MISSION_USERGUIDE_HEADERFILES "${MISSION_USERGUIDE_HEADERFILES}") From 0a9e232a7041ec424a6fb54d6e7b801a731cda10 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 16 Mar 2022 11:10:57 -0600 Subject: [PATCH 044/200] Fix #2064, Update doxygen warning file logic in workflow --- .github/workflows/build-documentation.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 86e646a16..a2752791b 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -122,7 +122,7 @@ jobs: - name: Build Usersguide run: | make usersguide > make_usersguide_stdout.txt 2> make_usersguide_stderr.txt - mv build/docs/cfe-usersguide-warnings.log usersguide_warnings.log + mv build/docs/users_guide/cfe-usersguide-warnings.log cfe-usersguide-warnings.log - name: Archive Users Guide Build Logs uses: actions/upload-artifact@v2 @@ -131,7 +131,7 @@ jobs: path: | make_usersguide_stdout.txt make_usersguide_stderr.txt - usersguide_warnings.log + cfe-usersguide-warnings.log - name: Error Check run: | @@ -142,7 +142,7 @@ jobs: - name: Warning Check run: | - if [[ -s usersguide_warnings.log ]]; then - cat usersguide_warnings.log + if [[ -s cfe-usersguide-warnings.log ]]; then + cat cfe-usersguide-warnings.log exit -1 fi From e5be0612ad6bf9db09ddf640306a65292abce2d5 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:34:51 -0400 Subject: [PATCH 045/200] Bump to v7.0.0-rc4+dev87 IC: Caelum-rc4+dev6, nasa/cFS#443 - Reverts development version identifier to 99 for revision number --- README.md | 6 ++++++ docs/src/cfs_versions.dox | 2 +- modules/core_api/fsw/inc/cfe_version.h | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 34583defe..583aba37a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ The detailed cFE user's guide can be viewed at and ### Development Build: v7.0.0-rc4+dev80 - Missing SB include for v2 msgid diff --git a/docs/src/cfs_versions.dox b/docs/src/cfs_versions.dox index 8e3c871fb..5a21cf583 100644 --- a/docs/src/cfs_versions.dox +++ b/docs/src/cfs_versions.dox @@ -22,7 +22,7 @@ bug fixes or major documentation updates. The Revision number may also be updated if there are other changes contained within a release that make it desirable for applications to distinguish one release from another. - WARNING: The revision number is set to the number 99 in development builds. To distinguish between development + WARNING: The revision number is set to the number 0xFF in development builds. To distinguish between development builds refer to the BUILD_NUMBER and BUILD_BASELINE detailed in the section "Identifying Development Builds". The Mission Version number is set to zero in all official releases, and is reserved for the mission use. diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 77d468f48..4fb0316ff 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -34,15 +34,15 @@ /* Version Macro Definitions updated for official releases only */ #define CFE_MAJOR_VERSION 6 /**< @brief Major release version (Former for Revision == 99) */ #define CFE_MINOR_VERSION 7 /**< @brief Minor release version (Former for Revision == 99) */ -#define CFE_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision number. */ +#define CFE_REVISION \ + 99 /*!< @brief * Set to 0 on OFFICIAL releases, and set to 99 on development versions. Revision number. */ /*! * @brief Mission revision. * - * Set to 0 on OFFICIAL releases, and set to 255 (0xFF) on development versions. - * Values 1-254 are reserved for mission use to denote patches/customizations as needed. + * Reserved for mission use to denote patches/customizations as needed. */ -#define CFE_MISSION_REV 0xFF +#define CFE_MISSION_REV 0 #define CFE_STR_HELPER(x) #x /**< @brief Convert argument to string */ #define CFE_STR(x) CFE_STR_HELPER(x) /**< @brief Expand macro before conversion */ From a7fd848370f8e049a4be9dc4ab3cc27be275e3d4 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 23 Mar 2022 09:47:11 -0600 Subject: [PATCH 046/200] Fix #2069, Remove old copyright headers --- cmake/sample_defs/cpu1_msgids.h | 20 ---------- cmake/sample_defs/cpu1_platform_cfg.h | 20 ---------- cmake/sample_defs/sample_mission_cfg.h | 20 ---------- cmake/sample_defs/sample_perfids.h | 20 ---------- cmake/target/inc/target_config.h | 20 ---------- cmake/target/src/target_config.c | 20 ---------- modules/cfe_assert/inc/cfe_assert.h | 27 ------------- modules/cfe_assert/src/cfe_assert_init.c | 30 ++------------- modules/cfe_assert/src/cfe_assert_io.c | 30 ++------------- modules/cfe_assert/src/cfe_assert_priv.h | 27 ------------- modules/cfe_assert/src/cfe_assert_runner.c | 30 ++------------- modules/cfe_testcase/inc/cfe_test_tbl.h | 27 ------------- modules/cfe_testcase/src/cfe_test.c | 32 +++------------- modules/cfe_testcase/src/cfe_test.h | 28 -------------- modules/cfe_testcase/src/cfe_test_table.c | 34 +++-------------- modules/cfe_testcase/src/cfe_test_table.h | 27 ------------- .../src/es_application_control_test.c | 38 ++++--------------- modules/cfe_testcase/src/es_behavior_test.c | 34 +++-------------- modules/cfe_testcase/src/es_cds_test.c | 34 +++-------------- modules/cfe_testcase/src/es_counter_test.c | 22 ----------- modules/cfe_testcase/src/es_info_test.c | 34 +++-------------- modules/cfe_testcase/src/es_mempool_test.c | 34 +++-------------- modules/cfe_testcase/src/es_misc_test.c | 34 +++-------------- modules/cfe_testcase/src/es_perf_test.c | 30 ++------------- .../cfe_testcase/src/es_resource_id_test.c | 34 +++-------------- modules/cfe_testcase/src/es_task_test.c | 34 +++-------------- modules/cfe_testcase/src/evs_filters_test.c | 34 +++-------------- modules/cfe_testcase/src/evs_send_test.c | 34 +++-------------- modules/cfe_testcase/src/fs_header_test.c | 34 +++-------------- modules/cfe_testcase/src/fs_util_test.c | 34 +++-------------- modules/cfe_testcase/src/message_id_test.c | 34 +++-------------- modules/cfe_testcase/src/msg_api_test.c | 30 ++------------- .../cfe_testcase/src/resource_id_misc_test.c | 34 +++-------------- modules/cfe_testcase/src/sb_pipe_mang_test.c | 34 +++-------------- modules/cfe_testcase/src/sb_sendrecv_test.c | 22 ----------- .../cfe_testcase/src/sb_subscription_test.c | 22 ----------- .../src/tbl_content_access_test.c | 36 ++++-------------- .../cfe_testcase/src/tbl_content_mang_test.c | 34 +++-------------- .../cfe_testcase/src/tbl_information_test.c | 34 +++-------------- .../cfe_testcase/src/tbl_registration_test.c | 34 +++-------------- .../cfe_testcase/src/time_arithmetic_test.c | 34 +++-------------- .../cfe_testcase/src/time_conversion_test.c | 30 ++------------- modules/cfe_testcase/src/time_current_test.c | 34 +++-------------- modules/cfe_testcase/src/time_external_test.c | 34 +++-------------- modules/cfe_testcase/src/time_misc_test.c | 34 +++-------------- modules/cfe_testcase/tables/cfe_test_tbl.c | 32 +++------------- modules/config/fsw/src/cfe_config_get.c | 20 ---------- modules/config/fsw/src/cfe_config_init.c | 20 ---------- modules/config/fsw/src/cfe_config_lookup.c | 20 ---------- modules/config/fsw/src/cfe_config_map.h | 20 ---------- modules/config/fsw/src/cfe_config_priv.h | 20 ---------- modules/config/fsw/src/cfe_config_set.c | 20 ---------- modules/config/fsw/src/cfe_config_table.h | 20 ---------- modules/config/ut-coverage/test_cfe_config.c | 20 ---------- modules/core_api/eds/base_types.xml | 26 ++++++------- modules/core_api/eds/ccsds_spacepacket.xml | 29 ++++++-------- modules/core_api/eds/cfe_fs.xml | 29 ++++++-------- modules/core_api/eds/config.xml | 26 ++++++------- modules/core_api/fsw/inc/cfe.h | 20 ---------- modules/core_api/fsw/inc/cfe_config.h | 20 ---------- .../fsw/inc/cfe_config_api_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_endian.h | 20 ---------- modules/core_api/fsw/inc/cfe_error.h | 20 ---------- modules/core_api/fsw/inc/cfe_es.h | 20 ---------- .../core_api/fsw/inc/cfe_es_api_typedefs.h | 20 ---------- .../core_api/fsw/inc/cfe_es_extern_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_evs.h | 20 ---------- .../core_api/fsw/inc/cfe_evs_api_typedefs.h | 20 ---------- .../fsw/inc/cfe_evs_extern_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_fs.h | 20 ---------- .../core_api/fsw/inc/cfe_fs_api_typedefs.h | 20 ---------- .../core_api/fsw/inc/cfe_fs_extern_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_msg.h | 20 ---------- .../core_api/fsw/inc/cfe_msg_api_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_resourceid.h | 20 ---------- .../fsw/inc/cfe_resourceid_api_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_sb.h | 20 ---------- .../core_api/fsw/inc/cfe_sb_api_typedefs.h | 20 ---------- .../core_api/fsw/inc/cfe_sb_extern_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_tbl.h | 20 ---------- .../core_api/fsw/inc/cfe_tbl_api_typedefs.h | 20 ---------- .../fsw/inc/cfe_tbl_extern_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_tbl_filedef.h | 20 ---------- modules/core_api/fsw/inc/cfe_time.h | 20 ---------- .../core_api/fsw/inc/cfe_time_api_typedefs.h | 20 ---------- .../fsw/inc/cfe_time_extern_typedefs.h | 20 ---------- modules/core_api/fsw/inc/cfe_version.h | 20 ---------- .../ut-stubs/src/cfe_config_handlers.c | 20 ---------- .../core_api/ut-stubs/src/cfe_config_stubs.c | 20 ---------- .../core_api/ut-stubs/src/cfe_es_handlers.c | 20 ---------- modules/core_api/ut-stubs/src/cfe_es_stubs.c | 20 ---------- .../core_api/ut-stubs/src/cfe_evs_handlers.c | 20 ---------- modules/core_api/ut-stubs/src/cfe_evs_stubs.c | 20 ---------- .../core_api/ut-stubs/src/cfe_fs_handlers.c | 20 ---------- modules/core_api/ut-stubs/src/cfe_fs_stubs.c | 20 ---------- .../core_api/ut-stubs/src/cfe_msg_handlers.c | 20 ---------- modules/core_api/ut-stubs/src/cfe_msg_stubs.c | 20 ---------- .../ut-stubs/src/cfe_resourceid_handlers.c | 20 ---------- .../ut-stubs/src/cfe_resourceid_stubs.c | 20 ---------- .../core_api/ut-stubs/src/cfe_sb_handlers.c | 20 ---------- modules/core_api/ut-stubs/src/cfe_sb_stubs.c | 20 ---------- .../core_api/ut-stubs/src/cfe_tbl_handlers.c | 20 ---------- modules/core_api/ut-stubs/src/cfe_tbl_stubs.c | 20 ---------- .../core_api/ut-stubs/src/cfe_time_handlers.c | 20 ---------- .../core_api/ut-stubs/src/cfe_time_stubs.c | 20 ---------- modules/core_private/eds/base_types.xml | 29 ++++++-------- modules/core_private/eds/config.xml | 26 ++++++------- .../fsw/inc/cfe_config_core_internal.h | 20 ---------- .../fsw/inc/cfe_es_core_internal.h | 20 ---------- .../fsw/inc/cfe_es_erlog_typedef.h | 20 ---------- .../fsw/inc/cfe_es_perfdata_typedef.h | 20 ---------- .../fsw/inc/cfe_es_resetdata_typedef.h | 20 ---------- .../fsw/inc/cfe_evs_core_internal.h | 20 ---------- .../fsw/inc/cfe_evs_log_typedef.h | 20 ---------- .../fsw/inc/cfe_fs_core_internal.h | 20 ---------- .../fsw/inc/cfe_sb_core_internal.h | 20 ---------- .../fsw/inc/cfe_sb_destination_typedef.h | 20 ---------- modules/core_private/fsw/inc/cfe_sbr.h | 20 ---------- .../fsw/inc/cfe_sbr_api_typedefs.h | 20 ---------- .../fsw/inc/cfe_tbl_core_internal.h | 20 ---------- .../fsw/inc/cfe_time_core_internal.h | 20 ---------- .../fsw/inc/cfe_time_resetvars_typedef.h | 20 ---------- .../ut-stubs/inc/ut_osprintf_stubs.h | 20 ---------- .../core_private/ut-stubs/inc/ut_support.h | 20 ---------- .../src/cfe_config_core_internal_stubs.c | 20 ---------- .../src/cfe_es_core_internal_handlers.c | 20 ---------- .../ut-stubs/src/cfe_es_core_internal_stubs.c | 20 ---------- .../src/cfe_evs_core_internal_stubs.c | 20 ---------- .../src/cfe_fs_core_internal_handlers.c | 20 ---------- .../ut-stubs/src/cfe_fs_core_internal_stubs.c | 20 ---------- .../ut-stubs/src/cfe_sb_core_internal_stubs.c | 20 ---------- .../src/cfe_tbl_core_internal_stubs.c | 20 ---------- .../src/cfe_time_core_internal_stubs.c | 20 ---------- .../ut-stubs/src/ut_osprintf_stubs.c | 20 ---------- .../core_private/ut-stubs/src/ut_support.c | 20 ---------- modules/es/eds/cfe_es.xml | 26 ++++++------- modules/es/fsw/inc/cfe_es_events.h | 20 ---------- modules/es/fsw/inc/cfe_es_msg.h | 20 ---------- modules/es/fsw/src/cfe_es_api.c | 20 ---------- modules/es/fsw/src/cfe_es_apps.c | 20 ---------- modules/es/fsw/src/cfe_es_apps.h | 20 ---------- modules/es/fsw/src/cfe_es_backgroundtask.c | 20 ---------- modules/es/fsw/src/cfe_es_cds.c | 20 ---------- modules/es/fsw/src/cfe_es_cds.h | 20 ---------- modules/es/fsw/src/cfe_es_cds_mempool.c | 20 ---------- modules/es/fsw/src/cfe_es_cds_mempool.h | 20 ---------- modules/es/fsw/src/cfe_es_erlog.c | 20 ---------- modules/es/fsw/src/cfe_es_generic_pool.c | 20 ---------- modules/es/fsw/src/cfe_es_generic_pool.h | 20 ---------- modules/es/fsw/src/cfe_es_global.h | 20 ---------- modules/es/fsw/src/cfe_es_log.h | 20 ---------- modules/es/fsw/src/cfe_es_mempool.c | 20 ---------- modules/es/fsw/src/cfe_es_mempool.h | 20 ---------- modules/es/fsw/src/cfe_es_module_all.h | 20 ---------- modules/es/fsw/src/cfe_es_objtab.c | 20 ---------- modules/es/fsw/src/cfe_es_perf.c | 20 ---------- modules/es/fsw/src/cfe_es_perf.h | 20 ---------- modules/es/fsw/src/cfe_es_resource.c | 20 ---------- modules/es/fsw/src/cfe_es_resource.h | 20 ---------- modules/es/fsw/src/cfe_es_start.c | 20 ---------- modules/es/fsw/src/cfe_es_start.h | 20 ---------- modules/es/fsw/src/cfe_es_syslog.c | 20 ---------- modules/es/fsw/src/cfe_es_task.c | 20 ---------- modules/es/fsw/src/cfe_es_task.h | 20 ---------- modules/es/fsw/src/cfe_es_verify.h | 20 ---------- modules/es/ut-coverage/es_UT.c | 20 ---------- modules/es/ut-coverage/es_UT.h | 20 ---------- modules/evs/eds/cfe_evs.xml | 26 ++++++------- modules/evs/fsw/inc/cfe_evs_events.h | 20 ---------- modules/evs/fsw/inc/cfe_evs_msg.h | 20 ---------- modules/evs/fsw/src/cfe_evs.c | 20 ---------- modules/evs/fsw/src/cfe_evs_log.c | 20 ---------- modules/evs/fsw/src/cfe_evs_log.h | 20 ---------- modules/evs/fsw/src/cfe_evs_module_all.h | 20 ---------- modules/evs/fsw/src/cfe_evs_task.c | 20 ---------- modules/evs/fsw/src/cfe_evs_task.h | 20 ---------- modules/evs/fsw/src/cfe_evs_utils.c | 20 ---------- modules/evs/fsw/src/cfe_evs_utils.h | 20 ---------- modules/evs/fsw/src/cfe_evs_verify.h | 20 ---------- modules/evs/ut-coverage/evs_UT.c | 20 ---------- modules/evs/ut-coverage/evs_UT.h | 20 ---------- modules/fs/fsw/src/cfe_fs_api.c | 20 ---------- modules/fs/fsw/src/cfe_fs_module_all.h | 20 ---------- modules/fs/fsw/src/cfe_fs_priv.c | 20 ---------- modules/fs/fsw/src/cfe_fs_priv.h | 20 ---------- modules/fs/ut-coverage/fs_UT.c | 20 ---------- modules/fs/ut-coverage/fs_UT.h | 20 ---------- modules/msg/fsw/inc/ccsds_hdr.h | 20 ---------- modules/msg/fsw/src/cfe_msg_ccsdsext.c | 20 ---------- modules/msg/fsw/src/cfe_msg_ccsdspri.c | 20 ---------- modules/msg/fsw/src/cfe_msg_defaults.h | 20 ---------- modules/msg/fsw/src/cfe_msg_init.c | 20 ---------- .../msg/fsw/src/cfe_msg_initdefaulthdr_pri.c | 20 ---------- .../fsw/src/cfe_msg_initdefaulthdr_priext.c | 20 ---------- modules/msg/fsw/src/cfe_msg_msgid_shared.c | 20 ---------- modules/msg/fsw/src/cfe_msg_msgid_v1.c | 20 ---------- modules/msg/fsw/src/cfe_msg_msgid_v2.c | 20 ---------- modules/msg/fsw/src/cfe_msg_priv.h | 20 ---------- modules/msg/fsw/src/cfe_msg_sechdr_checksum.c | 20 ---------- modules/msg/fsw/src/cfe_msg_sechdr_fc.c | 20 ---------- modules/msg/fsw/src/cfe_msg_sechdr_time.c | 20 ---------- .../msg/option_inc/default_cfe_msg_hdr_pri.h | 20 ---------- .../option_inc/default_cfe_msg_hdr_priext.h | 20 ---------- .../msg/option_inc/default_cfe_msg_sechdr.h | 20 ---------- modules/msg/ut-coverage/msg_UT.c | 20 ---------- .../msg/ut-coverage/test_cfe_msg_ccsdsext.c | 20 ---------- .../msg/ut-coverage/test_cfe_msg_ccsdsext.h | 20 ---------- .../msg/ut-coverage/test_cfe_msg_ccsdspri.c | 20 ---------- .../msg/ut-coverage/test_cfe_msg_ccsdspri.h | 20 ---------- .../msg/ut-coverage/test_cfe_msg_checksum.c | 20 ---------- .../msg/ut-coverage/test_cfe_msg_checksum.h | 20 ---------- modules/msg/ut-coverage/test_cfe_msg_fc.c | 20 ---------- modules/msg/ut-coverage/test_cfe_msg_fc.h | 20 ---------- modules/msg/ut-coverage/test_cfe_msg_init.c | 20 ---------- modules/msg/ut-coverage/test_cfe_msg_init.h | 20 ---------- modules/msg/ut-coverage/test_cfe_msg_msgid.h | 20 ---------- .../ut-coverage/test_cfe_msg_msgid_shared.c | 20 ---------- .../ut-coverage/test_cfe_msg_msgid_shared.h | 20 ---------- .../msg/ut-coverage/test_cfe_msg_msgid_v1.c | 20 ---------- .../msg/ut-coverage/test_cfe_msg_msgid_v2.c | 20 ---------- modules/msg/ut-coverage/test_cfe_msg_time.c | 20 ---------- modules/msg/ut-coverage/test_cfe_msg_time.h | 20 ---------- modules/msg/ut-coverage/test_msg_ext_not.c | 20 ---------- modules/msg/ut-coverage/test_msg_not.c | 20 ---------- modules/msg/ut-coverage/test_msg_not.h | 20 ---------- modules/msg/ut-coverage/test_msg_pri_not.c | 20 ---------- modules/msg/ut-coverage/test_msg_prionly.c | 20 ---------- modules/msg/ut-coverage/test_msg_utils.h | 20 ---------- .../fsw/inc/cfe_core_resourceid_basevalues.h | 20 ---------- .../fsw/inc/cfe_resourceid_basevalue.h | 20 ---------- .../resourceid/fsw/src/cfe_resourceid_api.c | 20 ---------- .../option_inc/cfe_resourceid_simple.h | 20 ---------- .../option_inc/cfe_resourceid_strict.h | 20 ---------- .../ut-coverage/test_cfe_resourceid.c | 20 ---------- modules/sb/eds/cfe_sb.xml | 29 ++++++-------- modules/sb/fsw/inc/cfe_sb_events.h | 20 ---------- modules/sb/fsw/inc/cfe_sb_msg.h | 20 ---------- modules/sb/fsw/src/cfe_sb_api.c | 20 ---------- modules/sb/fsw/src/cfe_sb_buf.c | 20 ---------- modules/sb/fsw/src/cfe_sb_init.c | 20 ---------- modules/sb/fsw/src/cfe_sb_module_all.h | 20 ---------- modules/sb/fsw/src/cfe_sb_msg_id_util.c | 20 ---------- modules/sb/fsw/src/cfe_sb_priv.c | 20 ---------- modules/sb/fsw/src/cfe_sb_priv.h | 20 ---------- modules/sb/fsw/src/cfe_sb_task.c | 20 ---------- modules/sb/fsw/src/cfe_sb_util.c | 20 ---------- modules/sb/fsw/src/cfe_sb_verify.h | 20 ---------- modules/sb/ut-coverage/sb_UT.c | 20 ---------- modules/sb/ut-coverage/sb_UT.h | 20 ---------- modules/sbr/fsw/src/cfe_sbr_map_direct.c | 20 ---------- modules/sbr/fsw/src/cfe_sbr_map_hash.c | 20 ---------- modules/sbr/fsw/src/cfe_sbr_priv.h | 20 ---------- modules/sbr/fsw/src/cfe_sbr_route_unsorted.c | 20 ---------- .../sbr/ut-coverage/test_cfe_sbr_map_direct.c | 20 ---------- .../sbr/ut-coverage/test_cfe_sbr_map_hash.c | 20 ---------- .../ut-coverage/test_cfe_sbr_route_unsorted.c | 20 ---------- modules/tbl/eds/cfe_tbl.xml | 26 ++++++------- modules/tbl/fsw/inc/cfe_tbl_events.h | 20 ---------- modules/tbl/fsw/inc/cfe_tbl_msg.h | 20 ---------- modules/tbl/fsw/src/cfe_tbl_api.c | 20 ---------- modules/tbl/fsw/src/cfe_tbl_internal.c | 20 ---------- modules/tbl/fsw/src/cfe_tbl_internal.h | 20 ---------- modules/tbl/fsw/src/cfe_tbl_module_all.h | 20 ---------- modules/tbl/fsw/src/cfe_tbl_task.c | 20 ---------- modules/tbl/fsw/src/cfe_tbl_task.h | 20 ---------- modules/tbl/fsw/src/cfe_tbl_task_cmds.c | 20 ---------- modules/tbl/fsw/src/cfe_tbl_task_cmds.h | 20 ---------- modules/tbl/fsw/src/cfe_tbl_verify.h | 20 ---------- modules/tbl/ut-coverage/tbl_UT.c | 20 ---------- modules/tbl/ut-coverage/tbl_UT.h | 20 ---------- modules/time/eds/cfe_time.xml | 26 ++++++------- modules/time/fsw/inc/cfe_time_events.h | 20 ---------- modules/time/fsw/inc/cfe_time_msg.h | 20 ---------- modules/time/fsw/src/cfe_time_api.c | 20 ---------- modules/time/fsw/src/cfe_time_module_all.h | 20 ---------- modules/time/fsw/src/cfe_time_task.c | 20 ---------- modules/time/fsw/src/cfe_time_tone.c | 20 ---------- modules/time/fsw/src/cfe_time_utils.c | 20 ---------- modules/time/fsw/src/cfe_time_utils.h | 20 ---------- modules/time/fsw/src/cfe_time_verify.h | 20 ---------- modules/time/ut-coverage/time_UT.c | 20 ---------- modules/time/ut-coverage/time_UT.h | 20 ---------- 282 files changed, 313 insertions(+), 5873 deletions(-) diff --git a/cmake/sample_defs/cpu1_msgids.h b/cmake/sample_defs/cpu1_msgids.h index 72f311c0e..15f312ffc 100644 --- a/cmake/sample_defs/cpu1_msgids.h +++ b/cmake/sample_defs/cpu1_msgids.h @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/cmake/sample_defs/cpu1_platform_cfg.h b/cmake/sample_defs/cpu1_platform_cfg.h index 5917e4cd0..733274047 100644 --- a/cmake/sample_defs/cpu1_platform_cfg.h +++ b/cmake/sample_defs/cpu1_platform_cfg.h @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/cmake/sample_defs/sample_mission_cfg.h b/cmake/sample_defs/sample_mission_cfg.h index 4c31cf7ef..f7e891553 100644 --- a/cmake/sample_defs/sample_mission_cfg.h +++ b/cmake/sample_defs/sample_mission_cfg.h @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/cmake/sample_defs/sample_perfids.h b/cmake/sample_defs/sample_perfids.h index f5e2d8427..d9388dac9 100644 --- a/cmake/sample_defs/sample_perfids.h +++ b/cmake/sample_defs/sample_perfids.h @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/cmake/target/inc/target_config.h b/cmake/target/inc/target_config.h index a6f7bf6c1..a7c765561 100644 --- a/cmake/target/inc/target_config.h +++ b/cmake/target/inc/target_config.h @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/cmake/target/src/target_config.c b/cmake/target/src/target_config.c index 8b7e0d52c..1b88714fc 100644 --- a/cmake/target/src/target_config.c +++ b/cmake/target/src/target_config.c @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * \file * diff --git a/modules/cfe_assert/inc/cfe_assert.h b/modules/cfe_assert/inc/cfe_assert.h index c70c61eee..78ee7a971 100644 --- a/modules/cfe_assert/inc/cfe_assert.h +++ b/modules/cfe_assert/inc/cfe_assert.h @@ -1,30 +1,3 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_assert.h -** -** Purpose: -** Specification for the CFE assert (UT assert wrapper) functions. -** -*************************************************************************/ - /** * @file * diff --git a/modules/cfe_assert/src/cfe_assert_init.c b/modules/cfe_assert/src/cfe_assert_init.c index b28f7db17..1ecddedb8 100644 --- a/modules/cfe_assert/src/cfe_assert_init.c +++ b/modules/cfe_assert/src/cfe_assert_init.c @@ -1,29 +1,7 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_assert_init.c -** -** Purpose: -** Implementation of the CFE assert (UT assert wrapper) functions. -** -*************************************************************************/ +/** + * \file + * Implementation of the CFE assert (UT assert wrapper) functions. + */ /* * Includes diff --git a/modules/cfe_assert/src/cfe_assert_io.c b/modules/cfe_assert/src/cfe_assert_io.c index fd67cf818..7490e442e 100644 --- a/modules/cfe_assert/src/cfe_assert_io.c +++ b/modules/cfe_assert/src/cfe_assert_io.c @@ -1,29 +1,7 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_assert_io.c -** -** Purpose: -** Implementation of the CFE assert (UT assert wrapper) functions. -** -*************************************************************************/ +/** + * \file + * Implementation of the CFE assert (UT assert wrapper) functions. + */ #include #include diff --git a/modules/cfe_assert/src/cfe_assert_priv.h b/modules/cfe_assert/src/cfe_assert_priv.h index 5925213f7..38c879d10 100644 --- a/modules/cfe_assert/src/cfe_assert_priv.h +++ b/modules/cfe_assert/src/cfe_assert_priv.h @@ -1,30 +1,3 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_assert_priv.h -** -** Purpose: -** Specification for the CFE assert (UT assert wrapper) functions. -** -*************************************************************************/ - /** * @file * diff --git a/modules/cfe_assert/src/cfe_assert_runner.c b/modules/cfe_assert/src/cfe_assert_runner.c index 3a178a0a0..872158f4e 100644 --- a/modules/cfe_assert/src/cfe_assert_runner.c +++ b/modules/cfe_assert/src/cfe_assert_runner.c @@ -1,29 +1,7 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_assert_runner.c -** -** Purpose: -** Implementation of the CFE testrunner (UT testrunner wrapper) functions. -** -*************************************************************************/ +/** + * \file + * Implementation of the CFE testrunner (UT testrunner wrapper) functions. + */ /* * Includes diff --git a/modules/cfe_testcase/inc/cfe_test_tbl.h b/modules/cfe_testcase/inc/cfe_test_tbl.h index d8c01898d..04250b58a 100644 --- a/modules/cfe_testcase/inc/cfe_test_tbl.h +++ b/modules/cfe_testcase/inc/cfe_test_tbl.h @@ -1,30 +1,3 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_test_table.h -** -** Purpose: -** CFE Test Table struct definition -** -*************************************************************************/ - /** * @file * diff --git a/modules/cfe_testcase/src/cfe_test.c b/modules/cfe_testcase/src/cfe_test.c index a5ae1b5c0..7cebd85f6 100644 --- a/modules/cfe_testcase/src/cfe_test.c +++ b/modules/cfe_testcase/src/cfe_test.c @@ -1,30 +1,8 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_test.c -** -** Purpose: -** Initialization routine for CFE functional test -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Initialization routine for CFE functional test + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/cfe_test.h b/modules/cfe_testcase/src/cfe_test.h index fcf6c91f1..7eb49d150 100644 --- a/modules/cfe_testcase/src/cfe_test.h +++ b/modules/cfe_testcase/src/cfe_test.h @@ -1,31 +1,3 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_test.h -** -** Purpose: -** Initialization routine for CFE functional test -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ - /** * @file * diff --git a/modules/cfe_testcase/src/cfe_test_table.c b/modules/cfe_testcase/src/cfe_test_table.c index b8659f4cf..3ff2390ef 100644 --- a/modules/cfe_testcase/src/cfe_test_table.c +++ b/modules/cfe_testcase/src/cfe_test_table.c @@ -1,30 +1,8 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_test_table.c -** -** Purpose: -** Initialization of variables used by table functional tests and -** function definitions for setup and teardown table functions -** -*************************************************************************/ +/** + * \file + * Initialization of variables used by table functional tests and + * function definitions for setup and teardown table functions + */ /* * Includes @@ -46,4 +24,4 @@ void RegisterTestTable(void) void UnregisterTestTable(void) { UtAssert_INT32_EQ(CFE_TBL_Unregister(CFE_FT_Global.TblHandle), CFE_SUCCESS); -} \ No newline at end of file +} diff --git a/modules/cfe_testcase/src/cfe_test_table.h b/modules/cfe_testcase/src/cfe_test_table.h index c37539e01..b848ead31 100644 --- a/modules/cfe_testcase/src/cfe_test_table.h +++ b/modules/cfe_testcase/src/cfe_test_table.h @@ -1,30 +1,3 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_test_table.h -** -** Purpose: -** Declare global struct variable and function prototypes for table tests -** -*************************************************************************/ - /** * @file * diff --git a/modules/cfe_testcase/src/es_application_control_test.c b/modules/cfe_testcase/src/es_application_control_test.c index 22fa4c1e2..221f6f077 100644 --- a/modules/cfe_testcase/src/es_application_control_test.c +++ b/modules/cfe_testcase/src/es_application_control_test.c @@ -1,33 +1,11 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_application_control_test.c -** -** Purpose: -** Functional test of ES Application Control APIs -** -** Tests only invalid calls to the application control functions. -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of ES Application Control APIs + * + * Tests only invalid calls to the application control functions. + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/es_behavior_test.c b/modules/cfe_testcase/src/es_behavior_test.c index 9600003b9..d8866c226 100644 --- a/modules/cfe_testcase/src/es_behavior_test.c +++ b/modules/cfe_testcase/src/es_behavior_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_behavior_test.c -** -** Purpose: -** Functional test of basic ES Application Behavior APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic ES Application Behavior APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/es_cds_test.c b/modules/cfe_testcase/src/es_cds_test.c index ffba69e5a..651192833 100644 --- a/modules/cfe_testcase/src/es_cds_test.c +++ b/modules/cfe_testcase/src/es_cds_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_cds_test.c -** -** Purpose: -** Functional test of basic ES Critical Data Store APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic ES Critical Data Store APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/es_counter_test.c b/modules/cfe_testcase/src/es_counter_test.c index 6ccda5c88..4e2e586c1 100644 --- a/modules/cfe_testcase/src/es_counter_test.c +++ b/modules/cfe_testcase/src/es_counter_test.c @@ -1,25 +1,3 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -*************************************************************************/ - /** * @file * diff --git a/modules/cfe_testcase/src/es_info_test.c b/modules/cfe_testcase/src/es_info_test.c index 27990fbde..70f89108a 100644 --- a/modules/cfe_testcase/src/es_info_test.c +++ b/modules/cfe_testcase/src/es_info_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_info_test.c -** -** Purpose: -** Functional test of basic ES Information APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic ES Information APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/es_mempool_test.c b/modules/cfe_testcase/src/es_mempool_test.c index a3f97354e..78a51a3c4 100644 --- a/modules/cfe_testcase/src/es_mempool_test.c +++ b/modules/cfe_testcase/src/es_mempool_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_mempool_test.c -** -** Purpose: -** Functional test of basic ES Mempool APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic ES Mempool APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/es_misc_test.c b/modules/cfe_testcase/src/es_misc_test.c index 72910fa62..43dcce1bb 100644 --- a/modules/cfe_testcase/src/es_misc_test.c +++ b/modules/cfe_testcase/src/es_misc_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_misc_test.c -** -** Purpose: -** Functional test of basic ES Miscellaneous APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic ES Miscellaneous APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/es_perf_test.c b/modules/cfe_testcase/src/es_perf_test.c index ac84286bc..7c2c53a31 100644 --- a/modules/cfe_testcase/src/es_perf_test.c +++ b/modules/cfe_testcase/src/es_perf_test.c @@ -1,29 +1,7 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_perf_test.c -** -** Purpose: -** Functional test of ES Performance APIs -** -*************************************************************************/ +/** + * \file + * Functional test of ES Performance APIs + */ /* * Includes diff --git a/modules/cfe_testcase/src/es_resource_id_test.c b/modules/cfe_testcase/src/es_resource_id_test.c index 0345a5957..7d678b6cf 100644 --- a/modules/cfe_testcase/src/es_resource_id_test.c +++ b/modules/cfe_testcase/src/es_resource_id_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_resource_id_test.c -** -** Purpose: -** Functional test of ES Resource ID APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of ES Resource ID APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/es_task_test.c b/modules/cfe_testcase/src/es_task_test.c index 765460164..98a29fddf 100644 --- a/modules/cfe_testcase/src/es_task_test.c +++ b/modules/cfe_testcase/src/es_task_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_task_test.c -** -** Purpose: -** Functional test of ES Child Tasks APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of ES Child Tasks APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/evs_filters_test.c b/modules/cfe_testcase/src/evs_filters_test.c index 1a7fe121a..2de04fbdd 100644 --- a/modules/cfe_testcase/src/evs_filters_test.c +++ b/modules/cfe_testcase/src/evs_filters_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: evs_filters_test.c -** -** Purpose: -** Functional test of basic EVS Reset Filters APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic EVS Reset Filters APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/evs_send_test.c b/modules/cfe_testcase/src/evs_send_test.c index bd14a2ff8..66e272f47 100644 --- a/modules/cfe_testcase/src/evs_send_test.c +++ b/modules/cfe_testcase/src/evs_send_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: evs_send_test.c -** -** Purpose: -** Functional test of basic EVS Send Event APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic EVS Send Event APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/fs_header_test.c b/modules/cfe_testcase/src/fs_header_test.c index 64285b18b..cb028f706 100644 --- a/modules/cfe_testcase/src/fs_header_test.c +++ b/modules/cfe_testcase/src/fs_header_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: fs_header_test.c -** -** Purpose: -** Functional test of basic FS Header APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic FS Header APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/fs_util_test.c b/modules/cfe_testcase/src/fs_util_test.c index 2435078d7..3ace5bef0 100644 --- a/modules/cfe_testcase/src/fs_util_test.c +++ b/modules/cfe_testcase/src/fs_util_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: es_info_test.c -** -** Purpose: -** Functional test of FS File Utility APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of FS File Utility APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/message_id_test.c b/modules/cfe_testcase/src/message_id_test.c index 28e53bbca..0d0b931d5 100644 --- a/modules/cfe_testcase/src/message_id_test.c +++ b/modules/cfe_testcase/src/message_id_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: message_id_test.c -** -** Purpose: -** Functional test of Message ID APIs -** -** Demonstration.... -** -*************************************************************************/ +/** + * \file + * Functional test of Message ID APIs + * + * Demonstration.... + */ /* * Includes diff --git a/modules/cfe_testcase/src/msg_api_test.c b/modules/cfe_testcase/src/msg_api_test.c index ddf098070..1cd56d522 100644 --- a/modules/cfe_testcase/src/msg_api_test.c +++ b/modules/cfe_testcase/src/msg_api_test.c @@ -1,29 +1,7 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2021 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: msg_api_test.c -** -** Purpose: -** Functional test of cFE Message header APIs. -** -*************************************************************************/ +/** + * \file + * Functional test of cFE Message header APIs. + */ /* * Includes diff --git a/modules/cfe_testcase/src/resource_id_misc_test.c b/modules/cfe_testcase/src/resource_id_misc_test.c index e618d0bf6..2fba82982 100644 --- a/modules/cfe_testcase/src/resource_id_misc_test.c +++ b/modules/cfe_testcase/src/resource_id_misc_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: resource_id_misc_test.c -** -** Purpose: -** Functional test of Miscellaneous Resource Id APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of Miscellaneous Resource Id APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/sb_pipe_mang_test.c b/modules/cfe_testcase/src/sb_pipe_mang_test.c index d523267fe..a464134e7 100644 --- a/modules/cfe_testcase/src/sb_pipe_mang_test.c +++ b/modules/cfe_testcase/src/sb_pipe_mang_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: sb_pipe_mang_test.c -** -** Purpose: -** Functional test of Sb Pipe Management APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of Sb Pipe Management APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index 0c64451fa..cf3bd83f0 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -1,25 +1,3 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -*************************************************************************/ - /** * @file * diff --git a/modules/cfe_testcase/src/sb_subscription_test.c b/modules/cfe_testcase/src/sb_subscription_test.c index 628360445..5f60b492f 100644 --- a/modules/cfe_testcase/src/sb_subscription_test.c +++ b/modules/cfe_testcase/src/sb_subscription_test.c @@ -1,25 +1,3 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -*************************************************************************/ - /** * @file * diff --git a/modules/cfe_testcase/src/tbl_content_access_test.c b/modules/cfe_testcase/src/tbl_content_access_test.c index 82208e25d..e3f7c6775 100644 --- a/modules/cfe_testcase/src/tbl_content_access_test.c +++ b/modules/cfe_testcase/src/tbl_content_access_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: tbl_content_access_test.c -** -** Purpose: -** Functional test of Table Access Content APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of Table Access Content APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes @@ -164,4 +142,4 @@ void TBLContentAccessTestSetup(void) UtTest_Add(TestGetAddress, RegisterTestTable, NULL, "Test Table Get Address"); UtTest_Add(TestReleaseAddress, RegisterTestTable, NULL, "Test Table Release Address"); UtTest_Add(TestGetReleaseAddresses, NULL, NULL, "Test Table Get and Release Addresses"); -} \ No newline at end of file +} diff --git a/modules/cfe_testcase/src/tbl_content_mang_test.c b/modules/cfe_testcase/src/tbl_content_mang_test.c index 77e85c23c..27a1189f1 100644 --- a/modules/cfe_testcase/src/tbl_content_mang_test.c +++ b/modules/cfe_testcase/src/tbl_content_mang_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: tbl_content_mang_test.c -** -** Purpose: -** Functional test of Table Manage Content APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of Table Manage Content APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/tbl_information_test.c b/modules/cfe_testcase/src/tbl_information_test.c index bb44c31dc..19f1fbe0a 100644 --- a/modules/cfe_testcase/src/tbl_information_test.c +++ b/modules/cfe_testcase/src/tbl_information_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: tbl_information_test.c -** -** Purpose: -** Functional test of Table Information APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of Table Information APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/tbl_registration_test.c b/modules/cfe_testcase/src/tbl_registration_test.c index dcbf74885..3c9fe3a86 100644 --- a/modules/cfe_testcase/src/tbl_registration_test.c +++ b/modules/cfe_testcase/src/tbl_registration_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: tbl_registration_test.c -** -** Purpose: -** Functional test of Table Registration APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of Table Registration APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/time_arithmetic_test.c b/modules/cfe_testcase/src/time_arithmetic_test.c index 9834829e7..cc3c6570e 100644 --- a/modules/cfe_testcase/src/time_arithmetic_test.c +++ b/modules/cfe_testcase/src/time_arithmetic_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: time_arithmetic_test.c -** -** Purpose: -** Functional test of basic Time Arithmetic APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic Time Arithmetic APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/time_conversion_test.c b/modules/cfe_testcase/src/time_conversion_test.c index baf9c92a8..669dce305 100644 --- a/modules/cfe_testcase/src/time_conversion_test.c +++ b/modules/cfe_testcase/src/time_conversion_test.c @@ -1,29 +1,7 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2021 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: time_conversion_test.c -** -** Purpose: -** Functional test of basic Time Conversion APIs -** -*************************************************************************/ +/** + * \file + * Functional test of basic Time Conversion APIs + */ /* * Includes diff --git a/modules/cfe_testcase/src/time_current_test.c b/modules/cfe_testcase/src/time_current_test.c index 7f2cdcbe0..cd287cf29 100644 --- a/modules/cfe_testcase/src/time_current_test.c +++ b/modules/cfe_testcase/src/time_current_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: time_current_test.c -** -** Purpose: -** Functional test of basic Time Current APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic Time Current APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/time_external_test.c b/modules/cfe_testcase/src/time_external_test.c index 467cf9226..ac27ab100 100644 --- a/modules/cfe_testcase/src/time_external_test.c +++ b/modules/cfe_testcase/src/time_external_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: time_external_test.c -** -** Purpose: -** Functional test of basic External Time Source APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of basic External Time Source APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/src/time_misc_test.c b/modules/cfe_testcase/src/time_misc_test.c index 484ffee21..bf90c27a2 100644 --- a/modules/cfe_testcase/src/time_misc_test.c +++ b/modules/cfe_testcase/src/time_misc_test.c @@ -1,31 +1,9 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: time_misc_test.c -** -** Purpose: -** Functional test of miscellaneous Time APIs -** -** Demonstration of how to register and use the UT assert functions. -** -*************************************************************************/ +/** + * \file + * Functional test of miscellaneous Time APIs + * + * Demonstration of how to register and use the UT assert functions. + */ /* * Includes diff --git a/modules/cfe_testcase/tables/cfe_test_tbl.c b/modules/cfe_testcase/tables/cfe_test_tbl.c index 65fae385e..982536e26 100644 --- a/modules/cfe_testcase/tables/cfe_test_tbl.c +++ b/modules/cfe_testcase/tables/cfe_test_tbl.c @@ -1,29 +1,7 @@ -/************************************************************************* -** -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** File: cfe_test_tbl.c -** -** Purpose: -** Create a file containing a CFE Test Table -** -*************************************************************************/ +/** + * \file + * Create a file containing a CFE Test Table + */ /* * Includes @@ -39,4 +17,4 @@ */ TBL_TEST_Table_t TestTable = {0xf007, 0xba11}; -CFE_TBL_FILEDEF(TestTable, CFE_TEST_APP.TestTable, Table Test Table, cfe_test_tbl.tbl) \ No newline at end of file +CFE_TBL_FILEDEF(TestTable, CFE_TEST_APP.TestTable, Table Test Table, cfe_test_tbl.tbl) diff --git a/modules/config/fsw/src/cfe_config_get.c b/modules/config/fsw/src/cfe_config_get.c index f1dc11f65..fa612027b 100644 --- a/modules/config/fsw/src/cfe_config_get.c +++ b/modules/config/fsw/src/cfe_config_get.c @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/modules/config/fsw/src/cfe_config_init.c b/modules/config/fsw/src/cfe_config_init.c index 4539ae6a1..a1e0c6280 100644 --- a/modules/config/fsw/src/cfe_config_init.c +++ b/modules/config/fsw/src/cfe_config_init.c @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/modules/config/fsw/src/cfe_config_lookup.c b/modules/config/fsw/src/cfe_config_lookup.c index 16a3cb426..48d88b533 100644 --- a/modules/config/fsw/src/cfe_config_lookup.c +++ b/modules/config/fsw/src/cfe_config_lookup.c @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /* ** File: ** cfe_es_api.c diff --git a/modules/config/fsw/src/cfe_config_map.h b/modules/config/fsw/src/cfe_config_map.h index 212bdd1f1..682f49132 100644 --- a/modules/config/fsw/src/cfe_config_map.h +++ b/modules/config/fsw/src/cfe_config_map.h @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/modules/config/fsw/src/cfe_config_priv.h b/modules/config/fsw/src/cfe_config_priv.h index 56da3a560..e2e64e263 100644 --- a/modules/config/fsw/src/cfe_config_priv.h +++ b/modules/config/fsw/src/cfe_config_priv.h @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/modules/config/fsw/src/cfe_config_set.c b/modules/config/fsw/src/cfe_config_set.c index d2b374e9e..c221eb6dc 100644 --- a/modules/config/fsw/src/cfe_config_set.c +++ b/modules/config/fsw/src/cfe_config_set.c @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/modules/config/fsw/src/cfe_config_table.h b/modules/config/fsw/src/cfe_config_table.h index d3e7583fb..229abf040 100644 --- a/modules/config/fsw/src/cfe_config_table.h +++ b/modules/config/fsw/src/cfe_config_table.h @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /** * @file * diff --git a/modules/config/ut-coverage/test_cfe_config.c b/modules/config/ut-coverage/test_cfe_config.c index c4edf3f7b..3c063fb40 100644 --- a/modules/config/ut-coverage/test_cfe_config.c +++ b/modules/config/ut-coverage/test_cfe_config.c @@ -1,23 +1,3 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - /* * Includes */ diff --git a/modules/core_api/eds/base_types.xml b/modules/core_api/eds/base_types.xml index aac48fcf7..f5a495dca 100644 --- a/modules/core_api/eds/base_types.xml +++ b/modules/core_api/eds/base_types.xml @@ -1,23 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/core_api/eds/base_types.xml b/modules/core_api/eds/base_types.xml index f5a495dca..009375352 100644 --- a/modules/core_api/eds/base_types.xml +++ b/modules/core_api/eds/base_types.xml @@ -102,44 +102,6 @@ - - - - - - - - - - diff --git a/modules/es/eds/cfe_es.xml b/modules/es/eds/cfe_es.xml index 0cb3701a8..0832cb034 100644 --- a/modules/es/eds/cfe_es.xml +++ b/modules/es/eds/cfe_es.xml @@ -50,12 +50,14 @@ + + @@ -65,6 +67,7 @@ + @@ -113,10 +116,97 @@ + + + This is the type that is used for any API accepting or returning an App ID + + + + + + This is the type that is used for any API accepting or returning a Task ID + + + + + + This is the type that is used for any API accepting or returning a Lib ID + + + + + + This is the type that is used for any API accepting or returning an Counter ID + + + + + + Data type used to hold Handles of Memory Pools + created via CFE_ES_PoolCreate and CFE_ES_PoolCreateNoSem + + + + + + Data type used to hold Handles of Critical Data Stores. See #CFE_ES_RegisterCDS + + + + + + @note the valid range is only 0-255 (same as OSAL) but + a wider type is used for backward compatibility + in binary formats of messages. + + + + + + + + + + For backward compatibility with existing CFE code this should be uint32, + but all telemetry information will be limited to 4GB in size as a result. + + On 64-bit platforms this can be a 64-bit value which will allow larger + memory objects, but this will break compatibility with existing control + systems, and may also change the alignment/padding of messages. + + In either case this must be an unsigned type. + + + + + + + + + + For backward compatibility with existing CFE code this should be uint32, + but if running on a 64-bit platform, addresses in telemetry will be + truncated to 32 bits and therefore will not be valid. + + On 64-bit platforms this can be a 64-bit address which will allow the + full memory address in commands and telemetry, but this will break + compatibility with existing control systems, and may also change + the alignment/padding of messages. + + In either case this must be an unsigned type. + + FSW code should access this value via the macros provided, which + converts to the native "cpuaddr" type provided by OSAL. This macro + provides independence between the message representation and local + representation of a memory address. + + + + + + - - @@ -131,7 +221,7 @@ QueryAll Commands. - + \cfetlmmnemonic \ES_APP_ID @@ -171,37 +261,37 @@ \cfetlmmnemonic \ES_ADDRVALID - + \cfetlmmnemonic \ES_CODEADDR - + \cfetlmmnemonic \ES_CODESIZE - + \cfetlmmnemonic \ES_DATAADDR - + \cfetlmmnemonic \ES_DATASIZE - + \cfetlmmnemonic \ES_BSSADDR - + \cfetlmmnemonic \ES_BSSSIZE - + \cfetlmmnemonic \ES_STARTADDR @@ -211,12 +301,12 @@ \cfetlmmnemonic \ES_EXCEPTNACTN - + \cfetlmmnemonic \ES_PRIORITY - + \cfetlmmnemonic \ES_MAINTASKID @@ -239,6 +329,28 @@ + + + Structure that is used to provide information about a task. It is primarily + used for the Query All Tasks (#CFE_ES_QUERY_ALL_TASKS_CC) command. + + @note There is not currently a telemetry message directly containing this + data structure, but it does define the format of the data file generated + by the Query All Tasks command. Therefore it should be considered + part of the overall telemetry interface. + + + + + + + + + + + + + @@ -249,13 +361,13 @@ - + - + \cfetlmmnemonic \ES_POOLSIZE @@ -270,7 +382,7 @@ \cfetlmmnemonic \ES_BLKERRCTR - + \cfetlmmnemonic \ES_FREEBYTES @@ -292,16 +404,6 @@ - - - For command details, see #CFE_ES_SHELL_CMD_CC - - - - - - - @@ -423,7 +525,7 @@ - + @@ -444,7 +546,7 @@ - + \cfetlmmnemonic \ES_POOLHANDLE @@ -668,46 +770,31 @@ - - - - - \brief ASCII text string containing output from OS Shell - that was received in response to an OS Shell Command - - - + - - + - + - + - - - - - - - + - + \cfeescmd Executive Services No-Op @@ -743,11 +830,11 @@ None - + - + \cfeescmd Executive Services Reset Counters @@ -790,11 +877,11 @@ \sa #CFE_ES_RESET_PR_COUNT_CC - + - + \cfeescmd Executive Services Processor / Power-On Reset @@ -848,71 +935,14 @@ \sa #CFE_ES_RESET_PR_COUNT_CC, #CFE_ES_SET_MAX_PR_COUNT_CC - + - - - \cfeescmd Executive Services O/S Shell Command - - \par Description - - This command passes an ASCII string as a command line to the - underlying realtime operating system shell. Any response to - the command is both written to the shell command output file - and sent as a series of shell command output telemetry packets. - - If the shell command output filename argument is empty, then - #CFE_ES_DEFAULT_SHELL_FILENAME will be used as the filename. - \cfecmdmnemonic \ES_SHELL - - \par Command Structure - #CFE_ES_ShellCmd_t - - \par Command Verification - - Successful execution of this command may be verified with - the following telemetry: - - \b \c \ES_CMDPC - command execution counter will - increment - - The #CFE_ES_SHELL_INF_EID informational event message will be - generated - - \par Error Conditions - - This command may fail for the following reason(s): - - The command packet length is incorrect - - Failure to create the shell command output file - - The shell command started with ES_ but was not one of the - recognized cFE shell commands - - There was an error while performing a #OS_lseek on the shell command output file - - There was an error while redirecting the shell command response to the - shell command output file - - Evidence of failure may be found in the following telemetry: - - \b \c \ES_CMDEC - command error counter will increment - - the #CFE_ES_SHELL_ERR_EID error event message will be generated - - Additional information on the error should be found in the System Log - - \par Criticality - - This command should be used with caution. Interfering with the - operation of the underlying realtime operating system can cause - significant problems. - - - - - - - - - - + \cfeescmd Load and Start an Application @@ -962,14 +992,14 @@ \sa #CFE_ES_STOP_APP_CC, #CFE_ES_RESTART_APP_CC, #CFE_ES_RELOAD_APP_CC - + - + \cfeescmd Stop and Unload Application @@ -1023,14 +1053,14 @@ \sa #CFE_ES_START_APP_CC, #CFE_ES_RESTART_APP_CC, #CFE_ES_RELOAD_APP_CC - + - + \cfeescmd Stops and Restarts an Application @@ -1077,14 +1107,14 @@ \sa #CFE_ES_START_APP_CC, #CFE_ES_STOP_APP_CC, #CFE_ES_RELOAD_APP_CC - + - + \cfeescmd Stops, Unloads, Loads from a File and Restarts an Application @@ -1134,14 +1164,14 @@ \sa #CFE_ES_START_APP_CC, #CFE_ES_STOP_APP_CC, #CFE_ES_RESTART_APP_CC - + - + \cfeescmd Request Executive Services Information on a Specified Application @@ -1182,14 +1212,14 @@ \sa #CFE_ES_QUERY_ALL_CC, #CFE_ES_QUERY_ALL_TASKS_CC - + - + \cfeescmd Writes all Executive Services Information on All Applications to a File @@ -1235,14 +1265,14 @@ \sa #CFE_ES_QUERY_ONE_CC, #CFE_ES_QUERY_ALL_TASKS_CC - + - + \cfeescmd Clear Executive Services System Log @@ -1284,11 +1314,11 @@ #CFE_ES_OVERWRITE_SYSLOG_CC - + - + \cfeescmd Writes contents of Executive Services System Log to a File @@ -1299,7 +1329,7 @@ \cfecmdmnemonic \ES_WRITESYSLOG2FILE \par Command Structure - #CFE_ES_WriteSyslogCmd_t + #CFE_ES_WriteSysLogCmd_t \par Command Verification @@ -1335,14 +1365,14 @@ #CFE_ES_OVERWRITE_SYSLOG_CC - + - + \cfeescmd Clears the contents of the Exception and Reset Log @@ -1383,11 +1413,11 @@ \sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC, #CFE_ES_WRITE_ERLOG_CC - + - + \cfeescmd Writes Exception and Reset Log to a File @@ -1433,14 +1463,14 @@ \sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC, #CFE_ES_CLEAR_ERLOG_CC - + - + \cfeescmd Start Performance Analyzer @@ -1490,14 +1520,14 @@ \sa #CFE_ES_PERF_STOPDATA_CC, #CFE_ES_PERF_SETFILTERMASK_CC, #CFE_ES_PERF_SETTRIGMASK_CC - + - + \cfeescmd Stop Performance Analyzer @@ -1544,14 +1574,14 @@ \sa #CFE_ES_PERF_STARTDATA_CC, #CFE_ES_PERF_SETFILTERMASK_CC, #CFE_ES_PERF_SETTRIGMASK_CC - + - + \cfeescmd Set Performance Analyzer's Filter Masks @@ -1593,14 +1623,14 @@ \sa #CFE_ES_PERF_STARTDATA_CC, #CFE_ES_PERF_STOPDATA_CC, #CFE_ES_PERF_SETTRIGMASK_CC - + - + \cfeescmd Set Performance Analyzer's Trigger Masks @@ -1641,14 +1671,14 @@ \sa #CFE_ES_PERF_STARTDATA_CC, #CFE_ES_PERF_STOPDATA_CC, #CFE_ES_PERF_SETFILTERMASK_CC - + - + \cfeescmd Set Executive Services System Log Mode to Discard/Overwrite @@ -1693,14 +1723,14 @@ \sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC - + - + \cfeescmd Resets the Processor Reset Counter to Zero @@ -1744,11 +1774,11 @@ \sa #CFE_ES_SET_MAX_PR_COUNT_CC, #CFE_ES_RESET_CC - + - + \cfeescmd Configure the Maximum Number of Processor Resets before a Power-On Reset @@ -1793,14 +1823,14 @@ \sa #CFE_ES_RESET_PR_COUNT_CC - + - + \cfeescmd Delete Critical Data Store @@ -1847,14 +1877,14 @@ \sa #CFE_ES_DUMP_CDS_REG_CC, #CFE_TBL_DELETE_CDS_CC - + - + \cfeescmd Telemeter Memory Pool Statistics @@ -1898,14 +1928,14 @@ used in the command is correct. - + - + \cfeescmd Dump Critical Data Store Registry to a File @@ -1950,14 +1980,14 @@ \sa #CFE_ES_DELETE_CDS_CC, #CFE_TBL_DELETE_CDS_CC - + - + \cfeescmd Writes a list of All Executive Services Tasks to a File @@ -2003,13 +2033,32 @@ \sa #CFE_ES_QUERY_ALL_CC, CFE_ES_QUERY_ONE_CC - + + + + Structure that is used to provide information about a critical data store. + It is primarily used for the Dump CDS registry (#CFE_ES_DUMP_CDS_REGISTRY_CC) + command. + + @note There is not currently a telemetry message directly containing this + data structure, but it does define the format of the data file generated + by the Dump CDS registry command. Therefore it should be considered + part of the overall telemetry interface. + + + + + + + + + @@ -2023,7 +2072,7 @@ - + @@ -2036,11 +2085,6 @@ - - - - - @@ -2053,7 +2097,6 @@ - @@ -2062,7 +2105,6 @@ - diff --git a/modules/evs/eds/cfe_evs.xml b/modules/evs/eds/cfe_evs.xml index 4e5adc9bb..5a3146555 100644 --- a/modules/evs/eds/cfe_evs.xml +++ b/modules/evs/eds/cfe_evs.xml @@ -164,7 +164,7 @@ - + \cfetlmmnemonic \EVS_APPID @@ -305,28 +305,30 @@ - + - + + + - + - + - + \cfeevscmd Event Services No-Op @@ -354,11 +356,11 @@ None - + - + \cfeevscmd Event Services Reset Counters @@ -395,11 +397,11 @@ \sa #CFE_EVS_RESET_APP_COUNTER_CC - + - + \cfeevscmd Enable Event Type @@ -445,14 +447,14 @@ #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC, #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC - + - + \cfeevscmd Disable Event Type @@ -499,14 +501,14 @@ #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC, #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC - + - + \cfeevscmd Set Event Format Mode @@ -552,14 +554,14 @@ \sa - + - + \cfeevscmd Enable Application Event Type @@ -609,14 +611,14 @@ #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC, #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC - + - + \cfeevscmd Disable Application Event Type @@ -666,14 +668,14 @@ #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC - + - + \cfeevscmd Enable Event Services for an Application @@ -713,14 +715,14 @@ #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC - + - + \cfeevscmd Disable Event Services for an Application @@ -760,14 +762,14 @@ #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC, #CFE_EVS_ENABLE_APP_EVENTS_CC - + - + \cfeevscmd Reset Application Event Counters @@ -803,14 +805,14 @@ \sa #CFE_EVS_RESET_COUNTERS_CC - + - + \cfeevscmd Set Application Event Filter @@ -850,14 +852,14 @@ \sa #CFE_EVS_RESET_FILTER_CC, #CFE_EVS_RESET_ALL_FILTERS_CC, #CFE_EVS_ADD_EVENT_FILTER_CC, #CFE_EVS_DELETE_EVENT_FILTER_CC - + - + \cfeevscmd Enable Event Services Output Ports @@ -895,14 +897,14 @@ \sa #CFE_EVS_DISABLE_PORTS_CC - + - + \cfeevscmd Disable Event Services Output Ports @@ -941,14 +943,14 @@ \sa #CFE_EVS_ENABLE_PORTS_CC - + - + \cfeevscmd Reset an Event Filter for an Application @@ -982,14 +984,14 @@ \sa #CFE_EVS_SET_FILTER_CC, #CFE_EVS_RESET_ALL_FILTERS_CC, #CFE_EVS_ADD_EVENT_FILTER_CC, #CFE_EVS_DELETE_EVENT_FILTER_CC - + - + \cfeevscmd Reset All Event Filters for an Application @@ -1024,14 +1026,14 @@ \sa #CFE_EVS_SET_FILTER_CC, #CFE_EVS_RESET_FILTER_CC, #CFE_EVS_ADD_EVENT_FILTER_CC, #CFE_EVS_DELETE_EVENT_FILTER_CC - + - + \cfeevscmd Add Application Event Filter @@ -1066,14 +1068,14 @@ \sa #CFE_EVS_SET_FILTER_CC, #CFE_EVS_RESET_FILTER_CC, #CFE_EVS_RESET_ALL_FILTERS_CC, #CFE_EVS_DELETE_EVENT_FILTER_CC - + - + \cfeevscmd Delete Application Event Filter @@ -1108,14 +1110,14 @@ \sa #CFE_EVS_SET_FILTER_CC, #CFE_EVS_RESET_FILTER_CC, #CFE_EVS_RESET_ALL_FILTERS_CC, #CFE_EVS_ADD_EVENT_FILTER_CC - + - + \cfeevscmd Write Event Services Application Information to File @@ -1150,14 +1152,14 @@ \sa #CFE_EVS_FILE_WRITE_LOG_DATA_CC, #CFE_EVS_SET_LOG_MODE_CC - + - + \cfeevscmd Write Event Log to File @@ -1190,14 +1192,14 @@ \sa #CFE_EVS_FILE_WRITE_APP_DATA_CC, #CFE_EVS_SET_LOG_MODE_CC, #CFE_EVS_CLEAR_LOG_CC - + - + \cfeevscmd Set Logging Mode @@ -1232,14 +1234,14 @@ \sa #CFE_EVS_FILE_WRITE_LOG_DATA_CC, #CFE_EVS_CLEAR_LOG_CC - + - + \cfeevscmd Clear Event Log @@ -1273,7 +1275,7 @@ \sa #CFE_EVS_FILE_WRITE_LOG_DATA_CC, #CFE_EVS_SET_LOG_MODE_CC - + @@ -1291,7 +1293,7 @@ - + diff --git a/modules/fs/eds/cfe_fs.xml b/modules/fs/eds/cfe_fs.xml new file mode 100644 index 000000000..50b123a7b --- /dev/null +++ b/modules/fs/eds/cfe_fs.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + Executive Services Exception/Reset Log File which is generated in response to a + \link #CFE_ES_WRITE_ERLOG_CC \ES_WRITEERLOG2FILE \endlink + command. + + + + + Executive Services System Log File which is generated in response to a + \link #CFE_ES_WRITE_SYSLOG_CC \ES_WRITESYSLOG2FILE \endlink + command. + + + + + Executive Services Information on All Applications File which is generated in response to a + \link #CFE_ES_QUERY_ALL_CC \ES_WRITEAPPINFO2FILE \endlink + command. + + + + + Executive Services Performance Analyzer Data File which is generated in response to a + \link #CFE_ES_PERF_STOPDATA_CC \ES_STOPLADATA \endlink + command. + + + + + Executive Services Shell Response Data File which is generated in response to a + \link #CFE_ES_SHELL_CMD_CC \ES_SHELL \endlink + command. + + + + + Executive Services Critical Data Store Registry Dump File which is generated in response to a + \link #CFE_ES_DUMP_CDS_REG_CC \ES_DUMPCDSREG \endlink + command. + + + + + Table Services Registry Dump File which is generated in response to a + \link #CFE_TBL_DUMP_REG_CC \TBL_WRITEREG2FILE \endlink + command. + + + + + Table Services Table Image File which is generated either on the ground or in response to a + \link #CFE_TBL_DUMP_CC \TBL_DUMP \endlink command. + + + + + Event Services Application Data Dump File which is generated in response to a + \link #CFE_EVS_FILE_WRITE_APP_DATA_CC \EVS_WRITEAPPDATA2FILE \endlink + command. + + + + + Event Services Local Event Log Dump File which is generated in response to a + \link #CFE_EVS_FILE_WRITE_LOG_DATA_CC \EVS_WRITELOG2FILE \endlink + command. + + + + + Software Bus Pipe Data Dump File which is generated in response to a + \link #CFE_SB_SEND_PIPE_INFO_CC \SB_WRITEPIPE2FILE \endlink + command. + + + + + Software Bus Message Routing Data Dump File which is generated in response to a + \link #CFE_SB_SEND_ROUTING_INFO_CC \SB_WRITEROUTING2FILE \endlink + command. + + + + + Software Bus Message Mapping Data Dump File which is generated in response to a + \link #CFE_SB_SEND_MAP_INFO_CC \SB_WRITEMAP2FILE \endlink + command. + + + + + Executive Services Query All Tasks Data File which is generated in response to a + \link #CFE_ES_QUERY_ALL_TASKS_CC \ES_WRITETASKINFO2FILE \endlink + command. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/resourceid/eds/cfe_resourceid.xml b/modules/resourceid/eds/cfe_resourceid.xml new file mode 100644 index 000000000..675558554 --- /dev/null +++ b/modules/resourceid/eds/cfe_resourceid.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/modules/sb/eds/cfe_sb.xml b/modules/sb/eds/cfe_sb.xml index 073f1313e..7fff096e8 100644 --- a/modules/sb/eds/cfe_sb.xml +++ b/modules/sb/eds/cfe_sb.xml @@ -25,21 +25,24 @@ - + - - - - - - + + + + + + + + + - + @@ -62,10 +65,44 @@ - + + + Currently an unused parameter in #CFE_SB_SubscribeEx + Intended to be used for interprocessor communication only + - - + + + + + + + + This statistics structure is output as part of the CFE SB + "Send Pipe Info" command (CFE_SB_SEND_PIPE_INFO_CC). + + Previous versions of CFE simply wrote the internal CFE_SB_PipeD_t object + to the file, but this also contains information such as pointers which are + not relevant outside the running CFE process. + + By defining the pipe info structure separately, it also provides some + independence, such that the internal CFE_SB_PipeD_t definition + can evolve without changing the binary format of the information + file. + + + + + + + + + + + + @@ -146,6 +183,11 @@ \cfetlmmnemonic \SB_DUPSUBCNT + + + \cfetlmmnemonic \SB_GETPIPEIDBYNAMEEC + + \cfetlmmnemonic \SB_PIPEOVREC @@ -156,7 +198,7 @@ \cfetlmmnemonic \SB_MSGLIMEC - + \cfetlmmnemonic \SB_MEMPOOLHANDLE @@ -184,21 +226,22 @@ \cfetlmmnemonic \SB_PDPIPEID - + \cfetlmmnemonic \SB_PDDEPTH - + \cfetlmmnemonic \SB_PDINUSE - + \cfetlmmnemonic \SB_PDPKINUSE + @@ -318,7 +361,7 @@ - + @@ -334,7 +377,7 @@ - + @@ -347,7 +390,7 @@ - + @@ -374,38 +417,47 @@ - + - + + + + + + + - + - + - + - + \cfesbcmd Software Bus No-Op @@ -434,11 +486,11 @@ None - + - + \cfesbcmd Software Bus Reset Counters @@ -471,11 +523,11 @@ values that are reset by this command. - + - + \cfesbcmd Send Software Bus Statistics @@ -509,11 +561,11 @@ \sa - + - + \cfesbcmd Write Software Bus Routing Info to a File @@ -556,14 +608,14 @@ \sa #CFE_SB_SEND_PIPE_INFO_CC, #CFE_SB_SEND_MAP_INFO_CC, #CFE_SB_WriteFileInfoCmd_t - + - + \cfesbcmd Enable Software Bus Route @@ -602,14 +654,14 @@ \sa #CFE_SB_SEND_ROUTING_INFO_CC, #CFE_SB_DISABLE_ROUTE_CC, #CFE_SB_EnableRouteCmd_t - + - + \cfesbcmd Disable Software Bus Route @@ -651,14 +703,14 @@ \sa #CFE_SB_SEND_ROUTING_INFO_CC, #CFE_SB_ENABLE_ROUTE_CC, #CFE_SB_EnableRouteCmd_t - + - + \cfesbcmd Write Pipe Info to a File @@ -701,14 +753,14 @@ \sa #CFE_SB_SEND_ROUTING_INFO_CC, #CFE_SB_SEND_MAP_INFO_CC - + - + \cfesbcmd Write Map Info to a File @@ -752,14 +804,14 @@ \sa #CFE_SB_SEND_ROUTING_INFO_CC, #CFE_SB_SEND_PIPE_INFO_CC - + - + \cfesbcmd Enable Subscription Reporting Command @@ -791,11 +843,11 @@ #CFE_SB_SEND_PREV_SUBS_CC - + - + \cfesbcmd Disable Subscription Reporting Command @@ -827,11 +879,11 @@ #CFE_SB_SEND_PREV_SUBS_CC - + - + \cfesbcmd Send Previous Subscriptions Command @@ -863,7 +915,7 @@ #CFE_SB_DISABLE_SUB_REPORTING_CC - + @@ -879,10 +931,10 @@ - + - + @@ -901,10 +953,10 @@ - + - + @@ -925,7 +977,7 @@ the software bus. This is typically the various types of telemetry that the application generates. - + @@ -953,7 +1005,7 @@ This is a receive-only interface; the Telemetry interface provides the equivalent send function. - + @@ -1015,10 +1067,15 @@ + + + + + - + @@ -1049,6 +1106,7 @@ + @@ -1058,6 +1116,7 @@ + diff --git a/modules/tbl/eds/cfe_tbl.xml b/modules/tbl/eds/cfe_tbl.xml index f3eacf07d..cce7acfe2 100644 --- a/modules/tbl/eds/cfe_tbl.xml +++ b/modules/tbl/eds/cfe_tbl.xml @@ -53,8 +53,8 @@ - - + + @@ -236,7 +236,7 @@ \cfetlmmnemonic \TBL_NUMFREESHRBUF - + \cfetlmmnemonic \TBL_MEMPOOLHANDLE @@ -269,9 +269,9 @@ - + - + \cfetlmmnemonic \TBL_SIZE @@ -281,17 +281,17 @@ \cfetlmmnemonic \TBL_CRC - + \cfetlmmnemonic \TBL_ACTBUFADD - + \cfetlmmnemonic \TBL_IACTBUFADD - + \cfetlmmnemonic \TBL_VALFUNCPTR @@ -301,9 +301,14 @@ \cfetlmmnemonic \TBL_TIMELASTUPD - + - \cfetlmmnemonic \TBL_FILECSECONDS + \cfetlmmnemonic \TBL_FILECSECONDS + + + + + \cfetlmmnemonic \TBL_FILECSUBSECONDS @@ -346,33 +351,36 @@ \cfetlmmnemonic \TBL_CRITICAL + - + + + - + - + - + - + - + \cfetblcmd Table No-Op @@ -399,11 +407,11 @@ None - + - + \cfetblcmd Table Reset Counters @@ -437,11 +445,11 @@ values that are reset by this command. - + - + \cfetblcmd Load Table @@ -491,14 +499,14 @@ \sa #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC - + - + \cfetblcmd Dump Table @@ -538,14 +546,14 @@ \sa #CFE_TBL_LOAD_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC - + - + \cfetblcmd Validate Table @@ -597,14 +605,14 @@ \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC - + - + \cfetblcmd Activate Table @@ -641,14 +649,14 @@ \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ABORT_LOAD_CC - + - + \cfetblcmd Dump Table Registry @@ -688,14 +696,14 @@ \sa #CFE_TBL_TLM_REG_CC - + - + \cfetblcmd Telemeter One Table Registry Entry @@ -728,14 +736,14 @@ \sa #CFE_TBL_DUMP_REG_CC - + - + \cfetblcmd Delete Critical Table from Critical Data Store @@ -777,14 +785,14 @@ \sa #CFE_ES_DUMP_CDS_REG_CC, #CFE_ES_DELETE_CDS_CC - + - + \cfetblcmd Abort Table Load @@ -821,7 +829,7 @@ \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC - + @@ -842,7 +850,7 @@ - + diff --git a/modules/time/eds/cfe_time.xml b/modules/time/eds/cfe_time.xml index 4be579eea..0e58d9605 100644 --- a/modules/time/eds/cfe_time.xml +++ b/modules/time/eds/cfe_time.xml @@ -42,6 +42,7 @@ + @@ -173,7 +174,8 @@ - + + @@ -182,7 +184,7 @@ - + @@ -236,7 +238,7 @@ \cfetlmmnemonic \TIME_STCFSUBSECS - + @@ -270,7 +272,7 @@ \cfetlmmnemonic \TIME_LEAPS - + \cfetlmmnemonic \TIME_APISTATE @@ -458,10 +460,25 @@ - + + + + + + + + + + + + + + - + + + \cfetimecmd Time No-Op @@ -490,11 +507,11 @@ None - + - + \cfetimecmd Time Reset Counters @@ -536,11 +553,11 @@ None - + - + \cfetimecmd Request TIME Diagnostic Telemetry @@ -573,7 +590,7 @@ \sa - + @@ -630,7 +647,7 @@ \sa #CFE_TIME_SET_STATE_CC, #CFE_TIME_SET_SIGNAL_CC - + @@ -697,7 +714,7 @@ \sa #CFE_TIME_SET_SOURCE_CC, #CFE_TIME_SET_SIGNAL_CC - + @@ -743,7 +760,7 @@ \sa #CFE_TIME_SUB_DELAY_CC - + @@ -790,7 +807,7 @@ \sa #CFE_TIME_ADD_DELAY_CC - + @@ -845,7 +862,7 @@ \sa #CFE_TIME_SET_MET_CC, #CFE_TIME_SET_STCF_CC, #CFE_TIME_SET_LEAPS_CC - + @@ -896,7 +913,7 @@ \sa #CFE_TIME_SET_TIME_CC, #CFE_TIME_SET_STCF_CC, #CFE_TIME_SET_LEAPS_CC - + @@ -941,7 +958,7 @@ \sa #CFE_TIME_SET_TIME_CC, #CFE_TIME_SET_MET_CC, #CFE_TIME_SET_LEAPS_CC - + @@ -984,7 +1001,7 @@ \sa #CFE_TIME_SET_TIME_CC, #CFE_TIME_SET_MET_CC, #CFE_TIME_SET_STCF_CC - + @@ -1027,7 +1044,7 @@ \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_1HZADJ_CC, #CFE_TIME_SUB_1HZADJ_CC - + @@ -1069,7 +1086,7 @@ \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_ADD_1HZADJ_CC, #CFE_TIME_SUB_1HZADJ_CC - + @@ -1125,7 +1142,7 @@ \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_SUB_1HZADJ_CC - + @@ -1181,7 +1198,7 @@ \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_1HZADJ_CC - + @@ -1232,26 +1249,26 @@ \sa #CFE_TIME_SET_STATE_CC, #CFE_TIME_SET_SOURCE_CC - + - + - + - + @@ -1272,7 +1289,7 @@ - + @@ -1283,12 +1300,12 @@ - + - + @@ -1298,7 +1315,7 @@ - + From bb60c19d4e1b256ea1a8b2db965a8cd301823df3 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 20 Dec 2022 11:11:32 -0500 Subject: [PATCH 131/200] Bump to v7.0.0-rc4+dev242 --- CHANGELOG.md | 6 ++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c49b189ad..5a13ff859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Development Build: v7.0.0-rc4+dev242 +- EDS Updates to match the current mainline +- Update UTs to use correct cmd types +- Move CRC types and convert to enum +- See , , and + ## Development Build: v7.0.0-rc4+dev233 - Replace CFE_MSG_CommandHeader_t w/ CFE_TBL_NoArgsCmd_t - See diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 6d48704d9..e31fe2ba3 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 233 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 242 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From c1f46aa8628e606c402ab1fc907cf46e35e5119a Mon Sep 17 00:00:00 2001 From: Justin Figueroa Date: Wed, 18 Jan 2023 14:21:07 -0500 Subject: [PATCH 132/200] Fix #2225, Adds workflow_dispatch to all workflows Adds time-staggered schedule workflows in addition to workflow_dispatch --- .github/workflows/build-documentation.yml | 5 +++++ .github/workflows/code-coverage.yml | 4 ++++ .github/workflows/codeql-build.yml | 4 ++++ .github/workflows/format-check.yml | 4 ++++ .github/workflows/functional-tests.yml | 4 ++++ .github/workflows/static-analysis.yml | 4 ++++ 6 files changed, 25 insertions(+) diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 5b00bd4cf..2f319de62 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -3,6 +3,11 @@ name: cFS Documentation and Guides on: push: pull_request: + workflow_dispatch: + schedule: + # 10:45 PM UTC every Sunday + - cron: '45 22 * * 0' + jobs: # Checks for duplicate actions. Skips push actions if there is a matching or diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index b7180a80f..45153fd92 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -3,6 +3,10 @@ name: "Code Coverage Analysis" on: push: pull_request: + workflow_dispatch: + schedule: + # 11:00 PM UTC every Sunday + - cron: '0 23 * * 0' env: SIMULATION: native diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 00a86762d..1c86e725d 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -3,6 +3,10 @@ name: "CodeQL Analysis" on: push: pull_request: + workflow_dispatch: + schedule: + # 11:15 PM UTC every Sunday + - cron: '15 23 * * 0' jobs: codeql: diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index bf12f09e2..61c101cff 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -4,6 +4,10 @@ name: Format Check on: push: pull_request: + workflow_dispatch: + schedule: + # 11:30 PM UTC every Sunday + - cron: '30 23 * * 0' jobs: format-check: diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index c989c6517..121c088dc 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -3,6 +3,10 @@ name: "Functional Test" on: push: pull_request: + workflow_dispatch: + schedule: + # 11:45 PM UTC every Sunday + - cron: '45 23 * * 0' env: SIMULATION: native diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 017f54bb8..d24c93fe7 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -4,6 +4,10 @@ name: Static Analysis on: push: pull_request: + workflow_dispatch: + schedule: + # 11:59 PM UTC every Sunday + - cron: '59 23 * * 0' jobs: static-analysis: From 97afef9d22647816b9a734f7a64ae99d543c0c9b Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 20 Jan 2023 08:26:49 -0500 Subject: [PATCH 133/200] Bump to v7.0.0-rc4+dev246 --- CHANGELOG.md | 4 ++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a13ff859..4b71a6738 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Development Build: v7.0.0-rc4+dev246 +- Adds workflow_dispatch to all workflows +- See + ## Development Build: v7.0.0-rc4+dev242 - EDS Updates to match the current mainline - Update UTs to use correct cmd types diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index e31fe2ba3..763a61262 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 242 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 246 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 0be50e96467f849520467e73a915977836ab1d50 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 15 Feb 2023 14:11:41 -0500 Subject: [PATCH 134/200] Fix #2243, CFE_TBL_FILEDEF does not need static Remove the "static" qualification from the TBL file def objects, it is not needed, and works fine without any special sauce here. This also adds extended documentation to all of the FILEDEF object members to explain naming conventions and recommended practice. --- modules/core_api/fsw/inc/cfe_tbl_filedef.h | 93 +++++++++++++++++----- 1 file changed, 73 insertions(+), 20 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_tbl_filedef.h b/modules/core_api/fsw/inc/cfe_tbl_filedef.h index 333a864c4..00ed99625 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_filedef.h +++ b/modules/core_api/fsw/inc/cfe_tbl_filedef.h @@ -49,30 +49,84 @@ #include "cfe_tbl_extern_typedefs.h" /* for "CFE_TBL_FileHdr_t" definition */ #include "cfe_fs_extern_typedefs.h" /* for "CFE_FS_HDR_DESC_MAX_LEN" definition */ -/* +/** + * \brief Table File summary object + * * The definition of the file definition metadata that can be used by * external tools (e.g. elf2cfetbl) to generate CFE table data files. */ typedef struct CFE_TBL_FileDef { - char ObjectName[64]; /**< \brief Name of instantiated variable that contains desired table image */ - char TableName[CFE_MISSION_TBL_MAX_FULL_NAME_LEN]; /**< \brief Name of Table as defined onboard */ - char Description[CFE_FS_HDR_DESC_MAX_LEN]; /**< \brief Description of table image that is included in cFE File - Header */ - char TgtFilename[CFE_MISSION_MAX_FILE_LEN]; /**< \brief Default filename to be used for output of elf2cfetbl utility - */ - uint32 ObjectSize; /**< \brief Size, in bytes, of instantiated object */ + /** + * \brief Name of instantiated variable that contains desired table image + * + * \note For consistency and future compatibility with auto-generated table files + * and table definitions, the "ObjectName" should match the table struct typedef + * name without the "_t" suffix. For example, the limit checker action table (ADT) + * is defined by a type called "LC_ADT_t", the ObjectName should be "LC_ADT". + * + * This naming convention allows the type name to be inferred from the ObjectName + * (and vice-versa) without having to directly specify both the type name and object + * name here. + * + * Although the traditional elf2cfetbl tool does not currently do any type checking, + * future tool versions may add more robust type verification and therefore need to + * know the type name as well as the object name. + */ + char ObjectName[64]; + + /** + * \brief Name of Table as defined onboard + * + * This should be in the form of "APP_NAME.TABLE_NAME" where APP_NAME matches what + * the app is named at runtime (the 4th column of cfe_es_startup.scr) and TABLE_NAME + * matches the 2nd parameter of the call to CFE_TBL_Register(). Preferably the + * TABLE_NAME should also match the ObjectName here in this structure, although this + * is not strictly required, it helps keep things consistent. + */ + char TableName[CFE_MISSION_TBL_MAX_FULL_NAME_LEN]; + + /** + * \brief Description of table image that is included in cFE File Header + * + * This is a free-form text string that can be any meaningful value + */ + char Description[CFE_FS_HDR_DESC_MAX_LEN]; + + /** + * \brief Default filename to be used for output of elf2cfetbl utility + * + * This must match the expected table file name, which is the name of the source file but + * the ".c" extension replaced with ".tbl". This is the filename only - do not include a + * directory/path name here, it can be copied to any runtime directory on the target by + * external scripts, but should not be renamed. + */ + char TgtFilename[CFE_MISSION_MAX_FILE_LEN]; + + /** + * \brief Size, in bytes, of instantiated object + * + * This may be used by tools to check for consistency between the actual defined table size + * and the expected table size. This is set automatically via the #CFE_TBL_FILEDEF macro. + */ + uint32 ObjectSize; } CFE_TBL_FileDef_t; -/** The CFE_TBL_FILEDEF macro can be used to simplify the declaration of a table image when using the elf2cfetbl -utility. -** -** Note that the macro adds a NULL at the end to ensure that it is null-terminated. (C allows -** a struct to be statically initialized with a string exactly the length of the array, which -** loses the null terminator.) This means the actual length limit of the fields are the above -** LEN - 1. -** -** An example of the source code and how this macro would be used is as follows: +/** + * \brief Macro to assist in with table definition object declaration + * + * See notes in the #CFE_TBL_FileDef_t structure type about naming conventions and + * recommended practices for the various fields. + * + * The CFE_TBL_FILEDEF macro can be used to simplify the declaration of a table image + * when using the elf2cfetbl utility. + * + * Note that the macro adds a NULL at the end to ensure that it is null-terminated. (C allows + * a struct to be statically initialized with a string exactly the length of the array, which + * loses the null terminator.) This means the actual length limit of the fields are the above + * LEN - 1. + * + * An example of the source code and how this macro would be used is as follows: \code #include "cfe_tbl_filedef.h" @@ -92,9 +146,8 @@ utility. \endcode */ -#define CFE_TBL_FILEDEF(ObjName, TblName, Desc, Filename) \ - static OS_USED CFE_TBL_FileDef_t CFE_TBL_FileDef = {#ObjName "\0", #TblName "\0", #Desc "\0", #Filename "\0", \ - sizeof(ObjName)}; +#define CFE_TBL_FILEDEF(ObjName, TblName, Desc, Filename) \ + CFE_TBL_FileDef_t CFE_TBL_FileDef = {#ObjName "\0", #TblName "\0", #Desc "\0", #Filename "\0", sizeof(ObjName)}; /*************************************************************************/ From 321298362043b878fc21c696585d0b0c7f1ab15c Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 16 Feb 2023 16:07:53 -0500 Subject: [PATCH 135/200] Bump to v7.0.0-rc4+dev250 --- CHANGELOG.md | 4 ++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b71a6738..3e9a48743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Development Build: v7.0.0-rc4+dev250 +- CFE_TBL_FILEDEF does not need static +- See + ## Development Build: v7.0.0-rc4+dev246 - Adds workflow_dispatch to all workflows - See diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 763a61262..1c1f071df 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 246 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 250 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 6af96c3d5a2cf28dd31dfdc4278ecfa93a4d78ce Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 9 Mar 2023 13:01:40 -0500 Subject: [PATCH 136/200] Fix #2253, update naming convention document Updates to cover event ID recommendations --- docs/cFS_IdentifierNamingConvention.md | 97 +++++++++++++++++--------- 1 file changed, 65 insertions(+), 32 deletions(-) diff --git a/docs/cFS_IdentifierNamingConvention.md b/docs/cFS_IdentifierNamingConvention.md index 79ca8c6f6..c64493bcb 100644 --- a/docs/cFS_IdentifierNamingConvention.md +++ b/docs/cFS_IdentifierNamingConvention.md @@ -22,9 +22,9 @@ four goals: The methodology sections below include the process in which the convention was selected along with some examples and proposed names. -## Background +## Background -The following are inputs from Database Managers and users from TIRS, TIRS2, +The following are inputs from Database Managers and users from TIRS, TIRS2, MMS, ATLAS, DISCOVER that serve as the basis for the naming convention proposal. ### Commands @@ -61,23 +61,23 @@ Some general rules/recommendations to follow for cFS identifiers: 1. Use command and parameter names that convey the intent of the corresponding command or parameter - -2. Use the simplest format possible for command names and parameters. - + +2. Use the simplest format possible for command names and parameters. + * Avoid abbreviation unless it is common usage/knowledge and/or - required to avoid character limit. + required to avoid character limit. -3. Remove words that are inherent in that type of the mnemonic. +3. Remove words that are inherent in that type of the mnemonic. - * `Noop` instead of `NoopCmd` + * `Noop` instead of `NoopCmd` * `HK` instead of `HK_Pkt_Tlm` if it is always a telemetry packet - * `Name` instead of `FileName` or `Path` instead of `FilePath` if the + * `Name` instead of `FileName` or `Path` instead of `FilePath` if the command only deals with files - + 4. Individual identifier names should consist of only alphanumeric characters - and underscores, and must _not_ begin with a digit as some languages disallow + and underscores, and must _not_ begin with a digit as some languages disallow identifiers that begin with digits (i.e. `ONEHZ` instead of `1HZ`). - + CamelCase is preferred for terms where possible, but in cases where existing terms are in common use the existing case should be preserved. @@ -90,25 +90,25 @@ Some general rules/recommendations to follow for cFS identifiers: * Application Name (aka Namespace, e.g. `CFE_ES`, `SCH`, `TO_LAB`, etc.) * Interface Name (aka Topic, e.g. `CMD`, `HK`, etc.) * Subcommand Name (if applicable, e.g. `Noop`, `Restart`, etc.) - + Example: `SPACECRAFT/cpu1/CFE_ES/CMD/Noop` - + 6. A consistent character should be used as a separator between terms, but the - specific separator character depends on what is most appropriate for the system, - tool, or language in use. Tools may use a forward slash (`/`), an + specific separator character depends on what is most appropriate for the system, + tool, or language in use. Tools may use a forward slash (`/`), an underscore (`_`), a period (`.`), or a double-colon (`::`) as necessary. - + Note that underscores are allowed characters within terms, so while it is acceptable to concatenate using underscores, it may not be possible to perform the reverse operation and determine the original terms in this case. -7. Terms at the far left or far right of a multi-part identifier may be omitted where +7. Terms at the far left or far right of a multi-part identifier may be omitted where they are not known or not necessary based on the context. * Modular software components should omit the Spacecraft and Processor names from the left hand side of identifiers used in flight software. - - * When referring to an entire application, such as in a test script, one may omit the + + * When referring to an entire application, such as in a test script, one may omit the Interface and Subcommand terms from the right hand side of identifiers. __NOTE__: a sufficient number of terms must always be used in order to ensure uniqueness @@ -118,10 +118,10 @@ Some general rules/recommendations to follow for cFS identifiers: ## Applicability to Actions / Commands This section specifically concerns the last term within a fully qualified command name, which -indicates the specific command to perform. As mentioned previously, command names should clearly -indicate the action being taken as well as the subject of the action. +indicates the specific command to perform. As mentioned previously, command names should clearly +indicate the action being taken as well as the subject of the action. -The recommended convention for command names is a CamelCase identifier consisting of the +The recommended convention for command names is a CamelCase identifier consisting of the action first, followed by the subject. Example action terms: @@ -147,22 +147,22 @@ Example subjects: __NOTE__: Clarity of the command name should supersede this recommendation where relevant. In cases where strictly following this convention would lead to command names that are less clear or do not -adequately convey intent, it is acceptable to not follow this convention. This recommendation is +adequately convey intent, it is acceptable to not follow this convention. This recommendation is mainly to avoid command identifiers which are a mixture of `CounterReset` and `ResetCounter`, etc. ## Applicability to Flight Software -This section documents some additional rules/recommendations to follow specifically for flight +This section documents some additional rules/recommendations to follow specifically for flight software code implemented in C or C++. In general, to avoid name conflicts, all global identifiers in software code must employ some level of namespace protection. -In C, any global software identifiers or terms should begin with the application name followed by -an underscore, e.g. `CFE_FS_FILE_CONTENT_ID`. +In C, any global software identifiers or terms should begin with the application name followed by +an underscore, e.g. `CFE_FS_FILE_CONTENT_ID`. -In C++, where applicable, the `namespace` keyword with the application name may be used here instead +In C++, where applicable, the `namespace` keyword with the application name may be used here instead of an underscore prefix as described below. ### Typedefs @@ -198,9 +198,9 @@ Rationale: When creating enumeration labels that exist in the global namespace (which is _always_ the case for C code), the label and type names must be constructed using a consistent convention. The labels should be prefixed -using the enumerated type name without the suffix, concatenated using an underscore. +using the enumerated type name without the suffix, concatenated using an underscore. -For example, in the CFE_EVS application, the "LogMode" parameter has two possible options, "OVERWRITE" +For example, in the CFE_EVS application, the "LogMode" parameter has two possible options, "OVERWRITE" and "DISCARD". Using this convention, the specific identifiers would be as follows: Basic type name in external tool/ground system: `CFE_EVS/LogMode` @@ -215,10 +215,44 @@ Label names in C code: Note that this recommendation is specific for C and C++ where the label names are in global scope. In other languages or systems where enumeration label is not automatically a global identifier, this prefix may not be required. +## Applicability to Events and Event Identifiers + +Most CFS applications also use event services (EVS) to send status messages, outside of the normal Telemetry stream. In +addition to the message text, events also contain a numeric event identifier (referred to as an "EventID" or "EID"). + +As these identifiers serve to associate a human-readable name with the numeric ID for event labeling purposes, an +enumeration is a natural fit for this purpose as well. The enumeration labels should follow all the same naming +conventions as any other enumeration, described above. + +For consistency, an enumeration used for this purpose should be named `EventID`, and the C typedef name for the +enumeration should follow the same pattern of `_EventID_Enum_t`. + +The labels should convey the event name as well as the type of the event, separated by an underscore, in all capital +letters. This should follow the general pattern of `_` where "EVT" is a 3-letter abbreviation. + +For example: + +| Event ID Label | Application | Event Description | Event Type | +| :------------------------: | :---------------: | :---------------: | :-----------: | +| `CFE_EVS_EventID_NOOP_INF` | CFE Event Service | NOOP Command | Informational | +| `HS_EventID_CR_PIPE_ERR` | Health & Safety | Create Pipe Error | Error | + +Common events should be named consistently across applications for ease of recognition. + +Common command/event descriptions include: + +| Event Name | Event Description | Event Type | +| :------------: | :--------------------------------------: | :-----------: | +| `MID_ERR` | Invalid Message ID Received | Error | +| `LEN_ERR` | Incorrect Message Length | Error | +| `CC_ERR` | Invalid Command Code Received | Error | +| `NOOP_INF` | No-op Command Success | Informational | +| `INIT_INF` | Applicaiton Initialization Success | Informational | +| `RESET_INF` | Reset Command Counters Command Success | Informational | # Appendix: Abbreviation Guide -In general it is preferable to use entire words unless this would create an identifier which is +In general it is preferable to use entire words unless this would create an identifier which is unacceptably long. However, in cases where words do need to be shortened, it is beneficial to be consistent in the abbreviated term. @@ -239,4 +273,3 @@ be abbreviated (e.g. use Error, not Err). Enable Ena Disable Dis Subscription Subscr - From 7fa014335115b6e3d7a3b9092a7d3762784d445d Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 14 Mar 2023 10:14:20 -0400 Subject: [PATCH 137/200] Fix #2240, improve 64-bit memory address handling in CMD/TLM The "CFE_ES_MemAddress_t" and "CFE_ES_MemOffset_t" types were intended to provide a path for easily upgrading the CMD/TLM structs from 32-bit to 64-bit memory addresses. However, this type was a bit overused and in some of those use-cases (e.g. in TBL header) it assumed that the type was 32-bits during the byte swap ops. As a result, the type could not be changed to 64 bits as intended. This reverts those cases in TBL back to uint32 (meaning that tables will still be limited to 32 bit sizes, even on 64 bit CPUs) but otherwise the addresses and sizes in ES/SB telemetry can grow to 64 bits as intended. For unit tests, correct operation depends on the availablily of an updated test macro that can compare integers as "size_t" type. (as opposed to uint32). --- modules/cfe_assert/inc/cfe_assert.h | 15 ------ modules/cfe_testcase/src/es_info_test.c | 46 +++++++----------- modules/cfe_testcase/src/es_mempool_test.c | 4 +- .../cfe_testcase/src/tbl_content_mang_test.c | 23 ++++----- modules/core_api/eds/base_types.xml | 28 +++++++++++ .../core_api/fsw/inc/cfe_es_extern_typedefs.h | 30 +++++++++--- .../fsw/inc/cfe_tbl_extern_typedefs.h | 12 +++-- .../core_private/ut-stubs/inc/ut_support.h | 15 ------ modules/es/eds/cfe_es.xml | 38 +++++++-------- modules/es/fsw/src/cfe_es_api.c | 4 +- modules/es/fsw/src/cfe_es_mempool.c | 3 +- modules/es/fsw/src/cfe_es_task.c | 13 ++--- modules/es/ut-coverage/es_UT.c | 48 +++++++++---------- modules/msg/ut-coverage/test_cfe_msg_init.c | 2 +- modules/sb/ut-coverage/sb_UT.c | 8 ++-- modules/tbl/eds/cfe_tbl.xml | 6 +-- modules/tbl/fsw/src/cfe_tbl_internal.c | 4 +- modules/tbl/fsw/src/cfe_tbl_task_cmds.c | 4 +- modules/tbl/ut-coverage/tbl_UT.c | 10 ++-- 19 files changed, 159 insertions(+), 154 deletions(-) diff --git a/modules/cfe_assert/inc/cfe_assert.h b/modules/cfe_assert/inc/cfe_assert.h index 52faa6d9d..082b0872e 100644 --- a/modules/cfe_assert/inc/cfe_assert.h +++ b/modules/cfe_assert/inc/cfe_assert.h @@ -110,21 +110,6 @@ typedef void (*CFE_Assert_StatusCallback_t)(uint8 MessageType, const char *Prefi #define CFE_Assert_RESOURCEID_UNDEFINED(id) \ UtAssert_True(!CFE_RESOURCEID_TEST_DEFINED(id), "%s (0x%lx) not defined", #id, CFE_RESOURCEID_TO_ULONG(id)) -/*****************************************************************************/ -/** -** \brief Macro to check CFE memory size/offset for equality -** -** \par Description -** A macro that checks two memory offset/size values for equality. -** -** \par Assumptions, External Events, and Notes: -** This is a simple unsigned comparison which logs the values as hexadecimal -** -******************************************************************************/ -#define CFE_Assert_MEMOFFSET_EQ(off1, off2) \ - UtAssert_GenericUnsignedCompare(off1, UtAssert_Compare_EQ, off2, UtAssert_Radix_HEX, __FILE__, __LINE__, \ - "Offset Check: ", #off1, #off2) - /*****************************************************************************/ /** ** \brief Macro to check CFE message ID for equality diff --git a/modules/cfe_testcase/src/es_info_test.c b/modules/cfe_testcase/src/es_info_test.c index c51f94cd9..020c7fb7a 100644 --- a/modules/cfe_testcase/src/es_info_test.c +++ b/modules/cfe_testcase/src/es_info_test.c @@ -70,24 +70,17 @@ void TestGetAppInfo(void) TestAppInfo.FileName); UtAssert_True(strlen(ESAppInfo.FileName) == 0, "ES App Info -> FileName = %s", ESAppInfo.FileName); - UtAssert_True(TestAppInfo.StackSize > 0, "Test App Info -> StackSz = %d", (int)TestAppInfo.StackSize); - UtAssert_True(ESAppInfo.StackSize > 0, "ES App Info -> StackSz = %d", (int)ESAppInfo.StackSize); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(TestAppInfo.StackSize)); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(ESAppInfo.StackSize)); if (TestAppInfo.AddressesAreValid) { - UtAssert_True(TestAppInfo.AddressesAreValid > 0, "Test App Info -> AddrsValid? = %d", - (int)TestAppInfo.AddressesAreValid); - UtAssert_True(TestAppInfo.CodeAddress > 0, "Test App Info -> CodeAddress = %ld", - (unsigned long)TestAppInfo.CodeAddress); - UtAssert_True(TestAppInfo.CodeSize > 0, "Test App Info -> CodeSize = %ld", - (unsigned long)TestAppInfo.CodeSize); - UtAssert_True(TestAppInfo.DataAddress > 0, "Test App Info -> DataAddress = %ld", - (unsigned long)TestAppInfo.DataAddress); - UtAssert_True(TestAppInfo.DataSize > 0, "Test App Info -> DataSize = %ld", - (unsigned long)TestAppInfo.DataSize); - UtAssert_True(TestAppInfo.BSSAddress > 0, "Test App Info -> BSSAddress = %ld", - (unsigned long)TestAppInfo.BSSAddress); - UtAssert_True(TestAppInfo.BSSSize > 0, "Test App Info -> BSSSize = %ld", (unsigned long)TestAppInfo.BSSSize); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(TestAppInfo.CodeAddress)); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(TestAppInfo.CodeSize)); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(TestAppInfo.DataAddress)); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(TestAppInfo.DataSize)); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(TestAppInfo.BSSAddress)); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(TestAppInfo.BSSSize)); } else { @@ -102,10 +95,8 @@ void TestGetAppInfo(void) UtAssert_True(ESAppInfo.AddressesAreValid == 0, "ES App Info -> AddrsValid? = %d", (int)ESAppInfo.AddressesAreValid); - UtAssert_True(TestAppInfo.StartAddress > 0, "Test App Info -> StartAddress = 0x%8lx", - (unsigned long)TestAppInfo.StartAddress); - UtAssert_True(ESAppInfo.StartAddress == 0, "ES App Info -> StartAddress = 0x%8lx", - (unsigned long)ESAppInfo.StartAddress); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(TestAppInfo.StartAddress)); + UtAssert_NULL(CFE_ES_MEMADDRESS_TO_PTR(ESAppInfo.StartAddress)); UtAssert_INT32_EQ(TestAppInfo.ExceptionAction, 0); UtAssert_INT32_EQ(ESAppInfo.ExceptionAction, 1); @@ -180,18 +171,17 @@ void TestGetLibInfo(void) UtAssert_StrCmp(LibInfo.EntryPoint, "CFE_Assert_LibInit", "Lib Info -> EntryPt = %s", LibInfo.EntryPoint); UtAssert_True(strstr(LibInfo.FileName, FileName) != NULL, "Lib Info -> FileName = %s contains %s", LibInfo.FileName, FileName); - UtAssert_True(LibInfo.StackSize == 0, "Lib Info -> StackSz = %d", (int)LibInfo.StackSize); + + UtAssert_ZERO(CFE_ES_MEMOFFSET_TO_SIZET(LibInfo.StackSize)); if (LibInfo.AddressesAreValid) { - UtAssert_True(LibInfo.AddressesAreValid > 0, "Lib Info -> AddrsValid? = %ld", - (unsigned long)LibInfo.AddressesAreValid); - UtAssert_True(LibInfo.CodeAddress > 0, "Lib Info -> CodeAddress = %ld", (unsigned long)LibInfo.CodeAddress); - UtAssert_True(LibInfo.CodeSize > 0, "Lib Info -> CodeSize = %ld", (unsigned long)LibInfo.CodeSize); - UtAssert_True(LibInfo.DataAddress > 0, "Lib Info -> DataAddress = %ld", (unsigned long)LibInfo.DataAddress); - UtAssert_True(LibInfo.DataSize > 0, "Lib Info -> DataSize = %ld", (unsigned long)LibInfo.DataSize); - UtAssert_True(LibInfo.BSSAddress > 0, "Lib Info -> BSSAddress = %ld", (unsigned long)LibInfo.BSSAddress); - UtAssert_True(LibInfo.BSSSize > 0, "Lib Info -> BSSSize = %ld", (unsigned long)LibInfo.BSSSize); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(LibInfo.CodeAddress)); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(LibInfo.CodeSize)); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(LibInfo.DataAddress)); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(LibInfo.DataSize)); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(LibInfo.BSSAddress)); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(LibInfo.BSSSize)); } else { diff --git a/modules/cfe_testcase/src/es_mempool_test.c b/modules/cfe_testcase/src/es_mempool_test.c index a1e7a0f8e..9878cb998 100644 --- a/modules/cfe_testcase/src/es_mempool_test.c +++ b/modules/cfe_testcase/src/es_mempool_test.c @@ -185,10 +185,10 @@ void TestMemPoolDelete(void) UtAssert_INT32_EQ(CFE_ES_PoolCreateEx(&PoolID, Buffer, sizeof(Buffer), 0, NULL, CFE_ES_NO_MUTEX), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_ES_GetMemPoolStats(&Stats, PoolID), CFE_SUCCESS); - UtAssert_UINT32_EQ(Stats.PoolSize, sizeof(Buffer)); + UtAssert_EQ(size_t, CFE_ES_MEMOFFSET_TO_SIZET(Stats.PoolSize), sizeof(Buffer)); UtAssert_UINT32_EQ(Stats.NumBlocksRequested, 0); UtAssert_UINT32_EQ(Stats.CheckErrCtr, 0); - UtAssert_UINT32_EQ(Stats.NumFreeBytes, sizeof(Buffer)); + UtAssert_EQ(size_t, CFE_ES_MEMOFFSET_TO_SIZET(Stats.NumFreeBytes), sizeof(Buffer)); UtAssert_INT32_EQ(CFE_ES_GetMemPoolStats(NULL, PoolID), CFE_ES_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_ES_GetMemPoolStats(&Stats, CFE_ES_MEMHANDLE_UNDEFINED), CFE_ES_ERR_RESOURCEID_NOT_VALID); diff --git a/modules/cfe_testcase/src/tbl_content_mang_test.c b/modules/cfe_testcase/src/tbl_content_mang_test.c index 5609f2f4b..ec1135980 100644 --- a/modules/cfe_testcase/src/tbl_content_mang_test.c +++ b/modules/cfe_testcase/src/tbl_content_mang_test.c @@ -248,22 +248,23 @@ void TestModified(void) UtAssert_INT32_EQ(CFE_TBL_Modified(CFE_TBL_BAD_TABLE_HANDLE), CFE_TBL_ERR_INVALID_HANDLE); } -/* Helper function to set a CFE_ES_MemOffset_t value (must be big-endian) */ -void TblTest_UpdateOffset(CFE_ES_MemOffset_t *TgtVal, CFE_ES_MemOffset_t SetVal) +/* Helper function to set a 32-bit table offset value (must be big-endian) */ +void TblTest_UpdateOffset(uint32 *TgtVal, size_t SetVal) { + size_t i; union { - CFE_ES_MemOffset_t offset; - uint8 bytes[sizeof(CFE_ES_MemOffset_t)]; + uint32 offset; + uint8 bytes[sizeof(uint32)]; } offsetbuf; - offsetbuf.bytes[3] = SetVal & 0xFF; - SetVal >>= 8; - offsetbuf.bytes[2] = SetVal & 0xFF; - SetVal >>= 8; - offsetbuf.bytes[1] = SetVal & 0xFF; - SetVal >>= 8; - offsetbuf.bytes[0] = SetVal & 0xFF; + i = sizeof(offsetbuf.bytes); + while (i > 0) + { + --i; + offsetbuf.bytes[i] = SetVal & 0xFF; + SetVal >>= 8; + } *TgtVal = offsetbuf.offset; } diff --git a/modules/core_api/eds/base_types.xml b/modules/core_api/eds/base_types.xml index 009375352..bbbe7b158 100644 --- a/modules/core_api/eds/base_types.xml +++ b/modules/core_api/eds/base_types.xml @@ -102,6 +102,34 @@ + + + + For backward compatibility with existing CFS code this should be uint32, + but all telemetry information will be limited to 4GB in size as a result. + + On 64-bit platforms this can be expanded to 64 bits which will allow larger + memory objects, but this will break compatibility with existing control + systems, and may also change the alignment/padding of some messages. + + In either case this must be an unsigned type, and should be large enough + to represent the largest memory address/size in use in the CFS system. + + + + + + + diff --git a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h index 638e6cc88..f30f381e8 100644 --- a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h @@ -381,11 +381,21 @@ typedef uint16 CFE_ES_TaskPriority_Atom_t; */ typedef uint32 CFE_ES_MemOffset_t; -/* +/** + * @brief Memory Offset initializer wrapper + * * A converter macro to use when initializing a CFE_ES_MemOffset_t * from an integer value of a different type. */ -#define CFE_ES_MEMOFFSET_C(x) ((CFE_ES_MemOffset_t)(x)) +#define CFE_ES_MEMOFFSET_C(x) ((CFE_ES_MemOffset_t)(x)) + +/** + * @brief Memory Offset to integer value (size_t) wrapper + * + * A converter macro to use when interpreting a CFE_ES_MemOffset_t + * value as a "size_t" type + */ +#define CFE_ES_MEMOFFSET_TO_SIZET(x) ((size_t)(x)) /** * @brief Type used for memory addresses in command and telemetry messages @@ -408,15 +418,21 @@ typedef uint32 CFE_ES_MemOffset_t; */ typedef uint32 CFE_ES_MemAddress_t; -/* +/** + * @brief Memory Address initializer wrapper + * * A converter macro to use when initializing a CFE_ES_MemAddress_t * from a pointer value of a different type. + */ +#define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x)&0xFFFFFFFF)) + +/** + * @brief Memory Address to pointer wrapper * - * @note on a 64 bit platform, this macro will truncate the address such - * that it will fit into a 32-bit telemetry field. Obviously, the resulting - * value is no longer usable as a memory address after this. + * A converter macro to use when interpreting a CFE_ES_MemAddress_t + * as a pointer value. */ -#define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x)&0xFFFFFFFF)) +#define CFE_ES_MEMADDRESS_TO_PTR(x) ((void *)(cpuaddr)(x)) /* * Data Structures shared between API and Message (CMD/TLM) interfaces diff --git a/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h index 60a813dff..f8fcbcfc5 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h @@ -66,13 +66,17 @@ typedef uint16 CFE_TBL_BufferSelect_Enum_t; * @brief The definition of the header fields that are included in CFE Table Data files. * * This header follows the CFE_FS header and precedes the actual table data. + * + * @note The Offset and NumBytes fields in the table header are to 32 bits for + * backward compatibility with existing CFE versions. This means that even on + * 64-bit CPUs, individual table files will be limited to 4GiB in size. */ typedef struct CFE_TBL_File_Hdr { - uint32 Reserved; /**< Future Use: NumTblSegments in File? */ - CFE_ES_MemOffset_t Offset; /**< Byte Offset at which load should commence */ - CFE_ES_MemOffset_t NumBytes; /**< Number of bytes to load into table */ - char TableName[CFE_MISSION_TBL_MAX_FULL_NAME_LEN]; /**< Fully qualified name of table to load */ + uint32 Reserved; /**< Future Use: NumTblSegments in File? */ + uint32 Offset; /**< Byte Offset at which load should commence */ + uint32 NumBytes; /**< Number of bytes to load into table */ + char TableName[CFE_MISSION_TBL_MAX_FULL_NAME_LEN]; /**< Fully qualified name of table to load */ } CFE_TBL_File_Hdr_t; #endif /* CFE_EDS_ENABLED_BUILD */ diff --git a/modules/core_private/ut-stubs/inc/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h index 32caf1d63..4bd7d9a86 100644 --- a/modules/core_private/ut-stubs/inc/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -753,21 +753,6 @@ bool CFE_UtAssert_MessageCheck_Impl(bool Status, const char *File, uint32 Line, UtAssert_GenericUnsignedCompare(CFE_RESOURCEID_TO_ULONG(id1), UtAssert_Compare_EQ, CFE_RESOURCEID_TO_ULONG(id2), \ UtAssert_Radix_HEX, __FILE__, __LINE__, "Resource ID Check: ", #id1, #id2) -/*****************************************************************************/ -/** -** \brief Macro to check CFE memory size/offset for equality -** -** \par Description -** A macro that checks two memory offset/size values for equality. -** -** \par Assumptions, External Events, and Notes: -** This is a simple unsigned comparison which logs the values as hexadecimal -** -******************************************************************************/ -#define CFE_UtAssert_MEMOFFSET_EQ(off1, off2) \ - UtAssert_GenericUnsignedCompare(off1, UtAssert_Compare_EQ, off2, UtAssert_Radix_HEX, __FILE__, __LINE__, \ - "Offset Check: ", #off1, #off2) - /*****************************************************************************/ /** ** \brief Macro to check CFE message ID for equality diff --git a/modules/es/eds/cfe_es.xml b/modules/es/eds/cfe_es.xml index 0832cb034..8548c4f3c 100644 --- a/modules/es/eds/cfe_es.xml +++ b/modules/es/eds/cfe_es.xml @@ -165,7 +165,7 @@ - + For backward compatibility with existing CFE code this should be uint32, but all telemetry information will be limited to 4GB in size as a result. @@ -176,13 +176,12 @@ In either case this must be an unsigned type. - - - - - + + + + - + For backward compatibility with existing CFE code this should be uint32, but if running on a 64-bit platform, addresses in telemetry will be @@ -200,11 +199,10 @@ provides independence between the message representation and local representation of a memory address. - - - - - + + + + @@ -246,7 +244,7 @@ \cfetlmmnemonic \ES_APPFILENAME - + \cfetlmmnemonic \ES_STACKSIZE @@ -353,7 +351,7 @@ - + @@ -432,7 +430,7 @@ - + \brief #CFE_ES_ExceptionAction_RESTART_APP=On exception, restart Application, @@ -632,12 +630,12 @@ \cfetlmmnemonic \ES_PSPMISSIONREV - + \cfetlmmnemonic \ES_SYSLOGBYTEUSED - + \cfetlmmnemonic \ES_SYSLOGSIZE @@ -752,17 +750,17 @@ \cfetlmmnemonic \ES_PERFDATA2WRITE - + \cfetlmmnemonic \ES_HEAPBYTESFREE - + \cfetlmmnemonic \ES_HEAPBLKSFREE - + \cfetlmmnemonic \ES_HEAPMAXBLK diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index 2a9c2b8a1..2992581f9 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -1044,7 +1044,7 @@ CFE_Status_t CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_AppId_t AppId) strncpy(AppInfo->MainTaskName, TaskRecPtr->TaskName, sizeof(AppInfo->MainTaskName) - 1); AppInfo->MainTaskName[sizeof(AppInfo->MainTaskName) - 1] = '\0'; - AppInfo->StackSize = TaskRecPtr->StartParams.StackSize; + AppInfo->StackSize = CFE_ES_MEMOFFSET_C(TaskRecPtr->StartParams.StackSize); AppInfo->Priority = TaskRecPtr->StartParams.Priority; } else @@ -1213,7 +1213,7 @@ CFE_Status_t CFE_ES_GetTaskInfo(CFE_ES_TaskInfo_t *TaskInfo, CFE_ES_TaskId_t Tas ** Get the other stats for the task */ TaskInfo->ExecutionCounter = TaskRecPtr->ExecutionCounter; - TaskInfo->StackSize = TaskRecPtr->StartParams.StackSize; + TaskInfo->StackSize = CFE_ES_MEMOFFSET_C(TaskRecPtr->StartParams.StackSize); TaskInfo->Priority = TaskRecPtr->StartParams.Priority; /* diff --git a/modules/es/fsw/src/cfe_es_mempool.c b/modules/es/fsw/src/cfe_es_mempool.c index 6d75ff86f..c3856eed6 100644 --- a/modules/es/fsw/src/cfe_es_mempool.c +++ b/modules/es/fsw/src/cfe_es_mempool.c @@ -697,7 +697,8 @@ bool CFE_ES_ValidateHandle(CFE_ES_MemHandle_t Handle) /* Test #3) Check memory address in PSP (allows both RAM and EEPROM) */ CFE_ES_GenPoolGetUsage(&PoolRecPtr->Pool, NULL, &TotalSize); - if (CFE_PSP_MemValidateRange(PoolRecPtr->BaseAddr, TotalSize, CFE_PSP_MEM_ANY) != CFE_PSP_SUCCESS) + if (CFE_PSP_MemValidateRange(PoolRecPtr->BaseAddr, CFE_ES_MEMOFFSET_TO_SIZET(TotalSize), CFE_PSP_MEM_ANY) != + CFE_PSP_SUCCESS) { return false; } diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index d31700d59..0219f7c25 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -744,9 +744,9 @@ int32 CFE_ES_HousekeepingCmd(const CFE_ES_SendHkCmd_t *data) } else { - CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree = 0; - CFE_ES_Global.TaskData.HkPacket.Payload.HeapBlocksFree = 0; - CFE_ES_Global.TaskData.HkPacket.Payload.HeapMaxBlockSize = 0; + CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree = CFE_ES_MEMOFFSET_C(0); + CFE_ES_Global.TaskData.HkPacket.Payload.HeapBlocksFree = CFE_ES_MEMOFFSET_C(0); + CFE_ES_Global.TaskData.HkPacket.Payload.HeapMaxBlockSize = CFE_ES_MEMOFFSET_C(0); } /* @@ -900,14 +900,11 @@ int32 CFE_ES_StartAppCmd(const CFE_ES_StartAppCmd_t *data) else { /* If stack size was provided, use it, otherwise use default. */ - if (cmd->StackSize == 0) + StartParams.MainTaskInfo.StackSize = CFE_ES_MEMOFFSET_TO_SIZET(cmd->StackSize); + if (StartParams.MainTaskInfo.StackSize == 0) { StartParams.MainTaskInfo.StackSize = CFE_PLATFORM_ES_DEFAULT_STACK_SIZE; } - else - { - StartParams.MainTaskInfo.StackSize = cmd->StackSize; - } StartParams.MainTaskInfo.Priority = cmd->Priority; StartParams.ExceptionAction = cmd->ExceptionAction; diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index f59480b46..68ae5b4e4 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -2109,7 +2109,7 @@ void TestERLog(void) UT_SetDeferredRetcode(UT_KEY(CFE_PSP_Exception_CopyContext), 1, 128); UtAssert_BOOL_FALSE(CFE_ES_BackgroundERLogFileDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); - CFE_UtAssert_MEMOFFSET_EQ(State.EntryBuffer.ContextSize, 128); + UtAssert_UINT32_EQ(State.EntryBuffer.ContextSize, 128); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); @@ -2208,7 +2208,7 @@ void TestGenericPool(void) /* Free a buffer and attempt to reallocate */ CFE_UtAssert_SUCCESS(CFE_ES_GenPoolPutBlock(&Pool1, &BlockSize, Offset2)); - CFE_UtAssert_MEMOFFSET_EQ(BlockSize, 72); + UtAssert_EQ(size_t, BlockSize, 72); /* Should not be able to free more than once */ /* This should increment the validation error count */ @@ -2217,7 +2217,7 @@ void TestGenericPool(void) UtAssert_NONZERO(Pool1.ValidationErrorCount); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool1, &Offset4, 100)); - CFE_UtAssert_MEMOFFSET_EQ(Offset4, Offset2); + UtAssert_EQ(size_t, Offset4, Offset2); /* Attempt Bigger than the largest bucket */ UtAssert_INT32_EQ(CFE_ES_GenPoolGetBlock(&Pool1, &Offset1, 1000), CFE_ES_ERR_MEM_BLOCK_SIZE); @@ -2235,9 +2235,9 @@ void TestGenericPool(void) UtAssert_VOIDCALL(CFE_ES_GenPoolGetBucketUsage(&Pool1, Pool1.NumBuckets + 1, &BlockStats)); /* Check various outputs to ensure correctness */ - CFE_UtAssert_MEMOFFSET_EQ(TotalSize, OffsetEnd); + UtAssert_EQ(size_t, CFE_ES_MEMOFFSET_TO_SIZET(TotalSize), OffsetEnd); UtAssert_UINT32_EQ(CountBuf, 3); - UtAssert_NONZERO(FreeSize); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(FreeSize)); /* put blocks so the pool has a mixture of allocated and deallocated blocks */ CFE_UtAssert_SUCCESS(CFE_ES_GenPoolPutBlock(&Pool1, &BlockSize, Offset1)); @@ -2251,7 +2251,7 @@ void TestGenericPool(void) CFE_UtAssert_SUCCESS(CFE_ES_GenPoolRebuild(&Pool2)); /* After rebuilding, Pool2 should have similar state data to Pool1. */ - CFE_UtAssert_MEMOFFSET_EQ(Pool1.TailPosition, Pool2.TailPosition); + UtAssert_EQ(size_t, Pool1.TailPosition, Pool2.TailPosition); UtAssert_UINT32_EQ(Pool1.AllocationCount, Pool2.AllocationCount); for (i = 0; i < Pool1.NumBuckets; ++i) @@ -2270,10 +2270,10 @@ void TestGenericPool(void) /* Get blocks again, from the recovered pool, to demonstrate that * the pool is functional after recovery. */ CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool2, &Offset3, 44)); - CFE_UtAssert_MEMOFFSET_EQ(Offset3, Offset1); + UtAssert_EQ(size_t, Offset3, Offset1); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool2, &Offset4, 72)); - CFE_UtAssert_MEMOFFSET_EQ(Offset4, Offset2); + UtAssert_EQ(size_t, Offset4, Offset2); /* Test successfully creating indirect memory pool, no alignment, with mutex */ memset(&UT_MemPoolIndirectBuffer, 0xee, sizeof(UT_MemPoolIndirectBuffer)); @@ -2287,19 +2287,19 @@ void TestGenericPool(void) CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool2, &Offset1, 1)); /* With no alignment adjustments, the result offset should be exactly matching */ - CFE_UtAssert_MEMOFFSET_EQ(Offset1, 2 + sizeof(CFE_ES_GenPoolBD_t)); + UtAssert_EQ(size_t, Offset1, 2 + sizeof(CFE_ES_GenPoolBD_t)); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool2, &Offset2, 55)); /* the previous block should be 4 in size (smallest block) */ - CFE_UtAssert_MEMOFFSET_EQ(Offset2, Offset1 + 4 + sizeof(CFE_ES_GenPoolBD_t)); + UtAssert_EQ(size_t, Offset2, Offset1 + 4 + sizeof(CFE_ES_GenPoolBD_t)); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool2, &Offset3, 15)); /* the previous block should be 56 in size */ - CFE_UtAssert_MEMOFFSET_EQ(Offset3, Offset2 + 56 + sizeof(CFE_ES_GenPoolBD_t)); + UtAssert_EQ(size_t, Offset3, Offset2 + 56 + sizeof(CFE_ES_GenPoolBD_t)); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool2, &Offset4, 54)); /* the previous block should be 16 in size */ - CFE_UtAssert_MEMOFFSET_EQ(Offset4, Offset3 + 16 + sizeof(CFE_ES_GenPoolBD_t)); + UtAssert_EQ(size_t, Offset4, Offset3 + 16 + sizeof(CFE_ES_GenPoolBD_t)); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolPutBlock(&Pool2, &BlockSize, Offset1)); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolPutBlock(&Pool2, &BlockSize, Offset2)); @@ -2308,12 +2308,12 @@ void TestGenericPool(void) CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool2, &Offset1, 56)); /* should re-issue previous block */ - CFE_UtAssert_MEMOFFSET_EQ(Offset4, Offset1); + UtAssert_EQ(size_t, Offset4, Offset1); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool2, &Offset3, 56)); /* should re-issue previous block */ - CFE_UtAssert_MEMOFFSET_EQ(Offset3, Offset2); + UtAssert_EQ(size_t, Offset3, Offset2); /* Getting another will fail, despite being enough space, * because its now fragmented. */ @@ -2346,8 +2346,8 @@ void TestGenericPool(void) CFE_ES_GenPoolGetCounts(&Pool1, &NumBlocks, &CountBuf, &ErrBuf); /* Check various outputs to ensure correctness */ - CFE_UtAssert_MEMOFFSET_EQ(TotalSize, OffsetEnd); - CFE_UtAssert_MEMOFFSET_EQ(FreeSize, 0); + UtAssert_EQ(size_t, CFE_ES_MEMOFFSET_TO_SIZET(TotalSize), OffsetEnd); + UtAssert_ZERO(CFE_ES_MEMOFFSET_TO_SIZET(FreeSize)); UtAssert_UINT32_EQ(CountBuf, 2); /* @@ -2590,13 +2590,13 @@ void TestTask(void) /* Test a successful HK request */ ES_ResetUnitTest(); UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); - UtAssert_NONZERO(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree); + UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree)); /* Test the HK request with a get heap failure */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(OS_HeapGetInfo), 1, -1); UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); - UtAssert_ZERO(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree); + UtAssert_ZERO(CFE_ES_MEMOFFSET_TO_SIZET(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree)); /* Test successful no-op command */ ES_ResetUnitTest(); @@ -5533,8 +5533,8 @@ void TestSysLog(void) CFE_ES_SysLogReadStart_Unsync(&SysLogBuffer); - CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.EndIdx, sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1); - CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.LastOffset, sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1); + UtAssert_EQ(size_t, SysLogBuffer.EndIdx, sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1); + UtAssert_EQ(size_t, SysLogBuffer.LastOffset, sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1); UtAssert_ZERO(SysLogBuffer.BlockSize); UtAssert_ZERO(SysLogBuffer.SizeLeft); @@ -5561,8 +5561,8 @@ void TestSysLog(void) CFE_ES_SysLogReadData(&SysLogBuffer); UtAssert_UINT32_EQ(SysLogBuffer.EndIdx, 3); - CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.LastOffset, 1); - CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.BlockSize, 1); + UtAssert_EQ(size_t, SysLogBuffer.LastOffset, 1); + UtAssert_EQ(size_t, SysLogBuffer.BlockSize, 1); UtAssert_ZERO(SysLogBuffer.SizeLeft); /* Test case where calculated blocksize results in 0 */ @@ -5573,8 +5573,8 @@ void TestSysLog(void) CFE_ES_SysLogReadData(&SysLogBuffer); UtAssert_UINT32_EQ(SysLogBuffer.EndIdx, 0); - CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.LastOffset, 0); - CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.BlockSize, 0); + UtAssert_EQ(size_t, SysLogBuffer.LastOffset, 0); + UtAssert_EQ(size_t, SysLogBuffer.BlockSize, 0); UtAssert_INT32_EQ(SysLogBuffer.SizeLeft, 1); /* Test nominal flow through CFE_ES_SysLogDump diff --git a/modules/msg/ut-coverage/test_cfe_msg_init.c b/modules/msg/ut-coverage/test_cfe_msg_init.c index 6e8f4a7dc..a072566ae 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_init.c +++ b/modules/msg/ut-coverage/test_cfe_msg_init.c @@ -67,7 +67,7 @@ void Test_MSG_Init(void) CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(CFE_MSG_PTR(cmd), &msgid_act)); UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); CFE_UtAssert_SUCCESS(CFE_MSG_GetSize(CFE_MSG_PTR(cmd), &size)); - CFE_UtAssert_MEMOFFSET_EQ(size, sizeof(cmd)); + UtAssert_EQ(size_t, size, sizeof(cmd)); CFE_UtAssert_SUCCESS(CFE_MSG_GetSegmentationFlag(CFE_MSG_PTR(cmd), &segflag)); UtAssert_INT32_EQ(segflag, CFE_MSG_SegFlag_Unsegmented); diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 272974836..ba6a3dded 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -3911,26 +3911,26 @@ void Test_CFE_SB_MsgHdrSize(void) type = CFE_MSG_Type_Invalid; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - CFE_UtAssert_MEMOFFSET_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_Message_t)); + UtAssert_EQ(size_t, CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_Message_t)); /* Has secondary, tlm type */ hassec = true; type = CFE_MSG_Type_Tlm; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - CFE_UtAssert_MEMOFFSET_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_TelemetryHeader_t)); + UtAssert_EQ(size_t, CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_TelemetryHeader_t)); /* Has secondary, cmd type */ type = CFE_MSG_Type_Cmd; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - CFE_UtAssert_MEMOFFSET_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_CommandHeader_t)); + UtAssert_EQ(size_t, CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_CommandHeader_t)); /* Has secondary, invalid type */ type = CFE_MSG_Type_Invalid; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - CFE_UtAssert_MEMOFFSET_EQ(CFE_SB_MsgHdrSize(&msg), 0); + UtAssert_ZERO(CFE_SB_MsgHdrSize(&msg)); /* * Note, this function currently has a type mismatch - it attempts to diff --git a/modules/tbl/eds/cfe_tbl.xml b/modules/tbl/eds/cfe_tbl.xml index cce7acfe2..344884e9e 100644 --- a/modules/tbl/eds/cfe_tbl.xml +++ b/modules/tbl/eds/cfe_tbl.xml @@ -46,15 +46,15 @@ - + - - + + diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index 72a6f5216..bb72f3477 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -852,7 +852,7 @@ int32 CFE_TBL_LoadFromFile(const char *AppName, CFE_TBL_LoadBuff_t *WorkingBuffe OS_read(FileDescriptor, ((uint8 *)WorkingBufferPtr->BufferPtr) + TblFileHeader.Offset, TblFileHeader.NumBytes); if (OsStatus >= OS_SUCCESS) { - NumBytes = (long)OsStatus; /* status code conversion (size) */ + NumBytes = OsStatus; /* status code conversion (size) */ } else { @@ -873,7 +873,7 @@ int32 CFE_TBL_LoadFromFile(const char *AppName, CFE_TBL_LoadBuff_t *WorkingBuffe OsStatus = OS_read(FileDescriptor, &ExtraByte, 1); if (OsStatus >= OS_SUCCESS) { - NumBytes = (long)OsStatus; /* status code conversion (size) */ + NumBytes = OsStatus; /* status code conversion (size) */ } else { diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c index c76db44a5..5af3f9da6 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -715,8 +715,8 @@ CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile(const char *DumpFilename, const char *Ta /* Initialize the Table Image Header for the Dump File */ strncpy(TblFileHeader.TableName, TableName, sizeof(TblFileHeader.TableName) - 1); TblFileHeader.TableName[sizeof(TblFileHeader.TableName) - 1] = 0; - TblFileHeader.Offset = CFE_ES_MEMOFFSET_C(0); - TblFileHeader.NumBytes = CFE_ES_MEMOFFSET_C(TblSizeInBytes); + TblFileHeader.Offset = 0; + TblFileHeader.NumBytes = TblSizeInBytes; TblFileHeader.Reserved = 0; /* Determine if this is a little endian processor */ diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index 102584a51..77db831f9 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -88,8 +88,8 @@ CFE_TBL_RegistryRec_t Original[CFE_PLATFORM_TBL_MAX_NUM_TABLES]; */ void UT_TBL_SetupHeader(CFE_TBL_File_Hdr_t *TblFileHeader, size_t Offset, size_t NumBytes) { - TblFileHeader->Offset = CFE_ES_MEMOFFSET_C(Offset); - TblFileHeader->NumBytes = CFE_ES_MEMOFFSET_C(NumBytes); + TblFileHeader->Offset = Offset; + TblFileHeader->NumBytes = NumBytes; if (UT_Endianess == UT_LITTLE_ENDIAN) { @@ -780,7 +780,7 @@ void Test_CFE_TBL_GetTblRegData(void) CFE_TBL_Global.TblRegPacket.Payload.InactiveBufferAddr = CFE_ES_MEMADDRESS_C(0); CFE_TBL_Global.Registry[CFE_TBL_Global.HkTlmTblRegIndex].DoubleBuffered = true; CFE_TBL_GetTblRegData(); - UtAssert_NONZERO(CFE_TBL_Global.TblRegPacket.Payload.InactiveBufferAddr); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(CFE_TBL_Global.TblRegPacket.Payload.InactiveBufferAddr)); /* Test using a single buffered table and the buffer is inactive */ UT_InitData(); @@ -788,14 +788,14 @@ void Test_CFE_TBL_GetTblRegData(void) CFE_TBL_Global.Registry[CFE_TBL_Global.HkTlmTblRegIndex].DoubleBuffered = false; CFE_TBL_Global.Registry[CFE_TBL_Global.HkTlmTblRegIndex].LoadInProgress = CFE_TBL_NO_LOAD_IN_PROGRESS + 1; CFE_TBL_GetTblRegData(); - UtAssert_NONZERO(CFE_TBL_Global.TblRegPacket.Payload.InactiveBufferAddr); + UtAssert_NOT_NULL(CFE_ES_MEMADDRESS_TO_PTR(CFE_TBL_Global.TblRegPacket.Payload.InactiveBufferAddr)); /* Test with no inactive buffer */ UT_InitData(); CFE_TBL_Global.TblRegPacket.Payload.InactiveBufferAddr = CFE_ES_MEMADDRESS_C(0); CFE_TBL_Global.Registry[CFE_TBL_Global.HkTlmTblRegIndex].LoadInProgress = CFE_TBL_NO_LOAD_IN_PROGRESS; CFE_TBL_GetTblRegData(); - UtAssert_ZERO(CFE_TBL_Global.TblRegPacket.Payload.InactiveBufferAddr); + UtAssert_NULL(CFE_ES_MEMADDRESS_TO_PTR(CFE_TBL_Global.TblRegPacket.Payload.InactiveBufferAddr)); } /* From c5adc7d7d42592c6a3028c23b6b3d1510f8c6dcc Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 16 Mar 2023 16:17:40 -0400 Subject: [PATCH 138/200] Bump to v7.0.0-rc4+dev254 --- CHANGELOG.md | 4 ++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e9a48743..ae4d6c98a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Development Build: v7.0.0-rc4+dev254 +- improve 64-bit memory address handling in CMD/TLM +- See + ## Development Build: v7.0.0-rc4+dev250 - CFE_TBL_FILEDEF does not need static - See diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 1c1f071df..db5077422 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 250 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 254 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 10b63dcd5fb8d2bcac1a2c744ea001594aa48e50 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 20 Mar 2023 09:54:45 -0400 Subject: [PATCH 139/200] Fix #2258, add more generic status codes Adds several more generic CFE_STATUS_ codes to be used for common validation and input processing conditions. --- modules/core_api/fsw/inc/cfe_error.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/core_api/fsw/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h index 90c69d56b..bd7138478 100644 --- a/modules/core_api/fsw/inc/cfe_error.h +++ b/modules/core_api/fsw/inc/cfe_error.h @@ -202,6 +202,30 @@ char *CFE_ES_StatusToString(CFE_Status_t status, CFE_StatusString_t *status_stri */ #define CFE_STATUS_REQUEST_ALREADY_PENDING ((int32)0xc8000006) +/** + * @brief Request or input value failed basic structural validation + * + * A message or table input was not in the proper format to be understood + * and processed by an application, and was rejected. + */ +#define CFE_STATUS_VALIDATION_FAILURE ((int32)0xc8000007) + +/** + * @brief Request or input value is out of range + * + * A message, table, or function call input contained a value that was outside + * the acceptable range, and the request was rejected. + */ +#define CFE_STATUS_RANGE_ERROR ((int32)0xc8000008) + +/** + * @brief Cannot process request at this time + * + * The system is not currently in the correct state to accept the request at + * this time. + */ +#define CFE_STATUS_INCORRECT_STATE ((int32)0xc8000009) + /** * @brief Not Implemented * From 999eb5fa95dbf38c7cfb0c2dc442eb679119e004 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 23 Mar 2023 11:33:18 -0400 Subject: [PATCH 140/200] Fix #2262, separate dispatcher for messages Isolate the message verification and dispatch from the general message processing. Functions in the "task" source file now strictly handle the command content, and do not get involved in general validation. Also note: this is mostly a simple code move but does add a "const" qualifier to the task pipe function where it was missing before. All of the handlers were already "const". --- .../core_private/ut-stubs/inc/ut_support.h | 2 +- .../core_private/ut-stubs/src/ut_support.c | 2 +- modules/es/CMakeLists.txt | 1 + modules/es/fsw/src/cfe_es_dispatch.c | 285 ++++++++++++++++ modules/es/fsw/src/cfe_es_dispatch.h | 44 +++ modules/es/fsw/src/cfe_es_module_all.h | 1 + modules/es/fsw/src/cfe_es_task.c | 249 -------------- modules/es/fsw/src/cfe_es_task.h | 12 - modules/evs/CMakeLists.txt | 5 +- modules/evs/fsw/src/cfe_evs_dispatch.c | 310 ++++++++++++++++++ modules/evs/fsw/src/cfe_evs_dispatch.h | 42 +++ modules/evs/fsw/src/cfe_evs_module_all.h | 1 + modules/evs/fsw/src/cfe_evs_task.c | 276 ---------------- modules/evs/fsw/src/cfe_evs_task.h | 8 - modules/sb/CMakeLists.txt | 8 +- modules/sb/fsw/src/cfe_sb_dispatch.c | 200 +++++++++++ modules/sb/fsw/src/cfe_sb_dispatch.h | 47 +++ modules/sb/fsw/src/cfe_sb_module_all.h | 1 + modules/sb/fsw/src/cfe_sb_priv.h | 8 - modules/sb/fsw/src/cfe_sb_task.c | 167 ---------- modules/tbl/CMakeLists.txt | 5 +- modules/tbl/fsw/src/cfe_tbl_dispatch.c | 224 +++++++++++++ modules/tbl/fsw/src/cfe_tbl_dispatch.h | 55 ++++ modules/tbl/fsw/src/cfe_tbl_module_all.h | 1 + modules/tbl/fsw/src/cfe_tbl_task.c | 177 ---------- modules/tbl/fsw/src/cfe_tbl_task.h | 15 - modules/tbl/fsw/src/cfe_tbl_task_cmds.h | 12 - modules/time/CMakeLists.txt | 5 +- modules/time/fsw/src/cfe_time_dispatch.c | 264 +++++++++++++++ modules/time/fsw/src/cfe_time_dispatch.h | 47 +++ modules/time/fsw/src/cfe_time_module_all.h | 1 + modules/time/fsw/src/cfe_time_task.c | 236 ------------- modules/time/fsw/src/cfe_time_utils.h | 6 - 33 files changed, 1530 insertions(+), 1187 deletions(-) create mode 100644 modules/es/fsw/src/cfe_es_dispatch.c create mode 100644 modules/es/fsw/src/cfe_es_dispatch.h create mode 100644 modules/evs/fsw/src/cfe_evs_dispatch.c create mode 100644 modules/evs/fsw/src/cfe_evs_dispatch.h create mode 100644 modules/sb/fsw/src/cfe_sb_dispatch.c create mode 100644 modules/sb/fsw/src/cfe_sb_dispatch.h create mode 100644 modules/tbl/fsw/src/cfe_tbl_dispatch.c create mode 100644 modules/tbl/fsw/src/cfe_tbl_dispatch.h create mode 100644 modules/time/fsw/src/cfe_time_dispatch.c create mode 100644 modules/time/fsw/src/cfe_time_dispatch.h diff --git a/modules/core_private/ut-stubs/inc/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h index 4bd7d9a86..cfd13cc8c 100644 --- a/modules/core_private/ut-stubs/inc/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -252,7 +252,7 @@ void UT_SetupBasicMsgDispatch(const UT_TaskPipeDispatchId_t *DispatchReq, CFE_MS ** \returns ** This function does not return a value. ******************************************************************************/ -void UT_CallTaskPipe(void (*TaskPipeFunc)(CFE_SB_Buffer_t *), CFE_MSG_Message_t *MsgPtr, size_t MsgSize, +void UT_CallTaskPipe(void (*TaskPipeFunc)(const CFE_SB_Buffer_t *), const CFE_MSG_Message_t *MsgPtr, size_t MsgSize, UT_TaskPipeDispatchId_t DispatchId); /*****************************************************************************/ diff --git a/modules/core_private/ut-stubs/src/ut_support.c b/modules/core_private/ut-stubs/src/ut_support.c index 639b607c8..887ce1125 100644 --- a/modules/core_private/ut-stubs/src/ut_support.c +++ b/modules/core_private/ut-stubs/src/ut_support.c @@ -236,7 +236,7 @@ void UT_SetupBasicMsgDispatch(const UT_TaskPipeDispatchId_t *DispatchReq, CFE_MS ** This first sets up the various stubs according to the test case, ** then invokes the pipe function. */ -void UT_CallTaskPipe(void (*TaskPipeFunc)(CFE_SB_Buffer_t *), CFE_MSG_Message_t *MsgPtr, size_t MsgSize, +void UT_CallTaskPipe(void (*TaskPipeFunc)(const CFE_SB_Buffer_t *), const CFE_MSG_Message_t *MsgPtr, size_t MsgSize, UT_TaskPipeDispatchId_t DispatchId) { union diff --git a/modules/es/CMakeLists.txt b/modules/es/CMakeLists.txt index 0e8ebe701..772166537 100644 --- a/modules/es/CMakeLists.txt +++ b/modules/es/CMakeLists.txt @@ -13,6 +13,7 @@ set(es_SOURCES fsw/src/cfe_es_backgroundtask.c fsw/src/cfe_es_cds.c fsw/src/cfe_es_cds_mempool.c + fsw/src/cfe_es_dispatch.c fsw/src/cfe_es_erlog.c fsw/src/cfe_es_generic_pool.c fsw/src/cfe_es_mempool.c diff --git a/modules/es/fsw/src/cfe_es_dispatch.c b/modules/es/fsw/src/cfe_es_dispatch.c new file mode 100644 index 000000000..2d0df7172 --- /dev/null +++ b/modules/es/fsw/src/cfe_es_dispatch.c @@ -0,0 +1,285 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Msg pipe dispatcher routines for CFE ES + */ + +/* + * Includes + */ +#include "cfe_es_module_all.h" + +#include "cfe_version.h" +#include "target_config.h" +#include "cfe_es_verify.h" + +#include "cfe_config.h" + +#include + +/*---------------------------------------------------------------- + * + * Application-scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +bool CFE_ES_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) +{ + bool result = true; + CFE_MSG_Size_t ActualLength = 0; + CFE_MSG_FcnCode_t FcnCode = 0; + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; + + CFE_MSG_GetSize(MsgPtr, &ActualLength); + + /* + ** Verify the command packet length + */ + if (ExpectedLength != ActualLength) + { + CFE_MSG_GetMsgId(MsgPtr, &MsgId); + CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); + + CFE_EVS_SendEvent(CFE_ES_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", + (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, + (unsigned int)ExpectedLength); + result = false; + CFE_ES_Global.TaskData.CommandErrorCounter++; + } + + return result; +} + +/*---------------------------------------------------------------- + * + * Application-scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_ES_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) +{ + CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; + CFE_MSG_FcnCode_t CommandCode = 0; + + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); + switch (CFE_SB_MsgIdToValue(MessageID)) + { + /* + ** Housekeeping telemetry request + */ + case CFE_ES_SEND_HK_MID: + CFE_ES_HousekeepingCmd((const CFE_ES_SendHkCmd_t *)SBBufPtr); + break; + + /* + ** ES task ground commands + */ + case CFE_ES_CMD_MID: + + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); + switch (CommandCode) + { + case CFE_ES_NOOP_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_NoopCmd_t))) + { + CFE_ES_NoopCmd((const CFE_ES_NoopCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_RESET_COUNTERS_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ResetCountersCmd_t))) + { + CFE_ES_ResetCountersCmd((const CFE_ES_ResetCountersCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_RESTART_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_RestartCmd_t))) + { + CFE_ES_RestartCmd((const CFE_ES_RestartCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_START_APP_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StartAppCmd_t))) + { + CFE_ES_StartAppCmd((const CFE_ES_StartAppCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_STOP_APP_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StopAppCmd_t))) + { + CFE_ES_StopAppCmd((const CFE_ES_StopAppCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_RESTART_APP_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_RestartAppCmd_t))) + { + CFE_ES_RestartAppCmd((const CFE_ES_RestartAppCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_RELOAD_APP_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ReloadAppCmd_t))) + { + CFE_ES_ReloadAppCmd((const CFE_ES_ReloadAppCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_QUERY_ONE_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryOneCmd_t))) + { + CFE_ES_QueryOneCmd((const CFE_ES_QueryOneCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_QUERY_ALL_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryAllCmd_t))) + { + CFE_ES_QueryAllCmd((const CFE_ES_QueryAllCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_QUERY_ALL_TASKS_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryAllTasksCmd_t))) + { + CFE_ES_QueryAllTasksCmd((const CFE_ES_QueryAllTasksCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_CLEAR_SYSLOG_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ClearSysLogCmd_t))) + { + CFE_ES_ClearSysLogCmd((const CFE_ES_ClearSysLogCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_WRITE_SYSLOG_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_WriteSysLogCmd_t))) + { + CFE_ES_WriteSysLogCmd((const CFE_ES_WriteSysLogCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_OVER_WRITE_SYSLOG_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_OverWriteSysLogCmd_t))) + { + CFE_ES_OverWriteSysLogCmd((const CFE_ES_OverWriteSysLogCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_CLEAR_ER_LOG_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ClearERLogCmd_t))) + { + CFE_ES_ClearERLogCmd((const CFE_ES_ClearERLogCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_WRITE_ER_LOG_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_WriteERLogCmd_t))) + { + CFE_ES_WriteERLogCmd((const CFE_ES_WriteERLogCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_START_PERF_DATA_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StartPerfDataCmd_t))) + { + CFE_ES_StartPerfDataCmd((const CFE_ES_StartPerfDataCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_STOP_PERF_DATA_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StopPerfDataCmd_t))) + { + CFE_ES_StopPerfDataCmd((const CFE_ES_StopPerfDataCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_SET_PERF_FILTER_MASK_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetPerfFilterMaskCmd_t))) + { + CFE_ES_SetPerfFilterMaskCmd((const CFE_ES_SetPerfFilterMaskCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_SET_PERF_TRIGGER_MASK_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetPerfTriggerMaskCmd_t))) + { + CFE_ES_SetPerfTriggerMaskCmd((const CFE_ES_SetPerfTriggerMaskCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_RESET_PR_COUNT_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ResetPRCountCmd_t))) + { + CFE_ES_ResetPRCountCmd((const CFE_ES_ResetPRCountCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_SET_MAX_PR_COUNT_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetMaxPRCountCmd_t))) + { + CFE_ES_SetMaxPRCountCmd((const CFE_ES_SetMaxPRCountCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_DELETE_CDS_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_DeleteCDSCmd_t))) + { + CFE_ES_DeleteCDSCmd((const CFE_ES_DeleteCDSCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_SEND_MEM_POOL_STATS_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SendMemPoolStatsCmd_t))) + { + CFE_ES_SendMemPoolStatsCmd((const CFE_ES_SendMemPoolStatsCmd_t *)SBBufPtr); + } + break; + + case CFE_ES_DUMP_CDS_REGISTRY_CC: + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_DumpCDSRegistryCmd_t))) + { + CFE_ES_DumpCDSRegistryCmd((const CFE_ES_DumpCDSRegistryCmd_t *)SBBufPtr); + } + break; + + default: + CFE_EVS_SendEvent(CFE_ES_CC1_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid ground command code: ID = 0x%X, CC = %d", + (unsigned int)CFE_SB_MsgIdToValue(MessageID), (int)CommandCode); + CFE_ES_Global.TaskData.CommandErrorCounter++; + break; + } + break; + + default: + + CFE_EVS_SendEvent(CFE_ES_MID_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command pipe message ID: 0x%X", + (unsigned int)CFE_SB_MsgIdToValue(MessageID)); + CFE_ES_Global.TaskData.CommandErrorCounter++; + break; + } +} diff --git a/modules/es/fsw/src/cfe_es_dispatch.h b/modules/es/fsw/src/cfe_es_dispatch.h new file mode 100644 index 000000000..35b157ff0 --- /dev/null +++ b/modules/es/fsw/src/cfe_es_dispatch.h @@ -0,0 +1,44 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * cFE Executive Services (ES) dispatch header file + * + */ + +#ifndef CFE_ES_DISPATCH_H +#define CFE_ES_DISPATCH_H + +/* +** Includes +*/ +#include "common_types.h" + +#include "cfe_es_api_typedefs.h" +#include "cfe_sb_api_typedefs.h" +#include "cfe_msg_api_typedefs.h" + +/*---------------------------------------------------------------------------------------*/ +/** + * Reads and processes messages from the executive services command pipe + */ +void CFE_ES_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr); + +#endif /* CFE_ES_DISPATCH_H */ diff --git a/modules/es/fsw/src/cfe_es_module_all.h b/modules/es/fsw/src/cfe_es_module_all.h index 4127dc483..e21006b26 100644 --- a/modules/es/fsw/src/cfe_es_module_all.h +++ b/modules/es/fsw/src/cfe_es_module_all.h @@ -49,6 +49,7 @@ #include "cfe_es_events.h" #include "cfe_es_start.h" #include "cfe_es_task.h" +#include "cfe_es_dispatch.h" #include "cfe_es_resource.h" #include "cfe_es_log.h" diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index 0219f7c25..a862ffabf 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -434,221 +434,6 @@ int32 CFE_ES_TaskInit(void) return CFE_SUCCESS; } -/*---------------------------------------------------------------- - * - * Application-scope internal function - * See description in header file for argument/return detail - * - *-----------------------------------------------------------------*/ -void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr) -{ - CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; - CFE_MSG_FcnCode_t CommandCode = 0; - - CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); - switch (CFE_SB_MsgIdToValue(MessageID)) - { - /* - ** Housekeeping telemetry request - */ - case CFE_ES_SEND_HK_MID: - CFE_ES_HousekeepingCmd((CFE_ES_SendHkCmd_t *)SBBufPtr); - break; - - /* - ** ES task ground commands - */ - case CFE_ES_CMD_MID: - - CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); - switch (CommandCode) - { - case CFE_ES_NOOP_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_NoopCmd_t))) - { - CFE_ES_NoopCmd((CFE_ES_NoopCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_RESET_COUNTERS_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ResetCountersCmd_t))) - { - CFE_ES_ResetCountersCmd((CFE_ES_ResetCountersCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_RESTART_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_RestartCmd_t))) - { - CFE_ES_RestartCmd((CFE_ES_RestartCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_START_APP_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StartAppCmd_t))) - { - CFE_ES_StartAppCmd((CFE_ES_StartAppCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_STOP_APP_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StopAppCmd_t))) - { - CFE_ES_StopAppCmd((CFE_ES_StopAppCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_RESTART_APP_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_RestartAppCmd_t))) - { - CFE_ES_RestartAppCmd((CFE_ES_RestartAppCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_RELOAD_APP_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ReloadAppCmd_t))) - { - CFE_ES_ReloadAppCmd((CFE_ES_ReloadAppCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_QUERY_ONE_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryOneCmd_t))) - { - CFE_ES_QueryOneCmd((CFE_ES_QueryOneCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_QUERY_ALL_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryAllCmd_t))) - { - CFE_ES_QueryAllCmd((CFE_ES_QueryAllCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_QUERY_ALL_TASKS_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryAllTasksCmd_t))) - { - CFE_ES_QueryAllTasksCmd((CFE_ES_QueryAllTasksCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_CLEAR_SYSLOG_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ClearSysLogCmd_t))) - { - CFE_ES_ClearSysLogCmd((CFE_ES_ClearSysLogCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_WRITE_SYSLOG_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_WriteSysLogCmd_t))) - { - CFE_ES_WriteSysLogCmd((CFE_ES_WriteSysLogCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_OVER_WRITE_SYSLOG_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_OverWriteSysLogCmd_t))) - { - CFE_ES_OverWriteSysLogCmd((CFE_ES_OverWriteSysLogCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_CLEAR_ER_LOG_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ClearERLogCmd_t))) - { - CFE_ES_ClearERLogCmd((CFE_ES_ClearERLogCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_WRITE_ER_LOG_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_WriteERLogCmd_t))) - { - CFE_ES_WriteERLogCmd((CFE_ES_WriteERLogCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_START_PERF_DATA_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StartPerfDataCmd_t))) - { - CFE_ES_StartPerfDataCmd((CFE_ES_StartPerfDataCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_STOP_PERF_DATA_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StopPerfDataCmd_t))) - { - CFE_ES_StopPerfDataCmd((CFE_ES_StopPerfDataCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_SET_PERF_FILTER_MASK_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetPerfFilterMaskCmd_t))) - { - CFE_ES_SetPerfFilterMaskCmd((CFE_ES_SetPerfFilterMaskCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_SET_PERF_TRIGGER_MASK_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetPerfTriggerMaskCmd_t))) - { - CFE_ES_SetPerfTriggerMaskCmd((CFE_ES_SetPerfTriggerMaskCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_RESET_PR_COUNT_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ResetPRCountCmd_t))) - { - CFE_ES_ResetPRCountCmd((CFE_ES_ResetPRCountCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_SET_MAX_PR_COUNT_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetMaxPRCountCmd_t))) - { - CFE_ES_SetMaxPRCountCmd((CFE_ES_SetMaxPRCountCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_DELETE_CDS_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_DeleteCDSCmd_t))) - { - CFE_ES_DeleteCDSCmd((CFE_ES_DeleteCDSCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_SEND_MEM_POOL_STATS_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SendMemPoolStatsCmd_t))) - { - CFE_ES_SendMemPoolStatsCmd((CFE_ES_SendMemPoolStatsCmd_t *)SBBufPtr); - } - break; - - case CFE_ES_DUMP_CDS_REGISTRY_CC: - if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_DumpCDSRegistryCmd_t))) - { - CFE_ES_DumpCDSRegistryCmd((CFE_ES_DumpCDSRegistryCmd_t *)SBBufPtr); - } - break; - - default: - CFE_EVS_SendEvent(CFE_ES_CC1_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid ground command code: ID = 0x%X, CC = %d", - (unsigned int)CFE_SB_MsgIdToValue(MessageID), (int)CommandCode); - CFE_ES_Global.TaskData.CommandErrorCounter++; - break; - } - break; - - default: - - CFE_EVS_SendEvent(CFE_ES_MID_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command pipe message ID: 0x%X", - (unsigned int)CFE_SB_MsgIdToValue(MessageID)); - CFE_ES_Global.TaskData.CommandErrorCounter++; - break; - } -} - /*---------------------------------------------------------------- * * Application-scope internal function @@ -1676,40 +1461,6 @@ int32 CFE_ES_WriteERLogCmd(const CFE_ES_WriteERLogCmd_t *data) return CFE_SUCCESS; } -/*---------------------------------------------------------------- - * - * Application-scope internal function - * See description in header file for argument/return detail - * - *-----------------------------------------------------------------*/ -bool CFE_ES_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) -{ - bool result = true; - CFE_MSG_Size_t ActualLength = 0; - CFE_MSG_FcnCode_t FcnCode = 0; - CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; - - CFE_MSG_GetSize(MsgPtr, &ActualLength); - - /* - ** Verify the command packet length - */ - if (ExpectedLength != ActualLength) - { - CFE_MSG_GetMsgId(MsgPtr, &MsgId); - CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); - - CFE_EVS_SendEvent(CFE_ES_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, - (unsigned int)ExpectedLength); - result = false; - CFE_ES_Global.TaskData.CommandErrorCounter++; - } - - return result; -} - /*---------------------------------------------------------------- * * Application-scope internal function diff --git a/modules/es/fsw/src/cfe_es_task.h b/modules/es/fsw/src/cfe_es_task.h index 04bb495fd..54bf57a0a 100644 --- a/modules/es/fsw/src/cfe_es_task.h +++ b/modules/es/fsw/src/cfe_es_task.h @@ -89,12 +89,6 @@ void CFE_ES_TaskMain(void); */ int32 CFE_ES_TaskInit(void); -/*---------------------------------------------------------------------------------------*/ -/** - * Reads and processes messages from the executive services command pipe - */ -void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); - /* * Functions related to the ES background helper task for low-priority tasks */ @@ -283,12 +277,6 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data); */ bool CFE_ES_ValidateHandle(CFE_ES_MemHandle_t Handle); -/*---------------------------------------------------------------------------------------*/ -/** - * \brief Verify command packet length - */ -bool CFE_ES_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength); - /*---------------------------------------------------------------------------------------*/ /** * \brief Notify of file write inconsistency diff --git a/modules/evs/CMakeLists.txt b/modules/evs/CMakeLists.txt index a406d1651..66cb966c8 100644 --- a/modules/evs/CMakeLists.txt +++ b/modules/evs/CMakeLists.txt @@ -12,10 +12,7 @@ set(evs_SOURCES fsw/src/cfe_evs_log.c fsw/src/cfe_evs_task.c fsw/src/cfe_evs_utils.c - fsw/src/cfe_evs.c - fsw/src/cfe_evs_log.c - fsw/src/cfe_evs_task.c - fsw/src/cfe_evs_utils.c + fsw/src/cfe_evs_dispatch.c ) add_library(evs STATIC ${evs_SOURCES}) diff --git a/modules/evs/fsw/src/cfe_evs_dispatch.c b/modules/evs/fsw/src/cfe_evs_dispatch.c new file mode 100644 index 000000000..53ee28f71 --- /dev/null +++ b/modules/evs/fsw/src/cfe_evs_dispatch.c @@ -0,0 +1,310 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Event services message dispatcher + */ + +/* Include Files */ +#include "cfe_evs_module_all.h" /* All EVS internal definitions and API */ + +#include + +/* +** Local function prototypes. +*/ +void CFE_EVS_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr, CFE_SB_MsgId_t MsgId); +bool CFE_EVS_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength); + +/*---------------------------------------------------------------- + * + * Application-scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_EVS_ProcessCommandPacket(const CFE_SB_Buffer_t *SBBufPtr) +{ + CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; + + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); + + /* Process all SB messages */ + switch (CFE_SB_MsgIdToValue(MessageID)) + { + case CFE_EVS_CMD_MID: + /* EVS task specific command */ + CFE_EVS_ProcessGroundCommand(SBBufPtr, MessageID); + break; + + case CFE_EVS_SEND_HK_MID: + /* Housekeeping request */ + CFE_EVS_ReportHousekeepingCmd((const CFE_EVS_SendHkCmd_t *)SBBufPtr); + break; + + default: + /* Unknown command -- should never occur */ + CFE_EVS_Global.EVS_TlmPkt.Payload.CommandErrorCounter++; + EVS_SendEvent(CFE_EVS_ERR_MSGID_EID, CFE_EVS_EventType_ERROR, "Invalid command packet, Message ID = 0x%08X", + (unsigned int)CFE_SB_MsgIdToValue(MessageID)); + break; + } +} + +/*---------------------------------------------------------------- + * + * Internal helper routine only, not part of API. + * + * This function processes a command, verifying that it is valid and of + * proper length. + * + *-----------------------------------------------------------------*/ +void CFE_EVS_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr, CFE_SB_MsgId_t MsgId) +{ + /* status will get reset if it passes length check */ + int32 Status = CFE_STATUS_WRONG_MSG_LENGTH; + CFE_MSG_FcnCode_t FcnCode = 0; + + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); + + /* Process "known" EVS task ground commands */ + switch (FcnCode) + { + case CFE_EVS_NOOP_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_NoopCmd_t))) + { + Status = CFE_EVS_NoopCmd((const CFE_EVS_NoopCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_RESET_COUNTERS_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetCountersCmd_t))) + { + Status = CFE_EVS_ResetCountersCmd((const CFE_EVS_ResetCountersCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_ENABLE_EVENT_TYPE_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableEventTypeCmd_t))) + { + Status = CFE_EVS_EnableEventTypeCmd((const CFE_EVS_EnableEventTypeCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_DISABLE_EVENT_TYPE_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableEventTypeCmd_t))) + { + Status = CFE_EVS_DisableEventTypeCmd((const CFE_EVS_DisableEventTypeCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_SET_EVENT_FORMAT_MODE_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetEventFormatModeCmd_t))) + { + Status = CFE_EVS_SetEventFormatModeCmd((const CFE_EVS_SetEventFormatModeCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_ENABLE_APP_EVENT_TYPE_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableAppEventTypeCmd_t))) + { + Status = CFE_EVS_EnableAppEventTypeCmd((const CFE_EVS_EnableAppEventTypeCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_DISABLE_APP_EVENT_TYPE_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableAppEventTypeCmd_t))) + { + Status = CFE_EVS_DisableAppEventTypeCmd((const CFE_EVS_DisableAppEventTypeCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_ENABLE_APP_EVENTS_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableAppEventsCmd_t))) + { + Status = CFE_EVS_EnableAppEventsCmd((const CFE_EVS_EnableAppEventsCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_DISABLE_APP_EVENTS_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableAppEventsCmd_t))) + { + Status = CFE_EVS_DisableAppEventsCmd((const CFE_EVS_DisableAppEventsCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_RESET_APP_COUNTER_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetAppCounterCmd_t))) + { + Status = CFE_EVS_ResetAppCounterCmd((const CFE_EVS_ResetAppCounterCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_SET_FILTER_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetFilterCmd_t))) + { + Status = CFE_EVS_SetFilterCmd((const CFE_EVS_SetFilterCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_ENABLE_PORTS_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnablePortsCmd_t))) + { + Status = CFE_EVS_EnablePortsCmd((const CFE_EVS_EnablePortsCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_DISABLE_PORTS_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisablePortsCmd_t))) + { + Status = CFE_EVS_DisablePortsCmd((const CFE_EVS_DisablePortsCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_RESET_FILTER_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetFilterCmd_t))) + { + Status = CFE_EVS_ResetFilterCmd((const CFE_EVS_ResetFilterCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_RESET_ALL_FILTERS_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetAllFiltersCmd_t))) + { + Status = CFE_EVS_ResetAllFiltersCmd((const CFE_EVS_ResetAllFiltersCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_ADD_EVENT_FILTER_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_AddEventFilterCmd_t))) + { + Status = CFE_EVS_AddEventFilterCmd((const CFE_EVS_AddEventFilterCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_DELETE_EVENT_FILTER_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DeleteEventFilterCmd_t))) + { + Status = CFE_EVS_DeleteEventFilterCmd((const CFE_EVS_DeleteEventFilterCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_WRITE_APP_DATA_FILE_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_WriteAppDataFileCmd_t))) + { + Status = CFE_EVS_WriteAppDataFileCmd((const CFE_EVS_WriteAppDataFileCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_SET_LOG_MODE_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetLogModeCmd_t))) + { + Status = CFE_EVS_SetLogModeCmd((const CFE_EVS_SetLogModeCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_CLEAR_LOG_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ClearLogCmd_t))) + { + Status = CFE_EVS_ClearLogCmd((const CFE_EVS_ClearLogCmd_t *)SBBufPtr); + } + break; + + case CFE_EVS_WRITE_LOG_DATA_FILE_CC: + + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_WriteLogDataFileCmd_t))) + { + Status = CFE_EVS_WriteLogDataFileCmd((const CFE_EVS_WriteLogDataFileCmd_t *)SBBufPtr); + } + break; + + /* default is a bad command code as it was not found above */ + default: + + EVS_SendEvent(CFE_EVS_ERR_CC_EID, CFE_EVS_EventType_ERROR, "Invalid command code -- ID = 0x%08x, CC = %u", + (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode); + Status = CFE_STATUS_BAD_COMMAND_CODE; + + break; + } + + if (Status == CFE_SUCCESS) + { + CFE_EVS_Global.EVS_TlmPkt.Payload.CommandCounter++; + } + else if (Status < 0) /* Negative values indicate errors */ + { + CFE_EVS_Global.EVS_TlmPkt.Payload.CommandErrorCounter++; + } +} + +/*---------------------------------------------------------------- + * + * Internal helper routine only, not part of API. + * + * This function validates the length of a command structure, and + * generates an error event if is not the expected length. + * + *-----------------------------------------------------------------*/ +bool CFE_EVS_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) +{ + bool result = true; + CFE_MSG_Size_t ActualLength = 0; + CFE_MSG_FcnCode_t FcnCode = 0; + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; + + CFE_MSG_GetSize(MsgPtr, &ActualLength); + + /* + ** Verify the command packet length + */ + if (ExpectedLength != ActualLength) + { + CFE_MSG_GetMsgId(MsgPtr, &MsgId); + CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); + + EVS_SendEvent(CFE_EVS_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", + (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, + (unsigned int)ExpectedLength); + result = false; + } + + return result; +} diff --git a/modules/evs/fsw/src/cfe_evs_dispatch.h b/modules/evs/fsw/src/cfe_evs_dispatch.h new file mode 100644 index 000000000..6cd50eba0 --- /dev/null +++ b/modules/evs/fsw/src/cfe_evs_dispatch.h @@ -0,0 +1,42 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Event Services API - Dispatch API + */ + +#ifndef CFE_EVS_DISPATCH_H +#define CFE_EVS_DISPATCH_H + +/********************************** Include Files ************************************/ +#include "common_types.h" +#include "cfe_evs_api_typedefs.h" +#include "cfe_sb_api_typedefs.h" +#include "cfe_msg_api_typedefs.h" + +/*---------------------------------------------------------------------------------------*/ +/** + * @brief Command Pipe Processing + * + * This function processes packets received on the EVS command pipe. + */ +void CFE_EVS_ProcessCommandPacket(const CFE_SB_Buffer_t *SBBufPtr); + +#endif /* CFE_EVS_DISPATCH_H */ diff --git a/modules/evs/fsw/src/cfe_evs_module_all.h b/modules/evs/fsw/src/cfe_evs_module_all.h index 6009b03dc..312d60789 100644 --- a/modules/evs/fsw/src/cfe_evs_module_all.h +++ b/modules/evs/fsw/src/cfe_evs_module_all.h @@ -43,5 +43,6 @@ #include "cfe_evs_task.h" /* EVS internal definitions */ #include "cfe_evs_log.h" /* EVS log file definitions */ #include "cfe_evs_utils.h" /* EVS utility function definitions */ +#include "cfe_evs_dispatch.h" #endif /* CFE_EVS_MODULE_ALL_H */ diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index 1dd39ca09..782a297c5 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -307,282 +307,6 @@ int32 CFE_EVS_TaskInit(void) return CFE_SUCCESS; } -/*---------------------------------------------------------------- - * - * Application-scope internal function - * See description in header file for argument/return detail - * - *-----------------------------------------------------------------*/ -void CFE_EVS_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr) -{ - CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; - - CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); - - /* Process all SB messages */ - switch (CFE_SB_MsgIdToValue(MessageID)) - { - case CFE_EVS_CMD_MID: - /* EVS task specific command */ - CFE_EVS_ProcessGroundCommand(SBBufPtr, MessageID); - break; - - case CFE_EVS_SEND_HK_MID: - /* Housekeeping request */ - CFE_EVS_ReportHousekeepingCmd((CFE_EVS_SendHkCmd_t *)SBBufPtr); - break; - - default: - /* Unknown command -- should never occur */ - CFE_EVS_Global.EVS_TlmPkt.Payload.CommandErrorCounter++; - EVS_SendEvent(CFE_EVS_ERR_MSGID_EID, CFE_EVS_EventType_ERROR, "Invalid command packet, Message ID = 0x%08X", - (unsigned int)CFE_SB_MsgIdToValue(MessageID)); - break; - } -} - -/*---------------------------------------------------------------- - * - * Internal helper routine only, not part of API. - * - * This function processes a command, verifying that it is valid and of - * proper length. - * - *-----------------------------------------------------------------*/ -void CFE_EVS_ProcessGroundCommand(CFE_SB_Buffer_t *SBBufPtr, CFE_SB_MsgId_t MsgId) -{ - /* status will get reset if it passes length check */ - int32 Status = CFE_STATUS_WRONG_MSG_LENGTH; - CFE_MSG_FcnCode_t FcnCode = 0; - - CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); - - /* Process "known" EVS task ground commands */ - switch (FcnCode) - { - case CFE_EVS_NOOP_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_NoopCmd_t))) - { - Status = CFE_EVS_NoopCmd((CFE_EVS_NoopCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_RESET_COUNTERS_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetCountersCmd_t))) - { - Status = CFE_EVS_ResetCountersCmd((CFE_EVS_ResetCountersCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_ENABLE_EVENT_TYPE_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableEventTypeCmd_t))) - { - Status = CFE_EVS_EnableEventTypeCmd((CFE_EVS_EnableEventTypeCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_DISABLE_EVENT_TYPE_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableEventTypeCmd_t))) - { - Status = CFE_EVS_DisableEventTypeCmd((CFE_EVS_DisableEventTypeCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_SET_EVENT_FORMAT_MODE_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetEventFormatModeCmd_t))) - { - Status = CFE_EVS_SetEventFormatModeCmd((CFE_EVS_SetEventFormatModeCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_ENABLE_APP_EVENT_TYPE_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableAppEventTypeCmd_t))) - { - Status = CFE_EVS_EnableAppEventTypeCmd((CFE_EVS_EnableAppEventTypeCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_DISABLE_APP_EVENT_TYPE_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableAppEventTypeCmd_t))) - { - Status = CFE_EVS_DisableAppEventTypeCmd((CFE_EVS_DisableAppEventTypeCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_ENABLE_APP_EVENTS_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableAppEventsCmd_t))) - { - Status = CFE_EVS_EnableAppEventsCmd((CFE_EVS_EnableAppEventsCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_DISABLE_APP_EVENTS_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableAppEventsCmd_t))) - { - Status = CFE_EVS_DisableAppEventsCmd((CFE_EVS_DisableAppEventsCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_RESET_APP_COUNTER_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetAppCounterCmd_t))) - { - Status = CFE_EVS_ResetAppCounterCmd((CFE_EVS_ResetAppCounterCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_SET_FILTER_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetFilterCmd_t))) - { - Status = CFE_EVS_SetFilterCmd((CFE_EVS_SetFilterCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_ENABLE_PORTS_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnablePortsCmd_t))) - { - Status = CFE_EVS_EnablePortsCmd((CFE_EVS_EnablePortsCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_DISABLE_PORTS_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisablePortsCmd_t))) - { - Status = CFE_EVS_DisablePortsCmd((CFE_EVS_DisablePortsCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_RESET_FILTER_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetFilterCmd_t))) - { - Status = CFE_EVS_ResetFilterCmd((CFE_EVS_ResetFilterCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_RESET_ALL_FILTERS_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetAllFiltersCmd_t))) - { - Status = CFE_EVS_ResetAllFiltersCmd((CFE_EVS_ResetAllFiltersCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_ADD_EVENT_FILTER_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_AddEventFilterCmd_t))) - { - Status = CFE_EVS_AddEventFilterCmd((CFE_EVS_AddEventFilterCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_DELETE_EVENT_FILTER_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DeleteEventFilterCmd_t))) - { - Status = CFE_EVS_DeleteEventFilterCmd((CFE_EVS_DeleteEventFilterCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_WRITE_APP_DATA_FILE_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_WriteAppDataFileCmd_t))) - { - Status = CFE_EVS_WriteAppDataFileCmd((CFE_EVS_WriteAppDataFileCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_SET_LOG_MODE_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetLogModeCmd_t))) - { - Status = CFE_EVS_SetLogModeCmd((CFE_EVS_SetLogModeCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_CLEAR_LOG_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ClearLogCmd_t))) - { - Status = CFE_EVS_ClearLogCmd((CFE_EVS_ClearLogCmd_t *)SBBufPtr); - } - break; - - case CFE_EVS_WRITE_LOG_DATA_FILE_CC: - - if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_WriteLogDataFileCmd_t))) - { - Status = CFE_EVS_WriteLogDataFileCmd((CFE_EVS_WriteLogDataFileCmd_t *)SBBufPtr); - } - break; - - /* default is a bad command code as it was not found above */ - default: - - EVS_SendEvent(CFE_EVS_ERR_CC_EID, CFE_EVS_EventType_ERROR, "Invalid command code -- ID = 0x%08x, CC = %u", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode); - Status = CFE_STATUS_BAD_COMMAND_CODE; - - break; - } - - if (Status == CFE_SUCCESS) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.CommandCounter++; - } - else if (Status < 0) /* Negative values indicate errors */ - { - CFE_EVS_Global.EVS_TlmPkt.Payload.CommandErrorCounter++; - } -} - -/*---------------------------------------------------------------- - * - * Internal helper routine only, not part of API. - * - * This function validates the length of a command structure, and - * generates an error event if is not the expected length. - * - *-----------------------------------------------------------------*/ -bool CFE_EVS_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) -{ - bool result = true; - CFE_MSG_Size_t ActualLength = 0; - CFE_MSG_FcnCode_t FcnCode = 0; - CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; - - CFE_MSG_GetSize(MsgPtr, &ActualLength); - - /* - ** Verify the command packet length - */ - if (ExpectedLength != ActualLength) - { - CFE_MSG_GetMsgId(MsgPtr, &MsgId); - CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); - - EVS_SendEvent(CFE_EVS_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, - (unsigned int)ExpectedLength); - result = false; - } - - return result; -} - /*---------------------------------------------------------------- * * Application-scope internal function diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index e22c498ad..f8274057e 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -143,14 +143,6 @@ extern CFE_EVS_Global_t CFE_EVS_Global; */ int32 CFE_EVS_TaskInit(void); -/*---------------------------------------------------------------------------------------*/ -/** - * @brief Command Pipe Processing - * - * This function processes packets received on the EVS command pipe. - */ -void CFE_EVS_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr); - /* * EVS Message Handler Functions */ diff --git a/modules/sb/CMakeLists.txt b/modules/sb/CMakeLists.txt index 4362a2774..d7b9ecac7 100644 --- a/modules/sb/CMakeLists.txt +++ b/modules/sb/CMakeLists.txt @@ -13,13 +13,7 @@ set(sb_SOURCES fsw/src/cfe_sb_init.c fsw/src/cfe_sb_msg_id_util.c fsw/src/cfe_sb_priv.c - fsw/src/cfe_sb_task.c - fsw/src/cfe_sb_util.c - fsw/src/cfe_sb_api.c - fsw/src/cfe_sb_buf.c - fsw/src/cfe_sb_init.c - fsw/src/cfe_sb_msg_id_util.c - fsw/src/cfe_sb_priv.c + fsw/src/cfe_sb_dispatch.c fsw/src/cfe_sb_task.c fsw/src/cfe_sb_util.c ) diff --git a/modules/sb/fsw/src/cfe_sb_dispatch.c b/modules/sb/fsw/src/cfe_sb_dispatch.c new file mode 100644 index 000000000..9db5f9770 --- /dev/null +++ b/modules/sb/fsw/src/cfe_sb_dispatch.c @@ -0,0 +1,200 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/****************************************************************************** +** File: cfe_sb_task.c +** +** Purpose: +** This file contains the source code for the SB task. +** +** Author: R.McGraw/SSI +** +******************************************************************************/ + +/* Include Files */ + +#include "cfe_sb_module_all.h" + +#include + +/*---------------------------------------------------------------- + * + * Internal helper routine only, not part of API. + * + * Verifies the length of incoming SB command packets, returns true if acceptable + * + *-----------------------------------------------------------------*/ +bool CFE_SB_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) +{ + bool result = true; + CFE_MSG_Size_t ActualLength = 0; + CFE_MSG_FcnCode_t FcnCode = 0; + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; + + CFE_MSG_GetSize(MsgPtr, &ActualLength); + + /* + ** Verify the command packet length + */ + if (ExpectedLength != ActualLength) + { + CFE_MSG_GetMsgId(MsgPtr, &MsgId); + CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); + + CFE_EVS_SendEvent(CFE_SB_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", + (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, + (unsigned int)ExpectedLength); + result = false; + ++CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter; + } + + return result; +} + +/*---------------------------------------------------------------- + * + * Application-scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_SB_ProcessCmdPipePkt(const CFE_SB_Buffer_t *SBBufPtr) +{ + CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; + CFE_MSG_FcnCode_t FcnCode = 0; + + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); + + switch (CFE_SB_MsgIdToValue(MessageID)) + { + case CFE_SB_SEND_HK_MID: + /* Note: Command counter not incremented for this command */ + CFE_SB_SendHKTlmCmd((const CFE_MSG_CommandHeader_t *)SBBufPtr); + break; + + case CFE_SB_SUB_RPT_CTRL_MID: + /* Note: Command counter not incremented for this command */ + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); + switch (FcnCode) + { + case CFE_SB_SEND_PREV_SUBS_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendPrevSubsCmd_t))) + { + CFE_SB_SendPrevSubsCmd((const CFE_SB_SendPrevSubsCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_ENABLE_SUB_REPORTING_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_EnableSubReportingCmd_t))) + { + CFE_SB_EnableSubReportingCmd((const CFE_SB_EnableSubReportingCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_DISABLE_SUB_REPORTING_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_DisableSubReportingCmd_t))) + { + CFE_SB_DisableSubReportingCmd((const CFE_SB_DisableSubReportingCmd_t *)SBBufPtr); + } + break; + + default: + CFE_EVS_SendEvent(CFE_SB_BAD_CMD_CODE_EID, CFE_EVS_EventType_ERROR, + "Invalid Cmd, Unexpected Command Code %u", (unsigned int)FcnCode); + CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++; + break; + } /* end switch on cmd code */ + break; + + case CFE_SB_CMD_MID: + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); + switch (FcnCode) + { + case CFE_SB_NOOP_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_NoopCmd_t))) + { + CFE_SB_NoopCmd((const CFE_SB_NoopCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_RESET_COUNTERS_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_ResetCountersCmd_t))) + { + /* Note: Command counter not incremented for this command */ + CFE_SB_ResetCountersCmd((const CFE_SB_ResetCountersCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_SEND_SB_STATS_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendSbStatsCmd_t))) + { + CFE_SB_SendStatsCmd((const CFE_SB_SendSbStatsCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_WRITE_ROUTING_INFO_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_WriteRoutingInfoCmd_t))) + { + CFE_SB_WriteRoutingInfoCmd((const CFE_SB_WriteRoutingInfoCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_ENABLE_ROUTE_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_EnableRouteCmd_t))) + { + CFE_SB_EnableRouteCmd((const CFE_SB_EnableRouteCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_DISABLE_ROUTE_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_DisableRouteCmd_t))) + { + CFE_SB_DisableRouteCmd((const CFE_SB_DisableRouteCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_WRITE_PIPE_INFO_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_WritePipeInfoCmd_t))) + { + CFE_SB_WritePipeInfoCmd((const CFE_SB_WritePipeInfoCmd_t *)SBBufPtr); + } + break; + + case CFE_SB_WRITE_MAP_INFO_CC: + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_WriteMapInfoCmd_t))) + { + CFE_SB_WriteMapInfoCmd((const CFE_SB_WriteMapInfoCmd_t *)SBBufPtr); + } + break; + + default: + CFE_EVS_SendEvent(CFE_SB_BAD_CMD_CODE_EID, CFE_EVS_EventType_ERROR, + "Invalid Cmd, Unexpected Command Code %u", FcnCode); + CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++; + break; + } /* end switch on cmd code */ + break; + + default: + CFE_EVS_SendEvent(CFE_SB_BAD_MSGID_EID, CFE_EVS_EventType_ERROR, "Invalid Cmd, Unexpected Msg Id: 0x%x", + (unsigned int)CFE_SB_MsgIdToValue(MessageID)); + CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++; + break; + + } /* end switch on MsgId */ +} diff --git a/modules/sb/fsw/src/cfe_sb_dispatch.h b/modules/sb/fsw/src/cfe_sb_dispatch.h new file mode 100644 index 000000000..4857bda90 --- /dev/null +++ b/modules/sb/fsw/src/cfe_sb_dispatch.h @@ -0,0 +1,47 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * This header file contains prototypes for private functions and type + * definitions for SB internal use. + * + * Author: R.McGraw/SSI + * + */ + +#ifndef CFE_SB_DISPATCH_H +#define CFE_SB_DISPATCH_H + +/* +** Includes +*/ +#include "common_types.h" +#include "cfe_sb_api_typedefs.h" + +/*---------------------------------------------------------------------------------------*/ +/** + * Processes a single message buffer that has been received from the command pipe + * + * @param SBBufPtr Software bus buffer pointer + */ +void CFE_SB_ProcessCmdPipePkt(const CFE_SB_Buffer_t *SBBufPtr); + +#endif /* CFE_SB_DISPATCH_H */ diff --git a/modules/sb/fsw/src/cfe_sb_module_all.h b/modules/sb/fsw/src/cfe_sb_module_all.h index 8889993fc..fe3070205 100644 --- a/modules/sb/fsw/src/cfe_sb_module_all.h +++ b/modules/sb/fsw/src/cfe_sb_module_all.h @@ -43,6 +43,7 @@ #include "cfe_sb_events.h" #include "cfe_sb_destination_typedef.h" #include "cfe_sb_msg.h" +#include "cfe_sb_dispatch.h" #include "cfe_sbr.h" #include "cfe_core_resourceid_basevalues.h" diff --git a/modules/sb/fsw/src/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h index 76cbc93fd..9443c6094 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -331,14 +331,6 @@ void CFE_SB_LockSharedData(const char *FuncName, int32 LineNumber); */ void CFE_SB_UnlockSharedData(const char *FuncName, int32 LineNumber); -/*---------------------------------------------------------------------------------------*/ -/** - * Processes a single message buffer that has been received from the command pipe - * - * @param SBBufPtr Software bus buffer pointer - */ -void CFE_SB_ProcessCmdPipePkt(CFE_SB_Buffer_t *SBBufPtr); - /*---------------------------------------------------------------------------------------*/ /** * Function to reset the SB housekeeping counters. diff --git a/modules/sb/fsw/src/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c index c651056e8..2f99e48f0 100644 --- a/modules/sb/fsw/src/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -277,173 +277,6 @@ int32 CFE_SB_AppInit(void) return CFE_SUCCESS; } -/*---------------------------------------------------------------- - * - * Internal helper routine only, not part of API. - * - * Verifies the length of incoming SB command packets, returns true if acceptable - * - *-----------------------------------------------------------------*/ -bool CFE_SB_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) -{ - bool result = true; - CFE_MSG_Size_t ActualLength = 0; - CFE_MSG_FcnCode_t FcnCode = 0; - CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; - - CFE_MSG_GetSize(MsgPtr, &ActualLength); - - /* - ** Verify the command packet length - */ - if (ExpectedLength != ActualLength) - { - CFE_MSG_GetMsgId(MsgPtr, &MsgId); - CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); - - CFE_EVS_SendEvent(CFE_SB_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, - (unsigned int)ExpectedLength); - result = false; - ++CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter; - } - - return result; -} - -/*---------------------------------------------------------------- - * - * Application-scope internal function - * See description in header file for argument/return detail - * - *-----------------------------------------------------------------*/ -void CFE_SB_ProcessCmdPipePkt(CFE_SB_Buffer_t *SBBufPtr) -{ - CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; - CFE_MSG_FcnCode_t FcnCode = 0; - - CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); - - switch (CFE_SB_MsgIdToValue(MessageID)) - { - case CFE_SB_SEND_HK_MID: - /* Note: Command counter not incremented for this command */ - CFE_SB_SendHKTlmCmd((CFE_MSG_CommandHeader_t *)SBBufPtr); - break; - - case CFE_SB_SUB_RPT_CTRL_MID: - /* Note: Command counter not incremented for this command */ - CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); - switch (FcnCode) - { - case CFE_SB_SEND_PREV_SUBS_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendPrevSubsCmd_t))) - { - CFE_SB_SendPrevSubsCmd((CFE_SB_SendPrevSubsCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_ENABLE_SUB_REPORTING_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_EnableSubReportingCmd_t))) - { - CFE_SB_EnableSubReportingCmd((CFE_SB_EnableSubReportingCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_DISABLE_SUB_REPORTING_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_DisableSubReportingCmd_t))) - { - CFE_SB_DisableSubReportingCmd((CFE_SB_DisableSubReportingCmd_t *)SBBufPtr); - } - break; - - default: - CFE_EVS_SendEvent(CFE_SB_BAD_CMD_CODE_EID, CFE_EVS_EventType_ERROR, - "Invalid Cmd, Unexpected Command Code %u", (unsigned int)FcnCode); - CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++; - break; - } /* end switch on cmd code */ - break; - - case CFE_SB_CMD_MID: - CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); - switch (FcnCode) - { - case CFE_SB_NOOP_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_NoopCmd_t))) - { - CFE_SB_NoopCmd((CFE_SB_NoopCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_RESET_COUNTERS_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_ResetCountersCmd_t))) - { - /* Note: Command counter not incremented for this command */ - CFE_SB_ResetCountersCmd((CFE_SB_ResetCountersCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_SEND_SB_STATS_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendSbStatsCmd_t))) - { - CFE_SB_SendStatsCmd((CFE_SB_SendSbStatsCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_WRITE_ROUTING_INFO_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_WriteRoutingInfoCmd_t))) - { - CFE_SB_WriteRoutingInfoCmd((CFE_SB_WriteRoutingInfoCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_ENABLE_ROUTE_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_EnableRouteCmd_t))) - { - CFE_SB_EnableRouteCmd((CFE_SB_EnableRouteCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_DISABLE_ROUTE_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_DisableRouteCmd_t))) - { - CFE_SB_DisableRouteCmd((CFE_SB_DisableRouteCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_WRITE_PIPE_INFO_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_WritePipeInfoCmd_t))) - { - CFE_SB_WritePipeInfoCmd((CFE_SB_WritePipeInfoCmd_t *)SBBufPtr); - } - break; - - case CFE_SB_WRITE_MAP_INFO_CC: - if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_WriteMapInfoCmd_t))) - { - CFE_SB_WriteMapInfoCmd((CFE_SB_WriteMapInfoCmd_t *)SBBufPtr); - } - break; - - default: - CFE_EVS_SendEvent(CFE_SB_BAD_CMD_CODE_EID, CFE_EVS_EventType_ERROR, - "Invalid Cmd, Unexpected Command Code %u", FcnCode); - CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++; - break; - } /* end switch on cmd code */ - break; - - default: - CFE_EVS_SendEvent(CFE_SB_BAD_MSGID_EID, CFE_EVS_EventType_ERROR, "Invalid Cmd, Unexpected Msg Id: 0x%x", - (unsigned int)CFE_SB_MsgIdToValue(MessageID)); - CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++; - break; - - } /* end switch on MsgId */ -} - /*---------------------------------------------------------------- * * Application-scope internal function diff --git a/modules/tbl/CMakeLists.txt b/modules/tbl/CMakeLists.txt index 3a761a360..30d333245 100644 --- a/modules/tbl/CMakeLists.txt +++ b/modules/tbl/CMakeLists.txt @@ -12,10 +12,7 @@ set(tbl_SOURCES fsw/src/cfe_tbl_internal.c fsw/src/cfe_tbl_task.c fsw/src/cfe_tbl_task_cmds.c - fsw/src/cfe_tbl_api.c - fsw/src/cfe_tbl_internal.c - fsw/src/cfe_tbl_task.c - fsw/src/cfe_tbl_task_cmds.c + fsw/src/cfe_tbl_dispatch.c ) add_library(tbl STATIC ${tbl_SOURCES}) diff --git a/modules/tbl/fsw/src/cfe_tbl_dispatch.c b/modules/tbl/fsw/src/cfe_tbl_dispatch.c new file mode 100644 index 000000000..b9d8a2484 --- /dev/null +++ b/modules/tbl/fsw/src/cfe_tbl_dispatch.c @@ -0,0 +1,224 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/* +** File: cfe_tbl_task.c +** +** Subsystem: cFE TBL Task +** +** Author: David Kobe (the Hammers Company, Inc.) +** +** Notes: +** +*/ + +/* +** Required header files +*/ +#include "cfe_tbl_module_all.h" + +#include + +/** +** Data structure of a single record in #CFE_TBL_CmdHandlerTbl +*/ +typedef struct +{ + CFE_SB_MsgId_t MsgId; /**< \brief Acceptable Message ID */ + CFE_MSG_FcnCode_t CmdCode; /**< \brief Acceptable Command Code (if necessary) */ + size_t ExpectedLength; /**< \brief Expected Message Length (in bytes) including message header */ + CFE_TBL_MsgProcFuncPtr_t MsgProcFuncPtr; /**< \brief Pointer to function to handle message */ + CFE_TBL_MsgType_t MsgTypes; /**< \brief Message Type (i.e. - with/without Cmd Code) */ +} CFE_TBL_CmdHandlerTblRec_t; + +/* + * Macros to assist in building the CFE_TBL_CmdHandlerTbl - + * For command handler entries, which have a command code, payload type, and a handler function + */ +#define CFE_TBL_ENTRY(mid, ccode, paramtype, handlerfunc, msgtype) \ + { \ + CFE_SB_MSGID_WRAP_VALUE(mid), ccode, sizeof(paramtype), (CFE_TBL_MsgProcFuncPtr_t)handlerfunc, msgtype \ + } + +/* Constant Data */ + +const CFE_TBL_CmdHandlerTblRec_t CFE_TBL_CmdHandlerTbl[] = { + /* SEND_HK Entry */ + CFE_TBL_ENTRY(CFE_TBL_SEND_HK_MID, 0, CFE_TBL_NoArgsCmd_t, CFE_TBL_HousekeepingCmd, CFE_TBL_MSG_MSGTYPE), + + /* Everything else */ + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_NOOP_CC, CFE_TBL_NoopCmd_t, CFE_TBL_NoopCmd, CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_RESET_COUNTERS_CC, CFE_TBL_ResetCountersCmd_t, CFE_TBL_ResetCountersCmd, + CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_LOAD_CC, CFE_TBL_LoadCmd_t, CFE_TBL_LoadCmd, CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_DUMP_CC, CFE_TBL_DumpCmd_t, CFE_TBL_DumpCmd, CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_VALIDATE_CC, CFE_TBL_ValidateCmd_t, CFE_TBL_ValidateCmd, + CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_ACTIVATE_CC, CFE_TBL_ActivateCmd_t, CFE_TBL_ActivateCmd, + CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_DUMP_REGISTRY_CC, CFE_TBL_DumpRegistryCmd_t, CFE_TBL_DumpRegistryCmd, + CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_SEND_REGISTRY_CC, CFE_TBL_SendRegistryCmd_t, CFE_TBL_SendRegistryCmd, + CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_DELETE_CDS_CC, CFE_TBL_DeleteCDSCmd_t, CFE_TBL_DeleteCDSCmd, + CFE_TBL_CMD_MSGTYPE), + CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_ABORT_LOAD_CC, CFE_TBL_AbortLoadCmd_t, CFE_TBL_AbortLoadCmd, + CFE_TBL_CMD_MSGTYPE), + + /* list terminator (keep last) */ + {CFE_SB_MSGID_RESERVED, 0, 0, NULL, CFE_TBL_TERM_MSGTYPE}}; + +/******************************************************************************/ + +/*---------------------------------------------------------------- + * + * Application-scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_TBL_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) +{ + CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; + CFE_MSG_FcnCode_t CommandCode = 0; + int16 CmdIndx; + CFE_MSG_Size_t ActualLength = 0; + CFE_TBL_CmdProcRet_t CmdStatus = CFE_TBL_INC_ERR_CTR; /* Assume a failed command */ + + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); + + /* Search the Command Handler Table for a matching message */ + CmdIndx = CFE_TBL_SearchCmdHndlrTbl(MessageID, CommandCode); + + /* Check to see if a matching command was found */ + if (CmdIndx >= 0) + { + /* Verify Message Length before processing */ + CFE_MSG_GetSize(&SBBufPtr->Msg, &ActualLength); + if (ActualLength == CFE_TBL_CmdHandlerTbl[CmdIndx].ExpectedLength) + { + /* All checks have passed, call the appropriate message handler */ + CmdStatus = (CFE_TBL_CmdHandlerTbl[CmdIndx].MsgProcFuncPtr)(SBBufPtr); + } + else /* Bad Message Length */ + { + CFE_EVS_SendEvent(CFE_TBL_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid msg length -- ID = 0x%X, CC = %u, Len = %u, Expected = %u", + (unsigned int)CFE_SB_MsgIdToValue(MessageID), (unsigned int)CommandCode, + (unsigned int)ActualLength, (unsigned int)CFE_TBL_CmdHandlerTbl[CmdIndx].ExpectedLength); + } + + /* Only update command counters when message has a command code */ + if (CFE_TBL_CmdHandlerTbl[CmdIndx].MsgTypes == CFE_TBL_CMD_MSGTYPE) + { + if (CmdStatus == CFE_TBL_INC_CMD_CTR) + { + CFE_TBL_Global.CommandCounter++; + } + else if (CmdStatus == CFE_TBL_INC_ERR_CTR) + { + CFE_TBL_Global.CommandErrorCounter++; + } + } + } + else + { + /* Determine whether event message should be */ + /* "Bad Command Code" or "Bad Message ID" */ + if (CmdIndx == CFE_TBL_BAD_CMD_CODE) + { + CFE_EVS_SendEvent(CFE_TBL_CC1_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid command code -- ID = 0x%X, CC = %u", + (unsigned int)CFE_SB_MsgIdToValue(MessageID), (unsigned int)CommandCode); + + /* Update the command error counter */ + CFE_TBL_Global.CommandErrorCounter++; + } + else /* CmdIndx == CFE_TBL_BAD_MSG_ID */ + { + CFE_EVS_SendEvent(CFE_TBL_MID_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid message ID -- ID = 0x%X", + (unsigned int)CFE_SB_MsgIdToValue(MessageID)); + /* + ** Note: we only increment the command error counter when + ** processing messages with command codes + */ + } + } +} + +/*---------------------------------------------------------------- + * + * Application-scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +int16 CFE_TBL_SearchCmdHndlrTbl(CFE_SB_MsgId_t MessageID, uint16 CommandCode) +{ + int16 TblIndx = CFE_TBL_BAD_CMD_CODE; + bool FoundMsg = false; + bool FoundMatch = false; + + do + { + /* Point to next entry in Command Handler Table */ + TblIndx++; + + /* Check to see if we found a matching Message ID */ + if (CFE_SB_MsgId_Equal(CFE_TBL_CmdHandlerTbl[TblIndx].MsgId, MessageID) && + (CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes != CFE_TBL_TERM_MSGTYPE)) + { + /* Flag any found message IDs so that if there is an error, */ + /* we can determine if it was a bad message ID or bad command code */ + FoundMsg = true; + + /* If entry in the Command Handler Table is a command entry, */ + /* then check for a matching command code */ + if (CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes == CFE_TBL_CMD_MSGTYPE) + { + if (CFE_TBL_CmdHandlerTbl[TblIndx].CmdCode == CommandCode) + { + /* Found matching message ID and Command Code */ + FoundMatch = true; + } + } + else /* Message is not a command message with specific command code */ + { + /* Automatically assume a match when legit */ + /* Message ID is all that is required */ + FoundMatch = true; + } + } + } while ((!FoundMatch) && (CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes != CFE_TBL_TERM_MSGTYPE)); + + /* If we failed to find a match, return a negative index */ + if (!FoundMatch) + { + /* Determine if the message ID was bad or the command code */ + if (FoundMsg) + { + /* A matching message ID was found, so the command code must be bad */ + TblIndx = CFE_TBL_BAD_CMD_CODE; + } + else /* No matching message ID was found */ + { + TblIndx = CFE_TBL_BAD_MSG_ID; + } + } + + return TblIndx; +} diff --git a/modules/tbl/fsw/src/cfe_tbl_dispatch.h b/modules/tbl/fsw/src/cfe_tbl_dispatch.h new file mode 100644 index 000000000..ae9a61f2d --- /dev/null +++ b/modules/tbl/fsw/src/cfe_tbl_dispatch.h @@ -0,0 +1,55 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: cFE Table Services (TBL) utility function interface file + * + * Author: D. Kobe/the Hammers Company, Inc. + * + * Notes: + * + */ + +#ifndef CFE_TBL_DISPATCH_H +#define CFE_TBL_DISPATCH_H + +/* +** Required header files... +*/ +#include "cfe_tbl_api_typedefs.h" +#include "cfe_sb_api_typedefs.h" +#include "cfe_msg_api_typedefs.h" + +/*---------------------------------------------------------------------------------------*/ +/** +** \brief Processes command pipe messages +** +** \par Description +** Processes messages obtained from the command pipe. +** +** \par Assumptions, External Events, and Notes: +** None +** +** \param[in] SBBufPtr Pointer to the message received from the command pipe +** +*/ +void CFE_TBL_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr); + +#endif /* CFE_TBL_DISPATCH_H */ diff --git a/modules/tbl/fsw/src/cfe_tbl_module_all.h b/modules/tbl/fsw/src/cfe_tbl_module_all.h index 60e64152e..a4b4a304e 100644 --- a/modules/tbl/fsw/src/cfe_tbl_module_all.h +++ b/modules/tbl/fsw/src/cfe_tbl_module_all.h @@ -44,6 +44,7 @@ #include "cfe_tbl_internal.h" #include "cfe_tbl_task.h" #include "cfe_tbl_task_cmds.h" +#include "cfe_tbl_dispatch.h" /* * Additionally TBL needs to use special/extra CDS APIs that are not in the normal API diff --git a/modules/tbl/fsw/src/cfe_tbl_task.c b/modules/tbl/fsw/src/cfe_tbl_task.c index d49f7d48e..fa055b8f2 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.c +++ b/modules/tbl/fsw/src/cfe_tbl_task.c @@ -41,45 +41,6 @@ */ CFE_TBL_Global_t CFE_TBL_Global; -/* - * Macros to assist in building the CFE_TBL_CmdHandlerTbl - - * For command handler entries, which have a command code, payload type, and a handler function - */ -#define CFE_TBL_ENTRY(mid, ccode, paramtype, handlerfunc, msgtype) \ - { \ - CFE_SB_MSGID_WRAP_VALUE(mid), ccode, sizeof(paramtype), (CFE_TBL_MsgProcFuncPtr_t)handlerfunc, msgtype \ - } - -/* Constant Data */ - -const CFE_TBL_CmdHandlerTblRec_t CFE_TBL_CmdHandlerTbl[] = { - /* SEND_HK Entry */ - CFE_TBL_ENTRY(CFE_TBL_SEND_HK_MID, 0, CFE_TBL_NoArgsCmd_t, CFE_TBL_HousekeepingCmd, CFE_TBL_MSG_MSGTYPE), - - /* Everything else */ - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_NOOP_CC, CFE_TBL_NoopCmd_t, CFE_TBL_NoopCmd, CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_RESET_COUNTERS_CC, CFE_TBL_ResetCountersCmd_t, CFE_TBL_ResetCountersCmd, - CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_LOAD_CC, CFE_TBL_LoadCmd_t, CFE_TBL_LoadCmd, CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_DUMP_CC, CFE_TBL_DumpCmd_t, CFE_TBL_DumpCmd, CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_VALIDATE_CC, CFE_TBL_ValidateCmd_t, CFE_TBL_ValidateCmd, - CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_ACTIVATE_CC, CFE_TBL_ActivateCmd_t, CFE_TBL_ActivateCmd, - CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_DUMP_REGISTRY_CC, CFE_TBL_DumpRegistryCmd_t, CFE_TBL_DumpRegistryCmd, - CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_SEND_REGISTRY_CC, CFE_TBL_SendRegistryCmd_t, CFE_TBL_SendRegistryCmd, - CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_DELETE_CDS_CC, CFE_TBL_DeleteCDSCmd_t, CFE_TBL_DeleteCDSCmd, - CFE_TBL_CMD_MSGTYPE), - CFE_TBL_ENTRY(CFE_TBL_CMD_MID, CFE_TBL_ABORT_LOAD_CC, CFE_TBL_AbortLoadCmd_t, CFE_TBL_AbortLoadCmd, - CFE_TBL_CMD_MSGTYPE), - - /* list terminator (keep last) */ - {CFE_SB_MSGID_RESERVED, 0, 0, NULL, CFE_TBL_TERM_MSGTYPE}}; - -/******************************************************************************/ - /*---------------------------------------------------------------- * * Implemented per public API @@ -235,141 +196,3 @@ void CFE_TBL_InitData(void) CFE_MSG_Init(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), CFE_SB_INVALID_MSG_ID, sizeof(CFE_TBL_Global.NotifyMsg)); } - -/*---------------------------------------------------------------- - * - * Application-scope internal function - * See description in header file for argument/return detail - * - *-----------------------------------------------------------------*/ -void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr) -{ - CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; - CFE_MSG_FcnCode_t CommandCode = 0; - int16 CmdIndx; - CFE_MSG_Size_t ActualLength = 0; - CFE_TBL_CmdProcRet_t CmdStatus = CFE_TBL_INC_ERR_CTR; /* Assume a failed command */ - - CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); - CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); - - /* Search the Command Handler Table for a matching message */ - CmdIndx = CFE_TBL_SearchCmdHndlrTbl(MessageID, CommandCode); - - /* Check to see if a matching command was found */ - if (CmdIndx >= 0) - { - /* Verify Message Length before processing */ - CFE_MSG_GetSize(&SBBufPtr->Msg, &ActualLength); - if (ActualLength == CFE_TBL_CmdHandlerTbl[CmdIndx].ExpectedLength) - { - /* All checks have passed, call the appropriate message handler */ - CmdStatus = (CFE_TBL_CmdHandlerTbl[CmdIndx].MsgProcFuncPtr)(SBBufPtr); - } - else /* Bad Message Length */ - { - CFE_EVS_SendEvent(CFE_TBL_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid msg length -- ID = 0x%X, CC = %u, Len = %u, Expected = %u", - (unsigned int)CFE_SB_MsgIdToValue(MessageID), (unsigned int)CommandCode, - (unsigned int)ActualLength, (unsigned int)CFE_TBL_CmdHandlerTbl[CmdIndx].ExpectedLength); - } - - /* Only update command counters when message has a command code */ - if (CFE_TBL_CmdHandlerTbl[CmdIndx].MsgTypes == CFE_TBL_CMD_MSGTYPE) - { - if (CmdStatus == CFE_TBL_INC_CMD_CTR) - { - CFE_TBL_Global.CommandCounter++; - } - else if (CmdStatus == CFE_TBL_INC_ERR_CTR) - { - CFE_TBL_Global.CommandErrorCounter++; - } - } - } - else - { - /* Determine whether event message should be */ - /* "Bad Command Code" or "Bad Message ID" */ - if (CmdIndx == CFE_TBL_BAD_CMD_CODE) - { - CFE_EVS_SendEvent(CFE_TBL_CC1_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid command code -- ID = 0x%X, CC = %u", - (unsigned int)CFE_SB_MsgIdToValue(MessageID), (unsigned int)CommandCode); - - /* Update the command error counter */ - CFE_TBL_Global.CommandErrorCounter++; - } - else /* CmdIndx == CFE_TBL_BAD_MSG_ID */ - { - CFE_EVS_SendEvent(CFE_TBL_MID_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid message ID -- ID = 0x%X", - (unsigned int)CFE_SB_MsgIdToValue(MessageID)); - /* - ** Note: we only increment the command error counter when - ** processing messages with command codes - */ - } - } -} - -/*---------------------------------------------------------------- - * - * Application-scope internal function - * See description in header file for argument/return detail - * - *-----------------------------------------------------------------*/ -int16 CFE_TBL_SearchCmdHndlrTbl(CFE_SB_MsgId_t MessageID, uint16 CommandCode) -{ - int16 TblIndx = CFE_TBL_BAD_CMD_CODE; - bool FoundMsg = false; - bool FoundMatch = false; - - do - { - /* Point to next entry in Command Handler Table */ - TblIndx++; - - /* Check to see if we found a matching Message ID */ - if (CFE_SB_MsgId_Equal(CFE_TBL_CmdHandlerTbl[TblIndx].MsgId, MessageID) && - (CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes != CFE_TBL_TERM_MSGTYPE)) - { - /* Flag any found message IDs so that if there is an error, */ - /* we can determine if it was a bad message ID or bad command code */ - FoundMsg = true; - - /* If entry in the Command Handler Table is a command entry, */ - /* then check for a matching command code */ - if (CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes == CFE_TBL_CMD_MSGTYPE) - { - if (CFE_TBL_CmdHandlerTbl[TblIndx].CmdCode == CommandCode) - { - /* Found matching message ID and Command Code */ - FoundMatch = true; - } - } - else /* Message is not a command message with specific command code */ - { - /* Automatically assume a match when legit */ - /* Message ID is all that is required */ - FoundMatch = true; - } - } - } while ((!FoundMatch) && (CFE_TBL_CmdHandlerTbl[TblIndx].MsgTypes != CFE_TBL_TERM_MSGTYPE)); - - /* If we failed to find a match, return a negative index */ - if (!FoundMatch) - { - /* Determine if the message ID was bad or the command code */ - if (FoundMsg) - { - /* A matching message ID was found, so the command code must be bad */ - TblIndx = CFE_TBL_BAD_CMD_CODE; - } - else /* No matching message ID was found */ - { - TblIndx = CFE_TBL_BAD_MSG_ID; - } - } - - return TblIndx; -} diff --git a/modules/tbl/fsw/src/cfe_tbl_task.h b/modules/tbl/fsw/src/cfe_tbl_task.h index 852b5aa91..f3274d230 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.h +++ b/modules/tbl/fsw/src/cfe_tbl_task.h @@ -389,21 +389,6 @@ int16 CFE_TBL_SearchCmdHndlrTbl(CFE_SB_MsgId_t MessageID, uint16 CommandCode); */ int32 CFE_TBL_TaskInit(void); -/*---------------------------------------------------------------------------------------*/ -/** -** \brief Processes command pipe messages -** -** \par Description -** Processes messages obtained from the command pipe. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \param[in] SBBufPtr Pointer to the message received from the command pipe -** -*/ -void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); - /*---------------------------------------------------------------------------------------*/ /** ** \brief Table Service Application Data Initialization diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h index 33d2cd0a4..1dfd63a5a 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h @@ -72,18 +72,6 @@ typedef enum CFE_TBL_CMD_MSGTYPE /**< \brief Command Type (requires Message ID and Command Code match) */ } CFE_TBL_MsgType_t; -/** -** Data structure of a single record in #CFE_TBL_CmdHandlerTbl -*/ -typedef struct -{ - CFE_SB_MsgId_t MsgId; /**< \brief Acceptable Message ID */ - CFE_MSG_FcnCode_t CmdCode; /**< \brief Acceptable Command Code (if necessary) */ - size_t ExpectedLength; /**< \brief Expected Message Length (in bytes) including message header */ - CFE_TBL_MsgProcFuncPtr_t MsgProcFuncPtr; /**< \brief Pointer to function to handle message */ - CFE_TBL_MsgType_t MsgTypes; /**< \brief Message Type (i.e. - with/without Cmd Code) */ -} CFE_TBL_CmdHandlerTblRec_t; - /* Command Message Processing Functions */ /*****************************************************************************/ diff --git a/modules/time/CMakeLists.txt b/modules/time/CMakeLists.txt index 2168ed154..7c61c9236 100644 --- a/modules/time/CMakeLists.txt +++ b/modules/time/CMakeLists.txt @@ -12,10 +12,7 @@ set(time_SOURCES fsw/src/cfe_time_task.c fsw/src/cfe_time_tone.c fsw/src/cfe_time_utils.c - fsw/src/cfe_time_api.c - fsw/src/cfe_time_task.c - fsw/src/cfe_time_tone.c - fsw/src/cfe_time_utils.c + fsw/src/cfe_time_dispatch.c ) add_library(time STATIC ${time_SOURCES}) diff --git a/modules/time/fsw/src/cfe_time_dispatch.c b/modules/time/fsw/src/cfe_time_dispatch.c new file mode 100644 index 000000000..fcd6e08fd --- /dev/null +++ b/modules/time/fsw/src/cfe_time_dispatch.c @@ -0,0 +1,264 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @brief + * + * CFE TIME dispatch implementation + */ + +/* +** Required header files... +*/ +#include "cfe_time_module_all.h" + +/*---------------------------------------------------------------- + * + * Internal helper routine only, not part of API. + * + * Function to verify the length of incoming TIME command packets + * + *-----------------------------------------------------------------*/ +bool CFE_TIME_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) +{ + bool result = true; + CFE_MSG_Size_t ActualLength = 0; + CFE_MSG_FcnCode_t FcnCode = 0; + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; + + CFE_MSG_GetSize(MsgPtr, &ActualLength); + + /* + ** Verify the command packet length + */ + if (ExpectedLength != ActualLength) + { + CFE_MSG_GetMsgId(MsgPtr, &MsgId); + CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); + + CFE_EVS_SendEvent(CFE_TIME_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", + (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, + (unsigned int)ExpectedLength); + result = false; + ++CFE_TIME_Global.CommandErrorCounter; + } + + return result; +} + +/*---------------------------------------------------------------- + * + * Application-scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_TIME_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) +{ + CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; + CFE_MSG_FcnCode_t CommandCode = 0; + + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); + + switch (CFE_SB_MsgIdToValue(MessageID)) + { + /* + ** Housekeeping telemetry request... + */ + case CFE_TIME_SEND_HK_MID: + CFE_TIME_HousekeepingCmd((const CFE_TIME_SendHkCmd_t *)SBBufPtr); + break; + + /* + ** Time at the tone "signal"... + */ + case CFE_TIME_TONE_CMD_MID: + CFE_TIME_ToneSignalCmd((const CFE_TIME_ToneSignalCmd_t *)SBBufPtr); + break; + + /* + ** Time at the tone "data"... + */ + case CFE_TIME_DATA_CMD_MID: + CFE_TIME_ToneDataCmd((const CFE_TIME_ToneDataCmd_t *)SBBufPtr); + break; + + /* + ** Run time state machine at 1Hz... + */ + case CFE_TIME_1HZ_CMD_MID: + CFE_TIME_OneHzCmd((const CFE_TIME_1HzCmd_t *)SBBufPtr); + break; + +/* +** Request for time at the tone "data"... +*/ +#if (CFE_PLATFORM_TIME_CFG_SERVER == true) + case CFE_TIME_SEND_CMD_MID: + CFE_TIME_ToneSendCmd((const CFE_TIME_FakeToneCmd_t *)SBBufPtr); + break; +#endif + + /* + ** Time task ground commands... + */ + case CFE_TIME_CMD_MID: + + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); + switch (CommandCode) + { + case CFE_TIME_NOOP_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_NoopCmd_t))) + { + CFE_TIME_NoopCmd((const CFE_TIME_NoopCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_RESET_COUNTERS_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_ResetCountersCmd_t))) + { + CFE_TIME_ResetCountersCmd((const CFE_TIME_ResetCountersCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SEND_DIAGNOSTIC_TLM_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SendDiagnosticCmd_t))) + { + CFE_TIME_SendDiagnosticTlm((const CFE_TIME_SendDiagnosticCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SET_STATE_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetStateCmd_t))) + { + CFE_TIME_SetStateCmd((const CFE_TIME_SetStateCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SET_SOURCE_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSourceCmd_t))) + { + CFE_TIME_SetSourceCmd((const CFE_TIME_SetSourceCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SET_SIGNAL_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSignalCmd_t))) + { + CFE_TIME_SetSignalCmd((const CFE_TIME_SetSignalCmd_t *)SBBufPtr); + } + break; + + /* + ** Time Clients process "tone delay" commands... + */ + case CFE_TIME_ADD_DELAY_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_AddDelayCmd_t))) + { + CFE_TIME_AddDelayCmd((const CFE_TIME_AddDelayCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SUB_DELAY_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SubDelayCmd_t))) + { + CFE_TIME_SubDelayCmd((const CFE_TIME_SubDelayCmd_t *)SBBufPtr); + } + break; + + /* + ** Time Servers process "set time" commands... + */ + case CFE_TIME_SET_TIME_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetTimeCmd_t))) + { + CFE_TIME_SetTimeCmd((const CFE_TIME_SetTimeCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SET_MET_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetMETCmd_t))) + { + CFE_TIME_SetMETCmd((const CFE_TIME_SetMETCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SET_STCF_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSTCFCmd_t))) + { + CFE_TIME_SetSTCFCmd((const CFE_TIME_SetSTCFCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SET_LEAP_SECONDS_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetLeapSecondsCmd_t))) + { + CFE_TIME_SetLeapSecondsCmd((const CFE_TIME_SetLeapSecondsCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_ADD_ADJUST_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_AddAdjustCmd_t))) + { + CFE_TIME_AddAdjustCmd((const CFE_TIME_AddAdjustCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SUB_ADJUST_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SubAdjustCmd_t))) + { + CFE_TIME_SubAdjustCmd((const CFE_TIME_SubAdjustCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_ADD_1HZ_ADJUSTMENT_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Add1HZAdjustmentCmd_t))) + { + CFE_TIME_Add1HZAdjustmentCmd((const CFE_TIME_Add1HZAdjustmentCmd_t *)SBBufPtr); + } + break; + + case CFE_TIME_SUB_1HZ_ADJUSTMENT_CC: + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Sub1HZAdjustmentCmd_t))) + { + CFE_TIME_Sub1HZAdjustmentCmd((const CFE_TIME_Sub1HZAdjustmentCmd_t *)SBBufPtr); + } + break; + + default: + + CFE_TIME_Global.CommandErrorCounter++; + CFE_EVS_SendEvent(CFE_TIME_CC_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid command code -- ID = 0x%X, CC = %d", + (unsigned int)CFE_SB_MsgIdToValue(MessageID), (int)CommandCode); + break; + } /* switch (CFE_TIME_CMD_MID -- command code)*/ + break; + + default: + + /* + ** Note: we only increment the command error counter when + ** processing CFE_TIME_CMD_MID commands... + */ + CFE_EVS_SendEvent(CFE_TIME_ID_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid message ID -- ID = 0x%X", + (unsigned int)CFE_SB_MsgIdToValue(MessageID)); + break; + + } /* switch (message ID) */ +} diff --git a/modules/time/fsw/src/cfe_time_dispatch.h b/modules/time/fsw/src/cfe_time_dispatch.h new file mode 100644 index 000000000..2604b865c --- /dev/null +++ b/modules/time/fsw/src/cfe_time_dispatch.h @@ -0,0 +1,47 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/* +** File: cfe_time_task.c +** +** Subsystem: cFE TIME Task +** +** Author: S. Walling (Microtel) +** +** Notes: +** +*/ +#ifndef CFE_TIME_DISPATCH_H +#define CFE_TIME_DISPATCH_H + +/* +** Required header files... +*/ +#include "cfe_time_api_typedefs.h" +#include "cfe_sb_api_typedefs.h" +#include "cfe_msg_api_typedefs.h" + +/*---------------------------------------------------------------- + * + * Application-scope internal function + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_TIME_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr); + +#endif diff --git a/modules/time/fsw/src/cfe_time_module_all.h b/modules/time/fsw/src/cfe_time_module_all.h index 38675b228..8bd048ad6 100644 --- a/modules/time/fsw/src/cfe_time_module_all.h +++ b/modules/time/fsw/src/cfe_time_module_all.h @@ -42,5 +42,6 @@ #include "cfe_time_msg.h" #include "cfe_time_events.h" #include "cfe_time_utils.h" +#include "cfe_time_dispatch.h" #endif /* CFE_TIME_MODULE_ALL_H */ diff --git a/modules/time/fsw/src/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c index aa316c7a6..f392e6627 100644 --- a/modules/time/fsw/src/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -305,242 +305,6 @@ int32 CFE_TIME_TaskInit(void) return CFE_SUCCESS; } -/*---------------------------------------------------------------- - * - * Internal helper routine only, not part of API. - * - * Function to verify the length of incoming TIME command packets - * - *-----------------------------------------------------------------*/ -bool CFE_TIME_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) -{ - bool result = true; - CFE_MSG_Size_t ActualLength = 0; - CFE_MSG_FcnCode_t FcnCode = 0; - CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; - - CFE_MSG_GetSize(MsgPtr, &ActualLength); - - /* - ** Verify the command packet length - */ - if (ExpectedLength != ActualLength) - { - CFE_MSG_GetMsgId(MsgPtr, &MsgId); - CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); - - CFE_EVS_SendEvent(CFE_TIME_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, - (unsigned int)ExpectedLength); - result = false; - ++CFE_TIME_Global.CommandErrorCounter; - } - - return result; -} - -/*---------------------------------------------------------------- - * - * Application-scope internal function - * See description in header file for argument/return detail - * - *-----------------------------------------------------------------*/ -void CFE_TIME_TaskPipe(CFE_SB_Buffer_t *SBBufPtr) -{ - CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; - CFE_MSG_FcnCode_t CommandCode = 0; - - CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); - - switch (CFE_SB_MsgIdToValue(MessageID)) - { - /* - ** Housekeeping telemetry request... - */ - case CFE_TIME_SEND_HK_MID: - CFE_TIME_HousekeepingCmd((CFE_TIME_SendHkCmd_t *)SBBufPtr); - break; - - /* - ** Time at the tone "signal"... - */ - case CFE_TIME_TONE_CMD_MID: - CFE_TIME_ToneSignalCmd((CFE_TIME_ToneSignalCmd_t *)SBBufPtr); - break; - - /* - ** Time at the tone "data"... - */ - case CFE_TIME_DATA_CMD_MID: - CFE_TIME_ToneDataCmd((CFE_TIME_ToneDataCmd_t *)SBBufPtr); - break; - - /* - ** Run time state machine at 1Hz... - */ - case CFE_TIME_1HZ_CMD_MID: - CFE_TIME_OneHzCmd((CFE_TIME_1HzCmd_t *)SBBufPtr); - break; - -/* -** Request for time at the tone "data"... -*/ -#if (CFE_PLATFORM_TIME_CFG_SERVER == true) - case CFE_TIME_SEND_CMD_MID: - CFE_TIME_ToneSendCmd((CFE_TIME_FakeToneCmd_t *)SBBufPtr); - break; -#endif - - /* - ** Time task ground commands... - */ - case CFE_TIME_CMD_MID: - - CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); - switch (CommandCode) - { - case CFE_TIME_NOOP_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_NoopCmd_t))) - { - CFE_TIME_NoopCmd((CFE_TIME_NoopCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_RESET_COUNTERS_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_ResetCountersCmd_t))) - { - CFE_TIME_ResetCountersCmd((CFE_TIME_ResetCountersCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SEND_DIAGNOSTIC_TLM_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SendDiagnosticCmd_t))) - { - CFE_TIME_SendDiagnosticTlm((CFE_TIME_SendDiagnosticCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SET_STATE_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetStateCmd_t))) - { - CFE_TIME_SetStateCmd((CFE_TIME_SetStateCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SET_SOURCE_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSourceCmd_t))) - { - CFE_TIME_SetSourceCmd((CFE_TIME_SetSourceCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SET_SIGNAL_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSignalCmd_t))) - { - CFE_TIME_SetSignalCmd((CFE_TIME_SetSignalCmd_t *)SBBufPtr); - } - break; - - /* - ** Time Clients process "tone delay" commands... - */ - case CFE_TIME_ADD_DELAY_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_AddDelayCmd_t))) - { - CFE_TIME_AddDelayCmd((CFE_TIME_AddDelayCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SUB_DELAY_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SubDelayCmd_t))) - { - CFE_TIME_SubDelayCmd((CFE_TIME_SubDelayCmd_t *)SBBufPtr); - } - break; - - /* - ** Time Servers process "set time" commands... - */ - case CFE_TIME_SET_TIME_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetTimeCmd_t))) - { - CFE_TIME_SetTimeCmd((CFE_TIME_SetTimeCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SET_MET_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetMETCmd_t))) - { - CFE_TIME_SetMETCmd((CFE_TIME_SetMETCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SET_STCF_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSTCFCmd_t))) - { - CFE_TIME_SetSTCFCmd((CFE_TIME_SetSTCFCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SET_LEAP_SECONDS_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetLeapSecondsCmd_t))) - { - CFE_TIME_SetLeapSecondsCmd((CFE_TIME_SetLeapSecondsCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_ADD_ADJUST_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_AddAdjustCmd_t))) - { - CFE_TIME_AddAdjustCmd((CFE_TIME_AddAdjustCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SUB_ADJUST_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SubAdjustCmd_t))) - { - CFE_TIME_SubAdjustCmd((CFE_TIME_SubAdjustCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_ADD_1HZ_ADJUSTMENT_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Add1HZAdjustmentCmd_t))) - { - CFE_TIME_Add1HZAdjustmentCmd((CFE_TIME_Add1HZAdjustmentCmd_t *)SBBufPtr); - } - break; - - case CFE_TIME_SUB_1HZ_ADJUSTMENT_CC: - if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Sub1HZAdjustmentCmd_t))) - { - CFE_TIME_Sub1HZAdjustmentCmd((CFE_TIME_Sub1HZAdjustmentCmd_t *)SBBufPtr); - } - break; - - default: - - CFE_TIME_Global.CommandErrorCounter++; - CFE_EVS_SendEvent(CFE_TIME_CC_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid command code -- ID = 0x%X, CC = %d", - (unsigned int)CFE_SB_MsgIdToValue(MessageID), (int)CommandCode); - break; - } /* switch (CFE_TIME_CMD_MID -- command code)*/ - break; - - default: - - /* - ** Note: we only increment the command error counter when - ** processing CFE_TIME_CMD_MID commands... - */ - CFE_EVS_SendEvent(CFE_TIME_ID_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid message ID -- ID = 0x%X", - (unsigned int)CFE_SB_MsgIdToValue(MessageID)); - break; - - } /* switch (message ID) */ -} - /*---------------------------------------------------------------- * * Application-scope internal function diff --git a/modules/time/fsw/src/cfe_time_utils.h b/modules/time/fsw/src/cfe_time_utils.h index 7885acbc1..8c9502bac 100644 --- a/modules/time/fsw/src/cfe_time_utils.h +++ b/modules/time/fsw/src/cfe_time_utils.h @@ -331,12 +331,6 @@ CFE_TIME_SysTime_t CFE_TIME_LatchClock(void); */ int32 CFE_TIME_TaskInit(void); -/*---------------------------------------------------------------------------------------*/ -/** - * @brief Process command pipe message - */ -void CFE_TIME_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); - /*---------------------------------------------------------------------------------------*/ /** * @brief Initialize global time task data From 9f1a2068eb98ba957d1994056894d50f12772286 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 30 Mar 2023 16:15:53 -0400 Subject: [PATCH 141/200] Bump to v7.0.0-rc4+dev260 --- CHANGELOG.md | 5 +++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae4d6c98a..5fe316a04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Development Build: v7.0.0-rc4+dev260 +- add more generic status codes +- separate dispatcher for messages +- See and + ## Development Build: v7.0.0-rc4+dev254 - improve 64-bit memory address handling in CMD/TLM - See diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index db5077422..a15334cdb 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 254 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 260 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 9a3a6851eddb2a6e2fc27fa4a69e7c06a0fb82bd Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Sat, 1 Apr 2023 07:17:52 +1000 Subject: [PATCH 142/200] Fix #1515, Remove unnecessary memset from CFE_TBL_LoadFromFile --- modules/tbl/fsw/src/cfe_tbl_internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index bb72f3477..bd8eada94 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -891,8 +891,8 @@ int32 CFE_TBL_LoadFromFile(const char *AppName, CFE_TBL_LoadBuff_t *WorkingBuffe return CFE_TBL_ERR_FILE_TOO_LARGE; } - memset(WorkingBufferPtr->DataSource, 0, sizeof(WorkingBufferPtr->DataSource)); strncpy(WorkingBufferPtr->DataSource, Filename, sizeof(WorkingBufferPtr->DataSource) - 1); + WorkingBufferPtr->DataSource[sizeof(WorkingBufferPtr->DataSource) - 1] = '\0'; /* Save file creation time for later storage into Registry */ WorkingBufferPtr->FileCreateTimeSecs = StdFileHeader.TimeSeconds; From 54019f5a7e7c7b8971b4e883a46f9979d23e8377 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 11 Apr 2023 11:15:31 -0400 Subject: [PATCH 143/200] Fix #2287, remove return value doxygen markup The CFE_ES_TaskRecordSetFree() function is a void, it should not have any documentation about return value. Remove this line. Appears to be a cut and paste error, produces a warning in newer Doxygen versions. --- modules/es/fsw/src/cfe_es_resource.h | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/es/fsw/src/cfe_es_resource.h b/modules/es/fsw/src/cfe_es_resource.h index a0ecc3eee..f37525f27 100644 --- a/modules/es/fsw/src/cfe_es_resource.h +++ b/modules/es/fsw/src/cfe_es_resource.h @@ -468,7 +468,6 @@ static inline void CFE_ES_TaskRecordSetUsed(CFE_ES_TaskRecord_t *TaskRecPtr, CFE * that are known to refer to an actual table location (i.e. non-null). * * @param[in] TaskRecPtr pointer to task table entry - * @returns true if the entry is in use/configured, or false if it is free/empty */ static inline void CFE_ES_TaskRecordSetFree(CFE_ES_TaskRecord_t *TaskRecPtr) { From 810d20375c2988a228f73081d423f2418507457f Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 13 Apr 2023 13:27:42 -0400 Subject: [PATCH 144/200] Fix #2289, implement common search routine for config files Adds a 'cfe_locate_implementation_file()' function that provides a consistent means to find a file within the ${MISSION_DEFS} subdirectory. Similar locate/search logic was necessary in a few places, for generate_config_includefile as well as add_cfe_tables, but these were not consistent in the paths or ordering used. Using this function should make them consistent. --- cmake/global_functions.cmake | 140 +++++++++++++++++++++++++---------- 1 file changed, 101 insertions(+), 39 deletions(-) diff --git a/cmake/global_functions.cmake b/cmake/global_functions.cmake index d007d614a..9a50fd94d 100644 --- a/cmake/global_functions.cmake +++ b/cmake/global_functions.cmake @@ -3,13 +3,91 @@ # cFS Mission global CMake function definitions # # This is included by the top-level script and can define -# common routines and variables that may be referenced in both +# common routines and variables that may be referenced in both # the mission (non-arch) and arch-specific builds # ################################################################## include(CMakeParseArguments) +################################################################## +# +# FUNCTION: cfe_locate_implementation_file +# +# The CFE/CFS build permits users to modify or tune system behavior by +# providing customized versions of configuration files and tables. +# +# This function locates the preferred version of a file to use, by following +# a priority-based search scheme. Users can put their preferred version of +# a file in their MISSION_DEFS directory, based on a file naming convention. +# +# If no version of the file is found there, a default/fallback version can +# be specified as well, which can be part of the module source. +# +function(cfe_locate_implementation_file OUTPUT_VAR FILE_NAME) + + cmake_parse_arguments(LOCATEIMPL_ARG "OPTIONAL;ALLOW_LIST" "FALLBACK_FILE" "PREFIX;SUBDIR" ${ARGN}) + + # Always check for filename matches directly in the MISSION_DEFS dir + set(IMPL_SEARCH_BASEDIRS "${MISSION_DEFS}/") + # The prefix could also be a subdir, but do not repeat the mission name + foreach (PREFIX ${LOCATEIMPL_ARG_PREFIX}) + if (NOT "${MISSIONCONFIG}" STREQUAL "${PREFIX}") + list(APPEND IMPL_SEARCH_BASEDIRS "${MISSION_DEFS}/${PREFIX}/") + endif() + endforeach() + set(ADD_SUBDIRS) + foreach (SUBDIR ${LOCATEIMPL_ARG_SUBDIR}) + foreach (BASEDIR ${IMPL_SEARCH_BASEDIRS}) + list(APPEND ADD_SUBDIRS "${BASEDIR}${SUBDIR}/") + endforeach() + endforeach() + list(APPEND IMPL_SEARCH_BASEDIRS ${ADD_SUBDIRS}) + + # Build the list of possible locations for this file in REVERSE priority order + set(IMPL_SEARCH_PATH) + if (LOCATEIMPL_ARG_FALLBACK_FILE) + if (IS_ABSOLUTE "${LOCATEIMPL_ARG_FALLBACK_FILE}") + list(APPEND IMPL_SEARCH_PATH "${LOCATEIMPL_ARG_FALLBACK_FILE}") + else() + list(APPEND IMPL_SEARCH_PATH "${CMAKE_CURRENT_LIST_DIR}/${LOCATEIMPL_ARG_FALLBACK_FILE}") + endif() + endif() + + # Check for the existence of the file in each of the dirs + foreach(BASEDIR ${IMPL_SEARCH_BASEDIRS}) + list(APPEND IMPL_SEARCH_PATH "${BASEDIR}${FILE_NAME}") + + # A target-specific prefixed filename gets priority over a direct filename match + # But do not include this variant if the prefix is already part of the basedir + foreach (PREFIX ${LOCATEIMPL_ARG_PREFIX}) + if (NOT "${BASEDIR}" MATCHES "/${PREFIX}/") + list(APPEND IMPL_SEARCH_PATH "${BASEDIR}${PREFIX}_${FILE_NAME}") + endif() + endforeach() + endforeach() + + set(SELECTED_FILE) + foreach (CHECK_FILE ${IMPL_SEARCH_PATH}) + if (EXISTS "${CHECK_FILE}") + list(APPEND SELECTED_FILE ${CHECK_FILE}) + endif() + endforeach() + + if (SELECTED_FILE) + message(STATUS "Using file: ${SELECTED_FILE} for ${FILE_NAME}") + elseif(NOT LOCATEIMPL_ARG_OPTIONAL) + message(FATAL_ERROR "No implementation for ${FILE_NAME} found") + endif() + + # Export the result to the caller + if (NOT LOCATEIMPL_ARG_ALLOW_LIST AND SELECTED_FILE) + list(GET SELECTED_FILE -1 SELECTED_FILE) + endif() + set(${OUTPUT_VAR} ${SELECTED_FILE} PARENT_SCOPE) + +endfunction() + ################################################################## # # FUNCTION: generate_c_headerfile @@ -78,48 +156,32 @@ function(generate_config_includefile) set(GENCONFIG_ARG_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/inc") endif (NOT GENCONFIG_ARG_OUTPUT_DIRECTORY) - set(WRAPPER_FILE_CONTENT) - set(ITEM_FOUND FALSE) + if (IS_CFS_ARCH_BUILD) + set(ARCH_PREFIXES ${BUILD_CONFIG}) + else() + set(ARCH_PREFIXES) + endif() - # Assemble a list of file names to test for - # Check for existence of a file in defs directory with an exact matching name - # Then Check for existence of file(s) with a matching prefix+suffix - set(CHECK_PATH_LIST "${MISSION_DEFS}/${GENCONFIG_ARG_FILE_NAME}") if (GENCONFIG_ARG_MATCH_SUFFIX) - foreach(PREFIX ${GENCONFIG_ARG_PREFIXES} ${GENCONFIG_ARG_UNPARSED_ARGUMENTS}) - list(APPEND CHECK_PATH_LIST "${MISSION_DEFS}/${PREFIX}_${GENCONFIG_ARG_MATCH_SUFFIX}") - endforeach() - endif(GENCONFIG_ARG_MATCH_SUFFIX) - - # Check for existence of files, and add to content if present - # Note that all files are appended/concatenated together. - foreach(SRC_LOCAL_PATH ${CHECK_PATH_LIST}) - if (EXISTS "${SRC_LOCAL_PATH}") - file(TO_NATIVE_PATH "${SRC_LOCAL_PATH}" SRC_NATIVE_PATH) - list(APPEND WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n") - set(ITEM_FOUND TRUE) - else() - list(APPEND WRAPPER_FILE_CONTENT "/* ${SRC_LOCAL_PATH} does not exist */\n") - endif (EXISTS "${SRC_LOCAL_PATH}") - endforeach() - - # If _no_ files were found in the above loop, - # then check for and use the fallback file. - # (if specified by the caller it should always exist) - # Also produce a message on the console showing whether mission config or fallback was used - if (ITEM_FOUND) - message(STATUS "Generated ${GENCONFIG_ARG_FILE_NAME} from ${MISSION_DEFS} configuration") - elseif (GENCONFIG_ARG_FALLBACK_FILE) - file(TO_NATIVE_PATH "${GENCONFIG_ARG_FALLBACK_FILE}" SRC_NATIVE_PATH) - list(APPEND WRAPPER_FILE_CONTENT - "\n\n/* No configuration for ${GENCONFIG_ARG_FILE_NAME}, using fallback */\n" - "#include \"${GENCONFIG_ARG_FALLBACK_FILE}\"\n") - message(STATUS "Using ${GENCONFIG_ARG_FALLBACK_FILE} for ${GENCONFIG_ARG_FILE_NAME}") + set(TGTFILE ${GENCONFIG_ARG_MATCH_SUFFIX}) else() - message("ERROR: No implementation for ${GENCONFIG_ARG_FILE_NAME} found") - message(FATAL_ERROR "Tested: ${CHECK_PATH_LIST}") + set(TGTFILE ${GENCONFIG_ARG_FILE_NAME}) endif() + # Use the common search function to find the candidate(s) + cfe_locate_implementation_file(SRC_LOCAL_PATH_LIST "${TGTFILE}" + ALLOW_LIST + FALLBACK_FILE "${GENCONFIG_ARG_FALLBACK_FILE}" + PREFIX ${GENCONFIG_ARG_PREFIXES} ${ARCH_PREFIXES} + SUBDIR config + ) + + set(WRAPPER_FILE_CONTENT) + foreach(SELECTED_FILE ${SRC_LOCAL_PATH_LIST}) + file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH) + list(APPEND WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n") + endforeach() + # Generate a header file generate_c_headerfile("${GENCONFIG_ARG_OUTPUT_DIRECTORY}/${GENCONFIG_ARG_FILE_NAME}" ${WRAPPER_FILE_CONTENT}) @@ -139,7 +201,7 @@ endfunction(generate_config_includefile) # # This function then sets up the following variables in the global scope: # TGTSYS_LIST: list of CPU architectures used in the build. Note this -# will always contain a "native" target (for tools at least) which +# will always contain a "native" target (for tools at least) which # is forced to be last. # MISSION_APPS: list of all applications in this build # MISSION_PSPMODULES: list of all psp modules in this build From b06c3aaba50ee1d30854bff235298ade554d4867 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 13 Apr 2023 15:35:37 -0400 Subject: [PATCH 145/200] Bump to v7.0.0-rc4+dev268 --- CHANGELOG.md | 6 ++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fe316a04..3d9c1e652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Development Build: v7.0.0-rc4+dev268 +- update naming convention document +- remove return value doxygen markup +- implement common search routine for config files +- See , , and + ## Development Build: v7.0.0-rc4+dev260 - add more generic status codes - separate dispatcher for messages diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index a15334cdb..33491ac6e 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 260 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 268 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 1dc455b9b236575253f8cebe2a9c79c9bab93f5c Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 17 Apr 2023 14:49:14 +0000 Subject: [PATCH 146/200] Fix #219, #93, Add EVS port timestamp and simplify port selection --- cmake/sample_defs/cpu1_platform_cfg.h | 11 ++++ modules/evs/fsw/src/cfe_evs_task.c | 37 ++--------- modules/evs/fsw/src/cfe_evs_task.h | 1 + modules/evs/fsw/src/cfe_evs_utils.c | 92 ++++++++------------------- modules/evs/fsw/src/cfe_evs_verify.h | 4 ++ modules/evs/ut-coverage/evs_UT.c | 15 ++++- 6 files changed, 61 insertions(+), 99 deletions(-) diff --git a/cmake/sample_defs/cpu1_platform_cfg.h b/cmake/sample_defs/cpu1_platform_cfg.h index b898e7b37..55c81ba2a 100644 --- a/cmake/sample_defs/cpu1_platform_cfg.h +++ b/cmake/sample_defs/cpu1_platform_cfg.h @@ -1462,6 +1462,17 @@ */ #define CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE CFE_EVS_MsgFormat_LONG +/** +** \cfeevscfg Include time in port send +** +** \par Description: +** Includes the time when sending events out a port +** +** \par Limits +** Set as true or false +*/ +#define CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND false + /* Platform Configuration Parameters for Table Service (TBL) */ /** diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index 782a297c5..f7e34ad6c 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -76,7 +76,8 @@ int32 CFE_EVS_EarlyInit(void) CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort = CFE_PLATFORM_EVS_PORT_DEFAULT; CFE_EVS_Global.EVS_TlmPkt.Payload.LogMode = CFE_PLATFORM_EVS_DEFAULT_LOG_MODE; - CFE_EVS_Global.EVS_EventBurstMax = CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST; + CFE_EVS_Global.EVS_EventBurstMax = CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST; + CFE_EVS_Global.IncludeTimeInPortSend = CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND; /* Get a pointer to the CFE reset area from the BSP */ PspStatus = CFE_PSP_GetResetArea(&resetAreaAddr, &resetAreaSize); @@ -491,22 +492,7 @@ int32 CFE_EVS_EnablePortsCmd(const CFE_EVS_EnablePortsCmd_t *data) else { /* Process command data */ - if (((CmdPtr->BitMask & CFE_EVS_PORT1_BIT) >> 0) == true) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort |= CFE_EVS_PORT1_BIT; - } - if (((CmdPtr->BitMask & CFE_EVS_PORT2_BIT) >> 1) == true) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort |= CFE_EVS_PORT2_BIT; - } - if (((CmdPtr->BitMask & CFE_EVS_PORT3_BIT) >> 2) == true) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort |= CFE_EVS_PORT3_BIT; - } - if (((CmdPtr->BitMask & CFE_EVS_PORT4_BIT) >> 3) == true) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort |= CFE_EVS_PORT4_BIT; - } + CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort |= CmdPtr->BitMask; EVS_SendEvent(CFE_EVS_ENAPORT_EID, CFE_EVS_EventType_DEBUG, "Enable Ports Command Received with Port Bit Mask = 0x%02x", (unsigned int)CmdPtr->BitMask); @@ -538,22 +524,7 @@ int32 CFE_EVS_DisablePortsCmd(const CFE_EVS_DisablePortsCmd_t *data) else { /* Process command data */ - if (((CmdPtr->BitMask & CFE_EVS_PORT1_BIT) >> 0) == true) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort &= ~CFE_EVS_PORT1_BIT; - } - if (((CmdPtr->BitMask & CFE_EVS_PORT2_BIT) >> 1) == true) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort &= ~CFE_EVS_PORT2_BIT; - } - if (((CmdPtr->BitMask & CFE_EVS_PORT3_BIT) >> 2) == true) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort &= ~CFE_EVS_PORT3_BIT; - } - if (((CmdPtr->BitMask & CFE_EVS_PORT4_BIT) >> 3) == true) - { - CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort &= ~CFE_EVS_PORT4_BIT; - } + CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort &= ~CmdPtr->BitMask; EVS_SendEvent(CFE_EVS_DISPORT_EID, CFE_EVS_EventType_DEBUG, "Disable Ports Command Received with Port Bit Mask = 0x%02x", (unsigned int)CmdPtr->BitMask); diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index f8274057e..b39775495 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -122,6 +122,7 @@ typedef struct osal_id_t EVS_SharedDataMutexID; CFE_ES_AppId_t EVS_AppID; uint32 EVS_EventBurstMax; + bool IncludeTimeInPortSend; /* Includes time in message sent out ports */ } CFE_EVS_Global_t; /* diff --git a/modules/evs/fsw/src/cfe_evs_utils.c b/modules/evs/fsw/src/cfe_evs_utils.c index 8127046b4..75cc90f40 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.c +++ b/modules/evs/fsw/src/cfe_evs_utils.c @@ -35,10 +35,7 @@ /* Local Function Prototypes */ void EVS_SendViaPorts(CFE_EVS_LongEventTlm_t *EVS_PktPtr); -void EVS_OutputPort1(char *Message); -void EVS_OutputPort2(char *Message); -void EVS_OutputPort3(char *Message); -void EVS_OutputPort4(char *Message); +void EVS_OutputPort(uint8 PortNum, char *Message); /* Function Definitions */ @@ -541,50 +538,45 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 *-----------------------------------------------------------------*/ void EVS_SendViaPorts(CFE_EVS_LongEventTlm_t *EVS_PktPtr) { - char PortMessage[CFE_EVS_MAX_PORT_MSG_LENGTH]; + char PortMessage[CFE_EVS_MAX_PORT_MSG_LENGTH]; + char TimeBuffer[CFE_TIME_PRINTED_STRING_SIZE] = ""; + char Separator[2] = ""; + CFE_TIME_SysTime_t PktTime; - if (((CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort & CFE_EVS_PORT1_BIT) >> 0) == true) + if (CFE_EVS_Global.IncludeTimeInPortSend) + { + CFE_MSG_GetMsgTime(CFE_MSG_PTR(EVS_PktPtr->TelemetryHeader), &PktTime); + CFE_TIME_Print(TimeBuffer, PktTime); + snprintf(Separator, sizeof(Separator), " "); + } + + snprintf(PortMessage, sizeof(PortMessage), "%s%s%u/%u/%s %u: %s", TimeBuffer, Separator, + (unsigned int)EVS_PktPtr->Payload.PacketID.SpacecraftID, + (unsigned int)EVS_PktPtr->Payload.PacketID.ProcessorID, EVS_PktPtr->Payload.PacketID.AppName, + (unsigned int)EVS_PktPtr->Payload.PacketID.EventID, EVS_PktPtr->Payload.Message); + + if (CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort & CFE_EVS_PORT1_BIT) { - /* Copy event message to string format */ - snprintf(PortMessage, CFE_EVS_MAX_PORT_MSG_LENGTH, "EVS Port1 %u/%u/%s %u: %s", - (unsigned int)EVS_PktPtr->Payload.PacketID.SpacecraftID, - (unsigned int)EVS_PktPtr->Payload.PacketID.ProcessorID, EVS_PktPtr->Payload.PacketID.AppName, - (unsigned int)EVS_PktPtr->Payload.PacketID.EventID, EVS_PktPtr->Payload.Message); /* Send string event out port #1 */ - EVS_OutputPort1(PortMessage); + EVS_OutputPort(1, PortMessage); } - if (((CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort & CFE_EVS_PORT2_BIT) >> 1) == true) + if (CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort & CFE_EVS_PORT2_BIT) { - /* Copy event message to string format */ - snprintf(PortMessage, CFE_EVS_MAX_PORT_MSG_LENGTH, "EVS Port2 %u/%u/%s %u: %s", - (unsigned int)EVS_PktPtr->Payload.PacketID.SpacecraftID, - (unsigned int)EVS_PktPtr->Payload.PacketID.ProcessorID, EVS_PktPtr->Payload.PacketID.AppName, - (unsigned int)EVS_PktPtr->Payload.PacketID.EventID, EVS_PktPtr->Payload.Message); /* Send string event out port #2 */ - EVS_OutputPort2(PortMessage); + EVS_OutputPort(2, PortMessage); } - if (((CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort & CFE_EVS_PORT3_BIT) >> 2) == true) + if (CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort & CFE_EVS_PORT3_BIT) { - /* Copy event message to string format */ - snprintf(PortMessage, CFE_EVS_MAX_PORT_MSG_LENGTH, "EVS Port3 %u/%u/%s %u: %s", - (unsigned int)EVS_PktPtr->Payload.PacketID.SpacecraftID, - (unsigned int)EVS_PktPtr->Payload.PacketID.ProcessorID, EVS_PktPtr->Payload.PacketID.AppName, - (unsigned int)EVS_PktPtr->Payload.PacketID.EventID, EVS_PktPtr->Payload.Message); /* Send string event out port #3 */ - EVS_OutputPort3(PortMessage); + EVS_OutputPort(3, PortMessage); } - if (((CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort & CFE_EVS_PORT4_BIT) >> 3) == true) + if (CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort & CFE_EVS_PORT4_BIT) { - /* Copy event message to string format */ - snprintf(PortMessage, CFE_EVS_MAX_PORT_MSG_LENGTH, "EVS Port4 %u/%u/%s %u: %s", - (unsigned int)EVS_PktPtr->Payload.PacketID.SpacecraftID, - (unsigned int)EVS_PktPtr->Payload.PacketID.ProcessorID, EVS_PktPtr->Payload.PacketID.AppName, - (unsigned int)EVS_PktPtr->Payload.PacketID.EventID, EVS_PktPtr->Payload.Message); /* Send string event out port #4 */ - EVS_OutputPort4(PortMessage); + EVS_OutputPort(4, PortMessage); } } @@ -593,39 +585,9 @@ void EVS_SendViaPorts(CFE_EVS_LongEventTlm_t *EVS_PktPtr) * Internal helper routine only, not part of API. * *-----------------------------------------------------------------*/ -void EVS_OutputPort1(char *Message) -{ - OS_printf("%s\n", Message); -} - -/*---------------------------------------------------------------- - * - * Internal helper routine only, not part of API. - * - *-----------------------------------------------------------------*/ -void EVS_OutputPort2(char *Message) -{ - OS_printf("%s\n", Message); -} - -/*---------------------------------------------------------------- - * - * Internal helper routine only, not part of API. - * - *-----------------------------------------------------------------*/ -void EVS_OutputPort3(char *Message) -{ - OS_printf("%s\n", Message); -} - -/*---------------------------------------------------------------- - * - * Internal helper routine only, not part of API. - * - *-----------------------------------------------------------------*/ -void EVS_OutputPort4(char *Message) +void EVS_OutputPort(uint8 PortNum, char *Message) { - OS_printf("%s\n", Message); + OS_printf("EVS Port%u %s\n", PortNum, Message); } /*---------------------------------------------------------------- diff --git a/modules/evs/fsw/src/cfe_evs_verify.h b/modules/evs/fsw/src/cfe_evs_verify.h index 7c8c8df6e..15ae544a0 100644 --- a/modules/evs/fsw/src/cfe_evs_verify.h +++ b/modules/evs/fsw/src/cfe_evs_verify.h @@ -45,6 +45,10 @@ #error CFE_PLATFORM_EVS_DEFAULT_LOG_MODE can only be 0 (Overwrite) or 1 (Discard)! #endif +#if (CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND != true) && (CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND != false) +#error CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND must be true or false +#endif + #if (CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE != CFE_EVS_MsgFormat_LONG) && \ (CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE != CFE_EVS_MsgFormat_SHORT) #error CFE_EVS_DEFAULT_MSG_FORMAT can only be CFE_EVS_MsgFormat_LONG or CFE_EVS_MsgFormat_SHORT ! diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 534743970..6d593aa2d 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -279,6 +279,7 @@ void Test_Init(void) UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetResetType), 1, CFE_PSP_RST_TYPE_POWERON); CFE_EVS_EarlyInit(); + CFE_EVS_Global.IncludeTimeInPortSend = false; /* Do generic testing without time in port message */ CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[4]); /* Task main with init failure */ @@ -359,6 +360,7 @@ void Test_Init(void) UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetResetType), 1, CFE_PSP_RST_TYPE_POWERON); CFE_EVS_EarlyInit(); + CFE_EVS_Global.IncludeTimeInPortSend = false; /* Do generic testing without time in port message */ CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[4]); /* Test task initialization where event services fails */ @@ -812,7 +814,9 @@ void Test_Ports(void) { CFE_EVS_BitMaskCmd_t bitmaskcmd; UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; + CFE_TIME_SysTime_t PacketTime; + memset(&PacketTime, 0, sizeof(PacketTime)); memset(&bitmaskcmd, 0, sizeof(bitmaskcmd)); UtPrintf("Begin Test Ports"); @@ -829,8 +833,17 @@ void Test_Ports(void) /* Test that ports are enabled by sending a message */ UT_InitData(); UT_SetHookFunction(UT_KEY(CFE_SB_TransmitMsg), UT_SoftwareBusSnapshotHook, &LocalSnapshotData); - CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Test ports message"); + UtAssert_UINT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Test ports message"), CFE_SUCCESS); UtAssert_UINT32_EQ(LocalSnapshotData.Count, 1); + UtAssert_STUB_COUNT(CFE_TIME_Print, 0); + + /* Test with time included */ + UT_InitData(); + CFE_EVS_Global.IncludeTimeInPortSend = true; + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgTime), &PacketTime, sizeof(PacketTime), false); + UtAssert_UINT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Test ports message"), CFE_SUCCESS); + UtAssert_STUB_COUNT(CFE_TIME_Print, 1); + CFE_EVS_Global.IncludeTimeInPortSend = false; /* Do generic testing without time in port message */ /* Disable all ports to cut down on unneeded output */ UT_InitData(); From efb8551adaa27ca0bf49174f10c05b41f0f80626 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 7 Apr 2023 11:28:50 -0400 Subject: [PATCH 147/200] Fix #2284, improve add_cfe_tables function Improves the functionality and adds additional documentation about how this function is intended to work. The improvements add some flexibility and intelligence and should be backward compatible with existing use cases. The add_cfe_app() function now adds an additional interface target that can be referenced when building tables, and this includes the directory-scope properties from the original app build. Therefore, calls to add_cfe_tables from other (non-app) contexts can get the full set of include directories. This also makes the target name simpler when adding custom properties, it is simply "${APP_NAME}.table" Finally, instead of invoking the table tool (elf2cfetbl) directly in the context of the table build rule, it generates a custom makefile rule instead, which is called from the top-level (mission) scope to do the conversions. --- cmake/arch_build.cmake | 255 +++++++++++++------- cmake/generate_table.cmake | 49 ---- cmake/mission_build.cmake | 42 +++- cmake/tables/elf2cfetbl_rules.mk | 5 + cmake/tables/generate_elf_table_rules.cmake | 34 +++ cmake/tables/table_rule_template.d.in | 10 + cmake/tables/tabletool_rule.mk | 10 + 7 files changed, 272 insertions(+), 133 deletions(-) delete mode 100644 cmake/generate_table.cmake create mode 100644 cmake/tables/elf2cfetbl_rules.mk create mode 100644 cmake/tables/generate_elf_table_rules.cmake create mode 100644 cmake/tables/table_rule_template.d.in create mode 100644 cmake/tables/tabletool_rule.mk diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index f2402d1ce..d1fe5a5dc 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -106,6 +106,30 @@ function(add_cfe_app APP_NAME APP_SRC_FILES) cfs_app_do_install(${APP_NAME} ${APP_DYNAMIC_TARGET_LIST}) endif (APP_DYNAMIC_TARGET_LIST) + # Add an interface target is added with a ".table" suffix, + # this should reflect all the INCLUDE_DIRECTORIES and COMPILE_DEFINITIONS that + # were used when compiling the app itself, such that tables (and other items) can be + # added later and reference the same set. + add_library(${APP_NAME}.table INTERFACE) + get_directory_property(CURRENT_INCLUDE_DIRS INCLUDE_DIRECTORIES) + if (NOT CURRENT_INCLUDE_DIRS) + set(CURRENT_INCLUDE_DIRS) # make it empty, not -NOTFOUND + endif() + get_directory_property(CURRENT_COMPILE_DEFS COMPILE_DEFINITIONS) + if (NOT CURRENT_COMPILE_DEFS) + set(CURRENT_COMPILE_DEFS) # make it empty, not -NOTFOUND + endif() + list (APPEND CURRENT_INCLUDE_DIRS + $ + $ + ) + list (APPEND CURRENT_COMPILE_DEFS + $ + $ + ) + target_include_directories(${APP_NAME}.table INTERFACE ${CURRENT_INCLUDE_DIRS}) + target_compile_definitions(${APP_NAME}.table INTERFACE ${CURRENT_COMPILE_DEFS} CFE_APP_NAME="${APP_NAME}") + endfunction(add_cfe_app) ################################################################## @@ -146,99 +170,160 @@ endfunction(add_cfe_app_dependency) # # Simplified routine to add CFS tables to be built with an app # -function(add_cfe_tables APP_NAME TBL_SRC_FILES) +# For apps with just a single table, the TABLE_FQNAME may be the +# same as the app name, which is simple. +# +# For apps with multiple tables, the TABLE_FQNAME may be of the +# form "${APP_NAME}.${TABLE_NAME}" where ${APP_NAME} refers to an +# app target that was registered via the "add_cfe_app" function. +# +# Note that for backward compatibility, any name will be accepted +# for TABLE_FQNAME. However if this function cannot determine which +# app the table is associated with, it will only have a default set +# of INCLUDE_DIRECTORIES when building the C source file(s). By +# associating a table with an app using the conventions above, the +# INCLUDE_DIRECTORIES from the parent app will be used when building the +# tables. +# +# This function produces one or more library targets in CMake, using names +# of the form: "tblobj_${TGT}_{TABLE_FQNAME}" where TGT reflects the name +# of the target from targets.cmake and TABLE_FQNAME reflects the first +# parameter to this function. +# +function(add_cfe_tables TABLE_FQNAME TBL_DEFAULT_SRC_FILES) + + get_filename_component(APP_NAME ${TABLE_FQNAME} NAME_WE) - if (TGTNAME) - set (TABLE_TGTLIST ${TGTNAME}) - elseif (TARGET ${APP_NAME}) + # If "TGTNAME" is set, then use it directly + set(TABLE_TGTLIST ${TGTNAME}) + set(TABLE_TEMPLATE "${CFE_SOURCE_DIR}/cmake/tables/table_rule_template.d.in") + set(TABLE_CMD_BASIC_OPTS + -DTEMPLATE_FILE="${TABLE_TEMPLATE}" + -DAPP_NAME="${APP_NAME}" + ) + + if (INSTALL_SUBDIR) + list(APPEND TABLE_CMD_BASIC_OPTS + -DINSTALL_SUBDIR="${INSTALL_SUBDIR}" + ) + endif() + + if (TARGET ${APP_NAME}.table) + if (NOT TABLE_TGTLIST) set (TABLE_TGTLIST ${TGTLIST_${APP_NAME}}) + endif() + set(TABLE_PARENT_TGT ${APP_NAME}.table) else() - # The first parameter should match the name of an app that was - # previously defined using "add_cfe_app". If target-scope properties - # are used for include directories and compile definitions, this is needed - # to compile tables with the same include path/definitions as the app has. - # However historically this could have been any string, which still works - # if directory-scope properties are used for includes, so this is not - # an error. - message("NOTE: \"${APP_NAME}\" passed to add_cfe_tables is not a previously-defined application target") + # The first parameter should match the name of an app that was + # previously defined using "add_cfe_app". If target-scope properties + # are used for include directories and compile definitions, this is needed + # to compile tables with the same include path/definitions as the app has. + # However historically this could have been any string, which still works + # if directory-scope properties are used for includes, so this is not + # an error. + message("NOTE: \"${APP_NAME}\" passed to add_cfe_tables is not a previously-defined application target") + if (NOT TABLE_TGTLIST) set (TABLE_TGTLIST ${APP_STATIC_TARGET_LIST} ${APP_DYNAMIC_TARGET_LIST}) + endif() + # No (known) parent app, just use core_api in this case. It will only get global-scope includes and defines. + set(TABLE_PARENT_TGT core_api) endif() + set(TABLE_GENSCRIPT "${CFE_SOURCE_DIR}/cmake/tables/generate_elf_table_rules.cmake") + # The table source must be compiled using the same "include_directories" # as any other target, but it uses the "add_custom_command" so there is # no automatic way to do this (at least in the older cmakes) + foreach(TGT ${TABLE_TGTLIST}) + + set(TABLE_CMD_TGT_OPTS + -DTARGET_NAME="${TGT}" + ) + + set(TABLE_LIBNAME "tblobj_${TGT}_${TABLE_FQNAME}") + list(APPEND TABLE_CMD_TGT_OPTS "-DARCHIVE_FILE=\"$\"") + + # Note that the TBL_DEFAULT_SRC_FILES is just a default - we now need + # to find the active source, which typically comes from the MISSION_DEFS dir. + # The TABLE_SELECTED_SRCS will become this list of active/selected source files + set(TABLE_SELECTED_SRCS) + foreach(TBL ${TBL_DEFAULT_SRC_FILES} ${ARGN}) + + # The file source basename (without directory or ext) should be the same as the table + # binary filename with a ".tbl" extension (this is the convention assumed by elf2cfetbl) + get_filename_component(TABLE_SRC_NEEDED ${TBL} NAME) + get_filename_component(TABLE_BASENAME ${TBL} NAME_WE) + + + # Check if an override exists at the mission level (recommended practice) + # This allows a mission to implement a customized table without modifying + # the original - this also makes for easier merging/updating if needed. + # Note this path list is in reverse-priority order, and only a single file + # will be end up being selected. + cfe_locate_implementation_file(TBL_SRC "${TABLE_SRC_NEEDED}" + OPTIONAL + FALLBACK_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${TBL}" + PREFIX ${TGT} + SUBDIR tables + ) + + list(APPEND TABLE_SELECTED_SRCS ${TBL_SRC}) + + if (TBL_SRC) + message(STATUS "Using ${TBL_SRC} as table definition for ${TABLE_BASENAME} on ${TGT}") + else() + message(FATAL_ERROR "No table definition for ${APP_NAME}.${TABLE_BASENAME} on ${TGT} found") + endif() + + # Set a preprocessor macro so when the .c file is compiled it knows what its + # input and (by convention) output name is supposed to be. + if (TABLE_LIBNAME) + set_property(SOURCE "${TBL_SRC}" APPEND PROPERTY COMPILE_DEFINITIONS + CFE_TABLE_NAME=${TABLE_BASENAME} + ) + endif() + + # Note the table is not generated directly here, as it may require the native system compiler, so + # the call to the table tool (eds2cfetbl in this build) is deferred to the parent scope. Instead, this + # generates a file that captures the state (include dirs, source files, targets) for use in a future step. + set(TABLE_RULEFILE "${MISSION_BINARY_DIR}/tables/${TGT}_${TABLE_FQNAME}.${TABLE_BASENAME}.d") + add_custom_command( + OUTPUT "${TABLE_RULEFILE}" + COMMAND ${CMAKE_COMMAND} + ${TABLE_CMD_BASIC_OPTS} + ${TABLE_CMD_TGT_OPTS} + -DOUTPUT_FILE="${TABLE_RULEFILE}" + -DTABLE_NAME="${TABLE_BASENAME}" + -DSOURCES="${TBL_SRC}" + -P "${TABLE_GENSCRIPT}" + WORKING_DIRECTORY + ${WORKING_DIRECTORY} + DEPENDS + ${TABLE_TEMPLATE} + ${TABLE_GENSCRIPT} + ${TABLE_PARENT_TGT} + ) + + # Add a custom target to generate the config file + add_custom_target(generate_table_${TGT}_${APP_NAME}_${TABLE_BASENAME} + DEPENDS "${TABLE_RULEFILE}" + ) + add_dependencies(cfetables generate_table_${TGT}_${APP_NAME}_${TABLE_BASENAME}) + + endforeach() + + if (TABLE_LIBNAME) + # NOTE: On newer CMake versions this should become an OBJECT library which makes this simpler. + # On older versions one may not reference the TARGET_OBJECTS property from the custom command. + # As a workaround this is built into a static library, and then the desired object is extracted + # before passing to elf2cfetbl. It is roundabout but it works. + add_library(${TABLE_LIBNAME} STATIC ${TABLE_SELECTED_SRCS}) + target_compile_definitions(${TABLE_LIBNAME} PRIVATE + CFE_CPU_NAME=${TGT} + ) + target_link_libraries(${TABLE_LIBNAME} ${TABLE_PARENT_TGT}) + endif() - # Create the intermediate table objects using the target compiler, - # then use "elf2cfetbl" to convert to a .tbl file - foreach(TBL ${TBL_SRC_FILES} ${ARGN}) - - # Get name without extension (NAME_WE) and append to list of tables - get_filename_component(TBLWE ${TBL} NAME_WE) - - foreach(TGT ${TABLE_TGTLIST}) - set(TABLE_LIBNAME "${TGT}_${APP_NAME}_${TBLWE}") - set(TABLE_DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/${TABLE_LIBNAME}") - set(TABLE_BINARY "${TABLE_DESTDIR}/${TBLWE}.tbl") - file(MAKE_DIRECTORY ${TABLE_DESTDIR}) - - # Check if an override exists at the mission level (recommended practice) - # This allows a mission to implement a customized table without modifying - # the original - this also makes for easier merging/updating if needed. - if (EXISTS "${MISSION_DEFS}/tables/${TGT}_${TBLWE}.c") - set(TBL_SRC "${MISSION_DEFS}/tables/${TGT}_${TBLWE}.c") - elseif (EXISTS "${MISSION_SOURCE_DIR}/tables/${TGT}_${TBLWE}.c") - set(TBL_SRC "${MISSION_SOURCE_DIR}/tables/${TGT}_${TBLWE}.c") - elseif (EXISTS "${MISSION_DEFS}/${TGT}/tables/${TBLWE}.c") - set(TBL_SRC "${MISSION_DEFS}/${TGT}/tables/${TBLWE}.c") - elseif (EXISTS "${MISSION_DEFS}/tables/${TBLWE}.c") - set(TBL_SRC "${MISSION_DEFS}/tables/${TBLWE}.c") - elseif (EXISTS "${MISSION_SOURCE_DIR}/tables/${TBLWE}.c") - set(TBL_SRC "${MISSION_SOURCE_DIR}/tables/${TBLWE}.c") - elseif (IS_ABSOLUTE "${TBL}") - set(TBL_SRC "${TBL}") - else() - set(TBL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${TBL}") - endif() - - if (NOT EXISTS "${TBL_SRC}") - message(FATAL_ERROR "ERROR: No source file for table ${TBLWE}") - else() - message("NOTE: Selected ${TBL_SRC} as source for ${APP_NAME}.${TBLWE} on ${TGT}") - - # NOTE: On newer CMake versions this should become an OBJECT library which makes this simpler. - # On older versions one may not reference the TARGET_OBJECTS property from the custom command. - # As a workaround this is built into a static library, and then the desired object is extracted - # before passing to elf2cfetbl. It is roundabout but it works. - add_library(${TABLE_LIBNAME} STATIC ${TBL_SRC}) - target_link_libraries(${TABLE_LIBNAME} PRIVATE core_api) - if (TARGET ${APP_NAME}) - target_include_directories(${TABLE_LIBNAME} PRIVATE $) - target_compile_definitions(${TABLE_LIBNAME} PRIVATE $) - endif() - - # IMPORTANT: This rule assumes that the output filename of elf2cfetbl matches - # the input file name but with a different extension (.o -> .tbl) - # The actual output filename is embedded in the source file (.c), however - # this must match and if it does not the build will break. That's just the - # way it is, because NO make system supports changing rules based on the - # current content of a dependency (rightfully so). - add_custom_command( - OUTPUT ${TABLE_BINARY} - COMMAND ${CMAKE_COMMAND} - -DCMAKE_AR=${CMAKE_AR} - -DTBLTOOL=${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl - -DLIB=$ - -P ${CFE_SOURCE_DIR}/cmake/generate_table.cmake - DEPENDS ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl ${TABLE_LIBNAME} - WORKING_DIRECTORY ${TABLE_DESTDIR} - ) - - # Add a custom target to invoke the elf2cfetbl tool to generate the tbl file, - # and install that binary file to the staging area. - add_custom_target(${TABLE_LIBNAME}_tbl ALL DEPENDS ${TABLE_BINARY}) - install(FILES ${TABLE_BINARY} DESTINATION ${TGT}/${INSTALL_SUBDIR}) - endif() - endforeach() endforeach() @@ -513,6 +598,10 @@ endfunction(cfs_app_check_intf) # function(prepare) + # "cfetables" is a top level target to build all table files + # all generated table files will be added as dependencies to this target + add_custom_target(cfetables) + # Choose the configuration file to use for OSAL on this system set(OSAL_CONFIGURATION_FILE) foreach(CONFIG ${BUILD_CONFIG_${TARGETSYSTEM}} ${OSAL_SYSTEM_OSCONFIG}) diff --git a/cmake/generate_table.cmake b/cmake/generate_table.cmake deleted file mode 100644 index b817ce6da..000000000 --- a/cmake/generate_table.cmake +++ /dev/null @@ -1,49 +0,0 @@ -################################################################## -# -# Sub-script to generate a table file via elf2cfetbl -# -# This small script runs at build time (as opposed to prep time) -# which converts a static library (.a) with a single object into a -# table (.tbl) file -# -################################################################## - -# -# Required passed in values: -# CMAKE_AR => path to "ar" utility for working with static lib files -# TBLTOOL => path to "elf2cfetbl" utility -# LIB => name of library file to convert -# -# This assumes/requires that the static library has a single object in it. -# Note, In newer versions of CMake an object library can be used. This workaround -# is intended to also be compatible with older CMake versions. -# - -# First run "ar t" to get the object file name, there should be only 1 file. -execute_process(COMMAND ${CMAKE_AR} t "${LIB}" - OUTPUT_VARIABLE OBJNAME - RESULT_VARIABLE RESULT - OUTPUT_STRIP_TRAILING_WHITESPACE -) -if (NOT RESULT EQUAL 0) - message(FATAL_ERROR "Failure running ${CMAKE_AR} t ${LIB}") -endif() - -# Next run "ar x" to extract that file. -execute_process(COMMAND ${CMAKE_AR} x "${LIB}" "${OBJNAME}" - RESULT_VARIABLE RESULT -) -if (NOT RESULT EQUAL 0) - message(FATAL_ERROR "Failure running ${CMAKE_AR} x ${LIB} ${OBJNAME}") -endif() - -# Finally invoke the table tool (elf2cfetbl) on the object -message("Executing Process: ${TBLTOOL} ${OBJNAME}") -execute_process(COMMAND ${TBLTOOL} "${OBJNAME}" - RESULT_VARIABLE RESULT -) -if (NOT RESULT EQUAL 0) - message(FATAL_ERROR "Failure running ${TBLTOOL}") -endif() - -message("Successfully converted ${LIB} to a CFE table") diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index ef3d62a8a..2ee6f7094 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -174,14 +174,28 @@ function(prepare) add_definitions(-DSIMULATION=${SIMULATION}) endif (SIMULATION) + # Prepare the table makefile - Ensure the list of tables is initially empty + file(MAKE_DIRECTORY "${MISSION_BINARY_DIR}/tables") + file(WRITE "${MISSION_BINARY_DIR}/tables/Makefile" + "MISSION_BINARY_DIR := ${MISSION_BINARY_DIR}\n" + "TABLE_BINARY_DIR := ${MISSION_BINARY_DIR}/tables\n" + "MISSION_SOURCE_DIR := ${MISSION_SOURCE_DIR}\n" + "MISSION_DEFS := ${MISSION_DEFS}\n\n" + "include \$(wildcard ${CFE_SOURCE_DIR}/cmake/tables/*.mk) \$(wildcard *.d)\n" + ) + # Create custom targets for building and cleaning all architectures # This is required particularly for doing extra stuff in the clean step add_custom_target(mission-all COMMAND $(MAKE) all) add_custom_target(mission-install COMMAND $(MAKE) install) add_custom_target(mission-clean COMMAND $(MAKE) clean) add_custom_target(mission-prebuild) + add_custom_target(mission-cfetables) add_custom_target(doc-prebuild) + add_dependencies(mission-all mission-cfetables) + add_dependencies(mission-install mission-cfetables) + # Locate the source location for all the apps found within the target file # This is done by searching through the list of paths to find a matching name # The environment variable is cached so it will be retained across runs. @@ -379,13 +393,31 @@ function(prepare) include_directories( ${core_api_MISSION_DIR}/fsw/inc ${osal_MISSION_DIR}/src/os/inc - ${psp_MISSION_DIR}/psp/fsw/inc + ${psp_MISSION_DIR}/fsw/inc ) add_subdirectory(${MISSION_SOURCE_DIR}/tools tools) # Add a dependency on the table generator tool as this is required for table builds # The "elf2cfetbl" target should have been added by the "tools" above add_dependencies(mission-prebuild elf2cfetbl) + set(TABLETOOL_EXEC $) + + add_custom_target(tabletool-execute + COMMAND $(MAKE) + CC="${CMAKE_C_COMPILER}" + CFLAGS="${CMAKE_C_FLAGS}" + AR="${CMAKE_AR}" + TBLTOOL="${TABLETOOL_EXEC}" + cfetables + WORKING_DIRECTORY + "${CMAKE_BINARY_DIR}/tables" + DEPENDS + mission-cfetables + ) + add_dependencies(mission-all tabletool-execute) + add_dependencies(mission-install tabletool-execute) + add_dependencies(mission-cfetables mission-prebuild) + install(DIRECTORY ${CMAKE_BINARY_DIR}/tables/staging/ DESTINATION .) # Build version information should be generated as part of the pre-build process add_dependencies(mission-prebuild mission-version) @@ -475,13 +507,21 @@ function(process_arch TARGETSYSTEM) WORKING_DIRECTORY "${ARCH_BINARY_DIR}" ) + add_custom_target(${TARGETSYSTEM}-cfetables + COMMAND + $(MAKE) cfetables + WORKING_DIRECTORY + "${ARCH_BINARY_DIR}" + ) # All subordinate builds depend on the generated files being present first add_dependencies(${TARGETSYSTEM}-install mission-prebuild) add_dependencies(${TARGETSYSTEM}-all mission-prebuild) + add_dependencies(${TARGETSYSTEM}-cfetables mission-prebuild) add_dependencies(mission-all ${TARGETSYSTEM}-all) add_dependencies(mission-clean ${TARGETSYSTEM}-clean) add_dependencies(mission-install ${TARGETSYSTEM}-install) + add_dependencies(mission-cfetables ${TARGETSYSTEM}-cfetables) endfunction(process_arch TARGETSYSTEM) diff --git a/cmake/tables/elf2cfetbl_rules.mk b/cmake/tables/elf2cfetbl_rules.mk new file mode 100644 index 000000000..fa36a6bf0 --- /dev/null +++ b/cmake/tables/elf2cfetbl_rules.mk @@ -0,0 +1,5 @@ +# Rule for traditional CFE table generation via elf2cfetbl + +elf/%.o: + @mkdir -pv $(dir $(@)) + cd $(dir $(@)) && $(AR) x $(abspath $(<)) $(notdir $(@)) diff --git a/cmake/tables/generate_elf_table_rules.cmake b/cmake/tables/generate_elf_table_rules.cmake new file mode 100644 index 000000000..35068e060 --- /dev/null +++ b/cmake/tables/generate_elf_table_rules.cmake @@ -0,0 +1,34 @@ +################################################################## +# +# Sub-script to capture the table compile/generation environment +# +# This small script runs at build time (as opposed to prep time) +# which captures a set of environment metadata +# +# It must be done this way such that generator expressions will +# be evaluated now, during the arch build process, rather than +# deferring the evaluation to the parent build where they may +# have different values. +# +################################################################## + +set(STAGING_DIR staging ${TARGET_NAME} ${INSTALL_SUBDIR}) +string(REPLACE ";" "/" STAGING_DIR "${STAGING_DIR}") + +set(TABLE_BINARY "${STAGING_DIR}/${TABLE_NAME}.tbl") +set(TMP_DIR "elf/${TARGET_NAME}") +set(TABLE_RULES) + +foreach(TBL_SRC ${SOURCES}) + + get_filename_component(DEP_FILE ${TBL_SRC} NAME) + set(DEP_FILE "${TMP_DIR}/${DEP_FILE}.o") + string(APPEND TABLE_RULES + "${DEP_FILE}: ${ARCHIVE_FILE}\n" + "${TABLE_BINARY}: ${DEP_FILE}\n" + "\n" + ) + +endforeach() + +configure_file(${TEMPLATE_FILE} ${OUTPUT_FILE}) diff --git a/cmake/tables/table_rule_template.d.in b/cmake/tables/table_rule_template.d.in new file mode 100644 index 000000000..4fa664818 --- /dev/null +++ b/cmake/tables/table_rule_template.d.in @@ -0,0 +1,10 @@ +# Template for table configuration + +cfetables: ${TABLE_BINARY} + +${TABLE_BINARY}: CFE_TABLE_CPUNAME := ${TARGET_NAME} +${TABLE_BINARY}: CFE_TABLE_APPNAME := ${APP_NAME} +${TABLE_BINARY}: CFE_TABLE_BASENAME := ${TABLE_NAME} + +# Rules to build ${TABLE_BINARY} +${TABLE_RULES} diff --git a/cmake/tables/tabletool_rule.mk b/cmake/tables/tabletool_rule.mk new file mode 100644 index 000000000..0e2e178f2 --- /dev/null +++ b/cmake/tables/tabletool_rule.mk @@ -0,0 +1,10 @@ +# Makefile for EDS-based CFE table generation +.PHONY: cfetables + +cfetables: + @echo "Table build completed" + +#%.tbl: $(TBLTOOL) +staging/%.tbl: + @mkdir -pv $(dir $(@)) + cd $(dir $(@)) && $(TBLTOOL) $(TBLTOOL_FLAGS) $(abspath $(^)) From a2d985244806cc4588cff578b26b8b8cbcbdfc75 Mon Sep 17 00:00:00 2001 From: dzbaker Date: Wed, 19 Apr 2023 13:55:32 -0400 Subject: [PATCH 148/200] Fix #2297, Create workflow to automate merging pull requests and pushing them to the integration-candidate branch. --- .github/workflows/icbundle.yml | 74 ++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/icbundle.yml diff --git a/.github/workflows/icbundle.yml b/.github/workflows/icbundle.yml new file mode 100644 index 000000000..c943edd86 --- /dev/null +++ b/.github/workflows/icbundle.yml @@ -0,0 +1,74 @@ +name: Integration Candidate Bundle Generation + +# Generate Integration Candidate branch for this repository. + +on: + workflow_dispatch: + inputs: + pr_nums: + description: 'The pull request numbers to include (Comma separated)' + required: true + type: string + +jobs: + generate-ic-bundle: + runs-on: ubuntu-latest + steps: + - name: Install Dependencies + run: | + sudo apt update + sudo apt install -y w3m + - name: Checkout IC Branch + uses: actions/checkout@v3 + with: + fetch-depth: '0' + ref: main + - name: Rebase IC Branch + run: | + git config user.name "GitHub Actions" + git config user.email "cfs-program@list.nasa.gov" + git pull + git checkout integration-candidate + git rebase main + - name: Merge each PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + prs=$(echo ${{ inputs.pr_nums }} | tr "," "\n") + for pr in $prs + do + src_branch=$(hub pr show -f %H $pr) + pr_title=$(hub pr show -f %t $pr) + commit_msg=$'Merge pull request #'"${pr}"$' from '"${src_branch}"$'\n\n'"${pr_title}" + git fetch origin pull/$pr/head:origin/pull/$pr/head + git merge origin/pull/$pr/head --no-ff -m "$commit_msg" + done + - name: Update Changelog and Version.h files + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + rev_num=$(git rev-list v7.0.0-rc4.. --count) + changelog_entry=$'# Changelog\\n\\n## Development Build: v7.0.0-rc4+dev'${rev_num} + prs=$(echo ${{ inputs.pr_nums }} | tr "," "\n") + see_entry=$'\-\ See:' + for pr in $prs + do + pr_title=$(hub pr show -f %t $pr) + changelog_entry="${changelog_entry}"$'\\n- '"${pr_title@Q}" + see_entry="${see_entry}"$' ' + done + changelog_entry="${changelog_entry}\n${see_entry}\n" + echo "s|# Changelog|$changelog_entry|" + sed -ir "s|Changelog|$changelog_entry|" CHANGELOG.md + + buildnumber_entry=$'#define CFE_BUILD_NUMBER '${rev_num}$' /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */' + sed -ir "s|define CFE_BUILD_NUMBER.*|$buildnumber_entry|" modules/core_api/fsw/inc/cfe_version.h + - name: Commit and Push Updates to IC Branch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + rev_num=$(git rev-list v7.0.0-rc4.. --count) + git add CHANGELOG.md + git add modules/core_api/fsw/inc/cfe_version.h + git commit -m "Updating documentation and version numbers for v7.0.0-rc4+dev${rev_num}" + git push -v origin integration-candidate From 7a31afdc1aeb0a0d4a56440a89825aaa55c3dbb5 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 17 Apr 2023 13:48:30 -0400 Subject: [PATCH 149/200] Fix #2296, add option to link to generated files Update the "generate_config_includefile" to be aware of generated files. This should not call cfe_locate_implementation_file() in this context because the file may not exist at the time. For this type of use case it should just directly link the file without any checking. --- cmake/global_functions.cmake | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/cmake/global_functions.cmake b/cmake/global_functions.cmake index 9a50fd94d..ba68c447e 100644 --- a/cmake/global_functions.cmake +++ b/cmake/global_functions.cmake @@ -151,7 +151,7 @@ endfunction(generate_c_headerfile) # function(generate_config_includefile) - cmake_parse_arguments(GENCONFIG_ARG "" "OUTPUT_DIRECTORY;FILE_NAME;FALLBACK_FILE;MATCH_SUFFIX" "PREFIXES" ${ARGN} ) + cmake_parse_arguments(GENCONFIG_ARG "" "OUTPUT_DIRECTORY;FILE_NAME;FALLBACK_FILE;MATCH_SUFFIX" "PREFIXES;GENERATED_FILE" ${ARGN} ) if (NOT GENCONFIG_ARG_OUTPUT_DIRECTORY) set(GENCONFIG_ARG_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/inc") endif (NOT GENCONFIG_ARG_OUTPUT_DIRECTORY) @@ -168,13 +168,20 @@ function(generate_config_includefile) set(TGTFILE ${GENCONFIG_ARG_FILE_NAME}) endif() - # Use the common search function to find the candidate(s) - cfe_locate_implementation_file(SRC_LOCAL_PATH_LIST "${TGTFILE}" - ALLOW_LIST - FALLBACK_FILE "${GENCONFIG_ARG_FALLBACK_FILE}" - PREFIX ${GENCONFIG_ARG_PREFIXES} ${ARCH_PREFIXES} - SUBDIR config - ) + if (GENCONFIG_ARG_GENERATED_FILE) + # A generated file may not yet exist at the time this runs, so just use + # what the caller said, no searching. + set(SRC_LOCAL_PATH_LIST ${GENCONFIG_ARG_GENERATED_FILE}) + message(STATUS "Using file: [generated] ${SRC_LOCAL_PATH_LIST} for ${TGTFILE}") + else() + # Use the common search function to find the candidate(s) + cfe_locate_implementation_file(SRC_LOCAL_PATH_LIST "${TGTFILE}" + ALLOW_LIST + FALLBACK_FILE "${GENCONFIG_ARG_FALLBACK_FILE}" + PREFIX ${GENCONFIG_ARG_PREFIXES} ${ARCH_PREFIXES} + SUBDIR config + ) + endif() set(WRAPPER_FILE_CONTENT) foreach(SELECTED_FILE ${SRC_LOCAL_PATH_LIST}) From 972f76aa640d57bd063a91af7be804a9fe986a68 Mon Sep 17 00:00:00 2001 From: havencarlson Date: Mon, 24 Apr 2023 14:51:21 -0400 Subject: [PATCH 150/200] Fix #1901, remove else statement that was unreachable by unit tests --- modules/tbl/fsw/inc/cfe_tbl_events.h | 12 ------------ modules/tbl/fsw/src/cfe_tbl_task_cmds.c | 7 +------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/modules/tbl/fsw/inc/cfe_tbl_events.h b/modules/tbl/fsw/inc/cfe_tbl_events.h index 83c2205ad..edcbe2926 100644 --- a/modules/tbl/fsw/inc/cfe_tbl_events.h +++ b/modules/tbl/fsw/inc/cfe_tbl_events.h @@ -345,18 +345,6 @@ */ #define CFE_TBL_NO_WORK_BUFFERS_ERR_EID 60 -/** - * \brief TBL Load Table Command Get Working Buffer Internal Failure Event ID - * - * \par Type: ERROR - * - * \par Cause: - * - * \link #CFE_TBL_LOAD_CC TBL Load Table Command \endlink failure due to - * internal get working buffer error. - */ -#define CFE_TBL_INTERNAL_ERROR_ERR_EID 61 - /** * \brief TBL Write File Creation Failure Event ID * diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c index 5af3f9da6..3f4ef27c9 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -475,16 +475,11 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data) TblFileHeader.TableName); } } - else if (Status == CFE_TBL_ERR_NO_BUFFER_AVAIL) + else { CFE_EVS_SendEvent(CFE_TBL_NO_WORK_BUFFERS_ERR_EID, CFE_EVS_EventType_ERROR, "No working buffers available for table '%s'", TblFileHeader.TableName); } - else - { - CFE_EVS_SendEvent(CFE_TBL_INTERNAL_ERROR_ERR_EID, CFE_EVS_EventType_ERROR, - "Internal Error (Status=0x%08X)", (unsigned int)Status); - } } else { From e31ae438ed6cb56be170086433262619a3d0b812 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 25 Apr 2023 13:46:57 -0400 Subject: [PATCH 151/200] Bump to v7.0.0-rc4+dev276 --- CHANGELOG.md | 6 ++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d9c1e652..c3fad7bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Development Build: v7.0.0-rc4+dev276 +- improve add_cfe_tables function +- add option to link to generated files +- Create Workflow for IC Bundle Generation +- See , , and + ## Development Build: v7.0.0-rc4+dev268 - update naming convention document - remove return value doxygen markup diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 33491ac6e..59f771ed3 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 268 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 276 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 85f4238d0f89b5f9ef3061eef2b972f0ef35f93e Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 25 Apr 2023 12:38:21 -0400 Subject: [PATCH 152/200] Fix #2305, document CFS component file naming Expand section 4 of the CFE application developer guide with recommended file naming patterns and the expected content of the files. CFS apps should strive to match this pattern for the next release. --- docs/cFE Application Developers Guide.md | 140 +++++++++++++++++------ 1 file changed, 108 insertions(+), 32 deletions(-) diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index f80ac237b..ebf9e6f0c 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -318,14 +318,14 @@ directory is described as a note under each folder. | |-- The flight software is all configured and built under this directory | |-- All mission and platform configuration files are placed here |-- apps - | |-- Contains application source code. + | |-- Contains application source code. | |-- Application source code may be shared amoung multiple build CPUs |-- libs | |-- Contains Core Flight System (cFS) Sample Library (sample_lib) |-- tools | |-- Contains Core Flight System (cFS) tools -``` -Module descriptions are provided in the table below. +``` +Module descriptions are provided in the table below. ``` -- missionxyz/cfe |-- cmake @@ -353,7 +353,7 @@ Module descriptions are provided in the table below. ``` -- missionxyz/build |-- CMakeFiles - | |-- Cmake fore cfe core build and all apps + | |-- Cmake for cfe core build and all apps |-- cpu1 | |-- Contains start up script "cfe_es_startup.scr" | |-- Where build.o and executable files, etc. are placed @@ -364,12 +364,12 @@ Module descriptions are provided in the table below. | |-- Where the cpu1 platform configuration include files go |-- src |-- tools -``` +``` ``` -- missionxyz/build/cpu1 |-- default_cpu1 | |-- CMakeFiles - | | | Cmake fore cfe core build and all apps + | | | Cmake for cfe core build and all apps | |-- apps | | |-- Where application makefiles go | | |-- One directory per application @@ -392,19 +392,19 @@ Module descriptions are provided in the table below. | |-- tbl | |-- time ``` -``` +``` -- missionxyz/apps |-- ci_lab |-- sample_app |-- sch_lab |-- to_lab -``` -``` +``` +``` -- missionxyz/tools |-- cFS-GroundSystem |-- elf2cfetbl |-- tblCRCTool -``` +``` ``` -- missionxyz/cf/modules/es |-- eds @@ -599,33 +599,109 @@ Child Tasks can be useful in both "Software Only" and "Hardware Servicing" applications. ## 4.2 Best Practices + ### 4.2.1 cFS Application Template Applications designed to interface with the cFE should follow standard templates. Reference sample_app on Github for “live” example. -| **Directory** | **Descriptions** | -|:--------------------------------------|:-------------------------------------------------------------------------------------------------------------| -| fsw/ | All components which are used on/deployed to the actual target or define the interface to those components | -| fsw/inc/ | Public/Interface headers for the component | -| fsw/src/ | Source files and private headers for the component | -| tables/ | Example/Initial table definitions | - - - -| **Files** | **Descriptions** | -|:--------------------------------------|:-------------------------------------------------------------------------------------------------------------| -| fsw/src/sample_app.c | Main source code for sample_app. Located in src directory. | -| fsw/src/sample_app.h | Main header file for sample_app. It contains your main global typedef, prototypes, and miscellaneous define. | -| fsw/src/sample_app_events.h | Defines sample_app event IDs | -| fsw/src/sample_app_msg.h | Defines sample_app commands and its structures | -| fsw/tables/sample_app_table.c | Define sample_app table(s) | -| fsw/platform_inc/sample_app_msgids.h | Define sample_app message IDs | -| fsw/mission_inc/sample_app_perfids.h | Define sample_app performance IDs | - -In addition to showing the standard structure of a cFS application, the -sample_app also demonstrates how to interface with cFS libraries and table -services. +__File Organization and Directory Structure__ + +| **Directory** | **Content** | +|:--------------------------------------|:-------------------------------------------------------------------------------| +| config/ | Example configuration files for the component | +| eds/ | CCSDS Electronic Data Sheet package for the component (defined per book 876.0) | +| fsw/ | Source units that comprise the flight software that executes on the target | +| fsw/inc/ | Public/Interface headers for the component | +| fsw/src/ | Source files and private headers for the component | +| tables/ | Example table definitions for the component | + +__Source File Naming Convention__ + +All source files associated with a component should begin with the component name as a prefix, to help ensure uniqueness +of file names across all flight software packages once imported into a combined software tree. All of the configuration header +files should also be overridable at the mission level; that is, a component only provides a default file (with a `default_` prefix, +for distinction) that can be "cloned and owned" by placing a copy, without the `default_` prefix, into the `_defs` directory +for the CFE/CFS mission build. Any customized file(s) in the `_defs` directory will be seen by the CMake build system and used +instead of the default version of the file that is provided from the orignal source tree. + +| **File Name Pattern** | **Scope** | **Content** | +|:---------------------------|:---------:|:----------------------------------------------------------------------------------------------------| +| _module_`_fcncodes.h` | INTERFACE | Function Codes and associated documentation for the CMD interface of the component (see note) | +| _module_`_msgdefs.h` | INTERFACE | Constant definitions for the CMD/TLM interface(s) of the component (see note) | +| _module_`_tbldefs.h` | INTERFACE | Constant definitions that affect the table file interface(s) of the component | +| _module_`_msgstruct.h` | INTERFACE | Structures that define the CMD/TLM message interface(s) of the component | +| _module_`_tblstruct.h` | INTERFACE | Structures that define the table file interface(s) of the component | +| _module_`_interface_cfg.h` | INTERFACE | Other configuration that affects the interface(s) of the component (table files and/or messages) | +| _module_`_eventids.h` | INTERFACE | CFE EVS Event IDs for the component, with descriptions/documentation | +| _module_`_global_cfg.h` | MISSION | Constants that need to be consistent across all instances, but do not directly affect interface(s) | +| _module_`_version.h` | MISSION | Version number of the component | +| _module_`_msgids.h` | PLATFORM | CFE Software Bus Message ID definitions for CMD/TLM interface(s) of the component | +| _module_`_internal_cfg.h` | PLATFORM | Software configuration that does not affect interfaces, and may be different per instance/platform | +| _module_`_perfids.h` | PLATFORM | CFE ES Performance monitor IDs for the component, with descriptions/documentation | +| _module_`_verify.h` | FSW | Compile-time configuration validation (typically included from only one source file) | +| _module_`_app.[ch]` | FSW | Application entry point, initialization, and main task loop | +| _module_`_cmds.[ch]` | FSW | Application command processor functions | +| _module_`_dispatch.[ch]` | FSW | Dispatch table for validating incoming commands and invoking appropriate command processor | + +**NOTE**: For backward compatibility, the `_msgdefs.h` header should also provide the function code definitions from `_fcncodes.h`, such that +inclusion of the `_msgdefs.h` file alone provides the command codes as well as any other required definitions for message interpretation. +However, the `_fcncodes.h` header should be strictly limited to defining command/function codes for the command interface and should not contain +any other information. + +**IMPORANT**: All of the header files above with "INTERFACE" scope control the table/message interface of the component. Changing any of the +values or definitions in these files will affect the inter-processor communication - either table files, exported data products, commands, or +telementry messages. Due caution should be exercised when customizing any of these files, as any changes will need to be propagated to all +other CFE instances, ground systems, test software or scripts, or any other tools that interact with the flight softare. + +Also note that Electronic Data Sheets (EDS) definitions will supercede the "INTERFACE" header files listed above. These headers are not +used by the software when building FSW based on EDS. Instead, the EDS tool will generate these headers based on the content of the EDS file(s) +and the software will be configured to use the generated headers during the build. + +__Combination Headers__ + +The header files in this section combine two or more files from the above set for simplicity of usage in source code, as well as backward +compatiblity with traditional file names from older versions of CFS apps. Although these files may also be overridden directly, it is +recommended to only override/modify the more granular headers defined above. + +| **File Name Pattern** | **Content** | +|:---------------------------|:-------------------------------------------------------------------------------------------| +| _module_`_mission_cfg.h` | Combination of `global_cfg.h` and `interface_cfg.h` (mission scope configuration) | +| _module_`_platform_cfg.h` | Combination of `mission_cfg.h` (above), `internal_cfg.h` and any other dependencies | +| _module_`_msg.h` | Complete message interface: Combination of `msgdefs.h`, `msgstruct.h` and all dependencies | +| _module_`_tbl.h` | Complete table interface: Combination of `tbldefs.h`, `tblstruct.h` and all dependencies | + +**IMPORANT**: Files from a limited scope may depend on files from a broader scope, but not the other way around. For example, +the `platform_cfg.h` may depend on items defined in `mission_cfg.h`, but items in `mission_cfg.h` must **not** depend on items +defined in `platform_cfg.h`. + +__Example for SAMPLE_APP__ + +The sample application (SAMPLE_APP) provides a concrete example of the currently-recommended patterns for CFE/CFS applications. +This section provides a summary the naming conventions put into practice for the sample application. + +| **Files** | **Description** | +|:--------------------------------------------|:--------------------------------------------------------------------------------------------------| +| `config/default_sample_app_msgids.h` | CFE Software Bus Message ID definitions for SAMPLE_APP (CMD, SEND_HK, and HK_TLM) | +| `config/default_sample_app_msgdefs.h` | Not needed | +| `config/default_sample_app_tbldefs.h` | Not needed | +| `config/default_sample_app_msgstruct.h` | Defines NoopCmd, ResetCountersCmd, ProcessCmd, and HkTlm message structures | +| `config/default_sample_app_tblstruct.h` | Defines the example table content structure | +| `config/default_sample_app_interface_cfg.h` | Not needed | +| `config/default_sample_app_global_cfg.h` | Not needed | +| `config/default_sample_app_internal_cfg.h` | Not needed | +| `eds/sample_app.xml` | EDS `` for the SAMPLE_APP component (supercedes headers above, if enabled) | +| `fsw/inc/sample_app_events.h` | Defines sample_app event IDs | +| `fsw/inc/sample_app_perfids.h` | Define sample_app performance IDs | +| `fsw/src/sample_app.c` | Application entry point, initialization, and main task loop | +| `fsw/inc/sample_app.h` | Declarations/Prototypes for `sample_app.c` that are needed by other source units | +| `fsw/src/sample_app_cmds.c` | Application command processor functions | +| `fsw/inc/sample_app_cmds.h` | Declarations/Prototypes for `sample_app_cmds.c` that are needed by other source units | +| `fsw/src/sample_app_dispatch.c` | Application command dispatcher ("TaskPipe"; identification and validation of all message inputs) | +| `fsw/inc/sample_app_dispatch.h` | Declarations/Prototypes for `sample_app_dispatch.c` that are needed by other source units | + +In addition to showing the standard structure of a cFS application, the sample_app also demonstrates how to interface with cFS libraries +and table services. ### 4.2.2 Avoid "Endian-ness" Dependencies From 43270f5bcdb3ba39de1d5e41ef485f316dc72243 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 27 Apr 2023 21:38:29 +0000 Subject: [PATCH 153/200] Fix #219, Remove option to exclude port output timestamp --- cmake/sample_defs/cpu1_platform_cfg.h | 11 - modules/evs/fsw/src/cfe_evs_task.c | 3 +- modules/evs/fsw/src/cfe_evs_task.h | 1 - modules/evs/fsw/src/cfe_evs_utils.c | 13 +- modules/evs/fsw/src/cfe_evs_verify.h | 4 - modules/evs/ut-coverage/evs_UT.c | 414 +++++++++++++------------- 6 files changed, 213 insertions(+), 233 deletions(-) diff --git a/cmake/sample_defs/cpu1_platform_cfg.h b/cmake/sample_defs/cpu1_platform_cfg.h index 55c81ba2a..b898e7b37 100644 --- a/cmake/sample_defs/cpu1_platform_cfg.h +++ b/cmake/sample_defs/cpu1_platform_cfg.h @@ -1462,17 +1462,6 @@ */ #define CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE CFE_EVS_MsgFormat_LONG -/** -** \cfeevscfg Include time in port send -** -** \par Description: -** Includes the time when sending events out a port -** -** \par Limits -** Set as true or false -*/ -#define CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND false - /* Platform Configuration Parameters for Table Service (TBL) */ /** diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index f7e34ad6c..01352f49d 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -76,8 +76,7 @@ int32 CFE_EVS_EarlyInit(void) CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort = CFE_PLATFORM_EVS_PORT_DEFAULT; CFE_EVS_Global.EVS_TlmPkt.Payload.LogMode = CFE_PLATFORM_EVS_DEFAULT_LOG_MODE; - CFE_EVS_Global.EVS_EventBurstMax = CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST; - CFE_EVS_Global.IncludeTimeInPortSend = CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND; + CFE_EVS_Global.EVS_EventBurstMax = CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST; /* Get a pointer to the CFE reset area from the BSP */ PspStatus = CFE_PSP_GetResetArea(&resetAreaAddr, &resetAreaSize); diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index b39775495..f8274057e 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -122,7 +122,6 @@ typedef struct osal_id_t EVS_SharedDataMutexID; CFE_ES_AppId_t EVS_AppID; uint32 EVS_EventBurstMax; - bool IncludeTimeInPortSend; /* Includes time in message sent out ports */ } CFE_EVS_Global_t; /* diff --git a/modules/evs/fsw/src/cfe_evs_utils.c b/modules/evs/fsw/src/cfe_evs_utils.c index 75cc90f40..bf6057b05 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.c +++ b/modules/evs/fsw/src/cfe_evs_utils.c @@ -539,18 +539,13 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 void EVS_SendViaPorts(CFE_EVS_LongEventTlm_t *EVS_PktPtr) { char PortMessage[CFE_EVS_MAX_PORT_MSG_LENGTH]; - char TimeBuffer[CFE_TIME_PRINTED_STRING_SIZE] = ""; - char Separator[2] = ""; + char TimeBuffer[CFE_TIME_PRINTED_STRING_SIZE]; CFE_TIME_SysTime_t PktTime; - if (CFE_EVS_Global.IncludeTimeInPortSend) - { - CFE_MSG_GetMsgTime(CFE_MSG_PTR(EVS_PktPtr->TelemetryHeader), &PktTime); - CFE_TIME_Print(TimeBuffer, PktTime); - snprintf(Separator, sizeof(Separator), " "); - } + CFE_MSG_GetMsgTime(CFE_MSG_PTR(EVS_PktPtr->TelemetryHeader), &PktTime); + CFE_TIME_Print(TimeBuffer, PktTime); - snprintf(PortMessage, sizeof(PortMessage), "%s%s%u/%u/%s %u: %s", TimeBuffer, Separator, + snprintf(PortMessage, sizeof(PortMessage), "%s %u/%u/%s %u: %s", TimeBuffer, (unsigned int)EVS_PktPtr->Payload.PacketID.SpacecraftID, (unsigned int)EVS_PktPtr->Payload.PacketID.ProcessorID, EVS_PktPtr->Payload.PacketID.AppName, (unsigned int)EVS_PktPtr->Payload.PacketID.EventID, EVS_PktPtr->Payload.Message); diff --git a/modules/evs/fsw/src/cfe_evs_verify.h b/modules/evs/fsw/src/cfe_evs_verify.h index 15ae544a0..7c8c8df6e 100644 --- a/modules/evs/fsw/src/cfe_evs_verify.h +++ b/modules/evs/fsw/src/cfe_evs_verify.h @@ -45,10 +45,6 @@ #error CFE_PLATFORM_EVS_DEFAULT_LOG_MODE can only be 0 (Overwrite) or 1 (Discard)! #endif -#if (CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND != true) && (CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND != false) -#error CFE_PLATFORM_EVS_INCLUDE_TIME_IN_PORT_SEND must be true or false -#endif - #if (CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE != CFE_EVS_MsgFormat_LONG) && \ (CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE != CFE_EVS_MsgFormat_SHORT) #error CFE_EVS_DEFAULT_MSG_FORMAT can only be CFE_EVS_MsgFormat_LONG or CFE_EVS_MsgFormat_SHORT ! diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 6d593aa2d..d122dba1d 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -132,6 +132,17 @@ typedef struct typedef CFE_Status_t (*UT_EVS_SendEventFunc_t)(uint32); +/* Custom time handler to avoid needing to provide buffer for every event call */ +void UT_CFE_MSG_GetMsgTime_CustomHandler(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) {} + +/* Add custom logic to cFE common UT_InitData */ +void UT_InitData_EVS(void) +{ + UT_InitData(); + + UT_SetHandlerFunction(UT_KEY(CFE_MSG_GetMsgTime), UT_CFE_MSG_GetMsgTime_CustomHandler, NULL); +} + /* Message init hook to stora last MsgId passed in */ static int32 UT_EVS_MSGInitHook(void *UserObj, int32 StubRetcode, uint32 CallCount, const UT_StubContext_t *Context) { @@ -274,16 +285,15 @@ void Test_Init(void) appbitcmd.Payload.AppName[sizeof(appbitcmd.Payload.AppName) - 1] = '\0'; /* Test successful early initialization of the cFE EVS */ - UT_InitData(); + UT_InitData_EVS(); UT_SetSizeofESResetArea(sizeof(CFE_ES_ResetData_t)); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetResetType), 1, CFE_PSP_RST_TYPE_POWERON); CFE_EVS_EarlyInit(); - CFE_EVS_Global.IncludeTimeInPortSend = false; /* Do generic testing without time in port message */ CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[4]); /* Task main with init failure */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetAppID), 1, -1); UtAssert_VOIDCALL(CFE_EVS_TaskMain()); @@ -291,7 +301,7 @@ void Test_Init(void) * invalid command packet */ UtPrintf("CFE_EVS_TaskMain - Test error reading command pipe, unrecognized msgid"); - UT_InitData(); + UT_InitData_EVS(); /* Set unexpected message ID */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &msgid, sizeof(msgid), false); @@ -301,20 +311,20 @@ void Test_Init(void) UtAssert_INT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_MSGID_EID); /* Test early initialization with a get reset area failure */ - UT_InitData(); + UT_InitData_EVS(); UT_SetStatusBSPResetArea(-1, CFE_TIME_RESET_SIGNATURE, CFE_TIME_ToneSignalSelect_PRIMARY); CFE_EVS_EarlyInit(); UT_SetStatusBSPResetArea(OS_SUCCESS, CFE_TIME_RESET_SIGNATURE, CFE_TIME_ToneSignalSelect_PRIMARY); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[1]); /* Test early initialization, restoring the event log */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetResetType), 1, -1); CFE_EVS_EarlyInit(); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[6]); /* Test early initialization, clearing the event log (log mode path) */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetResetType), 1, -1); CFE_EVS_Global.EVS_LogPtr->LogMode = CFE_EVS_LogMode_OVERWRITE + CFE_EVS_LogMode_DISCARD + 1; CFE_EVS_Global.EVS_LogPtr->LogFullFlag = false; @@ -323,7 +333,7 @@ void Test_Init(void) CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[5]); /* Test early initialization, clearing the event log (log full path) */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetResetType), 1, -1); CFE_EVS_Global.EVS_LogPtr->LogMode = CFE_EVS_LogMode_DISCARD; CFE_EVS_Global.EVS_LogPtr->LogFullFlag = 2; @@ -332,7 +342,7 @@ void Test_Init(void) CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[5]); /* Test early initialization, clearing the event log (next log path) */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetResetType), 1, -1); CFE_EVS_Global.EVS_LogPtr->LogMode = CFE_EVS_LogMode_OVERWRITE; CFE_EVS_Global.EVS_LogPtr->LogFullFlag = true; @@ -341,7 +351,7 @@ void Test_Init(void) CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[5]); /* Test early initialization with a mutex creation failure */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, -1); CFE_EVS_EarlyInit(); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[3]); @@ -349,64 +359,63 @@ void Test_Init(void) /* Test early initialization with an unexpected size returned * by CFE_PSP_GetResetArea */ - UT_InitData(); + UT_InitData_EVS(); UT_SetSizeofESResetArea(0); CFE_EVS_EarlyInit(); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[2]); /* Repeat successful initialization to configure log for later references */ - UT_InitData(); + UT_InitData_EVS(); UT_SetSizeofESResetArea(sizeof(CFE_ES_ResetData_t)); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetResetType), 1, CFE_PSP_RST_TYPE_POWERON); CFE_EVS_EarlyInit(); - CFE_EVS_Global.IncludeTimeInPortSend = false; /* Do generic testing without time in port message */ CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[4]); /* Test task initialization where event services fails */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetAppID), 2, -1); /* Set Failure in CFE_EVS_Register -> EVS_GetApp_ID */ CFE_EVS_TaskInit(); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[11]); /* Test task initialization where the pipe creation fails */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_SB_CreatePipe), 1, -1); CFE_EVS_TaskInit(); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[12]); /* Test task initialization where command subscription fails */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 1, -1); CFE_EVS_TaskInit(); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[13]); /* Test task initialization where HK request subscription fails */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 2, -1); CFE_EVS_TaskInit(); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[14]); /* Test task initialization where getting the application ID fails */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppID), -1); CFE_EVS_TaskInit(); CFE_UtAssert_SYSLOG(EVS_SYSLOG_MSGS[10]); /* Test successful task initialization */ - UT_InitData(); + UT_InitData_EVS(); CFE_EVS_TaskInit(); UtAssert_STUB_COUNT(CFE_ES_WriteToSysLog, 0); /* Enable DEBUG message output */ - UT_InitData(); + UT_InitData_EVS(); appbitcmd.Payload.BitMask = CFE_EVS_DEBUG_BIT | CFE_EVS_INFORMATION_BIT | CFE_EVS_ERROR_BIT | CFE_EVS_CRITICAL_BIT; UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAAPPEVTTYPE_EID); /* Disable ports */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = CFE_EVS_PORT1_BIT | CFE_EVS_PORT2_BIT | CFE_EVS_PORT3_BIT | CFE_EVS_PORT4_BIT; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_PORTS_CC, &UT_EVS_EventBuf); @@ -426,7 +435,7 @@ void Test_IllegalAppID(void) UtPrintf("Begin Test Illegal App ID"); /* Set test up with illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); /* Test registering an event using an illegal application ID */ @@ -438,42 +447,42 @@ void Test_IllegalAppID(void) UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(time, 0, 0, NULL), CFE_EVS_INVALID_PARAMETER); /* Test sending an event using an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, 0, "NULL"), CFE_EVS_APP_ILLEGAL_APP_ID); /* Test sending an event using an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); CFE_UtAssert_SUCCESS(EVS_SendEvent(0, 0, "NULL")); /* Test sending a timed event using an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(time, 0, 0, "NULL"), CFE_EVS_APP_ILLEGAL_APP_ID); /* Test sending an event with app ID using an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, 0, CFE_ES_APPID_UNDEFINED, "NULL"), CFE_EVS_APP_ILLEGAL_APP_ID); /* Test resetting a filter using an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_EVS_ResetFilter(0), CFE_EVS_APP_ILLEGAL_APP_ID); /* Test resetting all filters using an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_EVS_ResetAllFilters(), CFE_EVS_APP_ILLEGAL_APP_ID); /* Test application cleanup using an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_EVS_CleanUpApp(CFE_ES_APPID_UNDEFINED), CFE_EVS_APP_ILLEGAL_APP_ID); /* Test with out of range AppID */ - UT_InitData(); + UT_InitData_EVS(); AppID = CFE_ES_APPID_C(CFE_ResourceId_FromInteger(CFE_PLATFORM_ES_MAX_APPLICATIONS)); UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, 0, AppID, "NULL"), CFE_EVS_APP_ILLEGAL_APP_ID); } @@ -492,39 +501,39 @@ void Test_UnregisteredApp(void) UtPrintf("Begin Test Unregistered App"); - UT_InitData(); + UT_InitData_EVS(); /* Unregister the application (it was registered in CFE_EVS_TaskInit) */ CFE_EVS_CleanUpApp(AppID); /* Test sending an event to an unregistered application */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, 0, "NULL"), CFE_EVS_APP_NOT_REGISTERED); /* Test resetting a filter using an unregistered application */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_INT32_EQ(CFE_EVS_ResetFilter(0), CFE_EVS_APP_NOT_REGISTERED); /* Test resetting all filters using an unregistered application */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_INT32_EQ(CFE_EVS_ResetAllFilters(), CFE_EVS_APP_NOT_REGISTERED); /* Test sending an event with app ID to an unregistered application */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_INT32_EQ(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_INFORMATION, AppID, "NULL"), CFE_EVS_APP_NOT_REGISTERED); /* Test sending a timed event to an unregistered application */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_INT32_EQ(CFE_EVS_SendTimedEvent(time, CFE_EVS_EventType_INFORMATION, 0, "NULL"), CFE_EVS_APP_NOT_REGISTERED); /* Test application cleanup using an unregistered application */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_CleanUpApp(AppID)); /* Re-register the application for subsequent tests */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY)); } @@ -550,29 +559,29 @@ void Test_FilterRegistration(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; /* Test filter registration using an invalid filter option */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_INT32_EQ(CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY + 1), CFE_EVS_UNKNOWN_FILTER); /* Test successful filter registration with no filters */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY)); /* Re-register to test valid unregistration */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY)); /* Test successful app cleanup */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_CleanUpApp(AppID)); /* Test successful filter registration with a valid filter */ - UT_InitData(); + UT_InitData_EVS(); filter[0].EventID = 0; filter[0].Mask = 0x0001; CFE_UtAssert_SUCCESS(CFE_EVS_Register(filter, 1, CFE_EVS_EventFilter_BINARY)); /* Test successful multiple filter registration with valid filters */ - UT_InitData(); + UT_InitData_EVS(); for (i = 0; i < CFE_PLATFORM_EVS_MAX_EVENT_FILTERS + 1; i++) { @@ -585,19 +594,19 @@ void Test_FilterRegistration(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageSendCounter = 0; /* Send 1st information message, should get through */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "OK")); UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_TlmPkt.Payload.MessageSendCounter, 1); UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)), 1); /* Send 2nd information message, should be filtered */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "FAILED")); UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_TlmPkt.Payload.MessageSendCounter, 1); UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)), 0); /* Send last information message, which should cause filtering to lock */ - UT_InitData(); + UT_InitData_EVS(); FilterPtr = EVS_FindEventID(0, (EVS_BinFilter_t *)AppDataPtr->BinFilters); FilterPtr->Count = CFE_EVS_MAX_FILTER_COUNT - 1; CFE_UtAssert_SUCCESS(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "OK")); @@ -606,33 +615,33 @@ void Test_FilterRegistration(void) UtAssert_UINT32_EQ(FilterPtr->Count, CFE_EVS_MAX_FILTER_COUNT); /* Test that filter lock is applied */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "FAILED")); UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_TlmPkt.Payload.MessageSendCounter, 3); UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)), 0); UtAssert_UINT32_EQ(FilterPtr->Count, CFE_EVS_MAX_FILTER_COUNT); /* Test that filter lock is (still) applied */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "FAILED")); UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_TlmPkt.Payload.MessageSendCounter, 3); UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)), 0); UtAssert_UINT32_EQ(FilterPtr->Count, CFE_EVS_MAX_FILTER_COUNT); /* Return application to original state: re-register application */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY)); /* Test sending an event with app ID to a registered, filtered * application */ - UT_InitData(); + UT_InitData_EVS(); AppDataPtr->AppID = AppID; AppDataPtr->ActiveFlag = false; CFE_UtAssert_SUCCESS(CFE_EVS_SendEventWithAppID(0, CFE_EVS_EventType_INFORMATION, AppID, "NULL")); /* Test sending a timed event to a registered, filtered application */ - UT_InitData(); + UT_InitData_EVS(); AppDataPtr->AppID = AppID; AppDataPtr->ActiveFlag = false; CFE_UtAssert_SUCCESS(CFE_EVS_SendTimedEvent(time, CFE_EVS_EventType_INFORMATION, 0, "NULL")); @@ -648,29 +657,29 @@ void Test_FilterReset(void) UtPrintf("Begin Test Filter Reset"); /* Test successful filter registration */ - UT_InitData(); + UT_InitData_EVS(); filter.EventID = 1; filter.Mask = 0x0001; CFE_UtAssert_SUCCESS(CFE_EVS_Register(&filter, 1, CFE_EVS_EventFilter_BINARY)); /* Test filter reset using an invalid event ID */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_INT32_EQ(CFE_EVS_ResetFilter(CFE_PLATFORM_EVS_MAX_EVENT_FILTERS + 1), CFE_EVS_EVT_NOT_REGISTERED); /* Test filter reset using an unregistered event ID */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_ResetFilter(-1)); /* Test successful filter reset */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_ResetFilter(1)); /* Test successful reset of all filters */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_ResetAllFilters()); /* Return application to original state: re-register application */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY)); } @@ -713,7 +722,7 @@ void Test_Format(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; /* Enable DEBUG message output */ - UT_InitData(); + UT_InitData_EVS(); strncpy(appbitcmd.Payload.AppName, "ut_cfe_evs", sizeof(appbitcmd.Payload.AppName) - 1); appbitcmd.Payload.AppName[sizeof(appbitcmd.Payload.AppName) - 1] = '\0'; modecmd.Payload.MsgFormat = CFE_EVS_MsgFormat_LONG; @@ -723,7 +732,7 @@ void Test_Format(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAAPPEVTTYPE_EID); /* Test set event format mode command using an invalid mode */ - UT_InitData(); + UT_InitData_EVS(); modecmd.Payload.MsgFormat = 0xff; UT_EVS_DoDispatchCheckEvents(&modecmd, sizeof(modecmd), UT_TPID_CFE_EVS_CMD_SET_EVENT_FORMAT_MODE_CC, &UT_EVS_EventBuf); @@ -732,14 +741,14 @@ void Test_Format(void) /* Test set event format mode command using a valid command to set short * format, reports implicitly via event */ - UT_InitData(); + UT_InitData_EVS(); modecmd.Payload.MsgFormat = CFE_EVS_MsgFormat_SHORT; UT_EVS_DoDispatchCheckEventsShort(&modecmd, sizeof(modecmd), UT_TPID_CFE_EVS_CMD_SET_EVENT_FORMAT_MODE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_SETEVTFMTMOD_EID); UtPrintf("Test for short event sent when configured to do so "); - UT_InitData(); + UT_InitData_EVS(); UT_SetHookFunction(UT_KEY(CFE_MSG_Init), UT_EVS_MSGInitHook, &MsgData); UT_SetDataBuffer(UT_KEY(CFE_SB_TransmitMsg), &MsgSend, sizeof(MsgSend), false); CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Short format check 1"); @@ -756,7 +765,7 @@ void Test_Format(void) /* Test set event format mode command using a valid command to set long * format, reports implicitly via event */ - UT_InitData(); + UT_InitData_EVS(); modecmd.Payload.MsgFormat = CFE_EVS_MsgFormat_LONG; UT_EVS_DoDispatchCheckEvents(&modecmd, sizeof(modecmd), UT_TPID_CFE_EVS_CMD_SET_EVENT_FORMAT_MODE_CC, &UT_EVS_EventBuf); @@ -765,7 +774,7 @@ void Test_Format(void) /* Test event long format mode command was successful (the following * messages are output if long format selection is successful) */ - UT_InitData(); + UT_InitData_EVS(); memset(&CapturedMsg, 0xFF, sizeof(CapturedMsg)); UT_SetHookFunction(UT_KEY(CFE_SB_TransmitMsg), UT_SoftwareBusSnapshotHook, &LongFmtSnapshotData); CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Long format check (SendEvent)"); @@ -782,7 +791,7 @@ void Test_Format(void) /* Test sending an event using a string length greater than * the maximum allowed */ - UT_InitData(); + UT_InitData_EVS(); for (i = 0; i <= CFE_MISSION_EVS_MAX_MESSAGE_LENGTH; i++) { @@ -824,84 +833,77 @@ void Test_Ports(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; /* Test enabling all ports; reports implicitly via port output */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = CFE_EVS_PORT1_BIT | CFE_EVS_PORT2_BIT | CFE_EVS_PORT3_BIT | CFE_EVS_PORT4_BIT; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_ENABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAPORT_EID); /* Test that ports are enabled by sending a message */ - UT_InitData(); + UT_InitData_EVS(); UT_SetHookFunction(UT_KEY(CFE_SB_TransmitMsg), UT_SoftwareBusSnapshotHook, &LocalSnapshotData); - UtAssert_UINT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Test ports message"), CFE_SUCCESS); - UtAssert_UINT32_EQ(LocalSnapshotData.Count, 1); - UtAssert_STUB_COUNT(CFE_TIME_Print, 0); - - /* Test with time included */ - UT_InitData(); - CFE_EVS_Global.IncludeTimeInPortSend = true; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgTime), &PacketTime, sizeof(PacketTime), false); UtAssert_UINT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Test ports message"), CFE_SUCCESS); + UtAssert_UINT32_EQ(LocalSnapshotData.Count, 1); UtAssert_STUB_COUNT(CFE_TIME_Print, 1); - CFE_EVS_Global.IncludeTimeInPortSend = false; /* Do generic testing without time in port message */ /* Disable all ports to cut down on unneeded output */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = CFE_EVS_PORT1_BIT | CFE_EVS_PORT2_BIT | CFE_EVS_PORT3_BIT | CFE_EVS_PORT4_BIT; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_DISPORT_EID); /* Test enabling a port using a bitmask that is out of range (high) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = 0xff; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_ENABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test disabling a port using a bitmask that is out of range */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test enabling a port using a bitmask that is out of range (low) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = 0x0; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_ENABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test enabling a port 1 and 2, but not 3 and 4 (branch path coverage) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = CFE_EVS_PORT1_BIT | CFE_EVS_PORT2_BIT; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_ENABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAPORT_EID); /* Test enabling a port 3 and 4, but not 1 and 2 (branch path coverage) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = CFE_EVS_PORT3_BIT | CFE_EVS_PORT4_BIT; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_ENABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAPORT_EID); /* Test disabling a port using a bitmask that is out of range (low) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = 0x0; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test disabling a port 1 and 2, but not 3 and 4 (branch path coverage) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = CFE_EVS_PORT1_BIT | CFE_EVS_PORT2_BIT; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_DISPORT_EID); /* Test disabling a port 3 and 4, but not 1 and 2 (branch path coverage) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = CFE_EVS_PORT3_BIT | CFE_EVS_PORT4_BIT; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_PORTS_CC, &UT_EVS_EventBuf); @@ -932,7 +934,7 @@ void Test_Logging(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; /* Initialize */ - UT_InitData(); + UT_InitData_EVS(); memset(&CmdBuf, 0, sizeof(CmdBuf)); /* Enable logging and set conditions to allow complete code coverage */ @@ -945,21 +947,21 @@ void Test_Logging(void) CFE_EVS_Global.EVS_LogPtr = &CFE_EVS_ResetDataPtr->EVS_Log; /* Test setting the logging mode using an invalid mode */ - UT_InitData(); + UT_InitData_EVS(); CmdBuf.modecmd.Payload.LogMode = 0xff; UT_EVS_DoDispatchCheckEvents(&CmdBuf.modecmd, sizeof(CmdBuf.modecmd), UT_TPID_CFE_EVS_CMD_SET_LOG_MODE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_LOGMODE_EID); /* Test setting the logging mode to discard */ - UT_InitData(); + UT_InitData_EVS(); CmdBuf.modecmd.Payload.LogMode = CFE_EVS_LogMode_DISCARD; UT_EVS_DoDispatchCheckEvents(&CmdBuf.modecmd, sizeof(CmdBuf.modecmd), UT_TPID_CFE_EVS_CMD_SET_LOG_MODE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LOGMODE_EID); /* Test overfilling the log in discard mode */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_VOIDCALL(EVS_ClearLog()); /* Ensure log is filled, then add one more, implicitly testing @@ -977,7 +979,7 @@ void Test_Logging(void) UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_LogPtr->LogOverflowCounter, LogOverflowCounterExpected); /* Test setting the logging mode to overwrite */ - UT_InitData(); + UT_InitData_EVS(); CmdBuf.modecmd.Payload.LogMode = CFE_EVS_LogMode_OVERWRITE; UT_EVS_DoDispatchCheckEvents(&CmdBuf.modecmd, sizeof(CmdBuf.modecmd), UT_TPID_CFE_EVS_CMD_SET_LOG_MODE_CC, &UT_EVS_EventBuf); @@ -988,14 +990,14 @@ void Test_Logging(void) UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_LogPtr->LogOverflowCounter, LogOverflowCounterExpected); /* Test sending a no op command */ - UT_InitData(); + UT_InitData_EVS(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_EVS_DoDispatchCheckEvents(&CmdBuf.noopcmd, sizeof(CmdBuf.noopcmd), UT_TPID_CFE_EVS_CMD_NOOP_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_NOOP_EID); /* Clear log for next test */ - UT_InitData(); + UT_InitData_EVS(); CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = true; UT_EVS_DoDispatchCheckEvents(&CmdBuf.clearlogcmd, sizeof(CmdBuf.clearlogcmd), UT_TPID_CFE_EVS_CMD_CLEAR_LOG_CC, &UT_EVS_EventBuf); @@ -1003,7 +1005,7 @@ void Test_Logging(void) UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_LogPtr->LogOverflowCounter, 0); /* Test setting the logging mode to overwrite */ - UT_InitData(); + UT_InitData_EVS(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetSizeofESResetArea(sizeof(CFE_ES_ResetData_t)); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); @@ -1017,31 +1019,31 @@ void Test_Logging(void) /* Test successfully writing a single event log entry using the default * log name */ - UT_InitData(); + UT_InitData_EVS(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); CmdBuf.logfilecmd.Payload.LogFilename[0] = '\0'; CFE_UtAssert_SUCCESS(CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd)); /* Test writing a log entry with a file name failure */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); UtAssert_INT32_EQ(CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd), CFE_FS_INVALID_PATH); /* Test writing a log entry with a create failure */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); UtAssert_INT32_EQ(CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd), CFE_STATUS_EXTERNAL_RESOURCE_FAIL); /* Test successfully writing all log entries */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); CFE_EVS_Global.EVS_LogPtr->LogCount = CFE_PLATFORM_EVS_LOG_MAX; CFE_UtAssert_SUCCESS(CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd)); /* Test writing a log entry with a write failure */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); CFE_EVS_Global.EVS_LogPtr->LogCount = CFE_PLATFORM_EVS_LOG_MAX; @@ -1050,7 +1052,7 @@ void Test_Logging(void) /* Test successfully writing a single event log entry using a specified * log name */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); strncpy(CmdBuf.logfilecmd.Payload.LogFilename, "LogFile", sizeof(CmdBuf.logfilecmd.Payload.LogFilename) - 1); CmdBuf.logfilecmd.Payload.LogFilename[sizeof(CmdBuf.logfilecmd.Payload.LogFilename) - 1] = '\0'; @@ -1059,7 +1061,7 @@ void Test_Logging(void) /* Test successfully writing a single event log entry with a failure * writing the header */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, sizeof(CFE_FS_Header_t) + 1); CmdBuf.logfilecmd.Payload.LogFilename[0] = '\0'; UtAssert_INT32_EQ(CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd), CFE_EVS_FILE_WRITE_ERROR); @@ -1082,7 +1084,7 @@ void Test_WriteApp(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; /* Enable DEBUG message output */ - UT_InitData(); + UT_InitData_EVS(); memset(&CmdBuf, 0, sizeof(CmdBuf)); strncpy(CmdBuf.appbitcmd.Payload.AppName, "ut_cfe_evs", sizeof(CmdBuf.appbitcmd.Payload.AppName) - 1); CmdBuf.appbitcmd.Payload.AppName[sizeof(CmdBuf.appbitcmd.Payload.AppName) - 1] = '\0'; @@ -1093,7 +1095,7 @@ void Test_WriteApp(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAAPPEVTTYPE_EID); /* Test resetting counters */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&CmdBuf.ResetCountersCmd, sizeof(CmdBuf.ResetCountersCmd), UT_TPID_CFE_EVS_CMD_RESET_COUNTERS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_RSTCNT_EID); @@ -1101,7 +1103,7 @@ void Test_WriteApp(void) /* Test writing application data with a create failure using default * file name */ - UT_InitData(); + UT_InitData_EVS(); strncpy(CmdBuf.AppDataCmd.Payload.AppDataFilename, "ut_cfe_evs", sizeof(CmdBuf.AppDataCmd.Payload.AppDataFilename) - 1); CmdBuf.AppDataCmd.Payload.AppDataFilename[sizeof(CmdBuf.AppDataCmd.Payload.AppDataFilename) - 1] = '\0'; @@ -1111,14 +1113,14 @@ void Test_WriteApp(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_CRDATFILE_EID); /* Test writing application data with bad file name */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); UT_EVS_DoDispatchCheckEvents(&CmdBuf.AppDataCmd, sizeof(CmdBuf.AppDataCmd), UT_TPID_CFE_EVS_CMD_WRITE_APP_DATA_FILE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_CRDATFILE_EID); /* Test writing application data with a write/close failure */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_ERROR); UT_EVS_DoDispatchCheckEvents(&CmdBuf.AppDataCmd, sizeof(CmdBuf.AppDataCmd), @@ -1126,7 +1128,7 @@ void Test_WriteApp(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_WRDATFILE_EID); /* Test successfully writing application data */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&CmdBuf.AppDataCmd, sizeof(CmdBuf.AppDataCmd), UT_TPID_CFE_EVS_CMD_WRITE_APP_DATA_FILE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_WRDAT_EID); @@ -1134,7 +1136,7 @@ void Test_WriteApp(void) /* Test writing application data with a create failure using specified * file name */ - UT_InitData(); + UT_InitData_EVS(); strncpy(CmdBuf.AppDataCmd.Payload.AppDataFilename, "AppDataFileName", sizeof(CmdBuf.AppDataCmd.Payload.AppDataFilename) - 1); CmdBuf.AppDataCmd.Payload.AppDataFilename[sizeof(CmdBuf.AppDataCmd.Payload.AppDataFilename) - 1] = '\0'; @@ -1144,7 +1146,7 @@ void Test_WriteApp(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_CRDATFILE_EID); /* Test writing application data with a failure writing the header */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, sizeof(CFE_FS_Header_t) + 1); CmdBuf.AppDataCmd.Payload.AppDataFilename[0] = '\0'; UtAssert_INT32_EQ(CFE_EVS_WriteAppDataFileCmd(&CmdBuf.AppDataCmd), CFE_EVS_FILE_WRITE_ERROR); @@ -1165,7 +1167,7 @@ void Test_BadAppCmd(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; - UT_InitData(); + UT_InitData_EVS(); /* Set up event and mask */ appbitcmd.Payload.BitMask = 0; @@ -1189,21 +1191,21 @@ void Test_BadAppCmd(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test enabling application event types with an unknown application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test disabling application events with an unknown application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test enabling application events with an unknown application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); @@ -1212,47 +1214,47 @@ void Test_BadAppCmd(void) /* Test resetting the application event counter with an unknown * application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_APP_COUNTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test modifying event filters with an unknown application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test deleting event filters with an unknown application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_DELETE_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test setting the event filter mask with an unknown application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_SET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test resetting the filter with an unknown application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_RESET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test resetting all filters with an unknown application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_ALL_FILTERS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_NOAPPIDFOUND_EID); /* Test disabling application event types with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); strncpy(appbitcmd.Payload.AppName, "illegal_id", sizeof(appbitcmd.Payload.AppName) - 1); appbitcmd.Payload.AppName[sizeof(appbitcmd.Payload.AppName) - 1] = '\0'; strncpy(appnamecmd.Payload.AppName, "illegal_id", sizeof(appnamecmd.Payload.AppName) - 1); @@ -1272,21 +1274,21 @@ void Test_BadAppCmd(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_ILLAPPIDRANGE_EID); /* Test enabling application event types with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_ILLAPPIDRANGE_EID); /* Test disabling application events with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_ILLAPPIDRANGE_EID); /* Test enabling application events with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); @@ -1295,40 +1297,40 @@ void Test_BadAppCmd(void) /* Test resetting the application event counter with an illegal * application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_APP_COUNTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_ILLAPPIDRANGE_EID); /* Test adding the event filter with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_ILLAPPIDRANGE_EID); /* Test deleting the event filter with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_DELETE_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_ILLAPPIDRANGE_EID); /* Test setting the filter mask with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_SET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_ILLAPPIDRANGE_EID); /* Test resetting the filter with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_RESET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_ILLAPPIDRANGE_EID); /* Test resetting all filters with an illegal application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_AppID_ToIndex), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_ALL_FILTERS_CC, &UT_EVS_EventBuf); @@ -1337,7 +1339,7 @@ void Test_BadAppCmd(void) /* Test disabling application event types with an unregistered * application ID */ - UT_InitData(); + UT_InitData_EVS(); TestAppIndex = 2; UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); strncpy(appbitcmd.Payload.AppName, "unregistered_app", sizeof(appbitcmd.Payload.AppName) - 1); @@ -1355,21 +1357,21 @@ void Test_BadAppCmd(void) /* Test enabling application event types with an unregistered * application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_APPNOREGS_EID); /* Test disabling application events with an unregistered application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_APPNOREGS_EID); /* Test enabling application events with an unregistered application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); @@ -1378,40 +1380,40 @@ void Test_BadAppCmd(void) /* Test resetting the application event counter with an unregistered * application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_APP_COUNTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_APPNOREGS_EID); /* Test adding the event filter with an unregistered application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_APPNOREGS_EID); /* Test deleting the event filter with an unregistered application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_DELETE_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_APPNOREGS_EID); /* Test setting the filter mask with an unregistered application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_SET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_APPNOREGS_EID); /* Test resetting the filter with an unregistered application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_RESET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_APPNOREGS_EID); /* Test resetting all filters with an unregistered application ID */ - UT_InitData(); + UT_InitData_EVS(); UT_SetDataBuffer(UT_KEY(CFE_ES_AppID_ToIndex), &TestAppIndex, sizeof(TestAppIndex), false); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_ALL_FILTERS_CC, &UT_EVS_EventBuf); @@ -1435,7 +1437,7 @@ void Test_EventCmd(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; - UT_InitData(); + UT_InitData_EVS(); /* Run the next series of tests with valid, registered application name */ strncpy(appbitcmd.Payload.AppName, "ut_cfe_evs", sizeof(appbitcmd.Payload.AppName) - 1); @@ -1465,7 +1467,7 @@ void Test_EventCmd(void) UtAssert_ZERO(EventCount[3]); /* Test enabling of all events */ - UT_InitData(); + UT_InitData_EVS(); LocalSnapshotData.Count = 0; UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); @@ -1485,7 +1487,7 @@ void Test_EventCmd(void) UtAssert_UINT32_EQ(EventCount[3], 4); /* Test disabling event type using an illegal type */ - UT_InitData(); + UT_InitData_EVS(); appbitcmd.Payload.BitMask = 0xff; UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); @@ -1493,51 +1495,51 @@ void Test_EventCmd(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test enabling event type using an illegal type */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test successful disabling of application events */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, 0xFFFF); /* Test successful enabling of application events */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAAPPEVT_EID); /* Test disabling event types (leave debug enabled) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = CFE_EVS_INFORMATION_BIT | CFE_EVS_ERROR_BIT | CFE_EVS_CRITICAL_BIT; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_DISEVTTYPE_EID); /* Test enabling all event types (debug already enabled) */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_ENABLE_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAEVTTYPE_EID); /* Test successfully resetting the application event counter */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_APP_COUNTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_RSTEVTCNT_EID); /* Test disabling an event type using an out of range bit mask (high) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = 0xff; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test enabling an event type using an out of range bit mask (high) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = 0xff; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_ENABLE_EVENT_TYPE_CC, &UT_EVS_EventBuf); @@ -1546,7 +1548,7 @@ void Test_EventCmd(void) /* Test disabling an application event type using an out of * range bit mask (high) */ - UT_InitData(); + UT_InitData_EVS(); appbitcmd.Payload.BitMask = 0xff; UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); @@ -1555,21 +1557,21 @@ void Test_EventCmd(void) /* Test enabling an application event type using an out of * range bit mask (high) */ - UT_InitData(); + UT_InitData_EVS(); appbitcmd.Payload.BitMask = 0xff; UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test disabling an event type using an out of range bit mask (low) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = 0x0; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_DISABLE_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_INVALID_BITMASK_EID); /* Test enabling an event type using an out of range bit mask (low) */ - UT_InitData(); + UT_InitData_EVS(); bitmaskcmd.Payload.BitMask = 0x0; UT_EVS_DoDispatchCheckEvents(&bitmaskcmd, sizeof(bitmaskcmd), UT_TPID_CFE_EVS_CMD_ENABLE_EVENT_TYPE_CC, &UT_EVS_EventBuf); @@ -1578,7 +1580,7 @@ void Test_EventCmd(void) /* Test disabling an application event type using an out of * range bit mask (low) */ - UT_InitData(); + UT_InitData_EVS(); appbitcmd.Payload.BitMask = 0x0; UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); @@ -1587,7 +1589,7 @@ void Test_EventCmd(void) /* Test enabling an application event type using an out of * range bit mask (low) */ - UT_InitData(); + UT_InitData_EVS(); appbitcmd.Payload.BitMask = 0x0; UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); @@ -1609,7 +1611,7 @@ void Test_FilterCmd(void) CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; - UT_InitData(); + UT_InitData_EVS(); /* Set up event and mask */ appmaskcmd.Payload.Mask = 0; @@ -1633,7 +1635,7 @@ void Test_FilterCmd(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAAPPEVTTYPE_EID); /* Ensure there is no filter for the next tests */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_DELETE_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_EVTIDNOREGS_EID); @@ -1641,25 +1643,25 @@ void Test_FilterCmd(void) /* Test setting a filter with an application that is not registered * for filtering */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_SET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_EVTIDNOREGS_EID); /* Test resetting a filter with an application that is not registered * for filtering */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_RESET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_EVTIDNOREGS_EID); /* Test resetting all filters */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_ALL_FILTERS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_RSTALLFILTER_EID); /* Test successfully adding an event filter */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ADDFILTER_EID); @@ -1667,35 +1669,35 @@ void Test_FilterCmd(void) /* Test adding an event filter to an event already registered * for filtering */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_EVT_FILTERED_EID); /* Test successfully setting a filter mask */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_SET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_SETFILTERMSK_EID); /* Test successfully resetting a filter mask */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_RESET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_RSTFILTER_EID); /* Test successfully resetting all filters */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd), UT_TPID_CFE_EVS_CMD_RESET_ALL_FILTERS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_RSTALLFILTER_EID); /* Test successfully deleting an event filter */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_DELETE_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_DELFILTER_EID); /* Test filling the event filters */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_EventBuf.Count = 0; for (i = 0; i < CFE_PLATFORM_EVS_MAX_EVENT_FILTERS; i++) @@ -1709,43 +1711,43 @@ void Test_FilterCmd(void) UtAssert_UINT32_EQ(UT_EVS_EventBuf.Count, CFE_PLATFORM_EVS_MAX_EVENT_FILTERS); /* Test overfilling the event filters */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_MAXREGSFILTER_EID); /* Return application to original state, re-register application */ - UT_InitData(); + UT_InitData_EVS(); appmaskcmd.Payload.EventID = 0; CFE_UtAssert_SUCCESS(CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY)); /* Enable all application event message output */ - UT_InitData(); + UT_InitData_EVS(); appbitcmd.Payload.BitMask = CFE_EVS_DEBUG_BIT | CFE_EVS_INFORMATION_BIT | CFE_EVS_ERROR_BIT | CFE_EVS_CRITICAL_BIT; UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd), UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ENAAPPEVTTYPE_EID); /* Set-up to test filtering the same event twice */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ADDFILTER_EID); /* Test filtering the same event again */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd), UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_EVT_FILTERED_EID); /* Test successful event filter deletion */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd), UT_TPID_CFE_EVS_CMD_DELETE_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_DELFILTER_EID); /* Return application to original state, re-register application */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY)); } @@ -1761,122 +1763,122 @@ void Test_InvalidCmd(void) UtPrintf("Begin Test Invalid Command"); /* Test invalid msg id event */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, sizeof(cmd), UT_TPID_CFE_EVS_INVALID_MID, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_MSGID_EID); /* Test invalid command code event */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, sizeof(cmd), UT_TPID_CFE_EVS_CMD_INVALID_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_CC_EID); /* Test invalid command length event */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_NOOP_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with reset counters command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_RESET_COUNTERS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with enable event type command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_ENABLE_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with disable event type command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_DISABLE_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with set event format mode command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_SET_EVENT_FORMAT_MODE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with enable application event * type command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with disable application event * type command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENT_TYPE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with enable application events command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with disable application events command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with reset application counter command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_RESET_APP_COUNTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with set filter command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_SET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with enable ports command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_ENABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with disable ports command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_DISABLE_PORTS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with reset filter command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_RESET_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with reset all filters command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_RESET_ALL_FILTERS_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with add event filter command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with delete event filter command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_DELETE_EVENT_FILTER_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with write application data command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_WRITE_APP_DATA_FILE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with write log data command */ - UT_InitData(); + UT_InitData_EVS(); CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = true; UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_WRITE_LOG_DATA_FILE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with set log mode command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_SET_LOG_MODE_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); /* Test invalid command length with clear log command */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&cmd, 0, UT_TPID_CFE_EVS_CMD_CLEAR_LOG_CC, &UT_EVS_EventBuf); UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_LEN_ERR_EID); } @@ -1902,7 +1904,7 @@ void Test_Squelching(void) UtPrintf("Begin Test Squelching"); - UT_InitData(); + UT_InitData_EVS(); UT_EVS_ResetSquelch(); CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_EVS_MsgFormat_LONG; @@ -2037,7 +2039,7 @@ void Test_Misc(void) */ /* Test successful log data file write */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&PktBuf.writelogdatacmd, sizeof(PktBuf.writelogdatacmd), UT_TPID_CFE_EVS_CMD_WRITE_LOG_DATA_FILE_CC, &UT_EVS_EventBuf); if (UT_EVS_EventBuf.EventID == 0xFFFF) @@ -2050,7 +2052,7 @@ void Test_Misc(void) } /* Test successfully setting the logging mode */ - UT_InitData(); + UT_InitData_EVS(); UT_EVS_DoDispatchCheckEvents(&PktBuf.modecmd, sizeof(PktBuf.modecmd), UT_TPID_CFE_EVS_CMD_SET_LOG_MODE_CC, &UT_EVS_EventBuf); if (UT_EVS_EventBuf.EventID == 0xFFFF) @@ -2063,7 +2065,7 @@ void Test_Misc(void) } /* Test housekeeping report with log enabled */ - UT_InitData(); + UT_InitData_EVS(); CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = true; HK_SnapshotData.Count = 0; UT_SetHookFunction(UT_KEY(CFE_SB_TransmitMsg), UT_SoftwareBusSnapshotHook, &HK_SnapshotData); @@ -2071,15 +2073,15 @@ void Test_Misc(void) UtAssert_UINT32_EQ(HK_SnapshotData.Count, 1); /* Test successful application cleanup */ - UT_InitData(); + UT_InitData_EVS(); CFE_UtAssert_SUCCESS(CFE_EVS_CleanUpApp(CFE_ES_APPID_UNDEFINED)); /* Test registering an application with invalid filter argument */ - UT_InitData(); + UT_InitData_EVS(); UtAssert_INT32_EQ(CFE_EVS_Register(NULL, 1, 0), CFE_ES_BAD_ARGUMENT); /* Test housekeeping report with log disabled */ - UT_InitData(); + UT_InitData_EVS(); CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = false; HK_SnapshotData.Count = 0; UT_SetHookFunction(UT_KEY(CFE_SB_TransmitMsg), UT_SoftwareBusSnapshotHook, &HK_SnapshotData); @@ -2089,7 +2091,7 @@ void Test_Misc(void) /* Test sending a packet with the message counter and the event counter * at their maximum allowed values */ - UT_InitData(); + UT_InitData_EVS(); CFE_EVS_Global.EVS_TlmPkt.Payload.MessageSendCounter = CFE_EVS_MAX_EVENT_SEND_COUNT; AppDataPtr->EventCount = CFE_EVS_MAX_EVENT_SEND_COUNT; EVS_SendEvent(0, 0, "Max Event Count"); @@ -2099,7 +2101,7 @@ void Test_Misc(void) /* Test sending a message with the message length greater than the * maximum allowed value */ - UT_InitData(); + UT_InitData_EVS(); for (i = 0; i <= CFE_MISSION_EVS_MAX_MESSAGE_LENGTH; i++) { @@ -2115,7 +2117,7 @@ void Test_Misc(void) UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_TlmPkt.Payload.MessageTruncCounter, 1); /* Use all AppData and report housekeeping to get branch coverage */ - UT_InitData(); + UT_InitData_EVS(); for (i = 0; i < sizeof(CFE_EVS_Global.AppData) / sizeof(CFE_EVS_Global.AppData[0]); i++) { /* Doesn't matter here that AppID is all the same... */ From 75ecb39cd047266674bc090ea12c1d6001f76db8 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 27 Apr 2023 15:19:25 -0400 Subject: [PATCH 154/200] Fix #2311, correct fallback file case Only include the "FALLBACK_FILE" if the normal search came up empty. Do not return a list containing the fallback/default along with the user-supplied files, only return the user-supplied files. This was an issue when using "ALLOW_LIST" in that it had both. --- cmake/global_functions.cmake | 27 +++++++++++++++------------ modules/core_api/mission_build.cmake | 4 ++-- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/cmake/global_functions.cmake b/cmake/global_functions.cmake index ba68c447e..46396be1f 100644 --- a/cmake/global_functions.cmake +++ b/cmake/global_functions.cmake @@ -28,14 +28,17 @@ function(cfe_locate_implementation_file OUTPUT_VAR FILE_NAME) cmake_parse_arguments(LOCATEIMPL_ARG "OPTIONAL;ALLOW_LIST" "FALLBACK_FILE" "PREFIX;SUBDIR" ${ARGN}) - # Always check for filename matches directly in the MISSION_DEFS dir - set(IMPL_SEARCH_BASEDIRS "${MISSION_DEFS}/") + set(IMPL_SEARCH_BASEDIRS) # The prefix could also be a subdir, but do not repeat the mission name foreach (PREFIX ${LOCATEIMPL_ARG_PREFIX}) if (NOT "${MISSIONCONFIG}" STREQUAL "${PREFIX}") list(APPEND IMPL_SEARCH_BASEDIRS "${MISSION_DEFS}/${PREFIX}/") endif() endforeach() + # Always check for filename matches directly in the MISSION_DEFS dir + list(APPEND IMPL_SEARCH_BASEDIRS "${MISSION_DEFS}/") + list(REVERSE IMPL_SEARCH_BASEDIRS) + set(ADD_SUBDIRS) foreach (SUBDIR ${LOCATEIMPL_ARG_SUBDIR}) foreach (BASEDIR ${IMPL_SEARCH_BASEDIRS}) @@ -43,17 +46,10 @@ function(cfe_locate_implementation_file OUTPUT_VAR FILE_NAME) endforeach() endforeach() list(APPEND IMPL_SEARCH_BASEDIRS ${ADD_SUBDIRS}) + list(REMOVE_DUPLICATES IMPL_SEARCH_BASEDIRS) # Build the list of possible locations for this file in REVERSE priority order set(IMPL_SEARCH_PATH) - if (LOCATEIMPL_ARG_FALLBACK_FILE) - if (IS_ABSOLUTE "${LOCATEIMPL_ARG_FALLBACK_FILE}") - list(APPEND IMPL_SEARCH_PATH "${LOCATEIMPL_ARG_FALLBACK_FILE}") - else() - list(APPEND IMPL_SEARCH_PATH "${CMAKE_CURRENT_LIST_DIR}/${LOCATEIMPL_ARG_FALLBACK_FILE}") - endif() - endif() - # Check for the existence of the file in each of the dirs foreach(BASEDIR ${IMPL_SEARCH_BASEDIRS}) list(APPEND IMPL_SEARCH_PATH "${BASEDIR}${FILE_NAME}") @@ -74,6 +70,14 @@ function(cfe_locate_implementation_file OUTPUT_VAR FILE_NAME) endif() endforeach() + if (NOT SELECTED_FILE AND LOCATEIMPL_ARG_FALLBACK_FILE) + if (IS_ABSOLUTE "${LOCATEIMPL_ARG_FALLBACK_FILE}") + set(SELECTED_FILE "${LOCATEIMPL_ARG_FALLBACK_FILE}") + else() + set(SELECTED_FILE "${CMAKE_CURRENT_LIST_DIR}/${LOCATEIMPL_ARG_FALLBACK_FILE}") + endif() + endif() + if (SELECTED_FILE) message(STATUS "Using file: ${SELECTED_FILE} for ${FILE_NAME}") elseif(NOT LOCATEIMPL_ARG_OPTIONAL) @@ -156,7 +160,7 @@ function(generate_config_includefile) set(GENCONFIG_ARG_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/inc") endif (NOT GENCONFIG_ARG_OUTPUT_DIRECTORY) - if (IS_CFS_ARCH_BUILD) + if (IS_CFS_ARCH_BUILD AND NOT GENCONFIG_ARG_PREFIXES) set(ARCH_PREFIXES ${BUILD_CONFIG}) else() set(ARCH_PREFIXES) @@ -176,7 +180,6 @@ function(generate_config_includefile) else() # Use the common search function to find the candidate(s) cfe_locate_implementation_file(SRC_LOCAL_PATH_LIST "${TGTFILE}" - ALLOW_LIST FALLBACK_FILE "${GENCONFIG_ARG_FALLBACK_FILE}" PREFIX ${GENCONFIG_ARG_PREFIXES} ${ARCH_PREFIXES} SUBDIR config diff --git a/modules/core_api/mission_build.cmake b/modules/core_api/mission_build.cmake index 34eff598a..6bc99b88b 100644 --- a/modules/core_api/mission_build.cmake +++ b/modules/core_api/mission_build.cmake @@ -13,12 +13,12 @@ generate_config_includefile( FILE_NAME "cfe_mission_cfg.h" MATCH_SUFFIX "mission_cfg.h" - PREFIXES ${MISSIONCONFIG} + PREFIXES ${MISSIONCONFIG} cfe ) generate_config_includefile( FILE_NAME "cfe_perfids.h" MATCH_SUFFIX "perfids.h" - PREFIXES ${MISSIONCONFIG} + PREFIXES ${MISSIONCONFIG} cfe ) From 78333d3796027357d11ef6a5bdf767f34fcc3fcf Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 28 Apr 2023 08:57:16 -0400 Subject: [PATCH 155/200] Bump to v7.0.0-rc4+dev287 --- CHANGELOG.md | 7 +++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3fad7bc5..8e5f5e828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Development Build: v7.0.0-rc4+dev287 +- document CFS component file naming +- Add EVS port timestamp and simplify port selection +- remove else statement that was unreachable by unit tests +- correct fallback file case +- See , , , and + ## Development Build: v7.0.0-rc4+dev276 - improve add_cfe_tables function - add option to link to generated files diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 59f771ed3..d00df42b9 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 276 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 287 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From fb2234cb1390b019f29d49f2c3814c3f1a370f9c Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 28 Apr 2023 13:32:45 -0400 Subject: [PATCH 156/200] Fix #2310, Update XML files per interoperability testing Verify the JSON files generated from EDS match the expected content and CTF-based tests also pass. This required a few touchups to XML files to adjust sizes and/or padding. --- modules/es/eds/cfe_es.xml | 62 +++++++++++++++-------------------- modules/evs/eds/cfe_evs.xml | 5 +++ modules/sb/eds/cfe_sb.xml | 9 ++--- modules/tbl/eds/cfe_tbl.xml | 1 + modules/time/eds/cfe_time.xml | 8 ++--- 5 files changed, 42 insertions(+), 43 deletions(-) diff --git a/modules/es/eds/cfe_es.xml b/modules/es/eds/cfe_es.xml index 8548c4f3c..c5f7e7a18 100644 --- a/modules/es/eds/cfe_es.xml +++ b/modules/es/eds/cfe_es.xml @@ -30,7 +30,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -165,44 +165,41 @@ - + - For backward compatibility with existing CFE code this should be uint32, + For backward compatibility with existing CFS code this should be uint32, but all telemetry information will be limited to 4GB in size as a result. - On 64-bit platforms this can be a 64-bit value which will allow larger + On 64-bit platforms this can be expanded to 64 bits which will allow larger memory objects, but this will break compatibility with existing control - systems, and may also change the alignment/padding of messages. + systems, and may also change the alignment/padding of some messages. - In either case this must be an unsigned type. + In either case this must be an unsigned type, and should be large enough + to represent the largest memory address/size in use in the CFS system. - - - - + + + + + - + - For backward compatibility with existing CFE code this should be uint32, - but if running on a 64-bit platform, addresses in telemetry will be - truncated to 32 bits and therefore will not be valid. - - On 64-bit platforms this can be a 64-bit address which will allow the - full memory address in commands and telemetry, but this will break - compatibility with existing control systems, and may also change - the alignment/padding of messages. + For backward compatibility with existing CFS code this should be uint32, + but all telemetry information will be limited to 4GB in size as a result. - In either case this must be an unsigned type. + On 64-bit platforms this can be expanded to 64 bits which will allow larger + memory objects, but this will break compatibility with existing control + systems, and may also change the alignment/padding of some messages. - FSW code should access this value via the macros provided, which - converts to the native "cpuaddr" type provided by OSAL. This macro - provides independence between the message representation and local - representation of a memory address. + In either case this must be an unsigned type, and should be large enough + to represent the largest memory address/size in use in the CFS system. - - - - + + + + + @@ -249,11 +246,6 @@ \cfetlmmnemonic \ES_STACKSIZE - - - \cfetlmmnemonic \ES_MODULEID - - \cfetlmmnemonic \ES_ADDRVALID diff --git a/modules/evs/eds/cfe_evs.xml b/modules/evs/eds/cfe_evs.xml index 5a3146555..99297ab1d 100644 --- a/modules/evs/eds/cfe_evs.xml +++ b/modules/evs/eds/cfe_evs.xml @@ -98,6 +98,7 @@ + @@ -107,6 +108,7 @@ + @@ -117,6 +119,7 @@ + @@ -147,6 +150,7 @@ + @@ -250,6 +254,7 @@ \cfetlmmnemonic \EVS_LOGENABLED + \cfetlmmnemonic \EVS_APP diff --git a/modules/sb/eds/cfe_sb.xml b/modules/sb/eds/cfe_sb.xml index 7fff096e8..02284d5ea 100644 --- a/modules/sb/eds/cfe_sb.xml +++ b/modules/sb/eds/cfe_sb.xml @@ -128,6 +128,7 @@ + @@ -266,7 +267,7 @@ \cfetlmmnemonic \SB_SMPMIDIU - + \cfetlmmnemonic \SB_SMMMIDALW @@ -281,7 +282,7 @@ \cfetlmmnemonic \SB_SMPPIU - + \cfetlmmnemonic \SB_SMMPALW @@ -296,7 +297,7 @@ \cfetlmmnemonic \SB_SMPBMIU - + \cfetlmmnemonic \SB_SMMBMALW @@ -328,7 +329,7 @@ \cfetlmmnemonic \SB_SMPSBBIU - + \cfetlmmnemonic \SB_SMMPDALW diff --git a/modules/tbl/eds/cfe_tbl.xml b/modules/tbl/eds/cfe_tbl.xml index 344884e9e..51c86b47d 100644 --- a/modules/tbl/eds/cfe_tbl.xml +++ b/modules/tbl/eds/cfe_tbl.xml @@ -236,6 +236,7 @@ \cfetlmmnemonic \TBL_NUMFREESHRBUF + \cfetlmmnemonic \TBL_MEMPOOLHANDLE diff --git a/modules/time/eds/cfe_time.xml b/modules/time/eds/cfe_time.xml index 0e58d9605..5a3536b87 100644 --- a/modules/time/eds/cfe_time.xml +++ b/modules/time/eds/cfe_time.xml @@ -87,7 +87,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -119,7 +119,7 @@ - + From 4a11c240648144bc313b5eaaa4802bc3b13b65ea Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 10:19:16 -0400 Subject: [PATCH 157/200] Fix #2315, uniqueness of tbl target names If the passed-in table name does not use a qualifier suffix, then generate one by computing a hash of the context information. This ensures that the generated intermediate target names will be unique. --- cmake/arch_build.cmake | 17 +++++++++++++++++ cmake/global_functions.cmake | 8 ++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index d1fe5a5dc..a120dd8b3 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -194,6 +194,23 @@ function(add_cfe_tables TABLE_FQNAME TBL_DEFAULT_SRC_FILES) get_filename_component(APP_NAME ${TABLE_FQNAME} NAME_WE) + # The passed-in name allows for a qualifier (in the form of APP_NAME.QUALIFIER) to get + # uniqueness in the generated target names. If there is no qualifier, then there + # will potentially be a target name conflict. To avoid this, generate a hash of the + # context of this call - the current directory, app/tgt names, and source files. This + # should be unique but also produce the same hash when CMake is re-run. The hash + # can then be used as a qualifier. + if (TABLE_FQNAME STREQUAL APP_NAME) + string(SHA1 CONTEXT_HASH + "${CMAKE_CURRENT_LIST_DIR}+${TGTNAME}+${APP_NAME}+${TBL_DEFAULT_SRC_FILES};${ARGN}" + ) + set(TABLE_FQNAME "${APP_NAME}.tbl${CONTEXT_HASH}") + + if ($ENV{VERBOSE}) + message("No suffix specified, table build using ${TABLE_FQNAME} for ${APP_NAME} table") + endif() + endif() + # If "TGTNAME" is set, then use it directly set(TABLE_TGTLIST ${TGTNAME}) set(TABLE_TEMPLATE "${CFE_SOURCE_DIR}/cmake/tables/table_rule_template.d.in") diff --git a/cmake/global_functions.cmake b/cmake/global_functions.cmake index 46396be1f..7a363f0ea 100644 --- a/cmake/global_functions.cmake +++ b/cmake/global_functions.cmake @@ -65,6 +65,9 @@ function(cfe_locate_implementation_file OUTPUT_VAR FILE_NAME) set(SELECTED_FILE) foreach (CHECK_FILE ${IMPL_SEARCH_PATH}) + if ($ENV{VERBOSE}) + message("Testing for: ${CHECK_FILE}") + endif() if (EXISTS "${CHECK_FILE}") list(APPEND SELECTED_FILE ${CHECK_FILE}) endif() @@ -76,12 +79,13 @@ function(cfe_locate_implementation_file OUTPUT_VAR FILE_NAME) else() set(SELECTED_FILE "${CMAKE_CURRENT_LIST_DIR}/${LOCATEIMPL_ARG_FALLBACK_FILE}") endif() + if (NOT EXISTS "${SELECTED_FILE}" AND NOT LOCATEIMPL_ARG_OPTIONAL) + message(FATAL_ERROR "No implementation for ${FILE_NAME} found") + endif() endif() if (SELECTED_FILE) message(STATUS "Using file: ${SELECTED_FILE} for ${FILE_NAME}") - elseif(NOT LOCATEIMPL_ARG_OPTIONAL) - message(FATAL_ERROR "No implementation for ${FILE_NAME} found") endif() # Export the result to the caller From c9095c0b4efb4a6f887f5be8cadba893602b93a2 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 16:28:00 -0400 Subject: [PATCH 158/200] Fix #2320, reorganize ES header files Organize ES header file contents according to the convention --- modules/es/CMakeLists.txt | 2 +- modules/es/arch_build.cmake | 32 + .../config/default_cfe_es_extern_typedefs.h} | 18 +- .../default_cfe_es_fcncodes.h} | 536 +---------- .../es/config/default_cfe_es_interface_cfg.h | 151 ++++ .../es/config/default_cfe_es_internal_cfg.h | 839 ++++++++++++++++++ .../es/config/default_cfe_es_mission_cfg.h | 36 + modules/es/config/default_cfe_es_msg.h | 38 + modules/es/config/default_cfe_es_msgdefs.h | 31 + modules/es/config/default_cfe_es_msgids.h | 42 + modules/es/config/default_cfe_es_msgstruct.h | 543 ++++++++++++ .../es/config/default_cfe_es_platform_cfg.h | 41 + modules/es/config/default_cfe_es_topicids.h | 51 ++ .../{cfe_es_events.h => cfe_es_eventids.h} | 0 modules/es/fsw/src/cfe_es_module_all.h | 2 +- modules/es/mission_build.cmake | 37 + 16 files changed, 1858 insertions(+), 541 deletions(-) create mode 100644 modules/es/arch_build.cmake rename modules/{core_api/fsw/inc/cfe_es_extern_typedefs.h => es/config/default_cfe_es_extern_typedefs.h} (97%) rename modules/es/{fsw/inc/cfe_es_msg.h => config/default_cfe_es_fcncodes.h} (65%) create mode 100644 modules/es/config/default_cfe_es_interface_cfg.h create mode 100644 modules/es/config/default_cfe_es_internal_cfg.h create mode 100644 modules/es/config/default_cfe_es_mission_cfg.h create mode 100644 modules/es/config/default_cfe_es_msg.h create mode 100644 modules/es/config/default_cfe_es_msgdefs.h create mode 100644 modules/es/config/default_cfe_es_msgids.h create mode 100644 modules/es/config/default_cfe_es_msgstruct.h create mode 100644 modules/es/config/default_cfe_es_platform_cfg.h create mode 100644 modules/es/config/default_cfe_es_topicids.h rename modules/es/fsw/inc/{cfe_es_events.h => cfe_es_eventids.h} (100%) create mode 100644 modules/es/mission_build.cmake diff --git a/modules/es/CMakeLists.txt b/modules/es/CMakeLists.txt index 772166537..9d7d50824 100644 --- a/modules/es/CMakeLists.txt +++ b/modules/es/CMakeLists.txt @@ -36,5 +36,5 @@ endif (ENABLE_UNIT_TESTS) cfs_app_check_intf(${DEP} cfe_es_msg.h - cfe_es_events.h + cfe_es_eventids.h ) diff --git a/modules/es/arch_build.cmake b/modules/es/arch_build.cmake new file mode 100644 index 000000000..27403bd88 --- /dev/null +++ b/modules/es/arch_build.cmake @@ -0,0 +1,32 @@ +########################################################### +# +# ES Core Module platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the ES configuration +set(ES_PLATFORM_CONFIG_FILE_LIST + cfe_es_internal_cfg.h + cfe_es_msgids.h + cfe_es_platform_cfg.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(ES_CFGFILE ${ES_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${ES_CFGFILE}" NAME_WE) + if (DEFINED ES_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE "${ES_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${ES_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h b/modules/es/config/default_cfe_es_extern_typedefs.h similarity index 97% rename from modules/core_api/fsw/inc/cfe_es_extern_typedefs.h rename to modules/es/config/default_cfe_es_extern_typedefs.h index f30f381e8..58bfd8270 100644 --- a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h +++ b/modules/es/config/default_cfe_es_extern_typedefs.h @@ -25,16 +25,6 @@ #ifndef CFE_ES_EXTERN_TYPEDEFS_H #define CFE_ES_EXTERN_TYPEDEFS_H -/* This header may be generated from an EDS file, - * tools are available and the feature is enabled */ -#ifdef CFE_EDS_ENABLED_BUILD - -/* Use the EDS generated version of these types */ -#include "cfe_es_eds_typedefs.h" - -#else -/* Use the local definitions of these types */ - #include "common_types.h" #include "cfe_resourceid_typedef.h" #include "cfe_mission_cfg.h" @@ -387,7 +377,7 @@ typedef uint32 CFE_ES_MemOffset_t; * A converter macro to use when initializing a CFE_ES_MemOffset_t * from an integer value of a different type. */ -#define CFE_ES_MEMOFFSET_C(x) ((CFE_ES_MemOffset_t)(x)) +#define CFE_ES_MEMOFFSET_C(x) ((CFE_ES_MemOffset_t)(x)) /** * @brief Memory Offset to integer value (size_t) wrapper @@ -424,7 +414,7 @@ typedef uint32 CFE_ES_MemAddress_t; * A converter macro to use when initializing a CFE_ES_MemAddress_t * from a pointer value of a different type. */ -#define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x)&0xFFFFFFFF)) +#define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x)&0xFFFFFFFF)) /** * @brief Memory Address to pointer wrapper @@ -432,7 +422,7 @@ typedef uint32 CFE_ES_MemAddress_t; * A converter macro to use when interpreting a CFE_ES_MemAddress_t * as a pointer value. */ -#define CFE_ES_MEMADDRESS_TO_PTR(x) ((void *)(cpuaddr)(x)) +#define CFE_ES_MEMADDRESS_TO_PTR(x) ((void *)(cpuaddr)(x)) /* * Data Structures shared between API and Message (CMD/TLM) interfaces @@ -574,6 +564,4 @@ typedef struct CFE_ES_MemPoolStats \brief Contains stats on each block size */ } CFE_ES_MemPoolStats_t; -#endif /* CFE_EDS_ENABLED_BUILD */ - #endif /* CFE_ES_EXTERN_TYPEDEFS_H */ diff --git a/modules/es/fsw/inc/cfe_es_msg.h b/modules/es/config/default_cfe_es_fcncodes.h similarity index 65% rename from modules/es/fsw/inc/cfe_es_msg.h rename to modules/es/config/default_cfe_es_fcncodes.h index b320df61e..e02b4d347 100644 --- a/modules/es/fsw/inc/cfe_es_msg.h +++ b/modules/es/config/default_cfe_es_fcncodes.h @@ -18,33 +18,23 @@ /** * @file + * Specification for the CFE Executive Services (CFE_ES) command function codes * - * Purpose: - * cFE Executive Services (ES) Command and Telemetry packet definition file. - * - * References: - * Flight Software Branch C Coding Standard Version 1.0a - * cFE Flight Software Application Developers Guide - * - * Notes: - * + * @note + * This file should be strictly limited to the command/function code (CC) + * macro definitions. Other definitions such as enums, typedefs, or other + * macros should be placed in the msgdefs.h or msg.h files. */ +#ifndef CFE_ES_FCNCODES_H +#define CFE_ES_FCNCODES_H -#ifndef CFE_ES_MSG_H -#define CFE_ES_MSG_H - -/* -** Includes -*/ -#include "common_types.h" /* Basic data types */ -#include "cfe_msg_hdr.h" /* for header definitions */ -#include "cfe_es_extern_typedefs.h" +/************************************************************************ + * Macro Definitions + ************************************************************************/ -/* -** ES task command packet command codes -*/ /** \name Executive Services Command Codes */ /** \{ */ + /** \cfeescmd Executive Services No-Op ** ** \par Description @@ -1043,506 +1033,4 @@ /** \} */ -/*************************************************************************/ -/********************************/ -/* Command Message Data Formats */ -/********************************/ -/** -** \brief Generic "no arguments" command -** -** This command structure is used for commands that do not have any parameters. -** This includes: -** -# The Housekeeping Request Message -** -# The No-Op Command (For details, see #CFE_ES_NOOP_CC) -** -# The Reset Counters Command (For details, see #CFE_ES_RESET_COUNTERS_CC) -*/ -typedef struct CFE_ES_NoArgsCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ -} CFE_ES_NoArgsCmd_t; - -/* - * The following commands all share the "NoArgs" format - * - * They are each given their own type name matching the command name, which - * allows them to change independently in the future without changing the prototype - * of the handler function. - */ -typedef CFE_ES_NoArgsCmd_t CFE_ES_NoopCmd_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetCountersCmd_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearSysLogCmd_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearERLogCmd_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetPRCountCmd_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_SendHkCmd_t; - -/** -** \brief Restart cFE Command Payload -** -** For command details, see #CFE_ES_RESTART_CC -** -**/ -typedef struct CFE_ES_RestartCmd_Payload -{ - uint16 RestartType; /**< \brief #CFE_PSP_RST_TYPE_PROCESSOR=Processor Reset - or #CFE_PSP_RST_TYPE_POWERON=Power-On Reset */ -} CFE_ES_RestartCmd_Payload_t; - -/** - * \brief Restart cFE Command - */ -typedef struct CFE_ES_RestartCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_RestartCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_RestartCmd_t; - -/** -** \brief Generic file name command payload -** -** This format is shared by several executive services commands. -** For command details, see #CFE_ES_QUERY_ALL_CC, #CFE_ES_QUERY_ALL_TASKS_CC, -** #CFE_ES_WRITE_SYSLOG_CC, and #CFE_ES_WRITE_ER_LOG_CC -** -**/ -typedef struct CFE_ES_FileNameCmd_Payload -{ - char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief ASCII text string containing full path and - filename of file in which Application data is to be dumped */ -} CFE_ES_FileNameCmd_Payload_t; - -/** - * \brief Generic file name command - */ -typedef struct CFE_ES_FileNameCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_FileNameCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_FileNameCmd_t; - -/* - * Unique typedefs for each of the commands that utilize the FileNameCmd - * packet format - */ -typedef CFE_ES_FileNameCmd_t CFE_ES_QueryAllCmd_t; -typedef CFE_ES_FileNameCmd_t CFE_ES_QueryAllTasksCmd_t; -typedef CFE_ES_FileNameCmd_t CFE_ES_WriteSysLogCmd_t; -typedef CFE_ES_FileNameCmd_t CFE_ES_WriteERLogCmd_t; - -/** -** \brief Overwrite/Discard System Log Configuration Command Payload -** -** For command details, see #CFE_ES_OVER_WRITE_SYSLOG_CC -** -**/ -typedef struct CFE_ES_OverWriteSysLogCmd_Payload -{ - uint32 Mode; /**< \brief #CFE_ES_LogMode_DISCARD=Throw away most recent messages, - #CFE_ES_LogMode_OVERWRITE=Overwrite oldest with most recent */ -} CFE_ES_OverWriteSysLogCmd_Payload_t; - -/** - * \brief Overwrite/Discard System Log Configuration Command Payload - */ -typedef struct CFE_ES_OverWriteSysLogCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_OverWriteSysLogCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_OverWriteSysLogCmd_t; - -/** -** \brief Start Application Command Payload -** -** For command details, see #CFE_ES_START_APP_CC -** -**/ -typedef struct CFE_ES_StartAppCmd_Payload -{ - char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief Name of Application to be started */ - char AppEntryPoint[CFE_MISSION_MAX_API_LEN]; /**< \brief Symbolic name of Application's entry point */ - char AppFileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Full path and filename of Application's - executable image */ - - CFE_ES_MemOffset_t StackSize; /**< \brief Desired stack size for the new application */ - - CFE_ES_ExceptionAction_Enum_t ExceptionAction; /**< \brief #CFE_ES_ExceptionAction_RESTART_APP=On exception, - restart Application, - #CFE_ES_ExceptionAction_PROC_RESTART=On exception, - perform a Processor Reset */ - CFE_ES_TaskPriority_Atom_t Priority; /**< \brief The new Applications runtime priority. */ -} CFE_ES_StartAppCmd_Payload_t; - -/** - * \brief Start Application Command - */ -typedef struct CFE_ES_StartApp -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_StartAppCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_StartAppCmd_t; - -/** -** \brief Generic application name command payload -** -** For command details, see #CFE_ES_STOP_APP_CC, #CFE_ES_RESTART_APP_CC, #CFE_ES_QUERY_ONE_CC -** -**/ -typedef struct CFE_ES_AppNameCmd_Payload -{ - char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief ASCII text string containing Application or Library Name */ -} CFE_ES_AppNameCmd_Payload_t; - -/** - * \brief Generic application name command - */ -typedef struct CFE_ES_AppNameCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_AppNameCmd_t; - -/* - * Like NoArgsCmd, this message definition is shared by multiple commands. - * Create a separate typedef for each one so they can all evolve independently - * without affecting the prototype. - */ -typedef CFE_ES_AppNameCmd_t CFE_ES_StopAppCmd_t; -typedef CFE_ES_AppNameCmd_t CFE_ES_RestartAppCmd_t; -typedef CFE_ES_AppNameCmd_t CFE_ES_QueryOneCmd_t; - -/** -** \brief Reload Application Command Payload -** -** For command details, see #CFE_ES_RELOAD_APP_CC -** -**/ -typedef struct CFE_ES_AppReloadCmd_Payload -{ - char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief ASCII text string containing Application Name */ - char AppFileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Full path and filename of Application's - executable image */ -} CFE_ES_AppReloadCmd_Payload_t; - -/** - * \brief Reload Application Command - */ -typedef struct CFE_ES_ReloadAppCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_AppReloadCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_ReloadAppCmd_t; - -/** -** \brief Set Maximum Processor Reset Count Command Payload -** -** For command details, see #CFE_ES_SET_MAX_PR_COUNT_CC -** -**/ -typedef struct CFE_ES_SetMaxPRCountCmd_Payload -{ - uint16 MaxPRCount; /**< \brief New maximum number of Processor Resets before - an automatic Power-On Reset is performed */ -} CFE_ES_SetMaxPRCountCmd_Payload_t; - -/** - * \brief Set Maximum Processor Reset Count Command - */ -typedef struct CFE_ES_SetMaxPRCountCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_SetMaxPRCountCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_SetMaxPRCountCmd_t; - -/** -** \brief Delete Critical Data Store Command Payload -** -** For command details, see #CFE_ES_DELETE_CDS_CC -** -**/ -typedef struct CFE_ES_DeleteCDSCmd_Payload -{ - char - CdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief ASCII text string containing name of CDS to delete */ -} CFE_ES_DeleteCDSCmd_Payload_t; - -/** - * \brief Delete Critical Data Store Command - */ -typedef struct CFE_ES_DeleteCDSCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_DeleteCDSCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_DeleteCDSCmd_t; - -/** -** \brief Start Performance Analyzer Command Payload -** -** For command details, see #CFE_ES_START_PERF_DATA_CC -** -**/ -typedef struct CFE_ES_StartPerfCmd_Payload -{ - uint32 TriggerMode; /**< \brief Desired trigger position (Start, Center, End) */ -} CFE_ES_StartPerfCmd_Payload_t; - -/** - * \brief Start Performance Analyzer Command - */ -typedef struct CFE_ES_StartPerfDataCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_StartPerfCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_StartPerfDataCmd_t; - -/** -** \brief Stop Performance Analyzer Command Payload -** -** For command details, see #CFE_ES_STOP_PERF_DATA_CC -** -**/ -typedef struct CFE_ES_StopPerfCmd_Payload -{ - char DataFileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief ASCII text string of full path and filename - of file Performance Analyzer data is to be written */ -} CFE_ES_StopPerfCmd_Payload_t; - -/** - * \brief Stop Performance Analyzer Command - */ -typedef struct CFE_ES_StopPerfDataCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_StopPerfCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_StopPerfDataCmd_t; - -/** -** \brief Set Performance Analyzer Filter Mask Command Payload -** -** For command details, see #CFE_ES_SET_PERF_FILTER_MASK_CC -** -**/ -typedef struct CFE_ES_SetPerfFilterMaskCmd_Payload -{ - uint32 FilterMaskNum; /**< \brief Index into array of Filter Masks */ - uint32 FilterMask; /**< \brief New Mask for specified entry in array of Filter Masks */ -} CFE_ES_SetPerfFilterMaskCmd_Payload_t; - -/** - * \brief Set Performance Analyzer Filter Mask Command - */ -typedef struct CFE_ES_SetPerfFilterMaskCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_SetPerfFilterMaskCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_SetPerfFilterMaskCmd_t; - -/** -** \brief Set Performance Analyzer Trigger Mask Command Payload -** -** For command details, see #CFE_ES_SET_PERF_TRIGGER_MASK_CC -** -**/ -typedef struct CFE_ES_SetPerfTrigMaskCmd_Payload -{ - uint32 TriggerMaskNum; /**< \brief Index into array of Trigger Masks */ - uint32 TriggerMask; /**< \brief New Mask for specified entry in array of Trigger Masks */ -} CFE_ES_SetPerfTrigMaskCmd_Payload_t; - -/** - * \brief Set Performance Analyzer Trigger Mask Command - */ -typedef struct CFE_ES_SetPerfTriggerMaskCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_SetPerfTrigMaskCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_SetPerfTriggerMaskCmd_t; - -/** -** \brief Send Memory Pool Statistics Command Payload -** -** For command details, see #CFE_ES_SEND_MEM_POOL_STATS_CC -** -**/ -typedef struct CFE_ES_SendMemPoolStatsCmd_Payload -{ - char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief - RESERVED - should be all zeroes */ - CFE_ES_MemHandle_t PoolHandle; /**< \brief Handle of Pool whose statistics are to be telemetered */ -} CFE_ES_SendMemPoolStatsCmd_Payload_t; - -/** - * \brief Send Memory Pool Statistics Command - */ -typedef struct CFE_ES_SendMemPoolStatsCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_SendMemPoolStatsCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_SendMemPoolStatsCmd_t; - -/** -** \brief Dump CDS Registry Command Payload -** -** For command details, see #CFE_ES_DUMP_CDS_REGISTRY_CC -** -**/ -typedef struct CFE_ES_DumpCDSRegistryCmd_Payload -{ - char DumpFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief ASCII text string of full path and filename - of file CDS Registry is to be written */ -} CFE_ES_DumpCDSRegistryCmd_Payload_t; - -/** - * \brief Dump CDS Registry Command - */ -typedef struct CFE_ES_DumpCDSRegistryCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_ES_DumpCDSRegistryCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_ES_DumpCDSRegistryCmd_t; - -/*************************************************************************/ - -/************************************/ -/* Telemetry Interface Data Formats */ -/************************************/ - -/**********************************/ -/* Telemetry Message Data Formats */ -/**********************************/ -/** -** \cfeestlm Single Application Information Packet -**/ -typedef struct CFE_ES_OneAppTlm_Payload -{ - CFE_ES_AppInfo_t AppInfo; /**< \brief For more information, see #CFE_ES_AppInfo_t */ -} CFE_ES_OneAppTlm_Payload_t; - -typedef struct CFE_ES_OneAppTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_ES_OneAppTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_ES_OneAppTlm_t; - -/** -** \cfeestlm Memory Pool Statistics Packet -**/ -typedef struct CFE_ES_PoolStatsTlm_Payload -{ - CFE_ES_MemHandle_t PoolHandle; /**< \cfetlmmnemonic \ES_POOLHANDLE - \brief Handle of memory pool whose stats are being telemetered */ - CFE_ES_MemPoolStats_t PoolStats; /**< \brief For more info, see #CFE_ES_MemPoolStats_t */ -} CFE_ES_PoolStatsTlm_Payload_t; - -typedef struct CFE_ES_MemStatsTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_ES_PoolStatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_ES_MemStatsTlm_t; - -/*************************************************************************/ - -/** -** \cfeestlm Executive Services Housekeeping Packet -**/ -typedef struct CFE_ES_HousekeepingTlm_Payload -{ - uint8 CommandCounter; /**< \cfetlmmnemonic \ES_CMDPC - \brief The ES Application Command Counter */ - uint8 CommandErrorCounter; /**< \cfetlmmnemonic \ES_CMDEC - \brief The ES Application Command Error Counter */ - - uint16 CFECoreChecksum; /**< \cfetlmmnemonic \ES_CKSUM - \brief Checksum of cFE Core Code */ - uint8 CFEMajorVersion; /**< \cfetlmmnemonic \ES_CFEMAJORVER - \brief Major Version Number of cFE */ - uint8 CFEMinorVersion; /**< \cfetlmmnemonic \ES_CFEMINORVER - \brief Minor Version Number of cFE */ - uint8 CFERevision; /**< \cfetlmmnemonic \ES_CFEREVISION - \brief Sub-Minor Version Number of cFE */ - uint8 CFEMissionRevision; /**< \cfetlmmnemonic \ES_CFEMISSIONREV - \brief Mission Version Number of cFE */ - uint8 OSALMajorVersion; /**< \cfetlmmnemonic \ES_OSMAJORVER - \brief OS Abstraction Layer Major Version Number */ - uint8 OSALMinorVersion; /**< \cfetlmmnemonic \ES_OSMINORVER - \brief OS Abstraction Layer Minor Version Number */ - uint8 OSALRevision; /**< \cfetlmmnemonic \ES_OSREVISION - \brief OS Abstraction Layer Revision Number */ - uint8 OSALMissionRevision; /**< \cfetlmmnemonic \ES_OSMISSIONREV - \brief OS Abstraction Layer MissionRevision Number */ - - uint8 PSPMajorVersion; /**< \cfetlmmnemonic \ES_PSPMAJORVER - \brief Platform Support Package Major Version Number */ - uint8 PSPMinorVersion; /**< \cfetlmmnemonic \ES_PSPMINORVER - \brief Platform Support Package Minor Version Number */ - uint8 PSPRevision; /**< \cfetlmmnemonic \ES_PSPREVISION - \brief Platform Support Package Revision Number */ - uint8 PSPMissionRevision; /**< \cfetlmmnemonic \ES_PSPMISSIONREV - \brief Platform Support Package MissionRevision Number */ - - CFE_ES_MemOffset_t SysLogBytesUsed; /**< \cfetlmmnemonic \ES_SYSLOGBYTEUSED - \brief Total number of bytes used in system log */ - CFE_ES_MemOffset_t SysLogSize; /**< \cfetlmmnemonic \ES_SYSLOGSIZE - \brief Total size of the system log */ - uint32 SysLogEntries; /**< \cfetlmmnemonic \ES_SYSLOGENTRIES - \brief Number of entries in the system log */ - uint32 SysLogMode; /**< \cfetlmmnemonic \ES_SYSLOGMODE - \brief Write/Overwrite Mode */ - - uint32 ERLogIndex; /**< \cfetlmmnemonic \ES_ERLOGINDEX - \brief Current index of the ER Log (wraps around) */ - uint32 ERLogEntries; /**< \cfetlmmnemonic \ES_ERLOGENTRIES - \brief Number of entries made in the ER Log since the power on */ - - uint32 RegisteredCoreApps; /**< \cfetlmmnemonic \ES_REGCOREAPPS - \brief Number of Applications registered with ES */ - uint32 RegisteredExternalApps; /**< \cfetlmmnemonic \ES_REGEXTAPPS - \brief Number of Applications registered with ES */ - uint32 RegisteredTasks; /**< \cfetlmmnemonic \ES_REGTASKS - \brief Number of Tasks ( main AND child tasks ) registered with ES */ - uint32 RegisteredLibs; /**< \cfetlmmnemonic \ES_REGLIBS - \brief Number of Libraries registered with ES */ - - uint32 ResetType; /**< \cfetlmmnemonic \ES_RESETTYPE - \brief Reset type ( PROCESSOR or POWERON ) */ - uint32 ResetSubtype; /**< \cfetlmmnemonic \ES_RESETSUBTYPE - \brief Reset Sub Type */ - uint32 ProcessorResets; /**< \cfetlmmnemonic \ES_PROCRESETCNT - \brief Number of processor resets since last power on */ - uint32 MaxProcessorResets; /**< \cfetlmmnemonic \ES_MAXPROCRESETS - \brief Max processor resets before a power on is done */ - uint32 BootSource; /**< \cfetlmmnemonic \ES_BOOTSOURCE - \brief Boot source ( as provided from BSP ) */ - - uint32 PerfState; /**< \cfetlmmnemonic \ES_PERFSTATE - \brief Current state of Performance Analyzer */ - uint32 PerfMode; /**< \cfetlmmnemonic \ES_PERFMODE - \brief Current mode of Performance Analyzer */ - uint32 PerfTriggerCount; /**< \cfetlmmnemonic \ES_PERFTRIGCNT - \brief Number of Times Performance Analyzer has Triggered */ - uint32 PerfFilterMask[CFE_MISSION_ES_PERF_MAX_IDS / 32]; /**< \cfetlmmnemonic \ES_PERFFLTRMASK - \brief Current Setting of Performance Analyzer Filter Masks */ - uint32 - PerfTriggerMask[CFE_MISSION_ES_PERF_MAX_IDS / 32]; /**< \cfetlmmnemonic \ES_PERFTRIGMASK - \brief Current Setting of Performance Analyzer Trigger Masks */ - uint32 PerfDataStart; /**< \cfetlmmnemonic \ES_PERFDATASTART - \brief Identifies First Stored Entry in Performance Analyzer Log */ - uint32 PerfDataEnd; /**< \cfetlmmnemonic \ES_PERFDATAEND - \brief Identifies Last Stored Entry in Performance Analyzer Log */ - uint32 PerfDataCount; /**< \cfetlmmnemonic \ES_PERFDATACNT - \brief Number of Entries Put Into the Performance Analyzer Log */ - uint32 - PerfDataToWrite; /**< \cfetlmmnemonic \ES_PERFDATA2WRITE - \brief Number of Performance Analyzer Log Entries Left to be Written to Log Dump File */ - CFE_ES_MemOffset_t HeapBytesFree; /**< \cfetlmmnemonic \ES_HEAPBYTESFREE - \brief Number of free bytes remaining in the OS heap */ - CFE_ES_MemOffset_t HeapBlocksFree; /**< \cfetlmmnemonic \ES_HEAPBLKSFREE - \brief Number of free blocks remaining in the OS heap */ - CFE_ES_MemOffset_t HeapMaxBlockSize; /**< \cfetlmmnemonic \ES_HEAPMAXBLK - \brief Number of bytes in the largest free block */ -} CFE_ES_HousekeepingTlm_Payload_t; - -typedef struct CFE_ES_HousekeepingTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_ES_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_ES_HousekeepingTlm_t; - -#endif /* CFE_ES_MSG_H */ +#endif diff --git a/modules/es/config/default_cfe_es_interface_cfg.h b/modules/es/config/default_cfe_es_interface_cfg.h new file mode 100644 index 000000000..04f833187 --- /dev/null +++ b/modules/es/config/default_cfe_es_interface_cfg.h @@ -0,0 +1,151 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Executive Services (CFE_ES) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_ES_INTERFACE_CFG_H +#define CFE_ES_INTERFACE_CFG_H + +/** +** \cfeescfg Mission Max Apps in a message +** +** \par Description: +** Indicates the maximum number of apps in a telemetry housekeeping message +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +*/ +#define CFE_MISSION_ES_MAX_APPLICATIONS 16 + +/** +** \cfeescfg Define Max Number of Performance IDs for messages +** +** \par Description: +** Defines the maximum number of perf ids allowed in command/telemetry messages +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +*/ +#define CFE_MISSION_ES_PERF_MAX_IDS 128 + +/** \cfeescfg Maximum number of block sizes in pool structures +** +** \par Description: +** The upper limit for the number of block sizes supported in the generic +** pool implementation, which in turn implements the memory pools and CDS. +** This definition is used as the array size with the pool stats structure, +** and therefore should be consistent across all CPUs in a mission, as well +** as with the ground station. +** +** There is also a platform-specific limit which may be fewer than this +** value. +** +** \par Limits: +** Must be at least one. No specific upper limit, but the number is +** anticipated to be reasonably small (i.e. tens, not hundreds). Large +** values have not been tested. +** +** +*/ +#define CFE_MISSION_ES_POOL_MAX_BUCKETS 17 + +/** +** \cfeescfg Maximum Length of CDS Name +** +** \par Description: +** Indicates the maximum length (in characters) of the CDS name ('CDSName') +** portion of a Full CDS Name of the following form: +** "ApplicationName.CDSName" +** +** This length does not need to include an extra character for NULL termination. +** +** \par Limits +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +** +*/ +#define CFE_MISSION_ES_CDS_MAX_NAME_LENGTH 16 + +/** +** \cfeescfg Mission Default CRC algorithm +** +** \par Description: +** Indicates the which CRC algorithm should be used as the default +** for verifying the contents of Critical Data Stores and when calculating +** Table Image data integrity values. +** +** \par Limits +** Currently only CFE_ES_CrcType_CRC_16 is supported (see brief in CFE_ES_CrcType_Enum +** definition in cfe_es_api_typedefs.h) +*/ +#define CFE_MISSION_ES_DEFAULT_CRC CFE_ES_CrcType_CRC_16 + +/** +** \cfeescfg Maximum Length of Full CDS Name in messages +** +** \par Description: +** Indicates the maximum length (in characters) of the entire CDS name +** of the following form: "ApplicationName.CDSName" +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) + +#ifndef CFE_OMIT_DEPRECATED_6_8 +/* These names have been converted to an enum in cfe_es_api_typedefs.h */ + +/** \name Checksum/CRC algorithm identifiers */ + +#define CFE_MISSION_ES_CRC_8 CFE_ES_CrcType_CRC_8 /* 1 */ +#define CFE_MISSION_ES_CRC_16 CFE_ES_CrcType_CRC_16 /* 2 */ +#define CFE_MISSION_ES_CRC_32 CFE_ES_CrcType_CRC_32 /* 3 */ + +#endif + +#endif diff --git a/modules/es/config/default_cfe_es_internal_cfg.h b/modules/es/config/default_cfe_es_internal_cfg.h new file mode 100644 index 000000000..3eaf81527 --- /dev/null +++ b/modules/es/config/default_cfe_es_internal_cfg.h @@ -0,0 +1,839 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Executive Services (CFE_ES) Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_ES_INTERNAL_CFG_H +#define CFE_ES_INTERNAL_CFG_H + +/** +** \cfeescfg Define ES Task Priority +** +** \par Description: +** Defines the cFE_ES Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_ES_START_TASK_PRIORITY 68 + +/** +** \cfeescfg Define ES Task Stack Size +** +** \par Description: +** Defines the cFE_ES Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_ES_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +/** +** \cfeescfg Default virtual path for persistent storage +** +** \par Description: +** This configures the default location in the virtual file system +** for persistent/non-volatile storage. Files such as the startup +** script, app/library dynamic modules, and configuration tables are +** expected to be stored in this directory. +** +*/ +#define CFE_PLATFORM_ES_NONVOL_DISK_MOUNT_STRING "/cf" + +/** +** \cfeescfg Default virtual path for volatile storage +** +** \par Description: +** The #CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING parameter is used to set the cFE mount path +** for the CFE RAM disk. This is a parameter for missions that do not want to +** use the default value of "/ram", or for missions that need to have a different +** value for different CPUs or Spacecraft. +** Note that the vxWorks OSAL cannot currently handle names that have more than one +** path separator in it. The names "/ram", "/ramdisk", "/disk123" will all work, but +** "/disks/ram" will not. +** Multiple separators can be used with the posix or RTEMS ports. +** +*/ +#define CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING "/ram" + +/** +** \cfeescfg Define Max Number of Applications +** +** \par Description: +** Defines the maximum number of applications that can be loaded into the +** system. This number does not include child tasks. +** +** \par Limits +** There is a lower limit of 6. The lower limit corresponds to the cFE internal +** applications. There are no restrictions on the upper limit however, the +** maximum number of applications is system dependent and should be verified. +** AppIDs that are checked against this configuration are defined by a 32 bit +** data word. +*/ +#define CFE_PLATFORM_ES_MAX_APPLICATIONS 32 + +/** +** \cfeescfg Define Max Number of Shared libraries +** +** \par Description: +** Defines the maximum number of cFE Shared libraries that can be loaded into +** the system. +** +** \par Limits +** There is a lower limit of 1. There are no restrictions on the upper limit +** however, the maximum number of libraries is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_MAX_LIBRARIES 10 + +/** +** \cfeescfg Define Max Number of ER (Exception and Reset) log entries +** +** \par Description: +** Defines the maximum number of ER (Exception and Reset) log entries +** +** \par Limits +** There is a lower limit of 1. There are no restrictions on the upper limit +** however, the maximum number of log entries is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_ER_LOG_ENTRIES 20 + +/** \cfeescfg Maximum size of CPU Context in ES Error Log +** +** \par Description: +** This should be large enough to accommodate the CPU context +** information supplied by the PSP on the given platform. +** +** \par Limits: +** Must be greater than zero and a multiple of sizeof(uint32). +** Limited only by the available memory and the number of entries +** in the error log. Any context information beyond this size will +** be truncated. +*/ +#define CFE_PLATFORM_ES_ER_LOG_MAX_CONTEXT_SIZE 256 + +/** +** \cfeescfg Define Size of the cFE System Log. +** +** \par Description: +** Defines the size in bytes of the cFE system log. The system log holds +** variable length strings that are terminated by a linefeed and null +** character. +** +** \par Limits +** There is a lower limit of 512. There are no restrictions on the upper limit +** however, the maximum system log size is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_SYSTEM_LOG_SIZE 3072 + +/** +** \cfeescfg Define Number of entries in the ES Object table +** +** \par Description: +** Defines the number of entries in the ES Object table. This table controls +** the core cFE startup. +** +** \par Limits +** There is a lower limit of 15. There are no restrictions on the upper limit +** however, the maximum object table size is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_OBJECT_TABLE_SIZE 30 + +/** +** \cfeescfg Define Max Number of Generic Counters +** +** \par Description: +** Defines the maximum number of Generic Counters that can be registered. +** +** \par Limits +** This parameter has a lower limit of 1 and an upper limit of 65535. +*/ +#define CFE_PLATFORM_ES_MAX_GEN_COUNTERS 8 + +/** +** \cfeescfg Define ES Application Control Scan Rate +** +** \par Description: +** ES Application Control Scan Rate. This parameter controls the speed that ES +** scans the Application Table looking for App Delete/Restart/Reload requests. +** All Applications are deleted, restarted, or reloaded by the ES Application. +** ES will periodically scan for control requests to process. The scan rate is +** controlled by this parameter, which is given in milliseconds. A value of +** 1000 means that ES will scan the Application Table once per second. Be +** careful not to set the value of this too low, because ES will use more CPU +** cycles scanning the table. +** +** \par Limits +** There is a lower limit of 100 and an upper limit of 20000 on this +** configuration parameter. millisecond units. +*/ +#define CFE_PLATFORM_ES_APP_SCAN_RATE 1000 + +/** +** \cfeescfg Define ES Application Kill Timeout +** +** \par Description: +** ES Application Kill Timeout. This parameter controls the number of +** "scan periods" that ES will wait for an application to Exit after getting +** the signal Delete, Reload or Restart. The sequence works as follows: +** -# ES will set the control request for an App to Delete/Restart/Reload and +** set this kill timer to the value in this parameter. +** -# If the App is responding and Calls it's RunLoop function, it will drop out +** of it's main loop and call CFE_ES_ExitApp. Once it calls Exit App, then +** ES can delete, restart, or reload the app the next time it scans the app +** table. +** -# If the App is not responding, the ES App will decrement this Kill Timeout +** value each time it runs. If the timeout value reaches zero, ES will kill +** the app. +** +** The Kill timeout value depends on the #CFE_PLATFORM_ES_APP_SCAN_RATE. If the Scan Rate +** is 1000, or 1 second, and this #CFE_PLATFORM_ES_APP_KILL_TIMEOUT is set to 5, then it +** will take 5 seconds to kill a non-responding App. +** If the Scan Rate is 250, or 1/4 second, and the #CFE_PLATFORM_ES_APP_KILL_TIMEOUT is +** set to 2, then it will take 1/2 second to time out. +** +** \par Limits +** There is a lower limit of 1 and an upper limit of 100 on this configuration +** parameter. Units are number of #CFE_PLATFORM_ES_APP_SCAN_RATE cycles. +*/ +#define CFE_PLATFORM_ES_APP_KILL_TIMEOUT 5 + +/** +** \cfeescfg ES Ram Disk Sector Size +** +** \par Description: +** Defines the ram disk sector size. The ram disk is 1 of 4 memory areas that +** are preserved on a processor reset. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 128. There are no restrictions on the upper limit +** however, the maximum RAM disk sector size is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_RAM_DISK_SECTOR_SIZE 512 + +/** +** \cfeescfg ES Ram Disk Number of Sectors +** +** \par Description: +** Defines the ram disk number of sectors. The ram disk is one of four memory +** areas that are preserved on a processor reset. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 128. There are no restrictions on the upper limit +** however, the maximum number of RAM sectors is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_RAM_DISK_NUM_SECTORS 4096 + +/** +** \cfeescfg Percentage of Ram Disk Reserved for Decompressing Apps +** +** \par Description: +** The #CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED parameter is used to make sure that the +** Volatile ( RAM ) Disk has a defined amount of free space during a processor +** reset. The cFE uses the Volatile disk to decompress cFE applications during +** system startup. If this Volatile disk happens to get filled with logs and +** misc files, then a processor reset may not work, because there will be no +** room to decompress cFE apps. To solve that problem, this parameter sets the +** "Low Water Mark" for disk space on a Processor reset. It should be set to +** allow the largest cFE Application to be decompressed. +** During a Processor reset, if there is not sufficient space left on the disk, +** it will be re-formatted in order to clear up some space. +** +** This feature can be turned OFF by setting the parameter to 0. +** +** \par Limits +** There is a lower limit of 0 and an upper limit of 75 on this configuration +** parameter.Units are percentage. A setting of zero will turn this feature +** off. +*/ +#define CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED 30 + +/** +** \cfeescfg Define Critical Data Store Size +** +** \par Description: +** Defines the Critical Data Store (CDS) area size in bytes size. The CDS is +** one of four memory areas that are preserved during a processor reset. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 8192 and an upper limit of UINT_MAX (4 Gigabytes) +** on this configuration parameter. +*/ +#define CFE_PLATFORM_ES_CDS_SIZE (128 * 1024) + +/** +** \cfeescfg Define User Reserved Memory Size +** +** \par Description: +** User Reserved Memory Size. This is the size in bytes of the cFE User +** reserved Memory area. This is a block of memory that is available for cFE +** application use. The address is obtained by calling +** #CFE_PSP_GetUserReservedArea. The User Reserved Memory is one of four memory +** areas that are preserved during a processor reset. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 1024 and an upper limit of UINT_MAX (4 Gigabytes) +** on this configuration parameter. +*/ +#define CFE_PLATFORM_ES_USER_RESERVED_SIZE (1024 * 1024) + +/** +** \cfeescfg Define ES Reset Area Size +** +** \par Description: +** The ES Reset Area Size. This is the size in bytes of the cFE Reset variable +** and log area. This is a block of memory used by the cFE to store the system +** log ER Log and critical reset variables. This is 4 of 4 of the memory areas +** that are preserved during a processor reset. +** Note: This area must be sized large enough to hold all of the data +** structures. It should be automatically sized based on the CFE_ES_ResetData_t +** type, but circular dependencies in the headers prevent it from being defined +** this way. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 153600 (150KBytes) and an upper limit of UINT_MAX +** (4 Gigabytes) on this configuration parameter. +*/ +#define CFE_PLATFORM_ES_RESET_AREA_SIZE (170 * 1024) + +/** +** \cfeescfg Define Memory Pool Alignment Size +** +** \par Description: +** Ensures that buffers obtained from a memory pool are aligned +** to a certain minimum block size. Note the allocator will always +** align to the minimum required by the CPU architecture. This may +** be set greater than the CPU requirement as desired for optimal +** performance. +** +** For some architectures/applications it may be beneficial to set this +** to the cache line size of the target CPU, or to use special SIMD +** instructions that require a more stringent memory alignment. +** +** \par Limits +** This must always be a power of 2, as it is used as a binary address mask. +*/ +#define CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN 4 + +/** +** \cfeescfg ES Nonvolatile Startup Filename +** +** \par Description: +** The value of this constant defines the path and name of the file that +** contains a list of modules that will be loaded and started by the cFE after +** the cFE finishes its startup sequence. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_NONVOL_STARTUP_FILE "/cf/cfe_es_startup.scr" + +/** +** \cfeescfg ES Volatile Startup Filename +** +** \par Description: +** The value of this constant defines the path and name of the file that +** contains a list of modules that will be loaded and started by the cFE after +** the cFE finishes its startup sequence. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_VOLATILE_STARTUP_FILE "/ram/cfe_es_startup.scr" + +/** +** \cfeescfg Default Application Information Filename +** +** \par Description: +** The value of this constant defines the filename used to store information +** pertaining to all of the Applications that are registered with Executive +** Services. This filename is used only when no filename is specified in the +** the command to query all system apps. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_APP_LOG_FILE "/ram/cfe_es_app_info.log" + +/** +** \cfeescfg Default Application Information Filename +** +** \par Description: +** The value of this constant defines the filename used to store information +** pertaining to all of the Applications that are registered with Executive +** Services. This filename is used only when no filename is specified in the +** the command to query all system tasks. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_TASK_LOG_FILE "/ram/cfe_es_taskinfo.log" + +/** +** \cfeescfg Default System Log Filename +** +** \par Description: +** The value of this constant defines the filename used to store important +** information (as ASCII text strings) that might not be able to be sent in an +** Event Message. This filename is used only when no filename is specified in +** the command to dump the system log. No file specified in the cmd means the +** first character in the cmd filename is a NULL terminator (zero). +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_SYSLOG_FILE "/ram/cfe_es_syslog.log" + +/** +** \cfeescfg Default Exception and Reset (ER) Log Filename +** +** \par Description: +** The value of this constant defines the filename used to store the +** Exception and Reset (ER) Log. This filename is used only when no filename is +** specified in the command to dump the ER log. No file specified in the cmd +** means the first character in the cmd filename is a NULL terminator (zero). +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_ER_LOG_FILE "/ram/cfe_erlog.log" + +/** +** \cfeescfg Default Performance Data Filename +** +** \par Description: +** The value of this constant defines the filename used to store the +** Performance Data. This filename is used only when no filename is specified +** in the command to stop performance data collecting. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_PERF_DUMP_FILENAME "/ram/cfe_es_perf.dat" + +/** +** \cfeescfg Default Critical Data Store Registry Filename +** +** \par Description: +** The value of this constant defines the filename used to store the +** Critical Data Store Registry. This filename is used only when no filename is +** specified in the command to stop performance data collecting. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_CDS_REG_DUMP_FILE "/ram/cfe_cds_reg.log" + +/** +** \cfeescfg Define Default System Log Mode following Power On Reset +** +** \par Description: +** Defines the default mode for the operation of the ES System log following a power +** on reset. The log may operate in either Overwrite mode = 0, where once the +** log becomes full the oldest message in the log will be overwritten, or +** Discard mode = 1, where once the log becomes full the contents of the log are +** preserved and the new event is discarded. This constant may hold a value of +** either 0 or 1 depending on the desired default. +** Overwrite Mode = 0, Discard Mode = 1. +** +** \par Limits +** There is a lower limit of 0 and an upper limit of 1 on this configuration +** parameter. +*/ +#define CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE 0 + +/** +** \cfeescfg Define Default System Log Mode following Processor Reset +** +** \par Description: +** Defines the default mode for the operation of the ES System log following a +** processor reset. The log may operate in either Overwrite mode = 0, where once +** the log becomes full the oldest message in the log will be overwritten, or +** Discard mode = 1, where once the log becomes full the contents of the log are +** preserved and the new event is discarded. This constant may hold a value of +** either 0 or 1 depending on the desired default. +** Overwrite Mode = 0, Discard Mode = 1. +** +** \par Limits +** There is a lower limit of 0 and an upper limit of 1 on this configuration +** parameter. +*/ +#define CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE 1 + +/** +** \cfeescfg Define Max Size of Performance Data Buffer +** +** \par Description: +** Defines the maximum size of the performance data buffer. Units are number of +** performance data entries. An entry is defined by a 32 bit data word followed +** by a 64 bit time stamp. +** +** \par Limits +** There is a lower limit of 1025. There are no restrictions on the upper limit +** however, the maximum buffer size is system dependent and should be verified. +** The units are number of entries. An entry is defined by a 32 bit data word followed +** by a 64 bit time stamp. +*/ +#define CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE 10000 + +/** +** \cfeescfg Define Filter Mask Setting for Disabling All Performance Entries +** +** \par Description: +** Defines the filter mask for disabling all performance entries. The value is a +** bit mask. For each bit, 0 means the corresponding entry is disabled and +** 1 means it is enabled. +*/ +#define CFE_PLATFORM_ES_PERF_FILTMASK_NONE 0 + +/** +** \cfeescfg Define Filter Mask Setting for Enabling All Performance Entries +** +** \par Description: +** Defines the filter mask for enabling all performance entries. The value is a +** bit mask. For each bit, 0 means the corresponding entry is disabled and +** 1 means it is enabled. +*/ +#define CFE_PLATFORM_ES_PERF_FILTMASK_ALL ~CFE_PLATFORM_ES_PERF_FILTMASK_NONE + +/** +** \cfeescfg Define Default Filter Mask Setting for Performance Data Buffer +** +** \par Description: +** Defines the default filter mask for the performance data buffer. The value is a +** bit mask. For each bit, 0 means the corresponding entry is disabled and 1 +** means it is enabled. +** +*/ +#define CFE_PLATFORM_ES_PERF_FILTMASK_INIT CFE_PLATFORM_ES_PERF_FILTMASK_ALL + +/** +** \cfeescfg Define Default Filter Trigger Setting for Disabling All Performance Entries +** +** \par Description: +** Defines the default trigger mask for disabling all performance data entries. The value +** is a bit mask. For each bit, 0 means the trigger for the corresponding entry is +** disabled and 1 means it is enabled. +** +*/ +#define CFE_PLATFORM_ES_PERF_TRIGMASK_NONE 0 + +/** +** \cfeescfg Define Filter Trigger Setting for Enabling All Performance Entries +** +** \par Description: +** Defines the trigger mask for enabling all performance data entries. The value is +** a bit mask. For each bit, 0 means the trigger for the corresponding entry is +** disabled and 1 means it is enabled. +** +*/ +#define CFE_PLATFORM_ES_PERF_TRIGMASK_ALL ~CFE_PLATFORM_ES_PERF_TRIGMASK_NONE + +/** +** \cfeescfg Define Default Filter Trigger Setting for Performance Data Buffer +** +** \par Description: +** Defines the default trigger mask for the performance data buffer. The value is a +** 32-bit mask. For each bit, 0 means the trigger for the corresponding entry is +** disabled and 1 means it is enabled. +** +*/ +#define CFE_PLATFORM_ES_PERF_TRIGMASK_INIT CFE_PLATFORM_ES_PERF_TRIGMASK_NONE + +/** +** \cfeescfg Define Performance Analyzer Child Task Priority +** +** \par Description: +** This parameter defines the priority of the child task spawned by the +** Executive Services to write performance data to a file. Lower numbers +** are higher priority, with 1 being the highest priority in the case of a +** child task. +** +** \par Limits +** Valid range for a child task is 1 to 255 however, the priority cannot +** be higher (lower number) than the ES parent application priority. +*/ +#define CFE_PLATFORM_ES_PERF_CHILD_PRIORITY 200 + +/** +** \cfeescfg Define Performance Analyzer Child Task Stack Size +** +** \par Description: +** This parameter defines the stack size of the child task spawned by the +** Executive Services to write performance data to a file. +** +** \par Limits +** It is recommended this parameter be greater than or equal to 4KB. This parameter +** is limited by the maximum value allowed by the data type. In this case, the data +** type is an unsigned 32-bit integer, so the valid range is 0 to 0xFFFFFFFF. +*/ +#define CFE_PLATFORM_ES_PERF_CHILD_STACK_SIZE 4096 + +/** +** \cfeescfg Define Performance Analyzer Child Task Delay +** +** \par Description: +** This parameter defines the delay time (in milliseconds) between performance +** data file writes performed by the Executive Services Performance Analyzer +** Child Task. +** +** \par Limits +** It is recommended this parameter be greater than or equal to 20ms. This parameter +** is limited by the maximum value allowed by the data type. In this case, the data +** type is an unsigned 32-bit integer, so the valid range is 0 to 0xFFFFFFFF. +*/ +#define CFE_PLATFORM_ES_PERF_CHILD_MS_DELAY 20 + +/** +** \cfeescfg Define Performance Analyzer Child Task Number of Entries Between Delay +** +** \par Description: +** This parameter defines the number of performance analyzer entries the Performance +** Analyzer Child Task will write to the file between delays. +** +*/ +#define CFE_PLATFORM_ES_PERF_ENTRIES_BTWN_DLYS 50 + +/** +** \cfeescfg Define Default Stack Size for an Application +** +** \par Description: +** This parameter defines a default stack size. This parameter is used by the +** cFE Core Applications. +** +** \par Limits +** There is a lower limit of 2048. There are no restrictions on the upper limit +** however, the maximum stack size is system dependent and should be verified. +** Most operating systems provide tools for measuring the amount of stack used by a +** task during operation. It is always a good idea to verify that no more than 1/2 +** of the stack is used. +*/ +#define CFE_PLATFORM_ES_DEFAULT_STACK_SIZE 8192 + +/** +** \cfeescfg Define Maximum Number of Registered CDS Blocks +** +** \par Description: +** Maximum number of registered CDS Blocks +** +** \par Limits +** There is a lower limit of 8. There are no restrictions on the upper limit +** however, the maximum number of CDS entries is system dependent and +** should be verified. +*/ +#define CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES 512 + +/** +** \cfeescfg Define Number of Processor Resets Before a Power On Reset +** +** \par Description: +** Number of Processor Resets before a Power On Reset is called. If set to 2, +** then 2 processor resets will occur, and the 3rd processor reset will be a +** power on reset instead. +** +** \par Limits +** There is a lower limit of 0. There are no restrictions on the upper limit +** however, the maximum number of processor resets may be system dependent and +** should be verified. +*/ +#define CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS 2 + +/** \cfeescfg Maximum number of block sizes in pool structures +** +** \par Description: +** The upper limit for the number of block sizes supported in the generic +** pool implementation, which in turn implements the memory pools and CDS. +** +** \par Limits: +** Must be at least one. No specific upper limit, but the number is +** anticipated to be reasonably small (i.e. tens, not hundreds). Large +** values have not been tested. +** +** The ES and CDS block size lists must correlate with this value +*/ +#define CFE_PLATFORM_ES_POOL_MAX_BUCKETS 17 + +/** \cfeescfg Maximum number of memory pools +** +** \par Description: +** The upper limit for the number of memory pools that can concurrently +** exist within the system. +** +** The CFE_SB and CFE_TBL core subsystems each define a memory pool. +** +** Individual applications may also create memory pools, so this value +** should be set sufficiently high enough to support the applications +** being used on this platform. +** +** \par Limits: +** Must be at least 2 to support CFE core - SB and TBL pools. No +** specific upper limit. +*/ +#define CFE_PLATFORM_ES_MAX_MEMORY_POOLS 10 + +/** +** \cfeescfg Define Default ES Memory Pool Block Sizes +** +** \par Description: +** Default Intermediate ES Memory Pool Block Sizes. If an application +** is using the CFE_ES Memory Pool APIs (#CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, +** #CFE_ES_GetPoolBuf and #CFE_ES_PutPoolBuf) but finds these sizes +** inappropriate for their use, they may wish to use the #CFE_ES_PoolCreateEx +** API to specify their own intermediate block sizes +** +** \par Limits +** These sizes MUST be increasing and MUST be an integral multiple of 4. Also, +** CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_MISSION_SB_MAX_SB_MSG_SIZE and both +** CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE and CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE. Note that if Table +** Services have been removed from the CFE, the table size limits are still +** enforced although the table size definitions may be reduced. +*/ +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 8 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02 16 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_03 32 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_04 48 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_05 64 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_06 96 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_07 128 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_08 160 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_09 256 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_10 512 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_11 1024 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_12 2048 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_13 4096 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_14 8192 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_15 16384 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16 32768 +#define CFE_PLATFORM_ES_MAX_BLOCK_SIZE 80000 + +/** +** \cfeescfg Define ES Critical Data Store Memory Pool Block Sizes +** +** \par Description: +** Intermediate ES Critical Data Store Memory Pool Block Sizes +** +** \par Limits +** These sizes MUST be increasing and MUST be an integral multiple of 4. +*/ +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_01 8 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_02 16 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_03 32 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_04 48 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_05 64 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_06 96 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_07 128 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_08 160 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_09 256 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_10 512 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_11 1024 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_12 2048 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_13 4096 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_14 8192 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_15 16384 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_16 32768 +#define CFE_PLATFORM_ES_CDS_MAX_BLOCK_SIZE 80000 + +/** \cfeescfg Poll timer for startup sync delay +** +** \par Description: +** During startup, some tasks may need to synchronize their own initialization +** with the initialization of other applications in the system. +** +** CFE ES implements an API to accomplish this, that performs a task delay (sleep) +** while polling the overall system state until other tasks are ready. +** +** This value controls the amount of time that the CFE_ES_ApplicationSyncDelay +** will sleep between each check of the system state. This should be large enough +** to allow other tasks to run, but not so large as to noticeably delay the startup +** completion. +** +** Units are in milliseconds +** +** \par Limits: +** Must be defined as an integer value that is greater than +** or equal to zero. +*/ +#define CFE_PLATFORM_ES_STARTUP_SYNC_POLL_MSEC 50 + +/** \cfeescfg Startup script timeout +** +** \par Description: +** The upper limit for the total amount of time that all apps listed in the CFE ES startup +** script may take to all become ready. +** +** Unlike the "core" app timeout, this is a soft limit; if the allotted time is exceeded, +** it probably indicates an issue with one of the apps, but does not cause CFE ES to take +** any additional action other than logging the event to the syslog. +** +** Units are in milliseconds +** +** \par Limits: +** Must be defined as an integer value that is greater than +** or equal to zero. +*/ +#define CFE_PLATFORM_ES_STARTUP_SCRIPT_TIMEOUT_MSEC 1000 + +#endif diff --git a/modules/es/config/default_cfe_es_mission_cfg.h b/modules/es/config/default_cfe_es_mission_cfg.h new file mode 100644 index 000000000..4324f4648 --- /dev/null +++ b/modules/es/config/default_cfe_es_mission_cfg.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Executive Services (CFE_ES) Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_ES_MISSION_CFG_H +#define CFE_ES_MISSION_CFG_H + +#include "cfe_es_interface_cfg.h" + +#endif diff --git a/modules/es/config/default_cfe_es_msg.h b/modules/es/config/default_cfe_es_msg.h new file mode 100644 index 000000000..15487dc6c --- /dev/null +++ b/modules/es/config/default_cfe_es_msg.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Executive Services (CFE_ES) command and telemetry + * message data types. + * + * This is a compatibility header for the "cfe_es_msg.h" file that has + * traditionally provided the message definitions for cFS apps. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_ES_MSG_H +#define CFE_ES_MSG_H + +#include "cfe_mission_cfg.h" +#include "cfe_es_msgdefs.h" +#include "cfe_es_msgstruct.h" + +#endif diff --git a/modules/es/config/default_cfe_es_msgdefs.h b/modules/es/config/default_cfe_es_msgdefs.h new file mode 100644 index 000000000..df665719c --- /dev/null +++ b/modules/es/config/default_cfe_es_msgdefs.h @@ -0,0 +1,31 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Executive Services (CFE_ES) command and telemetry + * message constant definitions. + * + * For CFE_ES this is only the function/command code definitions + */ +#ifndef CFE_ES_MSGDEFS_H +#define CFE_ES_MSGDEFS_H + +#include "cfe_es_fcncodes.h" + +#endif diff --git a/modules/es/config/default_cfe_es_msgids.h b/modules/es/config/default_cfe_es_msgids.h new file mode 100644 index 000000000..9ee2bb252 --- /dev/null +++ b/modules/es/config/default_cfe_es_msgids.h @@ -0,0 +1,42 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Executive Services (CFE_ES) Application Message IDs + */ +#ifndef CFE_ES_MSGIDS_H +#define CFE_ES_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_es_topicids.h" + +/* +** cFE ES Command Message Id's +*/ +#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_CMD_MSG /* 0x1806 */ +#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_SEND_HK_MSG /* 0x1808 */ + +/* +** CFE ES Telemetry Message Id's +*/ +#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_HK_TLM_MSG /* 0x0800 */ +#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_APP_TLM_MSG /* 0x080B */ +#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */ + +#endif diff --git a/modules/es/config/default_cfe_es_msgstruct.h b/modules/es/config/default_cfe_es_msgstruct.h new file mode 100644 index 000000000..e173ca496 --- /dev/null +++ b/modules/es/config/default_cfe_es_msgstruct.h @@ -0,0 +1,543 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * cFE Executive Services (ES) Command and Telemetry packet definition file. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ +#ifndef CFE_ES_MSGSTRUCT_H +#define CFE_ES_MSGSTRUCT_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "cfe_es_msgdefs.h" +#include "cfe_msg_hdr.h" +#include "cfe_mission_cfg.h" + +/********************************/ +/* Command Message Data Formats */ +/********************************/ +/** +** \brief Generic "no arguments" command +** +** This command structure is used for commands that do not have any parameters. +** This includes: +** -# The Housekeeping Request Message +** -# The No-Op Command (For details, see #CFE_ES_NOOP_CC) +** -# The Reset Counters Command (For details, see #CFE_ES_RESET_COUNTERS_CC) +*/ +typedef struct CFE_ES_NoArgsCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ +} CFE_ES_NoArgsCmd_t; + +/* + * The following commands all share the "NoArgs" format + * + * They are each given their own type name matching the command name, which + * allows them to change independently in the future without changing the prototype + * of the handler function. + */ +typedef CFE_ES_NoArgsCmd_t CFE_ES_NoopCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetCountersCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearSysLogCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearERLogCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetPRCountCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_SendHkCmd_t; + +/** +** \brief Restart cFE Command Payload +** +** For command details, see #CFE_ES_RESTART_CC +** +**/ +typedef struct CFE_ES_RestartCmd_Payload +{ + uint16 RestartType; /**< \brief #CFE_PSP_RST_TYPE_PROCESSOR=Processor Reset + or #CFE_PSP_RST_TYPE_POWERON=Power-On Reset */ +} CFE_ES_RestartCmd_Payload_t; + +/** + * \brief Restart cFE Command + */ +typedef struct CFE_ES_RestartCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_RestartCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_RestartCmd_t; + +/** +** \brief Generic file name command payload +** +** This format is shared by several executive services commands. +** For command details, see #CFE_ES_QUERY_ALL_CC, #CFE_ES_QUERY_ALL_TASKS_CC, +** #CFE_ES_WRITE_SYSLOG_CC, and #CFE_ES_WRITE_ER_LOG_CC +** +**/ +typedef struct CFE_ES_FileNameCmd_Payload +{ + char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief ASCII text string containing full path and + filename of file in which Application data is to be dumped */ +} CFE_ES_FileNameCmd_Payload_t; + +/** + * \brief Generic file name command + */ +typedef struct CFE_ES_FileNameCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_FileNameCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_FileNameCmd_t; + +/* + * Unique typedefs for each of the commands that utilize the FileNameCmd + * packet format + */ +typedef CFE_ES_FileNameCmd_t CFE_ES_QueryAllCmd_t; +typedef CFE_ES_FileNameCmd_t CFE_ES_QueryAllTasksCmd_t; +typedef CFE_ES_FileNameCmd_t CFE_ES_WriteSysLogCmd_t; +typedef CFE_ES_FileNameCmd_t CFE_ES_WriteERLogCmd_t; + +/** +** \brief Overwrite/Discard System Log Configuration Command Payload +** +** For command details, see #CFE_ES_OVER_WRITE_SYSLOG_CC +** +**/ +typedef struct CFE_ES_OverWriteSysLogCmd_Payload +{ + uint32 Mode; /**< \brief #CFE_ES_LogMode_DISCARD=Throw away most recent messages, + #CFE_ES_LogMode_OVERWRITE=Overwrite oldest with most recent */ +} CFE_ES_OverWriteSysLogCmd_Payload_t; + +/** + * \brief Overwrite/Discard System Log Configuration Command Payload + */ +typedef struct CFE_ES_OverWriteSysLogCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_OverWriteSysLogCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_OverWriteSysLogCmd_t; + +/** +** \brief Start Application Command Payload +** +** For command details, see #CFE_ES_START_APP_CC +** +**/ +typedef struct CFE_ES_StartAppCmd_Payload +{ + char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief Name of Application to be started */ + char AppEntryPoint[CFE_MISSION_MAX_API_LEN]; /**< \brief Symbolic name of Application's entry point */ + char AppFileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Full path and filename of Application's + executable image */ + + CFE_ES_MemOffset_t StackSize; /**< \brief Desired stack size for the new application */ + + CFE_ES_ExceptionAction_Enum_t ExceptionAction; /**< \brief #CFE_ES_ExceptionAction_RESTART_APP=On exception, + restart Application, + #CFE_ES_ExceptionAction_PROC_RESTART=On exception, + perform a Processor Reset */ + CFE_ES_TaskPriority_Atom_t Priority; /**< \brief The new Applications runtime priority. */ +} CFE_ES_StartAppCmd_Payload_t; + +/** + * \brief Start Application Command + */ +typedef struct CFE_ES_StartApp +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_StartAppCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_StartAppCmd_t; + +/** +** \brief Generic application name command payload +** +** For command details, see #CFE_ES_STOP_APP_CC, #CFE_ES_RESTART_APP_CC, #CFE_ES_QUERY_ONE_CC +** +**/ +typedef struct CFE_ES_AppNameCmd_Payload +{ + char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief ASCII text string containing Application or Library Name */ +} CFE_ES_AppNameCmd_Payload_t; + +/** + * \brief Generic application name command + */ +typedef struct CFE_ES_AppNameCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_AppNameCmd_t; + +/* + * Like NoArgsCmd, this message definition is shared by multiple commands. + * Create a separate typedef for each one so they can all evolve independently + * without affecting the prototype. + */ +typedef CFE_ES_AppNameCmd_t CFE_ES_StopAppCmd_t; +typedef CFE_ES_AppNameCmd_t CFE_ES_RestartAppCmd_t; +typedef CFE_ES_AppNameCmd_t CFE_ES_QueryOneCmd_t; + +/** +** \brief Reload Application Command Payload +** +** For command details, see #CFE_ES_RELOAD_APP_CC +** +**/ +typedef struct CFE_ES_AppReloadCmd_Payload +{ + char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief ASCII text string containing Application Name */ + char AppFileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Full path and filename of Application's + executable image */ +} CFE_ES_AppReloadCmd_Payload_t; + +/** + * \brief Reload Application Command + */ +typedef struct CFE_ES_ReloadAppCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_AppReloadCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_ReloadAppCmd_t; + +/** +** \brief Set Maximum Processor Reset Count Command Payload +** +** For command details, see #CFE_ES_SET_MAX_PR_COUNT_CC +** +**/ +typedef struct CFE_ES_SetMaxPRCountCmd_Payload +{ + uint16 MaxPRCount; /**< \brief New maximum number of Processor Resets before + an automatic Power-On Reset is performed */ +} CFE_ES_SetMaxPRCountCmd_Payload_t; + +/** + * \brief Set Maximum Processor Reset Count Command + */ +typedef struct CFE_ES_SetMaxPRCountCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_SetMaxPRCountCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_SetMaxPRCountCmd_t; + +/** +** \brief Delete Critical Data Store Command Payload +** +** For command details, see #CFE_ES_DELETE_CDS_CC +** +**/ +typedef struct CFE_ES_DeleteCDSCmd_Payload +{ + char + CdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief ASCII text string containing name of CDS to delete */ +} CFE_ES_DeleteCDSCmd_Payload_t; + +/** + * \brief Delete Critical Data Store Command + */ +typedef struct CFE_ES_DeleteCDSCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_DeleteCDSCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_DeleteCDSCmd_t; + +/** +** \brief Start Performance Analyzer Command Payload +** +** For command details, see #CFE_ES_START_PERF_DATA_CC +** +**/ +typedef struct CFE_ES_StartPerfCmd_Payload +{ + uint32 TriggerMode; /**< \brief Desired trigger position (Start, Center, End) */ +} CFE_ES_StartPerfCmd_Payload_t; + +/** + * \brief Start Performance Analyzer Command + */ +typedef struct CFE_ES_StartPerfDataCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_StartPerfCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_StartPerfDataCmd_t; + +/** +** \brief Stop Performance Analyzer Command Payload +** +** For command details, see #CFE_ES_STOP_PERF_DATA_CC +** +**/ +typedef struct CFE_ES_StopPerfCmd_Payload +{ + char DataFileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief ASCII text string of full path and filename + of file Performance Analyzer data is to be written */ +} CFE_ES_StopPerfCmd_Payload_t; + +/** + * \brief Stop Performance Analyzer Command + */ +typedef struct CFE_ES_StopPerfDataCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_StopPerfCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_StopPerfDataCmd_t; + +/** +** \brief Set Performance Analyzer Filter Mask Command Payload +** +** For command details, see #CFE_ES_SET_PERF_FILTER_MASK_CC +** +**/ +typedef struct CFE_ES_SetPerfFilterMaskCmd_Payload +{ + uint32 FilterMaskNum; /**< \brief Index into array of Filter Masks */ + uint32 FilterMask; /**< \brief New Mask for specified entry in array of Filter Masks */ +} CFE_ES_SetPerfFilterMaskCmd_Payload_t; + +/** + * \brief Set Performance Analyzer Filter Mask Command + */ +typedef struct CFE_ES_SetPerfFilterMaskCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_SetPerfFilterMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_SetPerfFilterMaskCmd_t; + +/** +** \brief Set Performance Analyzer Trigger Mask Command Payload +** +** For command details, see #CFE_ES_SET_PERF_TRIGGER_MASK_CC +** +**/ +typedef struct CFE_ES_SetPerfTrigMaskCmd_Payload +{ + uint32 TriggerMaskNum; /**< \brief Index into array of Trigger Masks */ + uint32 TriggerMask; /**< \brief New Mask for specified entry in array of Trigger Masks */ +} CFE_ES_SetPerfTrigMaskCmd_Payload_t; + +/** + * \brief Set Performance Analyzer Trigger Mask Command + */ +typedef struct CFE_ES_SetPerfTriggerMaskCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_SetPerfTrigMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_SetPerfTriggerMaskCmd_t; + +/** +** \brief Send Memory Pool Statistics Command Payload +** +** For command details, see #CFE_ES_SEND_MEM_POOL_STATS_CC +** +**/ +typedef struct CFE_ES_SendMemPoolStatsCmd_Payload +{ + char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief - RESERVED - should be all zeroes */ + CFE_ES_MemHandle_t PoolHandle; /**< \brief Handle of Pool whose statistics are to be telemetered */ +} CFE_ES_SendMemPoolStatsCmd_Payload_t; + +/** + * \brief Send Memory Pool Statistics Command + */ +typedef struct CFE_ES_SendMemPoolStatsCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_SendMemPoolStatsCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_SendMemPoolStatsCmd_t; + +/** +** \brief Dump CDS Registry Command Payload +** +** For command details, see #CFE_ES_DUMP_CDS_REGISTRY_CC +** +**/ +typedef struct CFE_ES_DumpCDSRegistryCmd_Payload +{ + char DumpFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief ASCII text string of full path and filename + of file CDS Registry is to be written */ +} CFE_ES_DumpCDSRegistryCmd_Payload_t; + +/** + * \brief Dump CDS Registry Command + */ +typedef struct CFE_ES_DumpCDSRegistryCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_ES_DumpCDSRegistryCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_DumpCDSRegistryCmd_t; + +/*************************************************************************/ + +/************************************/ +/* Telemetry Interface Data Formats */ +/************************************/ + +/**********************************/ +/* Telemetry Message Data Formats */ +/**********************************/ +/** +** \cfeestlm Single Application Information Packet +**/ +typedef struct CFE_ES_OneAppTlm_Payload +{ + CFE_ES_AppInfo_t AppInfo; /**< \brief For more information, see #CFE_ES_AppInfo_t */ +} CFE_ES_OneAppTlm_Payload_t; + +typedef struct CFE_ES_OneAppTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_ES_OneAppTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_ES_OneAppTlm_t; + +/** +** \cfeestlm Memory Pool Statistics Packet +**/ +typedef struct CFE_ES_PoolStatsTlm_Payload +{ + CFE_ES_MemHandle_t PoolHandle; /**< \cfetlmmnemonic \ES_POOLHANDLE + \brief Handle of memory pool whose stats are being telemetered */ + CFE_ES_MemPoolStats_t PoolStats; /**< \brief For more info, see #CFE_ES_MemPoolStats_t */ +} CFE_ES_PoolStatsTlm_Payload_t; + +typedef struct CFE_ES_MemStatsTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_ES_PoolStatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_ES_MemStatsTlm_t; + +/*************************************************************************/ + +/** +** \cfeestlm Executive Services Housekeeping Packet +**/ +typedef struct CFE_ES_HousekeepingTlm_Payload +{ + uint8 CommandCounter; /**< \cfetlmmnemonic \ES_CMDPC + \brief The ES Application Command Counter */ + uint8 CommandErrorCounter; /**< \cfetlmmnemonic \ES_CMDEC + \brief The ES Application Command Error Counter */ + + uint16 CFECoreChecksum; /**< \cfetlmmnemonic \ES_CKSUM + \brief Checksum of cFE Core Code */ + uint8 CFEMajorVersion; /**< \cfetlmmnemonic \ES_CFEMAJORVER + \brief Major Version Number of cFE */ + uint8 CFEMinorVersion; /**< \cfetlmmnemonic \ES_CFEMINORVER + \brief Minor Version Number of cFE */ + uint8 CFERevision; /**< \cfetlmmnemonic \ES_CFEREVISION + \brief Sub-Minor Version Number of cFE */ + uint8 CFEMissionRevision; /**< \cfetlmmnemonic \ES_CFEMISSIONREV + \brief Mission Version Number of cFE */ + uint8 OSALMajorVersion; /**< \cfetlmmnemonic \ES_OSMAJORVER + \brief OS Abstraction Layer Major Version Number */ + uint8 OSALMinorVersion; /**< \cfetlmmnemonic \ES_OSMINORVER + \brief OS Abstraction Layer Minor Version Number */ + uint8 OSALRevision; /**< \cfetlmmnemonic \ES_OSREVISION + \brief OS Abstraction Layer Revision Number */ + uint8 OSALMissionRevision; /**< \cfetlmmnemonic \ES_OSMISSIONREV + \brief OS Abstraction Layer MissionRevision Number */ + + uint8 PSPMajorVersion; /**< \cfetlmmnemonic \ES_PSPMAJORVER + \brief Platform Support Package Major Version Number */ + uint8 PSPMinorVersion; /**< \cfetlmmnemonic \ES_PSPMINORVER + \brief Platform Support Package Minor Version Number */ + uint8 PSPRevision; /**< \cfetlmmnemonic \ES_PSPREVISION + \brief Platform Support Package Revision Number */ + uint8 PSPMissionRevision; /**< \cfetlmmnemonic \ES_PSPMISSIONREV + \brief Platform Support Package MissionRevision Number */ + + CFE_ES_MemOffset_t SysLogBytesUsed; /**< \cfetlmmnemonic \ES_SYSLOGBYTEUSED + \brief Total number of bytes used in system log */ + CFE_ES_MemOffset_t SysLogSize; /**< \cfetlmmnemonic \ES_SYSLOGSIZE + \brief Total size of the system log */ + uint32 SysLogEntries; /**< \cfetlmmnemonic \ES_SYSLOGENTRIES + \brief Number of entries in the system log */ + uint32 SysLogMode; /**< \cfetlmmnemonic \ES_SYSLOGMODE + \brief Write/Overwrite Mode */ + + uint32 ERLogIndex; /**< \cfetlmmnemonic \ES_ERLOGINDEX + \brief Current index of the ER Log (wraps around) */ + uint32 ERLogEntries; /**< \cfetlmmnemonic \ES_ERLOGENTRIES + \brief Number of entries made in the ER Log since the power on */ + + uint32 RegisteredCoreApps; /**< \cfetlmmnemonic \ES_REGCOREAPPS + \brief Number of Applications registered with ES */ + uint32 RegisteredExternalApps; /**< \cfetlmmnemonic \ES_REGEXTAPPS + \brief Number of Applications registered with ES */ + uint32 RegisteredTasks; /**< \cfetlmmnemonic \ES_REGTASKS + \brief Number of Tasks ( main AND child tasks ) registered with ES */ + uint32 RegisteredLibs; /**< \cfetlmmnemonic \ES_REGLIBS + \brief Number of Libraries registered with ES */ + + uint32 ResetType; /**< \cfetlmmnemonic \ES_RESETTYPE + \brief Reset type ( PROCESSOR or POWERON ) */ + uint32 ResetSubtype; /**< \cfetlmmnemonic \ES_RESETSUBTYPE + \brief Reset Sub Type */ + uint32 ProcessorResets; /**< \cfetlmmnemonic \ES_PROCRESETCNT + \brief Number of processor resets since last power on */ + uint32 MaxProcessorResets; /**< \cfetlmmnemonic \ES_MAXPROCRESETS + \brief Max processor resets before a power on is done */ + uint32 BootSource; /**< \cfetlmmnemonic \ES_BOOTSOURCE + \brief Boot source ( as provided from BSP ) */ + + uint32 PerfState; /**< \cfetlmmnemonic \ES_PERFSTATE + \brief Current state of Performance Analyzer */ + uint32 PerfMode; /**< \cfetlmmnemonic \ES_PERFMODE + \brief Current mode of Performance Analyzer */ + uint32 PerfTriggerCount; /**< \cfetlmmnemonic \ES_PERFTRIGCNT + \brief Number of Times Performance Analyzer has Triggered */ + uint32 PerfFilterMask[CFE_MISSION_ES_PERF_MAX_IDS / 32]; /**< \cfetlmmnemonic \ES_PERFFLTRMASK + \brief Current Setting of Performance Analyzer Filter Masks */ + uint32 + PerfTriggerMask[CFE_MISSION_ES_PERF_MAX_IDS / 32]; /**< \cfetlmmnemonic \ES_PERFTRIGMASK + \brief Current Setting of Performance Analyzer Trigger Masks */ + uint32 PerfDataStart; /**< \cfetlmmnemonic \ES_PERFDATASTART + \brief Identifies First Stored Entry in Performance Analyzer Log */ + uint32 PerfDataEnd; /**< \cfetlmmnemonic \ES_PERFDATAEND + \brief Identifies Last Stored Entry in Performance Analyzer Log */ + uint32 PerfDataCount; /**< \cfetlmmnemonic \ES_PERFDATACNT + \brief Number of Entries Put Into the Performance Analyzer Log */ + uint32 + PerfDataToWrite; /**< \cfetlmmnemonic \ES_PERFDATA2WRITE + \brief Number of Performance Analyzer Log Entries Left to be Written to Log Dump File */ + CFE_ES_MemOffset_t HeapBytesFree; /**< \cfetlmmnemonic \ES_HEAPBYTESFREE + \brief Number of free bytes remaining in the OS heap */ + CFE_ES_MemOffset_t HeapBlocksFree; /**< \cfetlmmnemonic \ES_HEAPBLKSFREE + \brief Number of free blocks remaining in the OS heap */ + CFE_ES_MemOffset_t HeapMaxBlockSize; /**< \cfetlmmnemonic \ES_HEAPMAXBLK + \brief Number of bytes in the largest free block */ +} CFE_ES_HousekeepingTlm_Payload_t; + +typedef struct CFE_ES_HousekeepingTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_ES_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_ES_HousekeepingTlm_t; + +#endif diff --git a/modules/es/config/default_cfe_es_platform_cfg.h b/modules/es/config/default_cfe_es_platform_cfg.h new file mode 100644 index 000000000..2b3176a9b --- /dev/null +++ b/modules/es/config/default_cfe_es_platform_cfg.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Executive Services (CFE_ES) Application Platform Configuration Header File + * + * This is a compatibility header for the "platform_cfg.h" file that has + * traditionally provided both public and private config definitions + * for each CFS app. + * + * These definitions are now provided in two separate files, one for + * the public/mission scope and one for internal scope. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_ES_PLATFORM_CFG_H +#define CFE_ES_PLATFORM_CFG_H + +#include "cfe_es_mission_cfg.h" +#include "cfe_es_internal_cfg.h" + +#endif diff --git a/modules/es/config/default_cfe_es_topicids.h b/modules/es/config/default_cfe_es_topicids.h new file mode 100644 index 000000000..b45705c21 --- /dev/null +++ b/modules/es/config/default_cfe_es_topicids.h @@ -0,0 +1,51 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Executive Services (CFE_ES) Application Topic IDs + */ +#ifndef CFE_ES_TOPICIDS_H +#define CFE_ES_TOPICIDS_H + +/** +** \cfemissioncfg cFE Portable Message Numbers for Commands +** +** \par Description: +** Portable message numbers for the cFE ES command messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_ES_CMD_MSG 6 +#define CFE_MISSION_ES_SEND_HK_MSG 8 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Telemetry +** +** \par Description: +** Portable message numbers for the cFE ES telemetry messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_ES_HK_TLM_MSG 0 +#define CFE_MISSION_ES_APP_TLM_MSG 11 +#define CFE_MISSION_ES_MEMSTATS_TLM_MSG 16 + +#endif diff --git a/modules/es/fsw/inc/cfe_es_events.h b/modules/es/fsw/inc/cfe_es_eventids.h similarity index 100% rename from modules/es/fsw/inc/cfe_es_events.h rename to modules/es/fsw/inc/cfe_es_eventids.h diff --git a/modules/es/fsw/src/cfe_es_module_all.h b/modules/es/fsw/src/cfe_es_module_all.h index e21006b26..9bc4d997d 100644 --- a/modules/es/fsw/src/cfe_es_module_all.h +++ b/modules/es/fsw/src/cfe_es_module_all.h @@ -46,7 +46,7 @@ #include "cfe_es_mempool.h" #include "cfe_es_global.h" #include "cfe_es_cds_mempool.h" -#include "cfe_es_events.h" +#include "cfe_es_eventids.h" #include "cfe_es_start.h" #include "cfe_es_task.h" #include "cfe_es_dispatch.h" diff --git a/modules/es/mission_build.cmake b/modules/es/mission_build.cmake new file mode 100644 index 000000000..0f071c324 --- /dev/null +++ b/modules/es/mission_build.cmake @@ -0,0 +1,37 @@ +########################################################### +# +# ES Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the ES configuration +set(ES_MISSION_CONFIG_FILE_LIST + cfe_es_mission_cfg.h + cfe_es_interface_cfg.h + cfe_es_extern_typedefs.h + cfe_es_fcncodes.h + cfe_es_msgdefs.h + cfe_es_msg.h + cfe_es_msgstruct.h + cfe_es_topicids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(ES_CFGFILE ${ES_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${ES_CFGFILE}" NAME_WE) + if (DEFINED ES_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${ES_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${ES_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach() From 941468d5696a2156e8d2c718930db1e72d1a7cd4 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 16:28:00 -0400 Subject: [PATCH 159/200] Fix #2320, reorganize SB header files Organize SB header file contents according to the convention --- modules/sb/CMakeLists.txt | 2 +- modules/sb/arch_build.cmake | 32 ++ .../config/default_cfe_sb_extern_typedefs.h} | 12 - .../default_cfe_sb_fcncodes.h} | 349 +---------------- .../sb/config/default_cfe_sb_interface_cfg.h | 69 ++++ .../sb/config/default_cfe_sb_internal_cfg.h | 290 ++++++++++++++ .../sb/config/default_cfe_sb_mission_cfg.h | 36 ++ modules/sb/config/default_cfe_sb_msg.h | 38 ++ modules/sb/config/default_cfe_sb_msgdefs.h | 31 ++ modules/sb/config/default_cfe_sb_msgids.h | 44 +++ modules/sb/config/default_cfe_sb_msgstruct.h | 362 ++++++++++++++++++ .../sb/config/default_cfe_sb_platform_cfg.h | 41 ++ modules/sb/config/default_cfe_sb_topicids.h | 53 +++ .../{cfe_sb_events.h => cfe_sb_eventids.h} | 0 modules/sb/fsw/src/cfe_sb_module_all.h | 2 +- modules/sb/mission_build.cmake | 37 ++ 16 files changed, 1044 insertions(+), 354 deletions(-) create mode 100644 modules/sb/arch_build.cmake rename modules/{core_api/fsw/inc/cfe_sb_extern_typedefs.h => sb/config/default_cfe_sb_extern_typedefs.h} (92%) rename modules/sb/{fsw/inc/cfe_sb_msg.h => config/default_cfe_sb_fcncodes.h} (54%) create mode 100644 modules/sb/config/default_cfe_sb_interface_cfg.h create mode 100644 modules/sb/config/default_cfe_sb_internal_cfg.h create mode 100644 modules/sb/config/default_cfe_sb_mission_cfg.h create mode 100644 modules/sb/config/default_cfe_sb_msg.h create mode 100644 modules/sb/config/default_cfe_sb_msgdefs.h create mode 100644 modules/sb/config/default_cfe_sb_msgids.h create mode 100644 modules/sb/config/default_cfe_sb_msgstruct.h create mode 100644 modules/sb/config/default_cfe_sb_platform_cfg.h create mode 100644 modules/sb/config/default_cfe_sb_topicids.h rename modules/sb/fsw/inc/{cfe_sb_events.h => cfe_sb_eventids.h} (100%) create mode 100644 modules/sb/mission_build.cmake diff --git a/modules/sb/CMakeLists.txt b/modules/sb/CMakeLists.txt index d7b9ecac7..6584053e7 100644 --- a/modules/sb/CMakeLists.txt +++ b/modules/sb/CMakeLists.txt @@ -29,5 +29,5 @@ endif(ENABLE_UNIT_TESTS) cfs_app_check_intf(${DEP} cfe_sb_msg.h - cfe_sb_events.h + cfe_sb_eventids.h ) diff --git a/modules/sb/arch_build.cmake b/modules/sb/arch_build.cmake new file mode 100644 index 000000000..10f7372f0 --- /dev/null +++ b/modules/sb/arch_build.cmake @@ -0,0 +1,32 @@ +########################################################### +# +# SB Core Module platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the SB configuration +set(SB_PLATFORM_CONFIG_FILE_LIST + cfe_sb_internal_cfg.h + cfe_sb_msgids.h + cfe_sb_platform_cfg.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(SB_CFGFILE ${SB_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${SB_CFGFILE}" NAME_WE) + if (DEFINED SB_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE "${SB_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${SB_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h b/modules/sb/config/default_cfe_sb_extern_typedefs.h similarity index 92% rename from modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h rename to modules/sb/config/default_cfe_sb_extern_typedefs.h index 21c37fd0a..8c283ca9a 100644 --- a/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h +++ b/modules/sb/config/default_cfe_sb_extern_typedefs.h @@ -25,16 +25,6 @@ #ifndef CFE_SB_EXTERN_TYPEDEFS_H #define CFE_SB_EXTERN_TYPEDEFS_H -/* This header may be generated from an EDS file, - * tools are available and the feature is enabled */ -#ifdef CFE_EDS_ENABLED_BUILD - -/* Use the EDS generated version of these types */ -#include "cfe_sb_eds_typedefs.h" - -#else -/* Use the local definitions of these types */ - #include "common_types.h" #include "cfe_mission_cfg.h" #include "cfe_resourceid_typedef.h" @@ -135,6 +125,4 @@ typedef struct currently unused */ } CFE_SB_Qos_t; -#endif /* CFE_EDS_ENABLED_BUILD */ - #endif /* CFE_SB_EXTERN_TYPEDEFS_H */ diff --git a/modules/sb/fsw/inc/cfe_sb_msg.h b/modules/sb/config/default_cfe_sb_fcncodes.h similarity index 54% rename from modules/sb/fsw/inc/cfe_sb_msg.h rename to modules/sb/config/default_cfe_sb_fcncodes.h index 87a7c1dc6..87c17fd65 100644 --- a/modules/sb/fsw/inc/cfe_sb_msg.h +++ b/modules/sb/config/default_cfe_sb_fcncodes.h @@ -11,32 +11,22 @@ * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ************************************************************************/ /** * @file + * Specification for the CFE Event Services (CFE_SB) command function codes * - * Purpose: - * This header file contains structure definitions for all SB command and - * telemetry packets - * - * Author: R.McGraw/SSI - * + * @note + * This file should be strictly limited to the command/function code (CC) + * macro definitions. Other definitions such as enums, typedefs, or other + * macros should be placed in the msgdefs.h or msg.h files. */ - -#ifndef CFE_SB_MSG_H -#define CFE_SB_MSG_H - -/* -** Includes -*/ -#include "common_types.h" /* Basic data types */ -#include "cfe_msg_hdr.h" /* for header definitions */ -#include "cfe_sb_extern_typedefs.h" -#include "cfe_es_extern_typedefs.h" +#ifndef CFE_SB_FCNCODES_H +#define CFE_SB_FCNCODES_H /**************************************** ** SB task command packet command codes @@ -469,325 +459,4 @@ */ #define CFE_SB_SEND_PREV_SUBS_CC 11 -/**************************** -** SB Command Formats ** -*****************************/ - -/* - * SB Messages which have no payload are each - * given unique typedefs to follow the command handler convention - * - * For the SB application these are mapped to the CFE_MSG_CommandHeader_t type, - * as they contain only a primary + command header. - */ -typedef CFE_MSG_CommandHeader_t CFE_SB_NoopCmd_t; -typedef CFE_MSG_CommandHeader_t CFE_SB_ResetCountersCmd_t; -typedef CFE_MSG_CommandHeader_t CFE_SB_EnableSubReportingCmd_t; -typedef CFE_MSG_CommandHeader_t CFE_SB_DisableSubReportingCmd_t; -typedef CFE_MSG_CommandHeader_t CFE_SB_SendSbStatsCmd_t; -typedef CFE_MSG_CommandHeader_t CFE_SB_SendPrevSubsCmd_t; -typedef CFE_MSG_CommandHeader_t CFE_SB_SendHkCmd_t; - -/** -** \brief Write File Info Command Payload -** -** This structure contains a generic definition used by SB commands that write to a file -*/ -typedef struct CFE_SB_WriteFileInfoCmd_Payload -{ - char Filename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Path and Filename of data to be loaded */ -} CFE_SB_WriteFileInfoCmd_Payload_t; - -/** - * \brief Write File Info Command - */ -typedef struct CFE_SB_WriteFileInfoCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_SB_WriteFileInfoCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_SB_WriteFileInfoCmd_t; - -/* - * Create a unique typedef for each of the commands that share this format. - */ -typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_WriteRoutingInfoCmd_t; -typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_WritePipeInfoCmd_t; -typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_WriteMapInfoCmd_t; - -/** -** \brief Enable/Disable Route Command Payload -** -** This structure contains a definition used by two SB commands, -** 'Enable Route' #CFE_SB_ENABLE_ROUTE_CC and 'Disable Route' #CFE_SB_DISABLE_ROUTE_CC. -** A route is the destination pipe for a particular message and is therefore defined -** as a MsgId and PipeId combination. -*/ -typedef struct CFE_SB_RouteCmd_Payload -{ - CFE_SB_MsgId_t MsgId; /**< \brief Message ID of route to be enabled or disabled #CFE_SB_MsgId_t */ - CFE_SB_PipeId_t Pipe; /**< \brief Pipe ID of route to be enabled or disabled #CFE_SB_PipeId_t */ - uint8 Spare; /**<\brief Spare byte to make command even number of bytes */ -} CFE_SB_RouteCmd_Payload_t; - -/** - * \brief Enable/Disable Route Command - */ -typedef struct CFE_SB_RouteCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_SB_RouteCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_SB_RouteCmd_t; - -/* - * Create a unique typedef for each of the commands that share this format. - */ -typedef CFE_SB_RouteCmd_t CFE_SB_EnableRouteCmd_t; -typedef CFE_SB_RouteCmd_t CFE_SB_DisableRouteCmd_t; - -/**************************** -** SB Telemetry Formats ** -*****************************/ - -/** -** \cfesbtlm Software Bus task housekeeping Packet -*/ -typedef struct CFE_SB_HousekeepingTlm_Payload -{ - uint8 CommandCounter; /**< \cfetlmmnemonic \SB_CMDPC - \brief Count of valid commands received */ - uint8 CommandErrorCounter; /**< \cfetlmmnemonic \SB_CMDEC - \brief Count of invalid commands received */ - uint8 NoSubscribersCounter; /**< \cfetlmmnemonic \SB_NOSUBEC - \brief Count pkts sent with no subscribers */ - uint8 MsgSendErrorCounter; /**< \cfetlmmnemonic \SB_MSGSNDEC - \brief Count of message send errors */ - - uint8 MsgReceiveErrorCounter; /**< \cfetlmmnemonic \SB_MSGRECEC - \brief Count of message receive errors */ - uint8 InternalErrorCounter; /**< \cfetlmmnemonic \SB_INTERNALEC - \brief Count of queue read or write errors */ - uint8 CreatePipeErrorCounter; /**< \cfetlmmnemonic \SB_NEWPIPEEC - \brief Count of errors in create pipe API */ - uint8 SubscribeErrorCounter; /**< \cfetlmmnemonic \SB_SUBSCREC - \brief Count of errors in subscribe API */ - uint8 PipeOptsErrorCounter; /**< \cfetlmmnemonic \SB_PIPEOPTSEC - \brief Count of errors in set/get pipe options API */ - uint8 DuplicateSubscriptionsCounter; /**< \cfetlmmnemonic \SB_DUPSUBCNT - \brief Count of duplicate subscriptions */ - uint8 GetPipeIdByNameErrorCounter; /**< \cfetlmmnemonic \SB_GETPIPEIDBYNAMEEC - \brief Count of errors in get pipe id by name API */ - uint8 Spare2Align[1]; /**< \cfetlmmnemonic \SB_SPARE2ALIGN - \brief Spare bytes to ensure alignment */ - - uint16 PipeOverflowErrorCounter; /**< \cfetlmmnemonic \SB_PIPEOVREC - \brief Count of pipe overflow errors */ - uint16 MsgLimitErrorCounter; /**< \cfetlmmnemonic \SB_MSGLIMEC - \brief Count of msg id to pipe errors */ - - CFE_ES_MemHandle_t MemPoolHandle; /**< \cfetlmmnemonic \SB_MEMPOOLHANDLE - \brief Handle to SB's Memory Pool */ - - uint32 MemInUse; /**< \cfetlmmnemonic \SB_MEMINUSE - \brief Memory in use */ - - uint32 UnmarkedMem; /**< \cfetlmmnemonic \SB_UNMARKEDMEM - \brief cfg param CFE_PLATFORM_SB_BUF_MEMORY_BYTES minus Peak Memory in use */ -} CFE_SB_HousekeepingTlm_Payload_t; - -typedef struct CFE_SB_HousekeepingTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_SB_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_SB_HousekeepingTlm_t; - -/** -** \brief SB Pipe Depth Statistics -** -** Used in SB Statistics Telemetry Packet #CFE_SB_StatsTlm_t -*/ -typedef struct CFE_SB_PipeDepthStats -{ - CFE_SB_PipeId_t PipeId; /**< \cfetlmmnemonic \SB_PDPIPEID - \brief Pipe Id associated with the stats below */ - uint16 MaxQueueDepth; /**< \cfetlmmnemonic \SB_PDDEPTH - \brief Number of messages the pipe can hold */ - uint16 CurrentQueueDepth; /**< \cfetlmmnemonic \SB_PDINUSE - \brief Number of messages currently on the pipe */ - uint16 PeakQueueDepth; /**< \cfetlmmnemonic \SB_PDPKINUSE - \brief Peak number of messages that have been on the pipe */ - uint16 Spare; /**< \cfetlmmnemonic \SB_PDSPARE - \brief Spare word to ensure alignment */ -} CFE_SB_PipeDepthStats_t; - -/** -** \brief SB Pipe Information File Entry -** -** This statistics structure is output as part of the CFE SB -** "Send Pipe Info" command (CFE_SB_SEND_PIPE_INFO_CC). -** -** Previous versions of CFE simply wrote the internal CFE_SB_PipeD_t object -** to the file, but this also contains information such as pointers which are -** not relevant outside the running CFE process. -** -** By defining the pipe info structure separately, it also provides some -** independence, such that the internal CFE_SB_PipeD_t definition -** can evolve without changing the binary format of the information -** file. -*/ -typedef struct CFE_SB_PipeInfoEntry -{ - CFE_SB_PipeId_t PipeId; /**< The runtime ID of the pipe */ - CFE_ES_AppId_t AppId; /**< The runtime ID of the application that owns the pipe */ - char PipeName[CFE_MISSION_MAX_API_LEN]; /**< The Name of the pipe */ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< The Name of the application that owns the pipe */ - uint16 MaxQueueDepth; /**< The allocated depth of the pipe (max capacity) */ - uint16 CurrentQueueDepth; /**< The current depth of the pipe */ - uint16 PeakQueueDepth; /**< The peak depth of the pipe (high watermark) */ - uint16 SendErrors; /**< Number of errors when writing to this pipe */ - uint8 Opts; /**< Pipe options set (bitmask) */ - uint8 Spare[3]; /**< Padding to make this structure a multiple of 4 bytes */ -} CFE_SB_PipeInfoEntry_t; - -/** -** \cfesbtlm SB Statistics Telemetry Packet -** -** SB Statistics packet sent in response to #CFE_SB_SEND_SB_STATS_CC -*/ -typedef struct CFE_SB_StatsTlm_Payload -{ - uint32 MsgIdsInUse; /**< \cfetlmmnemonic \SB_SMMIDIU - \brief Current number of MsgIds with a destination */ - uint32 PeakMsgIdsInUse; /**< \cfetlmmnemonic \SB_SMPMIDIU - \brief Peak number of MsgIds with a destination */ - uint32 MaxMsgIdsAllowed; /**< \cfetlmmnemonic \SB_SMMMIDALW - \brief cFE Cfg Param \link #CFE_PLATFORM_SB_MAX_MSG_IDS \endlink */ - - uint32 PipesInUse; /**< \cfetlmmnemonic \SB_SMPIU - \brief Number of pipes currently in use */ - uint32 PeakPipesInUse; /**< \cfetlmmnemonic \SB_SMPPIU - \brief Peak number of pipes since last reboot */ - uint32 MaxPipesAllowed; /**< \cfetlmmnemonic \SB_SMMPALW - \brief cFE Cfg Param \link #CFE_PLATFORM_SB_MAX_PIPES \endlink */ - - uint32 MemInUse; /**< \cfetlmmnemonic \SB_SMBMIU - \brief Memory bytes currently in use for SB msg transfers */ - uint32 PeakMemInUse; /**< \cfetlmmnemonic \SB_SMPBMIU - \brief Peak memory bytes in use for SB msg transfers */ - uint32 MaxMemAllowed; /**< \cfetlmmnemonic \SB_SMMBMALW - \brief cFE Cfg Param \link #CFE_PLATFORM_SB_BUF_MEMORY_BYTES \endlink */ - - uint32 SubscriptionsInUse; /**< \cfetlmmnemonic \SB_SMSIU - \brief Number of current subscriptions */ - uint32 PeakSubscriptionsInUse; /**< \cfetlmmnemonic \SB_SMPSIU - \brief Peak number of subscriptions */ - uint32 MaxSubscriptionsAllowed; /**< \cfetlmmnemonic \SB_SMMSALW - \brief product of \link #CFE_PLATFORM_SB_MAX_MSG_IDS \endlink - and \link #CFE_PLATFORM_SB_MAX_DEST_PER_PKT \endlink */ - - uint32 SBBuffersInUse; /**< \cfetlmmnemonic \SB_SMSBBIU - \brief Number of SB message buffers currently in use */ - uint32 PeakSBBuffersInUse; /**< \cfetlmmnemonic \SB_SMPSBBIU - \brief Max number of SB message buffers in use */ - - uint32 MaxPipeDepthAllowed; /**< \cfetlmmnemonic \SB_SMMPDALW - \brief Maximum allowed pipe depth */ - CFE_SB_PipeDepthStats_t - PipeDepthStats[CFE_MISSION_SB_MAX_PIPES]; /**< \cfetlmmnemonic \SB_SMPDS - \brief Pipe Depth Statistics #CFE_SB_PipeDepthStats_t*/ -} CFE_SB_StatsTlm_Payload_t; - -typedef struct CFE_SB_StatsTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_SB_StatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_SB_StatsTlm_t; - -/** -** \brief SB Routing File Entry -** -** Structure of one element of the routing information in response to #CFE_SB_WRITE_ROUTING_INFO_CC -*/ -typedef struct CFE_SB_RoutingFileEntry -{ - CFE_SB_MsgId_t MsgId; /**< \brief Message Id portion of the route */ - CFE_SB_PipeId_t PipeId; /**< \brief Pipe Id portion of the route */ - uint8 State; /**< \brief Route Enabled or Disabled */ - uint16 MsgCnt; /**< \brief Number of msgs with this MsgId sent to this PipeId */ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Pipe Depth Statistics */ - char PipeName[CFE_MISSION_MAX_API_LEN]; /**< \brief Pipe Depth Statistics */ -} CFE_SB_RoutingFileEntry_t; - -/** -** \brief SB Map File Entry -** -** Structure of one element of the map information in response to #CFE_SB_WRITE_MAP_INFO_CC -*/ -typedef struct CFE_SB_MsgMapFileEntry -{ - CFE_SB_MsgId_t MsgId; /**< \brief Message Id which has been subscribed to */ - CFE_SB_RouteId_Atom_t Index; /**< \brief Routing raw index value (0 based, not Route ID) */ -} CFE_SB_MsgMapFileEntry_t; - -/** -** \cfesbtlm SB Subscription Report Packet -** -** This structure defines the pkt sent by SB when a subscription or -** a request to unsubscribe is received while subscription reporting is enabled. -** By default subscription reporting is disabled. This feature is intended to be -** used primarily by Software Bus Networking Application (SBN) -** -** \sa #CFE_SB_ENABLE_SUB_REPORTING_CC, #CFE_SB_DISABLE_SUB_REPORTING_CC -*/ -typedef struct CFE_SB_SingleSubscriptionTlm_Payload -{ - uint8 SubType; /**< \brief Subscription or Unsubscription */ - CFE_SB_MsgId_t MsgId; /**< \brief MsgId subscribed or unsubscribe to */ - CFE_SB_Qos_t Qos; /**< \brief Quality of Service, used only for interprocessor communication */ - CFE_SB_PipeId_t Pipe; /**< \brief Destination pipe id to send above msg id */ -} CFE_SB_SingleSubscriptionTlm_Payload_t; - -typedef struct CFE_SB_SingleSubscriptionTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_SB_SingleSubscriptionTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_SB_SingleSubscriptionTlm_t; - -/** -** \brief SB Previous Subscriptions Entry -** -** This structure defines an entry used in the CFE_SB_PrevSubsPkt_t -** Intended to be used primarily by Software Bus Networking Application (SBN) -** -** Used in structure definition #CFE_SB_AllSubscriptionsTlm_t -*/ -typedef struct CFE_SB_SubEntries -{ - CFE_SB_MsgId_t MsgId; /**< \brief MsgId portion of the subscription */ - CFE_SB_Qos_t Qos; /**< \brief Qos portion of the subscription */ - CFE_SB_PipeId_t Pipe; /**< \brief PipeId portion of the subscription */ -} CFE_SB_SubEntries_t; - -/** -** \cfesbtlm SB Previous Subscriptions Packet -** -** This structure defines the pkt(s) sent by SB that contains a list of all current -** subscriptions. This pkt is generated on cmd and intended to be used primarily by -** the Software Bus Networking Application (SBN). Typically, when the cmd is received -** there are more subscriptions than can fit in one pkt. The complete list of -** subscriptions is sent via a series of segmented pkts. -*/ -typedef struct CFE_SB_AllSubscriptionsTlm_Payload -{ - uint32 PktSegment; /**< \brief Pkt number(starts at 1) in the series */ - uint32 TotalSegments; /**< \brief Total number of pkts needed to complete the request */ - uint32 Entries; /**< \brief Number of entries in the pkt */ - CFE_SB_SubEntries_t Entry[CFE_SB_SUB_ENTRIES_PER_PKT]; /**< \brief Array of #CFE_SB_SubEntries_t entries */ -} CFE_SB_AllSubscriptionsTlm_Payload_t; - -typedef struct CFE_SB_AllSubscriptionsTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_SB_AllSubscriptionsTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_SB_AllSubscriptionsTlm_t; - -#endif /* CFE_SB_MSG_H */ +#endif diff --git a/modules/sb/config/default_cfe_sb_interface_cfg.h b/modules/sb/config/default_cfe_sb_interface_cfg.h new file mode 100644 index 000000000..359f5f415 --- /dev/null +++ b/modules/sb/config/default_cfe_sb_interface_cfg.h @@ -0,0 +1,69 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Software Bus (CFE_SB) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_SB_INTERFACE_CFG_H +#define CFE_SB_INTERFACE_CFG_H + +/** +** \cfesbcfg Maximum SB Message Size +** +** \par Description: +** The following definition dictates the maximum message size allowed on +** the software bus. SB checks the pkt length field in the header of all +** messages sent. If the pkt length field indicates the message is larger +** than this define, SB sends an event and rejects the send. +** +** \par Limits +** This parameter has a lower limit of 6 (CCSDS primary header size). There +** are no restrictions on the upper limit however, the maximum message size is +** system dependent and should be verified. Total message size values that are +** checked against this configuration are defined by a 16 bit data word. +*/ +#define CFE_MISSION_SB_MAX_SB_MSG_SIZE 32768 + +/** +** \cfesbcfg Maximum Number of pipes that SB command/telemetry messages may hold +** +** \par Description: +** Dictates the maximum number of unique Pipes the SB message definitions will hold. +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +*/ +#define CFE_MISSION_SB_MAX_PIPES 64 + +#endif diff --git a/modules/sb/config/default_cfe_sb_internal_cfg.h b/modules/sb/config/default_cfe_sb_internal_cfg.h new file mode 100644 index 000000000..ef34dd381 --- /dev/null +++ b/modules/sb/config/default_cfe_sb_internal_cfg.h @@ -0,0 +1,290 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Software Bus (CFE_SB) Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_SB_INTERNAL_CFG_H +#define CFE_SB_INTERNAL_CFG_H + +/** +** \cfesbcfg Maximum Number of Unique Message IDs SB Routing Table can hold +** +** \par Description: +** Dictates the maximum number of unique MsgIds the SB routing table will hold. +** This constant has a direct effect on the size of SB's tables and arrays. +** Keeping this count as low as possible will save memory. +** To see the run-time, high-water mark and the current utilization figures +** regarding this parameter, send an SB command to 'Send Statistics Pkt'. +** +** \par Limits +** This must be a power of two if software bus message routing hash implementation +** is being used. Lower than 64 will cause unit test failures, and +** telemetry reporting is impacted below 32. There is no hard +** upper limit, but impacts memory footprint. For software bus message routing +** search implementation the number of msg ids subscribed to impacts performance. +** +*/ +#define CFE_PLATFORM_SB_MAX_MSG_IDS 256 + +/** +** \cfesbcfg Maximum Number of Unique Pipes SB Routing Table can hold +** +** \par Description: +** Dictates the maximum number of unique Pipes the SB routing table will hold. +** This constant has a direct effect on the size of SB's tables and arrays. +** Keeping this count as low as possible will save memory. +** To see the run-time, high-water mark and the current utilization figures +** regarding this parameter, send an SB command to 'Send Statistics Pkt'. +** +** \par Limits +** This parameter has a lower limit of 1. This parameter must also be less than +** or equal to OS_MAX_QUEUES. +** +*/ +#define CFE_PLATFORM_SB_MAX_PIPES 64 + +/** +** \cfesbcfg Maximum Number of unique local destinations a single MsgId can have +** +** \par Description: +** Dictates the maximum number of unique local destinations a single MsgId can +** have. +** +** \par Limits +** This parameter has a lower limit of 1. There are no restrictions on the upper +** limit however, the maximum number of destinations per packet is system dependent +** and should be verified. Destination number values that are checked against this +** configuration are defined by a 16 bit data word. +** +*/ +#define CFE_PLATFORM_SB_MAX_DEST_PER_PKT 16 + +/** +** \cfesbcfg Default Subscription Message Limit +** +** \par Description: +** Dictates the default Message Limit when using the #CFE_SB_Subscribe API. This will +** limit the number of messages with a specific message ID that can be received through +** a subscription. This only changes the default; other message limits can be set on a per +** subscription basis using #CFE_SB_SubscribeEx . +** +** \par Limits +** This parameter has a lower limit of 4 and an upper limit of 65535. +** +*/ +#define CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT 4 + +/** +** \cfesbcfg Size of the SB buffer memory pool +** +** \par Description: +** Dictates the size of the SB memory pool. For each message the SB +** sends, the SB dynamically allocates from this memory pool, the memory needed +** to process the message. The memory needed to process each message is msg +** size + msg descriptor(CFE_SB_BufferD_t). This memory pool is also used +** to allocate destination descriptors (CFE_SB_DestinationD_t) during the +** subscription process. +** To see the run-time, high-water mark and the current utilization figures +** regarding this parameter, send an SB command to 'Send Statistics Pkt'. +** Some memory statistics have been added to the SB housekeeping packet. +** NOTE: It is important to monitor these statistics to ensure the desired +** memory margin is met. +** +** \par Limits +** This parameter has a lower limit of 512 and an upper limit of UINT_MAX (4 Gigabytes). +** +*/ +#define CFE_PLATFORM_SB_BUF_MEMORY_BYTES 524288 + +/** +** \cfesbcfg Highest Valid Message Id +** +** \par Description: +** The value of this constant dictates the range of valid message ID's, from 0 +** to CFE_PLATFORM_SB_HIGHEST_VALID_MSGID (inclusive). +** +** Although this can be defined differently across platforms, each platform can +** only publish/subscribe to message ids within their allowable range. Typically +** this value is set the same across all mission platforms to avoid this complexity. +** +** \par Limits +** CFE_SB_INVALID_MSG is set to the maximum representable number of type CFE_SB_MsgId_t. +** CFE_PLATFORM_SB_HIGHEST_VALID_MSGID lower limit is 1, up to CFE_SB_INVALID_MSG_ID - 1. +** +** When using the direct message map implementation for software bus routing, this +** value is used to size the map where a value of 0x1FFF results in a 16 KBytes map +** and 0xFFFF is 128 KBytes. +** +** When using the hash implementation for software bus routing, a multiple of the +** CFE_PLATFORM_SB_MAX_MSG_IDS is used to size the message map. In that case +** the range selected here does not impact message map memory use, so it's +** reasonable to use up to the full range supported by the message ID implementation. +*/ +#define CFE_PLATFORM_SB_HIGHEST_VALID_MSGID 0x1FFF + +/** +** \cfesbcfg Default Routing Information Filename +** +** \par Description: +** The value of this constant defines the filename used to store the software +** bus routing information. This filename is used only when no filename is +** specified in the command. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_SB_DEFAULT_ROUTING_FILENAME "/ram/cfe_sb_route.dat" + +/** +** \cfesbcfg Default Pipe Information Filename +** +** \par Description: +** The value of this constant defines the filename used to store the software +** bus pipe information. This filename is used only when no filename is +** specified in the command. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_SB_DEFAULT_PIPE_FILENAME "/ram/cfe_sb_pipe.dat" + +/** +** \cfesbcfg Default Message Map Filename +** +** \par Description: +** The value of this constant defines the filename used to store the software +** bus message map information. This filename is used only when no filename is +** specified in the command. The message map is a lookup table (array of 16bit +** words) that has an element for each possible MsgId value and holds the +** routing table index for that MsgId. The Msg Map provides fast access to the +** destinations of a message. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_SB_DEFAULT_MAP_FILENAME "/ram/cfe_sb_msgmap.dat" + +/** +** \cfesbcfg SB Event Filtering +** +** \par Description: +** This group of configuration parameters dictates what SB events will be +** filtered through SB. The filtering will begin after the SB task initializes +** and stay in effect until a cmd to SB changes it. +** This allows the operator to set limits on the number of event messages that +** are sent during system initialization. +** NOTE: Set all unused event values and mask values to zero +** +** \par Limits +** This filtering applies only to SB events. +** These parameters have a lower limit of 0 and an upper limit of 65535. +*/ +#define CFE_PLATFORM_SB_FILTERED_EVENT1 CFE_SB_SEND_NO_SUBS_EID +#define CFE_PLATFORM_SB_FILTER_MASK1 CFE_EVS_FIRST_4_STOP + +#define CFE_PLATFORM_SB_FILTERED_EVENT2 CFE_SB_DUP_SUBSCRIP_EID +#define CFE_PLATFORM_SB_FILTER_MASK2 CFE_EVS_FIRST_4_STOP + +#define CFE_PLATFORM_SB_FILTERED_EVENT3 CFE_SB_MSGID_LIM_ERR_EID +#define CFE_PLATFORM_SB_FILTER_MASK3 CFE_EVS_FIRST_16_STOP + +#define CFE_PLATFORM_SB_FILTERED_EVENT4 CFE_SB_Q_FULL_ERR_EID +#define CFE_PLATFORM_SB_FILTER_MASK4 CFE_EVS_FIRST_16_STOP + +#define CFE_PLATFORM_SB_FILTERED_EVENT5 0 +#define CFE_PLATFORM_SB_FILTER_MASK5 CFE_EVS_NO_FILTER + +#define CFE_PLATFORM_SB_FILTERED_EVENT6 0 +#define CFE_PLATFORM_SB_FILTER_MASK6 CFE_EVS_NO_FILTER + +#define CFE_PLATFORM_SB_FILTERED_EVENT7 0 +#define CFE_PLATFORM_SB_FILTER_MASK7 CFE_EVS_NO_FILTER + +#define CFE_PLATFORM_SB_FILTERED_EVENT8 0 +#define CFE_PLATFORM_SB_FILTER_MASK8 CFE_EVS_NO_FILTER + +/** +** \cfeescfg Define SB Memory Pool Block Sizes +** +** \par Description: +** Software Bus Memory Pool Block Sizes +** +** \par Limits +** These sizes MUST be increasing and MUST be an integral multiple of 4. +** The number of block sizes defined cannot exceed +** #CFE_PLATFORM_ES_POOL_MAX_BUCKETS +*/ +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_01 8 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_02 16 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_03 20 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_04 36 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_05 64 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_06 96 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_07 128 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_08 160 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_09 256 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_10 512 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_11 1024 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_12 2048 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_13 4096 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_14 8192 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_15 16384 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_16 32768 +#define CFE_PLATFORM_SB_MAX_BLOCK_SIZE (CFE_MISSION_SB_MAX_SB_MSG_SIZE + 128) + +/** +** \cfeescfg Define SB Task Priority +** +** \par Description: +** Defines the cFE_SB Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_SB_START_TASK_PRIORITY 64 + +/** +** \cfeescfg Define SB Task Stack Size +** +** \par Description: +** Defines the cFE_SB Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_SB_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +#endif diff --git a/modules/sb/config/default_cfe_sb_mission_cfg.h b/modules/sb/config/default_cfe_sb_mission_cfg.h new file mode 100644 index 000000000..cbe188ae7 --- /dev/null +++ b/modules/sb/config/default_cfe_sb_mission_cfg.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Event Services (CFE_SB) Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_SB_MISSION_CFG_H +#define CFE_SB_MISSION_CFG_H + +#include "cfe_sb_interface_cfg.h" + +#endif diff --git a/modules/sb/config/default_cfe_sb_msg.h b/modules/sb/config/default_cfe_sb_msg.h new file mode 100644 index 000000000..09c101ff4 --- /dev/null +++ b/modules/sb/config/default_cfe_sb_msg.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_SB) command and telemetry + * message data types. + * + * This is a compatibility header for the "cfe_sb_msg.h" file that has + * traditionally provided the message definitions for cFS apps. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_SB_MSG_H +#define CFE_SB_MSG_H + +#include "cfe_mission_cfg.h" +#include "cfe_sb_msgdefs.h" +#include "cfe_sb_msgstruct.h" + +#endif diff --git a/modules/sb/config/default_cfe_sb_msgdefs.h b/modules/sb/config/default_cfe_sb_msgdefs.h new file mode 100644 index 000000000..e147861a5 --- /dev/null +++ b/modules/sb/config/default_cfe_sb_msgdefs.h @@ -0,0 +1,31 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_SB) command and telemetry + * message constant definitions. + * + * For CFE_SB this is only the function/command code definitions + */ +#ifndef CFE_SB_MSGDEFS_H +#define CFE_SB_MSGDEFS_H + +#include "cfe_sb_fcncodes.h" + +#endif diff --git a/modules/sb/config/default_cfe_sb_msgids.h b/modules/sb/config/default_cfe_sb_msgids.h new file mode 100644 index 000000000..21fce9c10 --- /dev/null +++ b/modules/sb/config/default_cfe_sb_msgids.h @@ -0,0 +1,44 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_SB) Application Message IDs + */ +#ifndef CFE_SB_MSGIDS_H +#define CFE_SB_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_sb_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_CMD_MSG /* 0x1803 */ +#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SEND_HK_MSG /* 0x180B */ +#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SUB_RPT_CTRL_MSG /* 0x180E */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_HK_TLM_MSG /* 0x0803 */ +#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_STATS_TLM_MSG /* 0x080A */ +#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ALLSUBS_TLM_MSG /* 0x080D */ +#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */ + +#endif diff --git a/modules/sb/config/default_cfe_sb_msgstruct.h b/modules/sb/config/default_cfe_sb_msgstruct.h new file mode 100644 index 000000000..cf83d161c --- /dev/null +++ b/modules/sb/config/default_cfe_sb_msgstruct.h @@ -0,0 +1,362 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * cFE Executive Services (SB) Command and Telemetry packet definition file. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ +#ifndef CFE_SB_MSGSTRUCT_H +#define CFE_SB_MSGSTRUCT_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "cfe_sb_interface_cfg.h" +#include "cfe_msg_hdr.h" + +/**************************** +** SB Command Formats ** +*****************************/ + +/* + * SB Messages which have no payload are each + * given unique typedefs to follow the command handler convention + * + * For the SB application these are mapped to the CFE_MSG_CommandHeader_t type, + * as they contain only a primary + command header. + */ +typedef CFE_MSG_CommandHeader_t CFE_SB_NoopCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_ResetCountersCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_EnableSubReportingCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_DisableSubReportingCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_SendSbStatsCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_SendPrevSubsCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_SendHkCmd_t; + +/** +** \brief Write File Info Command Payload +** +** This structure contains a generic definition used by SB commands that write to a file +*/ +typedef struct CFE_SB_WriteFileInfoCmd_Payload +{ + char Filename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Path and Filename of data to be loaded */ +} CFE_SB_WriteFileInfoCmd_Payload_t; + +/** + * \brief Write File Info Command + */ +typedef struct CFE_SB_WriteFileInfoCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_SB_WriteFileInfoCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_SB_WriteFileInfoCmd_t; + +/* + * Create a unique typedef for each of the commands that share this format. + */ +typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_WriteRoutingInfoCmd_t; +typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_WritePipeInfoCmd_t; +typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_WriteMapInfoCmd_t; + +/** +** \brief Enable/Disable Route Command Payload +** +** This structure contains a definition used by two SB commands, +** 'Enable Route' #CFE_SB_ENABLE_ROUTE_CC and 'Disable Route' #CFE_SB_DISABLE_ROUTE_CC. +** A route is the destination pipe for a particular message and is therefore defined +** as a MsgId and PipeId combination. +*/ +typedef struct CFE_SB_RouteCmd_Payload +{ + CFE_SB_MsgId_t MsgId; /**< \brief Message ID of route to be enabled or disabled #CFE_SB_MsgId_t */ + CFE_SB_PipeId_t Pipe; /**< \brief Pipe ID of route to be enabled or disabled #CFE_SB_PipeId_t */ + uint8 Spare; /**<\brief Spare byte to make command even number of bytes */ +} CFE_SB_RouteCmd_Payload_t; + +/** + * \brief Enable/Disable Route Command + */ +typedef struct CFE_SB_RouteCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_SB_RouteCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_SB_RouteCmd_t; + +/* + * Create a unique typedef for each of the commands that share this format. + */ +typedef CFE_SB_RouteCmd_t CFE_SB_EnableRouteCmd_t; +typedef CFE_SB_RouteCmd_t CFE_SB_DisableRouteCmd_t; + +/**************************** +** SB Telemetry Formats ** +*****************************/ + +/** +** \cfesbtlm Software Bus task housekeeping Packet +*/ +typedef struct CFE_SB_HousekeepingTlm_Payload +{ + uint8 CommandCounter; /**< \cfetlmmnemonic \SB_CMDPC + \brief Count of valid commands received */ + uint8 CommandErrorCounter; /**< \cfetlmmnemonic \SB_CMDEC + \brief Count of invalid commands received */ + uint8 NoSubscribersCounter; /**< \cfetlmmnemonic \SB_NOSUBEC + \brief Count pkts sent with no subscribers */ + uint8 MsgSendErrorCounter; /**< \cfetlmmnemonic \SB_MSGSNDEC + \brief Count of message send errors */ + + uint8 MsgReceiveErrorCounter; /**< \cfetlmmnemonic \SB_MSGRECEC + \brief Count of message receive errors */ + uint8 InternalErrorCounter; /**< \cfetlmmnemonic \SB_INTERNALEC + \brief Count of queue read or write errors */ + uint8 CreatePipeErrorCounter; /**< \cfetlmmnemonic \SB_NEWPIPEEC + \brief Count of errors in create pipe API */ + uint8 SubscribeErrorCounter; /**< \cfetlmmnemonic \SB_SUBSCREC + \brief Count of errors in subscribe API */ + uint8 PipeOptsErrorCounter; /**< \cfetlmmnemonic \SB_PIPEOPTSEC + \brief Count of errors in set/get pipe options API */ + uint8 DuplicateSubscriptionsCounter; /**< \cfetlmmnemonic \SB_DUPSUBCNT + \brief Count of duplicate subscriptions */ + uint8 GetPipeIdByNameErrorCounter; /**< \cfetlmmnemonic \SB_GETPIPEIDBYNAMEEC + \brief Count of errors in get pipe id by name API */ + uint8 Spare2Align[1]; /**< \cfetlmmnemonic \SB_SPARE2ALIGN + \brief Spare bytes to ensure alignment */ + + uint16 PipeOverflowErrorCounter; /**< \cfetlmmnemonic \SB_PIPEOVREC + \brief Count of pipe overflow errors */ + uint16 MsgLimitErrorCounter; /**< \cfetlmmnemonic \SB_MSGLIMEC + \brief Count of msg id to pipe errors */ + + CFE_ES_MemHandle_t MemPoolHandle; /**< \cfetlmmnemonic \SB_MEMPOOLHANDLE + \brief Handle to SB's Memory Pool */ + + uint32 MemInUse; /**< \cfetlmmnemonic \SB_MEMINUSE + \brief Memory in use */ + + uint32 UnmarkedMem; /**< \cfetlmmnemonic \SB_UNMARKEDMEM + \brief cfg param CFE_PLATFORM_SB_BUF_MEMORY_BYTES minus Peak Memory in use */ +} CFE_SB_HousekeepingTlm_Payload_t; + +typedef struct CFE_SB_HousekeepingTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_SB_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_SB_HousekeepingTlm_t; + +/** +** \brief SB Pipe Depth Statistics +** +** Used in SB Statistics Telemetry Packet #CFE_SB_StatsTlm_t +*/ +typedef struct CFE_SB_PipeDepthStats +{ + CFE_SB_PipeId_t PipeId; /**< \cfetlmmnemonic \SB_PDPIPEID + \brief Pipe Id associated with the stats below */ + uint16 MaxQueueDepth; /**< \cfetlmmnemonic \SB_PDDEPTH + \brief Number of messages the pipe can hold */ + uint16 CurrentQueueDepth; /**< \cfetlmmnemonic \SB_PDINUSE + \brief Number of messages currently on the pipe */ + uint16 PeakQueueDepth; /**< \cfetlmmnemonic \SB_PDPKINUSE + \brief Peak number of messages that have been on the pipe */ + uint16 Spare; /**< \cfetlmmnemonic \SB_PDSPARE + \brief Spare word to ensure alignment */ +} CFE_SB_PipeDepthStats_t; + +/** +** \brief SB Pipe Information File Entry +** +** This statistics structure is output as part of the CFE SB +** "Send Pipe Info" command (CFE_SB_SEND_PIPE_INFO_CC). +** +** Previous versions of CFE simply wrote the internal CFE_SB_PipeD_t object +** to the file, but this also contains information such as pointers which are +** not relevant outside the running CFE process. +** +** By defining the pipe info structure separately, it also provides some +** independence, such that the internal CFE_SB_PipeD_t definition +** can evolve without changing the binary format of the information +** file. +*/ +typedef struct CFE_SB_PipeInfoEntry +{ + CFE_SB_PipeId_t PipeId; /**< The runtime ID of the pipe */ + CFE_ES_AppId_t AppId; /**< The runtime ID of the application that owns the pipe */ + char PipeName[CFE_MISSION_MAX_API_LEN]; /**< The Name of the pipe */ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< The Name of the application that owns the pipe */ + uint16 MaxQueueDepth; /**< The allocated depth of the pipe (max capacity) */ + uint16 CurrentQueueDepth; /**< The current depth of the pipe */ + uint16 PeakQueueDepth; /**< The peak depth of the pipe (high watermark) */ + uint16 SendErrors; /**< Number of errors when writing to this pipe */ + uint8 Opts; /**< Pipe options set (bitmask) */ + uint8 Spare[3]; /**< Padding to make this structure a multiple of 4 bytes */ +} CFE_SB_PipeInfoEntry_t; + +/** +** \cfesbtlm SB Statistics Telemetry Packet +** +** SB Statistics packet sent in response to #CFE_SB_SEND_SB_STATS_CC +*/ +typedef struct CFE_SB_StatsTlm_Payload +{ + uint32 MsgIdsInUse; /**< \cfetlmmnemonic \SB_SMMIDIU + \brief Current number of MsgIds with a destination */ + uint32 PeakMsgIdsInUse; /**< \cfetlmmnemonic \SB_SMPMIDIU + \brief Peak number of MsgIds with a destination */ + uint32 MaxMsgIdsAllowed; /**< \cfetlmmnemonic \SB_SMMMIDALW + \brief cFE Cfg Param \link #CFE_PLATFORM_SB_MAX_MSG_IDS \endlink */ + + uint32 PipesInUse; /**< \cfetlmmnemonic \SB_SMPIU + \brief Number of pipes currently in use */ + uint32 PeakPipesInUse; /**< \cfetlmmnemonic \SB_SMPPIU + \brief Peak number of pipes since last reboot */ + uint32 MaxPipesAllowed; /**< \cfetlmmnemonic \SB_SMMPALW + \brief cFE Cfg Param \link #CFE_PLATFORM_SB_MAX_PIPES \endlink */ + + uint32 MemInUse; /**< \cfetlmmnemonic \SB_SMBMIU + \brief Memory bytes currently in use for SB msg transfers */ + uint32 PeakMemInUse; /**< \cfetlmmnemonic \SB_SMPBMIU + \brief Peak memory bytes in use for SB msg transfers */ + uint32 MaxMemAllowed; /**< \cfetlmmnemonic \SB_SMMBMALW + \brief cFE Cfg Param \link #CFE_PLATFORM_SB_BUF_MEMORY_BYTES \endlink */ + + uint32 SubscriptionsInUse; /**< \cfetlmmnemonic \SB_SMSIU + \brief Number of current subscriptions */ + uint32 PeakSubscriptionsInUse; /**< \cfetlmmnemonic \SB_SMPSIU + \brief Peak number of subscriptions */ + uint32 MaxSubscriptionsAllowed; /**< \cfetlmmnemonic \SB_SMMSALW + \brief product of \link #CFE_PLATFORM_SB_MAX_MSG_IDS \endlink + and \link #CFE_PLATFORM_SB_MAX_DEST_PER_PKT \endlink */ + + uint32 SBBuffersInUse; /**< \cfetlmmnemonic \SB_SMSBBIU + \brief Number of SB message buffers currently in use */ + uint32 PeakSBBuffersInUse; /**< \cfetlmmnemonic \SB_SMPSBBIU + \brief Max number of SB message buffers in use */ + + uint32 MaxPipeDepthAllowed; /**< \cfetlmmnemonic \SB_SMMPDALW + \brief Maximum allowed pipe depth */ + CFE_SB_PipeDepthStats_t + PipeDepthStats[CFE_MISSION_SB_MAX_PIPES]; /**< \cfetlmmnemonic \SB_SMPDS + \brief Pipe Depth Statistics #CFE_SB_PipeDepthStats_t*/ +} CFE_SB_StatsTlm_Payload_t; + +typedef struct CFE_SB_StatsTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_SB_StatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_SB_StatsTlm_t; + +/** +** \brief SB Routing File Entry +** +** Structure of one element of the routing information in response to #CFE_SB_WRITE_ROUTING_INFO_CC +*/ +typedef struct CFE_SB_RoutingFileEntry +{ + CFE_SB_MsgId_t MsgId; /**< \brief Message Id portion of the route */ + CFE_SB_PipeId_t PipeId; /**< \brief Pipe Id portion of the route */ + uint8 State; /**< \brief Route Enabled or Disabled */ + uint16 MsgCnt; /**< \brief Number of msgs with this MsgId sent to this PipeId */ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Pipe Depth Statistics */ + char PipeName[CFE_MISSION_MAX_API_LEN]; /**< \brief Pipe Depth Statistics */ +} CFE_SB_RoutingFileEntry_t; + +/** +** \brief SB Map File Entry +** +** Structure of one element of the map information in response to #CFE_SB_WRITE_MAP_INFO_CC +*/ +typedef struct CFE_SB_MsgMapFileEntry +{ + CFE_SB_MsgId_t MsgId; /**< \brief Message Id which has been subscribed to */ + CFE_SB_RouteId_Atom_t Index; /**< \brief Routing raw index value (0 based, not Route ID) */ +} CFE_SB_MsgMapFileEntry_t; + +/** +** \cfesbtlm SB Subscription Report Packet +** +** This structure defines the pkt sent by SB when a subscription or +** a request to unsubscribe is received while subscription reporting is enabled. +** By default subscription reporting is disabled. This feature is intended to be +** used primarily by Software Bus Networking Application (SBN) +** +** \sa #CFE_SB_ENABLE_SUB_REPORTING_CC, #CFE_SB_DISABLE_SUB_REPORTING_CC +*/ +typedef struct CFE_SB_SingleSubscriptionTlm_Payload +{ + uint8 SubType; /**< \brief Subscription or Unsubscription */ + CFE_SB_MsgId_t MsgId; /**< \brief MsgId subscribed or unsubscribe to */ + CFE_SB_Qos_t Qos; /**< \brief Quality of Service, used only for interprocessor communication */ + CFE_SB_PipeId_t Pipe; /**< \brief Destination pipe id to send above msg id */ +} CFE_SB_SingleSubscriptionTlm_Payload_t; + +typedef struct CFE_SB_SingleSubscriptionTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_SB_SingleSubscriptionTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_SB_SingleSubscriptionTlm_t; + +/** +** \brief SB Previous Subscriptions Entry +** +** This structure defines an entry used in the CFE_SB_PrevSubsPkt_t +** Intended to be used primarily by Software Bus Networking Application (SBN) +** +** Used in structure definition #CFE_SB_AllSubscriptionsTlm_t +*/ +typedef struct CFE_SB_SubEntries +{ + CFE_SB_MsgId_t MsgId; /**< \brief MsgId portion of the subscription */ + CFE_SB_Qos_t Qos; /**< \brief Qos portion of the subscription */ + CFE_SB_PipeId_t Pipe; /**< \brief PipeId portion of the subscription */ +} CFE_SB_SubEntries_t; + +/** +** \cfesbtlm SB Previous Subscriptions Packet +** +** This structure defines the pkt(s) sent by SB that contains a list of all current +** subscriptions. This pkt is generated on cmd and intended to be used primarily by +** the Software Bus Networking Application (SBN). Typically, when the cmd is received +** there are more subscriptions than can fit in one pkt. The complete list of +** subscriptions is sent via a series of segmented pkts. +*/ +typedef struct CFE_SB_AllSubscriptionsTlm_Payload +{ + uint32 PktSegment; /**< \brief Pkt number(starts at 1) in the series */ + uint32 TotalSegments; /**< \brief Total number of pkts needed to complete the request */ + uint32 Entries; /**< \brief Number of entries in the pkt */ + CFE_SB_SubEntries_t Entry[CFE_SB_SUB_ENTRIES_PER_PKT]; /**< \brief Array of #CFE_SB_SubEntries_t entries */ +} CFE_SB_AllSubscriptionsTlm_Payload_t; + +typedef struct CFE_SB_AllSubscriptionsTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_SB_AllSubscriptionsTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_SB_AllSubscriptionsTlm_t; + +#endif diff --git a/modules/sb/config/default_cfe_sb_platform_cfg.h b/modules/sb/config/default_cfe_sb_platform_cfg.h new file mode 100644 index 000000000..50cbbe905 --- /dev/null +++ b/modules/sb/config/default_cfe_sb_platform_cfg.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Software Bus (CFE_SB) Application Platform Configuration Header File + * + * This is a compatibility header for the "platform_cfg.h" file that has + * traditionally provided both public and private config definitions + * for each CFS app. + * + * These definitions are now provided in two separate files, one for + * the public/mission scope and one for internal scope. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_SB_PLATFORM_CFG_H +#define CFE_SB_PLATFORM_CFG_H + +#include "cfe_sb_mission_cfg.h" +#include "cfe_sb_internal_cfg.h" + +#endif diff --git a/modules/sb/config/default_cfe_sb_topicids.h b/modules/sb/config/default_cfe_sb_topicids.h new file mode 100644 index 000000000..3c3e7be37 --- /dev/null +++ b/modules/sb/config/default_cfe_sb_topicids.h @@ -0,0 +1,53 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Software Bus (CFE_SB) Application Topic IDs + */ +#ifndef CFE_SB_TOPICIDS_H +#define CFE_SB_TOPICIDS_H + +/** +** \cfemissioncfg cFE Portable Message Numbers for Commands +** +** \par Description: +** Portable message numbers for the cFE command messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_SB_CMD_MSG 3 +#define CFE_MISSION_SB_SEND_HK_MSG 11 +#define CFE_MISSION_SB_SUB_RPT_CTRL_MSG 14 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Telemetry +** +** \par Description: +** Portable message numbers for the cFE telemetry messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_SB_HK_TLM_MSG 3 +#define CFE_MISSION_SB_STATS_TLM_MSG 10 +#define CFE_MISSION_SB_ALLSUBS_TLM_MSG 13 +#define CFE_MISSION_SB_ONESUB_TLM_MSG 14 + +#endif diff --git a/modules/sb/fsw/inc/cfe_sb_events.h b/modules/sb/fsw/inc/cfe_sb_eventids.h similarity index 100% rename from modules/sb/fsw/inc/cfe_sb_events.h rename to modules/sb/fsw/inc/cfe_sb_eventids.h diff --git a/modules/sb/fsw/src/cfe_sb_module_all.h b/modules/sb/fsw/src/cfe_sb_module_all.h index fe3070205..d26a2b83f 100644 --- a/modules/sb/fsw/src/cfe_sb_module_all.h +++ b/modules/sb/fsw/src/cfe_sb_module_all.h @@ -40,7 +40,7 @@ #include "cfe_sb_core_internal.h" #include "cfe_sb_priv.h" -#include "cfe_sb_events.h" +#include "cfe_sb_eventids.h" #include "cfe_sb_destination_typedef.h" #include "cfe_sb_msg.h" #include "cfe_sb_dispatch.h" diff --git a/modules/sb/mission_build.cmake b/modules/sb/mission_build.cmake new file mode 100644 index 000000000..1eb5c2c71 --- /dev/null +++ b/modules/sb/mission_build.cmake @@ -0,0 +1,37 @@ +########################################################### +# +# SB Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the SB configuration +set(SB_MISSION_CONFIG_FILE_LIST + cfe_sb_mission_cfg.h + cfe_sb_interface_cfg.h + cfe_sb_extern_typedefs.h + cfe_sb_fcncodes.h + cfe_sb_msgdefs.h + cfe_sb_msg.h + cfe_sb_msgstruct.h + cfe_sb_topicids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(SB_CFGFILE ${SB_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${SB_CFGFILE}" NAME_WE) + if (DEFINED SB_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${SB_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${SB_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach() From 4c79b5fef579517c030d08a1f38b57691f94f33c Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 16:28:00 -0400 Subject: [PATCH 160/200] Fix #2320, reorganize TBL header files Organize TBL header file contents according to the convention --- modules/tbl/CMakeLists.txt | 2 +- modules/tbl/arch_build.cmake | 32 ++ .../config/default_cfe_tbl_extern_typedefs.h} | 12 - modules/tbl/config/default_cfe_tbl_fcncodes.h | 464 +++++++++++++++++ .../config/default_cfe_tbl_interface_cfg.h | 71 +++ .../tbl/config/default_cfe_tbl_internal_cfg.h | 265 ++++++++++ .../tbl/config/default_cfe_tbl_mission_cfg.h | 36 ++ modules/tbl/config/default_cfe_tbl_msg.h | 38 ++ modules/tbl/config/default_cfe_tbl_msgdefs.h | 31 ++ modules/tbl/config/default_cfe_tbl_msgids.h | 41 ++ .../default_cfe_tbl_msgstruct.h} | 466 +----------------- .../tbl/config/default_cfe_tbl_platform_cfg.h | 41 ++ modules/tbl/config/default_cfe_tbl_topicids.h | 50 ++ .../{cfe_tbl_events.h => cfe_tbl_eventids.h} | 0 modules/tbl/fsw/src/cfe_tbl_internal.h | 2 +- modules/tbl/fsw/src/cfe_tbl_module_all.h | 2 +- modules/tbl/mission_build.cmake | 37 ++ 17 files changed, 1124 insertions(+), 466 deletions(-) create mode 100644 modules/tbl/arch_build.cmake rename modules/{core_api/fsw/inc/cfe_tbl_extern_typedefs.h => tbl/config/default_cfe_tbl_extern_typedefs.h} (89%) create mode 100644 modules/tbl/config/default_cfe_tbl_fcncodes.h create mode 100644 modules/tbl/config/default_cfe_tbl_interface_cfg.h create mode 100644 modules/tbl/config/default_cfe_tbl_internal_cfg.h create mode 100644 modules/tbl/config/default_cfe_tbl_mission_cfg.h create mode 100644 modules/tbl/config/default_cfe_tbl_msg.h create mode 100644 modules/tbl/config/default_cfe_tbl_msgdefs.h create mode 100644 modules/tbl/config/default_cfe_tbl_msgids.h rename modules/tbl/{fsw/inc/cfe_tbl_msg.h => config/default_cfe_tbl_msgstruct.h} (51%) create mode 100644 modules/tbl/config/default_cfe_tbl_platform_cfg.h create mode 100644 modules/tbl/config/default_cfe_tbl_topicids.h rename modules/tbl/fsw/inc/{cfe_tbl_events.h => cfe_tbl_eventids.h} (100%) create mode 100644 modules/tbl/mission_build.cmake diff --git a/modules/tbl/CMakeLists.txt b/modules/tbl/CMakeLists.txt index 30d333245..0052b41fa 100644 --- a/modules/tbl/CMakeLists.txt +++ b/modules/tbl/CMakeLists.txt @@ -26,5 +26,5 @@ endif(ENABLE_UNIT_TESTS) cfs_app_check_intf(${DEP} cfe_tbl_msg.h - cfe_tbl_events.h + cfe_tbl_eventids.h ) diff --git a/modules/tbl/arch_build.cmake b/modules/tbl/arch_build.cmake new file mode 100644 index 000000000..25495554c --- /dev/null +++ b/modules/tbl/arch_build.cmake @@ -0,0 +1,32 @@ +########################################################### +# +# TBL Core Module platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the TBL configuration +set(TBL_PLATFORM_CONFIG_FILE_LIST + cfe_tbl_internal_cfg.h + cfe_tbl_msgids.h + cfe_tbl_platform_cfg.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(TBL_CFGFILE ${TBL_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${TBL_CFGFILE}" NAME_WE) + if (DEFINED TBL_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE "${TBL_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${TBL_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h b/modules/tbl/config/default_cfe_tbl_extern_typedefs.h similarity index 89% rename from modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h rename to modules/tbl/config/default_cfe_tbl_extern_typedefs.h index f8fcbcfc5..38540850c 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h +++ b/modules/tbl/config/default_cfe_tbl_extern_typedefs.h @@ -25,16 +25,6 @@ #ifndef CFE_TBL_EXTERN_TYPEDEFS_H #define CFE_TBL_EXTERN_TYPEDEFS_H -/* This header may be generated from an EDS file, - * tools are available and the feature is enabled */ -#ifdef CFE_EDS_ENABLED_BUILD - -/* Use the EDS generated version of these types */ -#include "cfe_tbl_eds_typedefs.h" - -#else -/* Use the local definitions of these types */ - #include "common_types.h" #include "cfe_es_extern_typedefs.h" #include "cfe_mission_cfg.h" /* for CFE_MISSION_TBL_MAX_FULL_NAME_LEN */ @@ -79,6 +69,4 @@ typedef struct CFE_TBL_File_Hdr char TableName[CFE_MISSION_TBL_MAX_FULL_NAME_LEN]; /**< Fully qualified name of table to load */ } CFE_TBL_File_Hdr_t; -#endif /* CFE_EDS_ENABLED_BUILD */ - #endif /* CFE_TBL_EXTERN_TYPEDEFS_H */ diff --git a/modules/tbl/config/default_cfe_tbl_fcncodes.h b/modules/tbl/config/default_cfe_tbl_fcncodes.h new file mode 100644 index 000000000..e5da0e13c --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_fcncodes.h @@ -0,0 +1,464 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_TBL) command function codes + * + * @note + * This file should be strictly limited to the command/function code (CC) + * macro definitions. Other definitions such as enums, typedefs, or other + * macros should be placed in the msgdefs.h or msg.h files. + */ +#ifndef CFE_TBL_FCNCODES_H +#define CFE_TBL_FCNCODES_H + +/* +** Table task command packet command codes +*/ +/** \name Table Services Command Codes */ +/** \{ */ + +/** \cfetblcmd Table No-Op +** +** \par Description +** This command performs no other function than to increment the +** command execution counter. The command may be used to verify +** general aliveness of the Table Services task. +** +** \cfecmdmnemonic \TBL_NOOP +** +** \par Command Structure +** #CFE_TBL_NoopCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with the +** following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will +** increment +** - The #CFE_TBL_NOOP_INF_EID informational event message will +** be generated +** +** \par Error Conditions +** There are no error conditions for this command. If the Table +** Services receives the command, the event is sent (although it +** may be filtered by EVS) and the counter is incremented +** unconditionally. +** +** \par Criticality +** None +** +** \sa +*/ +#define CFE_TBL_NOOP_CC 0 + +/** \cfetblcmd Table Reset Counters +** +** \par Description +** This command resets the following counters within the Table +** Services housekeeping telemetry: +** - Command Execution Counter (\TBL_CMDPC) +** - Command Error Counter (\TBL_CMDEC) +** - Successful Table Validations Counter (\TBL_VALSUCCESSCTR) +** - Failed Table Validations Counter (\TBL_VALFAILEDCTR) +** - Number of Table Validations Requested (\TBL_VALREQCTR) +** - Number of completed table validations (\TBL_VALCOMPLTDCTR) +** +** \cfecmdmnemonic \TBL_RESETCTRS +** +** \par Command Structure +** #CFE_TBL_ResetCountersCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with +** the following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will +** be reset to 0 +** - The #CFE_TBL_RESET_INF_EID debug event message will be +** generated +** +** \par Error Conditions +** There are no error conditions for this command. If the Table +** Services receives the command, the event is sent (although it +** may be filtered by EVS) and the counter is incremented +** unconditionally. +** +** \par Criticality +** This command is not inherently dangerous. However, it is +** possible for ground systems and on-board safing procedures +** to be designed such that they react to changes in the counter +** values that are reset by this command. +** +** \sa +*/ +#define CFE_TBL_RESET_COUNTERS_CC 1 + +/** \cfetblcmd Load Table +** +** \par Description +** This command loads the contents of the specified file into +** an inactive buffer for the table specified within the file. +** +** \cfecmdmnemonic \TBL_LOAD +** +** \par Command Structure +** #CFE_TBL_LoadCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with +** the following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will +** increment +** - The #CFE_TBL_FILE_LOADED_INF_EID informational event message +** will be generated +** +** \par Error Conditions +** This command can fail for the following reasons: +** - Table name found in table image file's table header is not found +** in table registry (ie - The table associated with the table image +** in the file has not been registered by an application). +** - The table image file has an invalid or incorrect size. The size of +** the image file must match the size field within in the header, and +** must also match the expected size of the table indicated in the registry. +** - No working buffers are available for the load. This would indicate +** that too many single-buffered table loads are in progress at the same +** time. +** - An attempt is being made to load an uninitialized table with a file +** containing only a partial table image. +** - The table image file was unable to be opened. Either the file does +** not exist at the specified location, the filename is in error, or +** the file system has been corrupted. +** +** Evidence of failure may be found in the following telemetry: +** - \b \c \TBL_CMDEC - command error counter will increment +** - Command specific error event messages are issued for all error cases +** +** \par Criticality +** This command is not inherently dangerous. It is performing the first +** step of loading a table and can be aborted (using the Abort Table Load +** command described below) without affecting the contents of the active +** table image. +** +** \sa #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC +*/ +#define CFE_TBL_LOAD_CC 2 + +/** \cfetblcmd Dump Table +** +** \par Description +** This command will cause the Table Services to put the contents +** of the specified table buffer into the command specified file. +** +** \cfecmdmnemonic \TBL_DUMP +** +** \par Command Structure +** #CFE_TBL_DumpCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with the +** following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will +** increment +** - Either the #CFE_TBL_OVERWRITE_DUMP_INF_EID OR the +** #CFE_TBL_WRITE_DUMP_INF_EID informational event message will +** be generated +** +** \par Error Conditions +** This command may fail for the following reason(s): +** - A single buffered table's inactive buffer was requested to be +** dumped and no such buffer is currently allocated. +** - Error occurred during write operation to file. Possible causes +** might be insufficient space in the file system or the filename +** or file path is improperly specified. +** - The specified table name was not found in the table registry. +** +** Evidence of failure may be found in the following telemetry: +** - \b \c \TBL_CMDEC - command error counter will increment +** - A command specific error event message is issued for all error +** cases +** +** \par Criticality +** This command is not inherently dangerous. It will create a new +** file in the file system and could, if performed repeatedly without +** sufficient file management by the operator, fill the file system. +** +** \sa #CFE_TBL_LOAD_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC +*/ +#define CFE_TBL_DUMP_CC 3 + +/** \cfetblcmd Validate Table +** +** \par Description +** This command will cause Table Services to calculate the Data Integrity +** Value for the specified table and to notify the owning application that +** the table's validation function should be executed. The results of both +** the Data Integrity Value computation and the validation function are +** reported in Table Services Housekeeping Telemetry. +** +** \cfecmdmnemonic \TBL_VALIDATE +** +** \par Command Structure +** #CFE_TBL_ValidateCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with the following +** telemetry: +** - \b \c \TBL_CMDPC - command execution counter will increment +** - \b \c \TBL_VALREQCTR - table validation request counter will increment +** - \b \c \TBL_LASTVALCRC - calculated data integrity value will be updated +** - The #CFE_TBL_VAL_REQ_MADE_INF_EID debug event message (indicating the +** application is being notified of a validation request) +** +** If the specified table has an associated validation function, then the +** following telemetry will also change: +** - Either \b \c \TBL_VALSUCCESSCTR OR \b \c \TBL_VALFAILEDCTR will +** increment +** - \b \c \TBL_VALCOMPLTDCTR - table validations performed counter will +** increment +** - \b \c \TBL_LASTVALS - table validation function return status will +** update +** - The #CFE_TBL_VALIDATION_INF_EID informational event message (indicating the +** validation function return status) will be generated +** +** \par Error Conditions +** This command may fail for the following reason(s): +** - A single buffered table's inactive buffer was requested to be validated +** and no such buffer is currently allocated. +** - Too many validations have been requested simultaneously. The operator +** must wait for one or more applications to perform their table validation +** functions before trying again. +** - The specified table name was not found in the table registry. +** +** Evidence of failure may be found in the following telemetry: +** - \b \c \TBL_CMDEC - command error counter will increment +** - Command specific error event message are issued for all error cases +** +** \par Criticality +** The success or failure of a table validation does not have any immediate +** impact on table contents. The results are sent to the operator in telemetry +** and the operator must determine whether the results are acceptable and send a +** command to activate the validated table image. +** +** \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC +*/ +#define CFE_TBL_VALIDATE_CC 4 + +/** \cfetblcmd Activate Table +** +** \par Description +** This command will cause Table Services to notify a table's owner +** that an update is pending. The owning application will then update +** the contents of the active table buffer with the contents of the +** associated inactive table buffer at a time of their convenience. +** +** \cfecmdmnemonic \TBL_ACTIVATE +** +** \par Command Structure +** #CFE_TBL_ActivateCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with the +** following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will +** increment +** - The #CFE_TBL_UPDATE_SUCCESS_INF_EID informational event message +** will be generated +** +** \par Error Conditions +** This command may fail for the following reason(s): +** - The specified table name was not found in the table registry. +** - The table was registered as a "dump only" type and thus cannot be activated +** - The table buffer has not been validated. +** +** Evidence of failure may be found in the following telemetry: +** - \b \c \TBL_CMDEC - command error counter will increment +** - Command specific error event message are issued for all +** error cases +** +** \par Criticality +** This command will cause the contents of the specified table to be +** updated with the contents in the inactive table buffer. +** +** \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ABORT_LOAD_CC +*/ +#define CFE_TBL_ACTIVATE_CC 5 + +/** \cfetblcmd Dump Table Registry +** +** \par Description +** This command will cause Table Services to write some of the +** contents of the Table Registry to the command specified file. +** This allows the operator to see the current state and configuration +** of all tables that have been registered with the cFE. +** +** \cfecmdmnemonic \TBL_WRITEREG2FILE +** +** \par Command Structure +** #CFE_TBL_DumpRegistryCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with the +** following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will +** increment +** - The generation of either #CFE_TBL_OVERWRITE_REG_DUMP_INF_EID +** or #CFE_TBL_WRITE_REG_DUMP_INF_EID debug event messages +** - The specified file should appear (or be updated) at the +** specified location in the file system +** +** \par Error Conditions +** This command may fail for the following reason(s): +** - A table registry dump is already in progress, not yet completed +** - The specified DumpFilename could not be parsed +** - Error occurred during write operation to file. Possible +** causes might be insufficient space in the file system +** or the filename or file path is improperly specified. +** +** Evidence of failure may be found in the following telemetry: +** - \b \c \TBL_CMDEC - command error counter will increment +** - An Error specific event message +** +** \par Criticality +** This command is not inherently dangerous. It will create a new +** file in the file system and could, if performed repeatedly without +** sufficient file management by the operator, fill the file system. +** +** \sa #CFE_TBL_SEND_REGISTRY_CC +*/ +#define CFE_TBL_DUMP_REGISTRY_CC 6 + +/** \cfetblcmd Telemeter One Table Registry Entry +** +** \par Description +** This command will cause Table Services to telemeter the contents +** of the Table Registry for the command specified table. +** +** \cfecmdmnemonic \TBL_TLMREG +** +** \par Command Structure +** #CFE_TBL_SendRegistryCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with the +** following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will increment +** - Receipt of a Table Registry Info Packet (see #CFE_TBL_TableRegistryTlm_t) +** - The #CFE_TBL_TLM_REG_CMD_INF_EID debug event message will +** be generated +** +** \par Error Conditions +** This command may fail for the following reason(s): +** - The specified table name was not found in the table registry. +** +** Evidence of failure may be found in the following telemetry: +** - \b \c \TBL_CMDEC - command error counter will increment +** - Error specific event message +** +** \par Criticality +** This command is not inherently dangerous. It will generate +** additional telemetry. +** +** \sa #CFE_TBL_DUMP_REGISTRY_CC +*/ +#define CFE_TBL_SEND_REGISTRY_CC 7 + +/** \cfetblcmd Delete Critical Table from Critical Data Store +** +** \par Description +** This command will delete the Critical Data Store (CDS) associated +** with the specified Critical Table. Note that any table still +** present in the Table Registry is unable to be deleted from +** the Critical Data Store. All Applications that are accessing +** the critical table must release and unregister their access +** before the CDS can be deleted. +** +** \cfecmdmnemonic \TBL_DELETECDS +** +** \par Command Structure +** #CFE_TBL_DeleteCDSCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with the +** following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will +** increment +** - The #CFE_TBL_CDS_DELETED_INFO_EID informational event message +** will be generated +** +** \par Error Conditions +** This command may fail for the following reason(s): +** - The specified table name was not found in the critical data +** store registry +** - The specified table name WAS found in the table registry (all +** registrations/sharing of the table must be unregistered before +** the table's CDS can be deleted) +** - The table's owning application is still active +** +** Evidence of failure may be found in the following telemetry: +** - \b \c \TBL_CMDEC - command error counter will increment +** - Error specific event message +** +** \par Criticality +** This command will cause the loss of the specified table's contents +** before the owning Application was terminated. +** +** \sa #CFE_ES_DUMP_CDS_REGISTRY_CC, #CFE_ES_DELETE_CDS_CC +*/ +#define CFE_TBL_DELETE_CDS_CC 8 + +/** \cfetblcmd Abort Table Load +** +** \par Description +** This command will cause Table Services to discard the contents of +** a table buffer that was previously loaded with the data in a file +** as specified by a Table Load command. For single buffered tables, +** the allocated shared working buffer is freed and becomes available +** for other Table Load commands. +** +** \cfecmdmnemonic \TBL_LOADABORT +** +** \par Command Structure +** #CFE_TBL_AbortLoadCmd_t +** +** \par Command Verification +** Successful execution of this command may be verified with the +** following telemetry: +** - \b \c \TBL_CMDPC - command execution counter will increment +** - The #CFE_TBL_LOAD_ABORT_INF_EID informational event message +** is generated +** - If the load was aborted for a single buffered table, the +** \b \c \TBL_NUMFREESHRBUF telemetry point should increment +** +** \par Error Conditions +** This command may fail for the following reason(s): +** - The specified table name was not found in the table registry. +** - The specified table did not have a load in progress to be aborted. +** +** Evidence of failure may be found in the following telemetry: +** - \b \c \TBL_CMDEC - command error counter will increment +** - Error specific event message +** +** \par Criticality +** This command will cause the loss of data put into an inactive table buffer. +** +** \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC +*/ +#define CFE_TBL_ABORT_LOAD_CC 9 +/** \} */ + +#endif diff --git a/modules/tbl/config/default_cfe_tbl_interface_cfg.h b/modules/tbl/config/default_cfe_tbl_interface_cfg.h new file mode 100644 index 000000000..214e65418 --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_interface_cfg.h @@ -0,0 +1,71 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Table Services (CFE_TBL) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TBL_INTERFACE_CFG_H +#define CFE_TBL_INTERFACE_CFG_H + +/** +** \cfetblcfg Maximum Table Name Length +** +** \par Description: +** Indicates the maximum length (in characters) of the table name +** ('TblName') portion of a Full Table Name of the following +** form: "ApplicationName.TblName" +** +** This length does not need to include an extra character for NULL termination. +** +** \par Limits +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_TBL_MAX_NAME_LENGTH 16 + +/** +** \cfetblcfg Maximum Length of Full Table Name in messages +** +** \par Description: +** Indicates the maximum length (in characters) of the entire table name +** within software bus messages, in "AppName.TableName" notation. +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_TBL_MAX_FULL_NAME_LEN (CFE_MISSION_TBL_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) + +#endif diff --git a/modules/tbl/config/default_cfe_tbl_internal_cfg.h b/modules/tbl/config/default_cfe_tbl_internal_cfg.h new file mode 100644 index 000000000..412553139 --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_internal_cfg.h @@ -0,0 +1,265 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Table Services (CFE_TBL) Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TBL_INTERNAL_CFG_H +#define CFE_TBL_INTERNAL_CFG_H + +/** +** \cfeescfg Define TBL Task Priority +** +** \par Description: +** Defines the cFE_TBL Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TBL_START_TASK_PRIORITY 70 + +/** +** \cfeescfg Define TBL Task Stack Size +** +** \par Description: +** Defines the cFE_TBL Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_TBL_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +/* Platform Configuration Parameters for Table Service (TBL) */ + +/** +** \cfetblcfg Size of Table Services Table Memory Pool +** +** \par Description: +** Defines the TOTAL size of the memory pool that cFE Table Services allocates +** from the system. The size must be large enough to provide memory for each +** registered table, the inactive buffers for double buffered tables and for +** the shared inactive buffers for single buffered tables. +** +** \par Limits +** The cFE does not place a limit on the size of this parameter. +*/ +#define CFE_PLATFORM_TBL_BUF_MEMORY_BYTES 524288 + +/** +** \cfetblcfg Maximum Size Allowed for a Double Buffered Table +** +** \par Description: +** Defines the maximum allowed size (in bytes) of a double buffered table. +** +** \par Limits +** The cFE does not place a limit on the size of this parameter but it must be +** less than half of #CFE_PLATFORM_TBL_BUF_MEMORY_BYTES. +*/ +#define CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE 16384 + +/** +** \cfetblcfg Maximum Size Allowed for a Single Buffered Table +** +** \par Description: +** Defines the maximum allowed size (in bytes) of a single buffered table. +** \b NOTE: This size determines the size of all shared table buffers. +** Therefore, this size will be multiplied by #CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS +** below when allocating memory for shared tables. +** +** \par Limits +** The cFE does not place a limit on the size of this parameter but it must be +** small enough to allow for #CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS number of tables +** to fit into #CFE_PLATFORM_TBL_BUF_MEMORY_BYTES. +*/ +#define CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE 16384 + +/** +** \cfetblcfg Maximum Number of Tables Allowed to be Registered +** +** \par Description: +** Defines the maximum number of tables supported by this processor's Table Services. +** +** \par Limits +** This number must be less than 32767. It should be recognized that this parameter +** determines the size of the Table Registry. An excessively high number will waste +** memory. +*/ +#define CFE_PLATFORM_TBL_MAX_NUM_TABLES 128 + +/** +** \cfetblcfg Maximum Number of Critical Tables that can be Registered +** +** \par Description: +** Defines the maximum number of critical tables supported by this processor's Table Services. +** +** \par Limits +** This number must be less than 32767. It should be recognized that this parameter +** determines the size of the Critical Table Registry which is maintained in the Critical +** Data Store. An excessively high number will waste Critical Data Store memory. Therefore, +** this number must not exceed the value defined in CFE_ES_CDS_MAX_CRITICAL_TABLES. +*/ +#define CFE_PLATFORM_TBL_MAX_CRITICAL_TABLES 32 + +/** +** \cfetblcfg Maximum Number of Table Handles +** +** \par Description: +** Defines the maximum number of Table Handles. +** +** \par Limits +** This number must be less than 32767. This number must be at least as big as +** the number of tables (#CFE_PLATFORM_TBL_MAX_NUM_TABLES) and should be set higher if tables +** are shared between applications. +*/ +#define CFE_PLATFORM_TBL_MAX_NUM_HANDLES 256 + +/** +** \cfetblcfg Maximum Number of Simultaneous Loads to Support +** +** \par Description: +** Defines the maximum number of single buffered tables that can be +** loaded simultaneously. This number is used to determine the number +** of shared buffers to allocate. +** +** \par Limits +** This number must be less than 32767. An excessively high number will +** degrade system performance and waste memory. A number less than 5 is +** suggested but not required. +*/ +#define CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS 4 + +/** +** \cfetblcfg Maximum Number of Simultaneous Table Validations +** +** \par Description: +** Defines the maximum number of pending validations that +** the Table Services can handle at any one time. When a +** table has a validation function, a validation request is +** made of the application to perform that validation. This +** number determines how many of those requests can be +** outstanding at any one time. +** +** \par Limits +** This number must be less than 32767. An excessively high number will +** degrade system performance and waste memory. A number less than 20 is +** suggested but not required. +*/ +#define CFE_PLATFORM_TBL_MAX_NUM_VALIDATIONS 10 + +/** +** \cfetblcfg Default Filename for a Table Registry Dump +** +** \par Description: +** Defines the file name used to store the table registry when +** no filename is specified in the dump registry command. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_TBL_DEFAULT_REG_DUMP_FILE "/ram/cfe_tbl_reg.log" + +/** +** \cfetblcfg Number of Spacecraft ID's specified for validation +** +** \par Description: +** Defines the number of specified spacecraft ID values that +** are verified during table loads. If the number is zero +** then no validation of the spacecraft ID field in the table +** file header is performed when tables are loaded. Non-zero +** values indicate how many values from the list of spacecraft +** ID's defined below are compared to the spacecraft ID field +** in the table file header. The ELF2CFETBL tool may be used +** to create table files with specified spacecraft ID values. +** +** \par Limits +** This number must be greater than or equal to zero and +** less than or equal to 2. +*/ +#define CFE_PLATFORM_TBL_VALID_SCID_COUNT 0 + +/* macro to construct 32 bit value from 4 chars */ +#define CFE_PLATFORM_TBL_U32FROM4CHARS(_C1, _C2, _C3, _C4) \ + ((uint32)(_C1) << 24 | (uint32)(_C2) << 16 | (uint32)(_C3) << 8 | (uint32)(_C4)) + +/** +** \cfetblcfg Spacecraft ID values used for table load validation +** +** \par Description: +** Defines the spacecraft ID values used for validating the +** spacecraft ID field in the table file header. To be valid, +** the spacecraft ID specified in the table file header must +** match one of the values defined here. +** +** \par Limits +** This value can be any 32 bit unsigned integer. +*/ +#define CFE_PLATFORM_TBL_VALID_SCID_1 (0x42) +#define CFE_PLATFORM_TBL_VALID_SCID_2 (CFE_PLATFORM_TBL_U32FROM4CHARS('a', 'b', 'c', 'd')) + +/** +** \cfetblcfg Number of Processor ID's specified for validation +** +** \par Description: +** Defines the number of specified processor ID values that +** are verified during table loads. If the number is zero +** then no validation of the processor ID field in the table +** file header is performed when tables are loaded. Non-zero +** values indicate how many values from the list of processor +** ID's defined below are compared to the processor ID field +** in the table file header. The ELF2CFETBL tool may be used +** to create table files with specified processor ID values. +** +** \par Limits +** This number must be greater than or equal to zero and +** less than or equal to 4. +*/ +#define CFE_PLATFORM_TBL_VALID_PRID_COUNT 0 + +/** +** \cfetblcfg Processor ID values used for table load validation +** +** \par Description: +** Defines the processor ID values used for validating the +** processor ID field in the table file header. To be valid, +** the spacecraft ID specified in the table file header must +** match one of the values defined here. +** +** \par Limits +** This value can be any 32 bit unsigned integer. +*/ +#define CFE_PLATFORM_TBL_VALID_PRID_1 (1) +#define CFE_PLATFORM_TBL_VALID_PRID_2 (CFE_PLATFORM_TBL_U32FROM4CHARS('a', 'b', 'c', 'd')) +#define CFE_PLATFORM_TBL_VALID_PRID_3 0 +#define CFE_PLATFORM_TBL_VALID_PRID_4 0 + +#endif diff --git a/modules/tbl/config/default_cfe_tbl_mission_cfg.h b/modules/tbl/config/default_cfe_tbl_mission_cfg.h new file mode 100644 index 000000000..9e3c57d21 --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_mission_cfg.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Event Services (CFE_TBL) Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TBL_MISSION_CFG_H +#define CFE_TBL_MISSION_CFG_H + +#include "cfe_tbl_interface_cfg.h" + +#endif diff --git a/modules/tbl/config/default_cfe_tbl_msg.h b/modules/tbl/config/default_cfe_tbl_msg.h new file mode 100644 index 000000000..b6893bdca --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_msg.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_TBL) command and telemetry + * message data types. + * + * This is a compatibility header for the "cfe_tbl_msg.h" file that has + * traditionally provided the message definitions for cFS apps. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TBL_MSG_H +#define CFE_TBL_MSG_H + +#include "cfe_mission_cfg.h" +#include "cfe_tbl_msgdefs.h" +#include "cfe_tbl_msgstruct.h" + +#endif diff --git a/modules/tbl/config/default_cfe_tbl_msgdefs.h b/modules/tbl/config/default_cfe_tbl_msgdefs.h new file mode 100644 index 000000000..ef6899b83 --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_msgdefs.h @@ -0,0 +1,31 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_TBL) command and telemetry + * message constant definitions. + * + * For CFE_TBL this is only the function/command code definitions + */ +#ifndef CFE_TBL_MSGDEFS_H +#define CFE_TBL_MSGDEFS_H + +#include "cfe_tbl_fcncodes.h" + +#endif diff --git a/modules/tbl/config/default_cfe_tbl_msgids.h b/modules/tbl/config/default_cfe_tbl_msgids.h new file mode 100644 index 000000000..58d492c9f --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_msgids.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_TBL) Application Message IDs + */ +#ifndef CFE_TBL_MSGIDS_H +#define CFE_TBL_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_tbl_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_CMD_MSG /* 0x1804 */ +#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_SEND_HK_MSG /* 0x180C */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_HK_TLM_MSG /* 0x0804 */ +#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_REG_TLM_MSG /* 0x080C */ + +#endif diff --git a/modules/tbl/fsw/inc/cfe_tbl_msg.h b/modules/tbl/config/default_cfe_tbl_msgstruct.h similarity index 51% rename from modules/tbl/fsw/inc/cfe_tbl_msg.h rename to modules/tbl/config/default_cfe_tbl_msgstruct.h index f48494194..04f76dbad 100644 --- a/modules/tbl/fsw/inc/cfe_tbl_msg.h +++ b/modules/tbl/config/default_cfe_tbl_msgstruct.h @@ -19,461 +19,25 @@ /** * @file * - * Purpose: cFE Table Services (TBL) SB message definitions header file + * Purpose: + * cFE Executive Services (TBL) Command and Telemetry packet definition file. * - * Author: D.Kobe/Hammers + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide * - * Notes: + * Notes: * */ +#ifndef CFE_TBL_MSGSTRUCT_H +#define CFE_TBL_MSGSTRUCT_H -#ifndef CFE_TBL_MSG_H -#define CFE_TBL_MSG_H - -/* -** Required header files... -*/ -#include "common_types.h" /* Basic data types */ -#include "cfe_msg_hdr.h" /* for header definitions */ -#include "cfe_tbl_extern_typedefs.h" -#include "cfe_time_extern_typedefs.h" - -/*************************************************************************/ - -/* -** Table task command packet command codes -*/ -/** \name Table Services Command Codes */ -/** \{ */ - -/** \cfetblcmd Table No-Op -** -** \par Description -** This command performs no other function than to increment the -** command execution counter. The command may be used to verify -** general aliveness of the Table Services task. -** -** \cfecmdmnemonic \TBL_NOOP -** -** \par Command Structure -** #CFE_TBL_NoopCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with the -** following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will -** increment -** - The #CFE_TBL_NOOP_INF_EID informational event message will -** be generated -** -** \par Error Conditions -** There are no error conditions for this command. If the Table -** Services receives the command, the event is sent (although it -** may be filtered by EVS) and the counter is incremented -** unconditionally. -** -** \par Criticality -** None -** -** \sa -*/ -#define CFE_TBL_NOOP_CC 0 - -/** \cfetblcmd Table Reset Counters -** -** \par Description -** This command resets the following counters within the Table -** Services housekeeping telemetry: -** - Command Execution Counter (\TBL_CMDPC) -** - Command Error Counter (\TBL_CMDEC) -** - Successful Table Validations Counter (\TBL_VALSUCCESSCTR) -** - Failed Table Validations Counter (\TBL_VALFAILEDCTR) -** - Number of Table Validations Requested (\TBL_VALREQCTR) -** - Number of completed table validations (\TBL_VALCOMPLTDCTR) -** -** \cfecmdmnemonic \TBL_RESETCTRS -** -** \par Command Structure -** #CFE_TBL_ResetCountersCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with -** the following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will -** be reset to 0 -** - The #CFE_TBL_RESET_INF_EID debug event message will be -** generated -** -** \par Error Conditions -** There are no error conditions for this command. If the Table -** Services receives the command, the event is sent (although it -** may be filtered by EVS) and the counter is incremented -** unconditionally. -** -** \par Criticality -** This command is not inherently dangerous. However, it is -** possible for ground systems and on-board safing procedures -** to be designed such that they react to changes in the counter -** values that are reset by this command. -** -** \sa -*/ -#define CFE_TBL_RESET_COUNTERS_CC 1 - -/** \cfetblcmd Load Table -** -** \par Description -** This command loads the contents of the specified file into -** an inactive buffer for the table specified within the file. -** -** \cfecmdmnemonic \TBL_LOAD -** -** \par Command Structure -** #CFE_TBL_LoadCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with -** the following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will -** increment -** - The #CFE_TBL_FILE_LOADED_INF_EID informational event message -** will be generated -** -** \par Error Conditions -** This command can fail for the following reasons: -** - Table name found in table image file's table header is not found -** in table registry (ie - The table associated with the table image -** in the file has not been registered by an application). -** - The table image file has an invalid or incorrect size. The size of -** the image file must match the size field within in the header, and -** must also match the expected size of the table indicated in the registry. -** - No working buffers are available for the load. This would indicate -** that too many single-buffered table loads are in progress at the same -** time. -** - An attempt is being made to load an uninitialized table with a file -** containing only a partial table image. -** - The table image file was unable to be opened. Either the file does -** not exist at the specified location, the filename is in error, or -** the file system has been corrupted. -** -** Evidence of failure may be found in the following telemetry: -** - \b \c \TBL_CMDEC - command error counter will increment -** - Command specific error event messages are issued for all error cases -** -** \par Criticality -** This command is not inherently dangerous. It is performing the first -** step of loading a table and can be aborted (using the Abort Table Load -** command described below) without affecting the contents of the active -** table image. -** -** \sa #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC -*/ -#define CFE_TBL_LOAD_CC 2 - -/** \cfetblcmd Dump Table -** -** \par Description -** This command will cause the Table Services to put the contents -** of the specified table buffer into the command specified file. -** -** \cfecmdmnemonic \TBL_DUMP -** -** \par Command Structure -** #CFE_TBL_DumpCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with the -** following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will -** increment -** - Either the #CFE_TBL_OVERWRITE_DUMP_INF_EID OR the -** #CFE_TBL_WRITE_DUMP_INF_EID informational event message will -** be generated -** -** \par Error Conditions -** This command may fail for the following reason(s): -** - A single buffered table's inactive buffer was requested to be -** dumped and no such buffer is currently allocated. -** - Error occurred during write operation to file. Possible causes -** might be insufficient space in the file system or the filename -** or file path is improperly specified. -** - The specified table name was not found in the table registry. -** -** Evidence of failure may be found in the following telemetry: -** - \b \c \TBL_CMDEC - command error counter will increment -** - A command specific error event message is issued for all error -** cases -** -** \par Criticality -** This command is not inherently dangerous. It will create a new -** file in the file system and could, if performed repeatedly without -** sufficient file management by the operator, fill the file system. -** -** \sa #CFE_TBL_LOAD_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC -*/ -#define CFE_TBL_DUMP_CC 3 - -/** \cfetblcmd Validate Table -** -** \par Description -** This command will cause Table Services to calculate the Data Integrity -** Value for the specified table and to notify the owning application that -** the table's validation function should be executed. The results of both -** the Data Integrity Value computation and the validation function are -** reported in Table Services Housekeeping Telemetry. -** -** \cfecmdmnemonic \TBL_VALIDATE -** -** \par Command Structure -** #CFE_TBL_ValidateCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with the following -** telemetry: -** - \b \c \TBL_CMDPC - command execution counter will increment -** - \b \c \TBL_VALREQCTR - table validation request counter will increment -** - \b \c \TBL_LASTVALCRC - calculated data integrity value will be updated -** - The #CFE_TBL_VAL_REQ_MADE_INF_EID debug event message (indicating the -** application is being notified of a validation request) -** -** If the specified table has an associated validation function, then the -** following telemetry will also change: -** - Either \b \c \TBL_VALSUCCESSCTR OR \b \c \TBL_VALFAILEDCTR will -** increment -** - \b \c \TBL_VALCOMPLTDCTR - table validations performed counter will -** increment -** - \b \c \TBL_LASTVALS - table validation function return status will -** update -** - The #CFE_TBL_VALIDATION_INF_EID informational event message (indicating the -** validation function return status) will be generated -** -** \par Error Conditions -** This command may fail for the following reason(s): -** - A single buffered table's inactive buffer was requested to be validated -** and no such buffer is currently allocated. -** - Too many validations have been requested simultaneously. The operator -** must wait for one or more applications to perform their table validation -** functions before trying again. -** - The specified table name was not found in the table registry. -** -** Evidence of failure may be found in the following telemetry: -** - \b \c \TBL_CMDEC - command error counter will increment -** - Command specific error event message are issued for all error cases -** -** \par Criticality -** The success or failure of a table validation does not have any immediate -** impact on table contents. The results are sent to the operator in telemetry -** and the operator must determine whether the results are acceptable and send a -** command to activate the validated table image. -** -** \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_ACTIVATE_CC, #CFE_TBL_ABORT_LOAD_CC -*/ -#define CFE_TBL_VALIDATE_CC 4 - -/** \cfetblcmd Activate Table -** -** \par Description -** This command will cause Table Services to notify a table's owner -** that an update is pending. The owning application will then update -** the contents of the active table buffer with the contents of the -** associated inactive table buffer at a time of their convenience. -** -** \cfecmdmnemonic \TBL_ACTIVATE -** -** \par Command Structure -** #CFE_TBL_ActivateCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with the -** following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will -** increment -** - The #CFE_TBL_UPDATE_SUCCESS_INF_EID informational event message -** will be generated -** -** \par Error Conditions -** This command may fail for the following reason(s): -** - The specified table name was not found in the table registry. -** - The table was registered as a "dump only" type and thus cannot be activated -** - The table buffer has not been validated. -** -** Evidence of failure may be found in the following telemetry: -** - \b \c \TBL_CMDEC - command error counter will increment -** - Command specific error event message are issued for all -** error cases -** -** \par Criticality -** This command will cause the contents of the specified table to be -** updated with the contents in the inactive table buffer. -** -** \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ABORT_LOAD_CC -*/ -#define CFE_TBL_ACTIVATE_CC 5 - -/** \cfetblcmd Dump Table Registry -** -** \par Description -** This command will cause Table Services to write some of the -** contents of the Table Registry to the command specified file. -** This allows the operator to see the current state and configuration -** of all tables that have been registered with the cFE. -** -** \cfecmdmnemonic \TBL_WRITEREG2FILE -** -** \par Command Structure -** #CFE_TBL_DumpRegistryCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with the -** following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will -** increment -** - The generation of either #CFE_TBL_OVERWRITE_REG_DUMP_INF_EID -** or #CFE_TBL_WRITE_REG_DUMP_INF_EID debug event messages -** - The specified file should appear (or be updated) at the -** specified location in the file system -** -** \par Error Conditions -** This command may fail for the following reason(s): -** - A table registry dump is already in progress, not yet completed -** - The specified DumpFilename could not be parsed -** - Error occurred during write operation to file. Possible -** causes might be insufficient space in the file system -** or the filename or file path is improperly specified. -** -** Evidence of failure may be found in the following telemetry: -** - \b \c \TBL_CMDEC - command error counter will increment -** - An Error specific event message -** -** \par Criticality -** This command is not inherently dangerous. It will create a new -** file in the file system and could, if performed repeatedly without -** sufficient file management by the operator, fill the file system. -** -** \sa #CFE_TBL_SEND_REGISTRY_CC -*/ -#define CFE_TBL_DUMP_REGISTRY_CC 6 - -/** \cfetblcmd Telemeter One Table Registry Entry -** -** \par Description -** This command will cause Table Services to telemeter the contents -** of the Table Registry for the command specified table. -** -** \cfecmdmnemonic \TBL_TLMREG -** -** \par Command Structure -** #CFE_TBL_SendRegistryCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with the -** following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will increment -** - Receipt of a Table Registry Info Packet (see #CFE_TBL_TableRegistryTlm_t) -** - The #CFE_TBL_TLM_REG_CMD_INF_EID debug event message will -** be generated -** -** \par Error Conditions -** This command may fail for the following reason(s): -** - The specified table name was not found in the table registry. -** -** Evidence of failure may be found in the following telemetry: -** - \b \c \TBL_CMDEC - command error counter will increment -** - Error specific event message -** -** \par Criticality -** This command is not inherently dangerous. It will generate -** additional telemetry. -** -** \sa #CFE_TBL_DUMP_REGISTRY_CC -*/ -#define CFE_TBL_SEND_REGISTRY_CC 7 - -/** \cfetblcmd Delete Critical Table from Critical Data Store -** -** \par Description -** This command will delete the Critical Data Store (CDS) associated -** with the specified Critical Table. Note that any table still -** present in the Table Registry is unable to be deleted from -** the Critical Data Store. All Applications that are accessing -** the critical table must release and unregister their access -** before the CDS can be deleted. -** -** \cfecmdmnemonic \TBL_DELETECDS -** -** \par Command Structure -** #CFE_TBL_DeleteCDSCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with the -** following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will -** increment -** - The #CFE_TBL_CDS_DELETED_INFO_EID informational event message -** will be generated -** -** \par Error Conditions -** This command may fail for the following reason(s): -** - The specified table name was not found in the critical data -** store registry -** - The specified table name WAS found in the table registry (all -** registrations/sharing of the table must be unregistered before -** the table's CDS can be deleted) -** - The table's owning application is still active -** -** Evidence of failure may be found in the following telemetry: -** - \b \c \TBL_CMDEC - command error counter will increment -** - Error specific event message -** -** \par Criticality -** This command will cause the loss of the specified table's contents -** before the owning Application was terminated. -** -** \sa #CFE_ES_DUMP_CDS_REGISTRY_CC, #CFE_ES_DELETE_CDS_CC -*/ -#define CFE_TBL_DELETE_CDS_CC 8 - -/** \cfetblcmd Abort Table Load -** -** \par Description -** This command will cause Table Services to discard the contents of -** a table buffer that was previously loaded with the data in a file -** as specified by a Table Load command. For single buffered tables, -** the allocated shared working buffer is freed and becomes available -** for other Table Load commands. -** -** \cfecmdmnemonic \TBL_LOADABORT -** -** \par Command Structure -** #CFE_TBL_AbortLoadCmd_t -** -** \par Command Verification -** Successful execution of this command may be verified with the -** following telemetry: -** - \b \c \TBL_CMDPC - command execution counter will increment -** - The #CFE_TBL_LOAD_ABORT_INF_EID informational event message -** is generated -** - If the load was aborted for a single buffered table, the -** \b \c \TBL_NUMFREESHRBUF telemetry point should increment -** -** \par Error Conditions -** This command may fail for the following reason(s): -** - The specified table name was not found in the table registry. -** - The specified table did not have a load in progress to be aborted. -** -** Evidence of failure may be found in the following telemetry: -** - \b \c \TBL_CMDEC - command error counter will increment -** - Error specific event message -** -** \par Criticality -** This command will cause the loss of data put into an inactive table buffer. -** -** \sa #CFE_TBL_LOAD_CC, #CFE_TBL_DUMP_CC, #CFE_TBL_VALIDATE_CC, #CFE_TBL_ACTIVATE_CC -*/ -#define CFE_TBL_ABORT_LOAD_CC 9 -/** \} */ - -/*************************************************************************/ +/************************************************************************ + * Includes + ************************************************************************/ +#include "cfe_mission_cfg.h" +#include "cfe_tbl_msgdefs.h" +#include "cfe_msg_hdr.h" /********************************/ /* Command Message Data Formats */ @@ -834,4 +398,4 @@ typedef struct CFE_TBL_TableRegistryTlm CFE_TBL_TblRegPacket_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TBL_TableRegistryTlm_t; -#endif /* CFE_TBL_MSG_H */ +#endif diff --git a/modules/tbl/config/default_cfe_tbl_platform_cfg.h b/modules/tbl/config/default_cfe_tbl_platform_cfg.h new file mode 100644 index 000000000..5bcff58d7 --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_platform_cfg.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Table Services (CFE_TBL) Application Platform Configuration Header File + * + * This is a compatibility header for the "platform_cfg.h" file that has + * traditionally provided both public and private config definitions + * for each CFS app. + * + * These definitions are now provided in two separate files, one for + * the public/mission scope and one for internal scope. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TBL_PLATFORM_CFG_H +#define CFE_TBL_PLATFORM_CFG_H + +#include "cfe_tbl_mission_cfg.h" +#include "cfe_tbl_internal_cfg.h" + +#endif diff --git a/modules/tbl/config/default_cfe_tbl_topicids.h b/modules/tbl/config/default_cfe_tbl_topicids.h new file mode 100644 index 000000000..207cff719 --- /dev/null +++ b/modules/tbl/config/default_cfe_tbl_topicids.h @@ -0,0 +1,50 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Table Services (CFE_TBL) Application Topic IDs + */ +#ifndef CFE_TBL_TOPICIDS_H +#define CFE_TBL_TOPICIDS_H + +/** +** \cfemissioncfg cFE Portable Message Numbers for Commands +** +** \par Description: +** Portable message numbers for the cFE command messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TBL_CMD_MSG 4 +#define CFE_MISSION_TBL_SEND_HK_MSG 12 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Telemetry +** +** \par Description: +** Portable message numbers for the cFE telemetry messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TBL_HK_TLM_MSG 4 +#define CFE_MISSION_TBL_REG_TLM_MSG 12 + +#endif diff --git a/modules/tbl/fsw/inc/cfe_tbl_events.h b/modules/tbl/fsw/inc/cfe_tbl_eventids.h similarity index 100% rename from modules/tbl/fsw/inc/cfe_tbl_events.h rename to modules/tbl/fsw/inc/cfe_tbl_eventids.h diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.h b/modules/tbl/fsw/src/cfe_tbl_internal.h index 6af1def29..556394ffa 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.h +++ b/modules/tbl/fsw/src/cfe_tbl_internal.h @@ -39,7 +39,7 @@ #include "cfe_perfids.h" #include "cfe_tbl_task.h" #include "cfe_tbl_task_cmds.h" -#include "cfe_tbl_events.h" +#include "cfe_tbl_eventids.h" #include "cfe_tbl_msg.h" /********************* Macro and Constant Type Definitions ***************************/ diff --git a/modules/tbl/fsw/src/cfe_tbl_module_all.h b/modules/tbl/fsw/src/cfe_tbl_module_all.h index a4b4a304e..a9f87a659 100644 --- a/modules/tbl/fsw/src/cfe_tbl_module_all.h +++ b/modules/tbl/fsw/src/cfe_tbl_module_all.h @@ -39,7 +39,7 @@ #include "cfe_tbl_core_internal.h" -#include "cfe_tbl_events.h" +#include "cfe_tbl_eventids.h" #include "cfe_tbl_msg.h" #include "cfe_tbl_internal.h" #include "cfe_tbl_task.h" diff --git a/modules/tbl/mission_build.cmake b/modules/tbl/mission_build.cmake new file mode 100644 index 000000000..d968d5f0c --- /dev/null +++ b/modules/tbl/mission_build.cmake @@ -0,0 +1,37 @@ +########################################################### +# +# TBL Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the TBL configuration +set(TBL_MISSION_CONFIG_FILE_LIST + cfe_tbl_mission_cfg.h + cfe_tbl_interface_cfg.h + cfe_tbl_extern_typedefs.h + cfe_tbl_fcncodes.h + cfe_tbl_msgdefs.h + cfe_tbl_msg.h + cfe_tbl_msgstruct.h + cfe_tbl_topicids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(TBL_CFGFILE ${TBL_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${TBL_CFGFILE}" NAME_WE) + if (DEFINED TBL_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${TBL_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${TBL_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach() From d5e2d89d6d5f4604cd2fe63e357859a01306ad0f Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 16:28:00 -0400 Subject: [PATCH 161/200] Fix #2320, reorganize TIME header files Organize TIME header file contents according to the convention --- modules/time/CMakeLists.txt | 2 +- modules/time/arch_build.cmake | 32 ++ .../default_cfe_time_extern_typedefs.h} | 12 - .../default_cfe_time_fcncodes.h} | 446 +----------------- .../config/default_cfe_time_interface_cfg.h | 210 +++++++++ .../config/default_cfe_time_internal_cfg.h | 243 ++++++++++ .../config/default_cfe_time_mission_cfg.h | 36 ++ modules/time/config/default_cfe_time_msg.h | 38 ++ .../time/config/default_cfe_time_msgdefs.h | 50 ++ modules/time/config/default_cfe_time_msgids.h | 49 ++ .../time/config/default_cfe_time_msgstruct.h | 441 +++++++++++++++++ .../config/default_cfe_time_platform_cfg.h | 41 ++ .../time/config/default_cfe_time_topicids.h | 64 +++ ...{cfe_time_events.h => cfe_time_eventids.h} | 0 modules/time/fsw/src/cfe_time_module_all.h | 2 +- modules/time/mission_build.cmake | 37 ++ 16 files changed, 1250 insertions(+), 453 deletions(-) create mode 100644 modules/time/arch_build.cmake rename modules/{core_api/fsw/inc/cfe_time_extern_typedefs.h => time/config/default_cfe_time_extern_typedefs.h} (96%) rename modules/time/{fsw/inc/cfe_time_msg.h => config/default_cfe_time_fcncodes.h} (64%) create mode 100644 modules/time/config/default_cfe_time_interface_cfg.h create mode 100644 modules/time/config/default_cfe_time_internal_cfg.h create mode 100644 modules/time/config/default_cfe_time_mission_cfg.h create mode 100644 modules/time/config/default_cfe_time_msg.h create mode 100644 modules/time/config/default_cfe_time_msgdefs.h create mode 100644 modules/time/config/default_cfe_time_msgids.h create mode 100644 modules/time/config/default_cfe_time_msgstruct.h create mode 100644 modules/time/config/default_cfe_time_platform_cfg.h create mode 100644 modules/time/config/default_cfe_time_topicids.h rename modules/time/fsw/inc/{cfe_time_events.h => cfe_time_eventids.h} (100%) create mode 100644 modules/time/mission_build.cmake diff --git a/modules/time/CMakeLists.txt b/modules/time/CMakeLists.txt index 7c61c9236..d4b7180f9 100644 --- a/modules/time/CMakeLists.txt +++ b/modules/time/CMakeLists.txt @@ -25,6 +25,6 @@ if(ENABLE_UNIT_TESTS) endif(ENABLE_UNIT_TESTS) cfs_app_check_intf(${DEP} - cfe_time_events.h + cfe_time_eventids.h cfe_time_msg.h ) diff --git a/modules/time/arch_build.cmake b/modules/time/arch_build.cmake new file mode 100644 index 000000000..534ca265f --- /dev/null +++ b/modules/time/arch_build.cmake @@ -0,0 +1,32 @@ +########################################################### +# +# TIME Core Module platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the TIME configuration +set(TIME_PLATFORM_CONFIG_FILE_LIST + cfe_time_internal_cfg.h + cfe_time_msgids.h + cfe_time_platform_cfg.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(TIME_CFGFILE ${TIME_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${TIME_CFGFILE}" NAME_WE) + if (DEFINED TIME_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE "${TIME_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TIME_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${TIME_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h b/modules/time/config/default_cfe_time_extern_typedefs.h similarity index 96% rename from modules/core_api/fsw/inc/cfe_time_extern_typedefs.h rename to modules/time/config/default_cfe_time_extern_typedefs.h index 8b4d09661..455c1f8af 100644 --- a/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h +++ b/modules/time/config/default_cfe_time_extern_typedefs.h @@ -25,16 +25,6 @@ #ifndef CFE_TIME_EXTERN_TYPEDEFS_H #define CFE_TIME_EXTERN_TYPEDEFS_H -/* This header may be generated from an EDS file, - * tools are available and the feature is enabled */ -#ifdef CFE_EDS_ENABLED_BUILD - -/* Use the EDS generated version of these types */ -#include "cfe_time_eds_typedefs.h" - -#else -/* Use the local definitions of these types */ - #include "common_types.h" /** @@ -289,6 +279,4 @@ enum CFE_TIME_SetState */ typedef uint8 CFE_TIME_SetState_Enum_t; -#endif /* CFE_EDS_ENABLED_BUILD */ - #endif /* CFE_TIME_EXTERN_TYPEDEFS_H */ diff --git a/modules/time/fsw/inc/cfe_time_msg.h b/modules/time/config/default_cfe_time_fcncodes.h similarity index 64% rename from modules/time/fsw/inc/cfe_time_msg.h rename to modules/time/config/default_cfe_time_fcncodes.h index 216821790..6fe06e1f8 100644 --- a/modules/time/fsw/inc/cfe_time_msg.h +++ b/modules/time/config/default_cfe_time_fcncodes.h @@ -18,26 +18,15 @@ /** * @file + * Specification for the CFE Time Services (CFE_TIME) command function codes * - * Purpose: cFE Time Services (TIME) SB message definitions header file - * - * Author: S.Walling/Microtel - * - * Notes: - * + * @note + * This file should be strictly limited to the command/function code (CC) + * macro definitions. Other definitions such as enums, typedefs, or other + * macros should be placed in the msgdefs.h or msg.h files. */ - -#ifndef CFE_TIME_MSG_H -#define CFE_TIME_MSG_H - -/* -** Required header files... -*/ -#include "common_types.h" /* Basic data types */ -#include "cfe_msg_hdr.h" /* for header definitions */ -#include "cfe_time_extern_typedefs.h" - -/*************************************************************************/ +#ifndef CFE_TIME_FCNCODES_H +#define CFE_TIME_FCNCODES_H /* ** Time task command packet command codes... @@ -702,425 +691,4 @@ #define CFE_TIME_SET_SIGNAL_CC 15 /* set clock signal (pri vs red) */ /** \} */ -/** \defgroup CFETIMEClkStates cFE Clock State Flag Defines - * \{ - */ -#define CFE_TIME_FLAG_CLKSET 0x8000 /**< \brief The spacecraft time has been set */ -#define CFE_TIME_FLAG_FLYING 0x4000 /**< \brief This instance of Time Services is flywheeling */ -#define CFE_TIME_FLAG_SRCINT 0x2000 /**< \brief The clock source is set to "internal" */ -#define CFE_TIME_FLAG_SIGPRI 0x1000 /**< \brief The clock signal is set to "primary" */ -#define CFE_TIME_FLAG_SRVFLY 0x0800 /**< \brief The Time Server is in flywheel mode */ -#define CFE_TIME_FLAG_CMDFLY 0x0400 /**< \brief This instance of Time Services was commanded into flywheel mode */ -#define CFE_TIME_FLAG_ADDADJ 0x0200 /**< \brief One time STCF Adjustment is to be done in positive direction */ -#define CFE_TIME_FLAG_ADD1HZ 0x0100 /**< \brief 1 Hz STCF Adjustment is to be done in a positive direction */ -#define CFE_TIME_FLAG_ADDTCL 0x0080 /**< \brief Time Client Latency is applied in a positive direction */ -#define CFE_TIME_FLAG_SERVER 0x0040 /**< \brief This instance of Time Services is a Time Server */ -#define CFE_TIME_FLAG_GDTONE 0x0020 /**< \brief The tone received is good compared to the last tone received */ -#define CFE_TIME_FLAG_REFERR \ - 0x0010 /**< \brief GetReference read error, will be set if unable to get a consistent ref value */ -#define CFE_TIME_FLAG_UNUSED 0x000F /**< \brief Reserved flags - should be zero */ -/** \} */ - -/*************************************************************************/ - -/** - * \brief Generic no argument command - */ -typedef struct CFE_TIME_NoArgsCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ -} CFE_TIME_NoArgsCmd_t; - -/* - * A separate typedef for each of the commands that share this definition - * This follows the convention for command handler prototypes and allows - * each one to independently evolve as necessary. - */ -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_NoopCmd_t; -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_ResetCountersCmd_t; -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_SendDiagnosticCmd_t; -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_1HzCmd_t; -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_ToneSignalCmd_t; -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_FakeToneCmd_t; -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_SendHkCmd_t; - -/** - * \brief Set leap seconds command payload - */ -typedef struct CFE_TIME_LeapsCmd_Payload -{ - int16 LeapSeconds; -} CFE_TIME_LeapsCmd_Payload_t; - -/** - * \brief Set leap seconds command - */ -typedef struct CFE_TIME_SetLeapSecondsCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_TIME_LeapsCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_TIME_SetLeapSecondsCmd_t; - -/** - * \brief Set clock state command payload - */ -typedef struct CFE_TIME_StateCmd_Payload -{ - CFE_TIME_ClockState_Enum_t ClockState; /**< \brief #CFE_TIME_ClockState_INVALID=Spacecraft time has - not been accurately set, #CFE_TIME_ClockState_VALID=Spacecraft clock - has been accurately set, #CFE_TIME_ClockState_FLYWHEEL=Force into - FLYWHEEL mode */ - /**< Selects the current clock state */ -} CFE_TIME_StateCmd_Payload_t; - -/** - * \brief Set clock state command - */ -typedef struct CFE_TIME_SetStateCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_TIME_StateCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_TIME_SetStateCmd_t; - -/** - * \brief Set time data source command payload - */ -typedef struct CFE_TIME_SourceCmd_Payload -{ - int16 TimeSource; /**< \brief #CFE_TIME_SourceSelect_INTERNAL=Internal Source, - #CFE_TIME_SourceSelect_EXTERNAL=External Source */ - /**< Selects either the "Internal" and "External" clock source */ -} CFE_TIME_SourceCmd_Payload_t; - -/** - * \brief Set time data source command - */ -typedef struct CFE_TIME_SetSourceCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_TIME_SourceCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_TIME_SetSourceCmd_t; - -/** - * \brief Set tone signal source command payload - */ -typedef struct CFE_TIME_SignalCmd_Payload -{ - int16 ToneSource; /**< \brief #CFE_TIME_ToneSignalSelect_PRIMARY=Primary Source, - #CFE_TIME_ToneSignalSelect_REDUNDANT=Redundant Source */ - /**< Selects either the "Primary" or "Redundant" tone signal source */ -} CFE_TIME_SignalCmd_Payload_t; - -/** - * \brief Set tone signal source command - */ -typedef struct CFE_TIME_SetSignalCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_TIME_SignalCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_TIME_SetSignalCmd_t; - -/** - * \brief Generic seconds, microseconds command payload - */ -typedef struct CFE_TIME_TimeCmd_Payload -{ - uint32 Seconds; - uint32 MicroSeconds; -} CFE_TIME_TimeCmd_Payload_t; - -/** - * \brief Generic seconds, microseconds argument command - */ -typedef struct CFE_TIME_TimeCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_TIME_TimeCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_TIME_TimeCmd_t; - -/* - * A separate typedef for each of the commands that share this definition - * This follows the convention for command handler prototypes and allows - * each one to independently evolve as necessary. - */ -typedef CFE_TIME_TimeCmd_t CFE_TIME_AddDelayCmd_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SubDelayCmd_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SetMETCmd_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SetSTCFCmd_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_AddAdjustCmd_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SubAdjustCmd_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SetTimeCmd_t; - -/** - * \brief Generic seconds, subseconds command payload - */ -typedef struct CFE_TIME_OneHzAdjustmentCmd_Payload -{ - uint32 Seconds; - uint32 Subseconds; -} CFE_TIME_OneHzAdjustmentCmd_Payload_t; - -/** - * \brief Generic seconds, subseconds adjustment command - */ -typedef struct CFE_TIME_OneHzAdjustmentCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_TIME_OneHzAdjustmentCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_TIME_OneHzAdjustmentCmd_t; - -/* - * A separate typedef for each of the commands that share this definition - * This follows the convention for command handler prototypes and allows - * each one to independently evolve as necessary. - */ -typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Add1HZAdjustmentCmd_t; -typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Sub1HZAdjustmentCmd_t; - -/** - * \brief Time at tone data command payload - */ -typedef struct CFE_TIME_ToneDataCmd_Payload -{ - CFE_TIME_SysTime_t AtToneMET; /**< \brief MET at time of tone */ - CFE_TIME_SysTime_t AtToneSTCF; /**< \brief STCF at time of tone */ - int16 AtToneLeapSeconds; /**< \brief Leap Seconds at time of tone */ - CFE_TIME_ClockState_Enum_t AtToneState; /**< \brief Clock state at time of tone */ -} CFE_TIME_ToneDataCmd_Payload_t; - -/** - * \brief Time at tone data command - */ -typedef struct CFE_TIME_ToneDataCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_TIME_ToneDataCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_TIME_ToneDataCmd_t; - -/*************************************************************************/ - -/** -** \cfetimetlm Time Services Housekeeping Packet -**/ -typedef struct CFE_TIME_HousekeepingTlm_Payload -{ - /* - ** Task command interface counters... - */ - uint8 CommandCounter; /**< \cfetlmmnemonic \TIME_CMDPC - \brief Time Command Execution Counter */ - uint8 CommandErrorCounter; /**< \cfetlmmnemonic \TIME_CMDEC - \brief Time Command Error Counter */ - - /* - ** Clock state flags and "as calculated" clock state... - */ - uint16 ClockStateFlags; /**< \cfetlmmnemonic \TIME_STATEFLG - \brief State Flags */ - CFE_TIME_ClockState_Enum_t ClockStateAPI; /**< \cfetlmmnemonic - \TIME_APISTATE \brief API State */ - - /* - ** Leap Seconds... - */ - int16 LeapSeconds; /**< \cfetlmmnemonic \TIME_LEAPSECS - \brief Current Leaps Seconds */ - - /* - ** Current MET and STCF time values... - */ - uint32 SecondsMET; /**< \cfetlmmnemonic \TIME_METSECS - \brief Current MET (seconds) */ - uint32 SubsecsMET; /**< \cfetlmmnemonic \TIME_METSUBSECS - \brief Current MET (sub-seconds) */ - - uint32 SecondsSTCF; /**< \cfetlmmnemonic \TIME_STCFSECS - \brief Current STCF (seconds) */ - uint32 SubsecsSTCF; /**< \cfetlmmnemonic \TIME_STCFSUBSECS - \brief Current STCF (sub-seconds) */ - -/* -** 1Hz STCF adjustment values (server only)... -*/ -#if (CFE_PLATFORM_TIME_CFG_SERVER == true) - uint32 Seconds1HzAdj; /**< \cfetlmmnemonic \TIME_1HZADJSECS - \brief Current 1 Hz SCTF adjustment (seconds) */ - uint32 Subsecs1HzAdj; /**< \cfetlmmnemonic \TIME_1HZADJSSECS - \brief Current 1 Hz SCTF adjustment (sub-seconds) */ -#endif - -/* -** Time at tone delay values (client only)... -*/ -#if (CFE_PLATFORM_TIME_CFG_CLIENT == true) - uint32 SecondsDelay; /**< \cfetlmmnemonic \TIME_1HZDLYSECS - \brief Current 1 Hz SCTF Delay (seconds) */ - uint32 SubsecsDelay; /**< \cfetlmmnemonic \TIME_1HZDLYSSECS - \brief Current 1 Hz SCTF Delay (sub-seconds) */ #endif -} CFE_TIME_HousekeepingTlm_Payload_t; - -typedef struct CFE_TIME_HousekeepingTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_TIME_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_TIME_HousekeepingTlm_t; - -/*************************************************************************/ - -/** -** \cfetimetlm Time Services Diagnostics Packet -**/ -typedef struct CFE_TIME_DiagnosticTlm_Payload -{ - /* - ** Data values used to compute time (in reference to "tone")... - */ - CFE_TIME_SysTime_t AtToneMET; /**< \cfetlmmnemonic \TIME_TMETS - \brief MET at time of tone */ - CFE_TIME_SysTime_t AtToneSTCF; /**< \cfetlmmnemonic \TIME_STCFS - \brief STCF at time of tone */ - CFE_TIME_SysTime_t AtToneDelay; /**< \cfetlmmnemonic \TIME_LATENTS - \brief Adjustment for slow tone detection */ - CFE_TIME_SysTime_t AtToneLatch; /**< \cfetlmmnemonic \TIME_TVALIDS - \brief Local clock latched at time of tone */ - - int16 AtToneLeapSeconds; /**< \cfetlmmnemonic \TIME_LEAPS - \brief Leap Seconds at time of tone */ - CFE_TIME_ClockState_Enum_t ClockStateAPI; /**< \cfetlmmnemonic \TIME_APISTATE - \brief Clock state as per API */ - - /* - ** Data values that reflect the time (right now)... - */ - CFE_TIME_SysTime_t TimeSinceTone; /**< \cfetlmmnemonic \TIME_ELAPSEDS - \brief Time elapsed since the tone */ - CFE_TIME_SysTime_t CurrentLatch; /**< \cfetlmmnemonic \TIME_LOCALS - \brief Local clock latched just "now" */ - CFE_TIME_SysTime_t CurrentMET; /**< \cfetlmmnemonic \TIME_METS - \brief MET at this instant */ - CFE_TIME_SysTime_t CurrentTAI; /**< \cfetlmmnemonic \TIME_TAIS - \brief TAI at this instant */ - CFE_TIME_SysTime_t CurrentUTC; /**< \cfetlmmnemonic \TIME_UTCS - \brief UTC at this instant */ - - /* - ** Data values used to define the current clock state... - */ - int16 ClockSetState; /**< \cfetlmmnemonic \TIME_VALID - \brief Time has been "set" */ - int16 ClockFlyState; /**< \cfetlmmnemonic \TIME_FLYWHEEL - \brief Current fly-wheel state */ - int16 ClockSource; /**< \cfetlmmnemonic \TIME_SOURCE - \brief Internal vs external, etc. */ - int16 ClockSignal; /**< \cfetlmmnemonic \TIME_SIGNAL - \brief Primary vs redundant, etc. */ - int16 ServerFlyState; /**< \cfetlmmnemonic \TIME_SRVFLY - \brief Used by clients only */ - int16 Forced2Fly; /**< \cfetlmmnemonic \TIME_CMD2FLY - \brief Commanded into fly-wheel */ - - /* - ** Clock state flags... - */ - uint16 ClockStateFlags; /**< \cfetlmmnemonic \TIME_STATEFLAGS - \brief Clock State Flags */ - - /* - ** STCF adjustment direction values... - */ - int16 OneTimeDirection; /**< \cfetlmmnemonic \TIME_ADJUSTDIR - \brief One time STCF adjustment direction (Add = 1, Sub = 2) */ - int16 OneHzDirection; /**< \cfetlmmnemonic \TIME_1HZADJDIR - \brief 1Hz STCF adjustment direction */ - int16 DelayDirection; /**< \cfetlmmnemonic \TIME_LATENTDIR - \brief Client latency adjustment direction */ - - /* - ** STCF adjustment values... - */ - CFE_TIME_SysTime_t OneTimeAdjust; /**< \cfetlmmnemonic \TIME_ADJUSTS - \brief Previous one-time STCF adjustment */ - CFE_TIME_SysTime_t OneHzAdjust; /**< \cfetlmmnemonic \TIME_1HZADJS - \brief Current 1Hz STCF adjustment */ - - /* - ** Most recent local clock latch values... - */ - CFE_TIME_SysTime_t ToneSignalLatch; /**< \cfetlmmnemonic \TIME_TTS - \brief Local Clock latched at most recent tone signal */ - CFE_TIME_SysTime_t ToneDataLatch; /**< \cfetlmmnemonic \TIME_TDS - \brief Local Clock latched at arrival of tone data */ - - /* - ** Miscellaneous counters (subject to reset command)... - */ - uint32 ToneMatchCounter; /**< \cfetlmmnemonic \TIME_VERIFYCNT - \brief Tone signal / data verification count */ - uint32 ToneMatchErrorCounter; /**< \cfetlmmnemonic \TIME_VERIFYER - \brief Tone signal / data verification error count */ - uint32 ToneSignalCounter; /**< \cfetlmmnemonic \TIME_TSDETCNT - \brief Tone signal detected SB message count */ - uint32 ToneDataCounter; /**< \cfetlmmnemonic \TIME_TATTCNT - \brief Time at the tone data SB message count */ - uint32 ToneIntCounter; /**< \cfetlmmnemonic \TIME_TSISRCNT - \brief Tone signal ISR execution count */ - uint32 ToneIntErrorCounter; /**< \cfetlmmnemonic \TIME_TSISRERR - \brief Tone signal ISR error count */ - uint32 ToneTaskCounter; /**< \cfetlmmnemonic \TIME_TSTASKCNT - \brief Tone task execution count */ - uint32 VersionCounter; /**< \cfetlmmnemonic \TIME_VERSIONCNT - \brief Count of mods to time at tone reference data (version) */ - uint32 LocalIntCounter; /**< \cfetlmmnemonic \TIME_1HZISRCNT - \brief Local 1Hz ISR execution count */ - uint32 LocalTaskCounter; /**< \cfetlmmnemonic \TIME_1HZTASKCNT - \brief Local 1Hz task execution count */ - - /* - ** Miscellaneous counters (not subject to reset command)... - */ - uint32 VirtualMET; /**< \cfetlmmnemonic \TIME_LOGICALMET - \brief Software MET */ - - /* - ** Time window verification values (converted from micro-secs)... - ** - ** Regardless of whether the tone follows the time packet, or vice - ** versa, these values define the acceptable window of time for - ** the second event to follow the first. The minimum value may - ** be as little as zero, and the maximum must be something less - ** than a second. - */ - uint32 MinElapsed; /**< \cfetlmmnemonic \TIME_MINWINDOW - \brief Min tone signal / data pkt arrival window (Sub-seconds) */ - uint32 MaxElapsed; /**< \cfetlmmnemonic \TIME_MAXWINDOW - \brief Max tone signal / data pkt arrival window (Sub-seconds) */ - - /* - ** Maximum local clock value (before roll-over)... - */ - CFE_TIME_SysTime_t MaxLocalClock; /**< \cfetlmmnemonic \TIME_WRAPS - \brief Max local clock value before rollover */ - - /* - ** Tone signal tolerance limits... - */ - uint32 ToneOverLimit; /**< \cfetlmmnemonic \TIME_MAXSS - \brief Max between tone signal interrupts */ - uint32 ToneUnderLimit; /**< \cfetlmmnemonic \TIME_MINSS - \brief Min between tone signal interrupts */ - - /* - ** Reset Area... - */ - uint32 DataStoreStatus; /**< \cfetlmmnemonic \TIME_ATASTSTAT - \brief Data Store status (preserved across processor reset) */ -} CFE_TIME_DiagnosticTlm_Payload_t; - -typedef struct CFE_TIME_DiagnosticTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_TIME_DiagnosticTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_TIME_DiagnosticTlm_t; - -#endif /* CFE_TIME_MSG_H */ diff --git a/modules/time/config/default_cfe_time_interface_cfg.h b/modules/time/config/default_cfe_time_interface_cfg.h new file mode 100644 index 000000000..3e614f154 --- /dev/null +++ b/modules/time/config/default_cfe_time_interface_cfg.h @@ -0,0 +1,210 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Time Services (CFE_TIME) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TIME_INTERFACE_CFG_H +#define CFE_TIME_INTERFACE_CFG_H + +/** +** \cfetimecfg Default Time Format +** +** \par Description: +** The following definitions select either UTC or TAI as the default +** (mission specific) time format. Although it is possible for an +** application to request time in a specific format, most callers +** should use CFE_TIME_GetTime(), which returns time in the default +** format. This avoids having to modify each individual caller +** when the default choice is changed. +** +** \par Limits +** if CFE_MISSION_TIME_CFG_DEFAULT_TAI is defined as true then CFE_MISSION_TIME_CFG_DEFAULT_UTC must be +** defined as false. +** if CFE_MISSION_TIME_CFG_DEFAULT_TAI is defined as false then CFE_MISSION_TIME_CFG_DEFAULT_UTC must be +** defined as true. +*/ +#define CFE_MISSION_TIME_CFG_DEFAULT_TAI true +#define CFE_MISSION_TIME_CFG_DEFAULT_UTC false + +/** +** \cfetimecfg Default Time Format +** +** \par Description: +** The following definition enables the use of a simulated time at +** the tone signal using a software bus message. +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_CFG_FAKE_TONE true + +/** +** \cfetimecfg Default Time and Tone Order +** +** \par Description: +** Time Services may be configured to expect the time at the tone +** data packet to either precede or follow the tone signal. If the +** time at the tone data packet follows the tone signal, then the +** data within the packet describes what the time "was" at the tone. +** If the time at the tone data packet precedes the tone signal, then +** the data within the packet describes what the time "will be" at +** the tone. One, and only one, of the following symbols must be set to true: +** - CFE_MISSION_TIME_AT_TONE_WAS +** - CFE_MISSION_TIME_AT_TONE_WILL_BE +** Note: If Time Services is defined as using a simulated tone signal +** (see #CFE_MISSION_TIME_CFG_FAKE_TONE above), then the tone data packet +** must follow the tone signal. +** +** \par Limits +** Either CFE_MISSION_TIME_AT_TONE_WAS or CFE_MISSION_TIME_AT_TONE_WILL_BE must be set to true. +** They may not both be true and they may not both be false. +*/ +#define CFE_MISSION_TIME_AT_TONE_WAS true +#define CFE_MISSION_TIME_AT_TONE_WILL_BE false + +/** +** \cfetimecfg Min and Max Time Elapsed +** +** \par Description: +** Based on the definition of Time and Tone Order +** (CFE_MISSION_TIME_AT_TONE_WAS/WILL_BE) either the "time at the tone" signal or +** data packet will follow the other. This definition sets the valid window +** of time for the second of the pair to lag behind the first. Time +** Services will invalidate both the tone and packet if the second does not +** arrive within this window following the first. +** +** For example, if the data packet follows the tone, it might be valid for +** the data packet to arrive between zero and 100,000 micro-seconds after +** the tone. But, if the tone follows the packet, it might be valid +** only if the packet arrived between 200,000 and 700,000 micro-seconds +** before the tone. +** +** Note: units are in micro-seconds +** +** \par Limits +** 0 to 999,999 decimal +*/ +#define CFE_MISSION_TIME_MIN_ELAPSED 0 +#define CFE_MISSION_TIME_MAX_ELAPSED 200000 + +/** +** \cfetimecfg Default Time Values +** +** \par Description: +** Default time values are provided to avoid problems due to time +** calculations performed after startup but before commands can be +** processed. For example, if the default time format is UTC then +** it is important that the sum of MET and STCF always exceed the +** value of Leap Seconds to prevent the UTC time calculation +** (time = MET + STCF - Leap Seconds) from resulting in a negative +** (very large) number.

    +** Some past missions have also created known (albeit wrong) default +** timestamps. For example, assume the epoch is defined as Jan 1, 1970 +** and further assume the default time values are set to create a timestamp +** of Jan 1, 2000. Even though the year 2000 timestamps are wrong, it +** may be of value to keep the time within some sort of bounds acceptable +** to the software.

    +** Note: Sub-second units are in micro-seconds (0 to 999,999) and +** all values must be defined +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_DEF_MET_SECS 1000 +#define CFE_MISSION_TIME_DEF_MET_SUBS 0 + +#define CFE_MISSION_TIME_DEF_STCF_SECS 1000000 +#define CFE_MISSION_TIME_DEF_STCF_SUBS 0 + +#define CFE_MISSION_TIME_DEF_LEAPS 37 + +#define CFE_MISSION_TIME_DEF_DELAY_SECS 0 +#define CFE_MISSION_TIME_DEF_DELAY_SUBS 1000 + +/** +** \cfetimecfg Default EPOCH Values +** +** \par Description: +** Default ground time epoch values +** Note: these values are used only by the CFE_TIME_Print() API function +** +** \par Limits +** Year - must be within 136 years +** Day - Jan 1 = 1, Feb 1 = 32, etc. +** Hour - 0 to 23 +** Minute - 0 to 59 +** Second - 0 to 59 +** Micros - 0 to 999999 +*/ +#define CFE_MISSION_TIME_EPOCH_YEAR 1980 +#define CFE_MISSION_TIME_EPOCH_DAY 1 +#define CFE_MISSION_TIME_EPOCH_HOUR 0 +#define CFE_MISSION_TIME_EPOCH_MINUTE 0 +#define CFE_MISSION_TIME_EPOCH_SECOND 0 +#define CFE_MISSION_TIME_EPOCH_MICROS 0 + +/** +** \cfetimecfg Time File System Factor +** +** \par Description: +** Define the s/c vs file system time conversion constant... +** +** Note: this value is intended for use only by CFE TIME API functions to +** convert time values based on the ground system epoch (s/c time) to +** and from time values based on the file system epoch (fs time). +** +** FS time = S/C time + factor +** S/C time = FS time - factor +** +** Worksheet: +** +** S/C epoch = Jan 1, 2005 (LRO ground system epoch) +** FS epoch = Jan 1, 1980 (vxWorks DOS file system epoch) +** +** Delta = 25 years, 0 days, 0 hours, 0 minutes, 0 seconds +** +** Leap years = 1980, 1984, 1988, 1992, 1996, 2000, 2004 +** (divisible by 4 -- except if by 100 -- unless also by 400) +** +** 1 year = 31,536,000 seconds +** 1 day = 86,400 seconds +** 1 hour = 3,600 seconds +** 1 minute = 60 seconds +** +** 25 years = 788,400,000 seconds +** 7 extra leap days = 604,800 seconds +** +** total delta = 789,004,800 seconds +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_FS_FACTOR 789004800 + +#endif diff --git a/modules/time/config/default_cfe_time_internal_cfg.h b/modules/time/config/default_cfe_time_internal_cfg.h new file mode 100644 index 000000000..3d284a24c --- /dev/null +++ b/modules/time/config/default_cfe_time_internal_cfg.h @@ -0,0 +1,243 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Time Service (CFE_TIME) Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TIME_INTERNAL_CFG_H +#define CFE_TIME_INTERNAL_CFG_H + +/** +** \cfetimecfg Time Server or Time Client Selection +** +** \par Description: +** This configuration parameter selects whether the Time task functions as a +** time "server" or "client". A time server generates the "time at the tone" +** packet which is received by time clients. +** +** \par Limits +** Enable one, and only one by defining either CFE_PLATFORM_TIME_CFG_SERVER or +** CFE_PLATFORM_TIME_CFG_CLIENT AS true. The other must be defined as false. +*/ +#define CFE_PLATFORM_TIME_CFG_SERVER true +#define CFE_PLATFORM_TIME_CFG_CLIENT false + +/** +** \cfetimecfg Time Tone In Big-Endian Order +** +** \par Description: +** If this configuration parameter is defined, the CFE time server will +** publish time tones with payloads in big-endian order, and time clients +** will expect the tones to be in big-endian order. This is useful for +** mixed-endian environments. This will become obsolete once EDS is +** available and the CFE time tone message is defined. +*/ +#undef CFE_PLATFORM_TIME_CFG_BIGENDIAN + +/** +** \cfetimecfg Local MET or Virtual MET Selection for Time Servers +** +** \par Description: +** Depending on the specific hardware system configuration, it may be possible +** for Time Servers to read the "local" MET from a h/w register rather than +** having to track the MET as the count of tone signal interrupts (virtual MET) +** +** Time Clients must be defined as using a virtual MET. Also, a Time Server +** cannot be defined as having both a h/w MET and an external time source (they +** both cannot synchronize to the same tone). +** +** Note: "disable" this define (set to false) only for Time Servers with local hardware +** that supports a h/w MET that is synchronized to the tone signal !!! +** +** \par Limits +** Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. +*/ +#define CFE_PLATFORM_TIME_CFG_VIRTUAL true + +/** +** \cfetimecfg Include or Exclude the Primary/Redundant Tone Selection Cmd +** +** \par Description: +** Depending on the specific hardware system configuration, it may be possible +** to switch between a primary and redundant tone signal. If supported by +** hardware, this definition will enable command interfaces to select the +** active tone signal. Both Time Clients and Time Servers support this feature. +** Note: Set the CFE_PLATFORM_TIME_CFG_SIGNAL define to true to enable tone signal commands. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_CFG_SIGNAL false + +/** +** \cfetimecfg Include or Exclude the Internal/External Time Source Selection Cmd +** +** \par Description: +** By default, Time Servers maintain time using an internal MET which may be a +** h/w register or software counter, depending on available hardware. The +** following definition enables command interfaces to switch between an +** internal MET, or external time data received from one of several supported +** external time sources. Only a Time Server may be configured to use external +** time data. +** Note: Set the CFE_PLATFORM_TIME_CFG_SOURCE define to true to include the Time Source +** Selection Command (command allows selection between the internal +** or external time source). Then choose the external source with the +** CFE_TIME_CFG_SRC_??? define. +** +** \par Limits +** Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. +*/ +#define CFE_PLATFORM_TIME_CFG_SOURCE false + +/** +** \cfetimecfg Choose the External Time Source for Server only +** +** \par Description: +** If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true, then one of the following external time +** source types must also be set to true. Do not set any of the external time +** source types to true unless #CFE_PLATFORM_TIME_CFG_SOURCE is set to true. +** +** \par Limits +** -# If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true then one and only one of the following +** three external time sources can and must be set true: +** #CFE_PLATFORM_TIME_CFG_SRC_MET, #CFE_PLATFORM_TIME_CFG_SRC_GPS, #CFE_PLATFORM_TIME_CFG_SRC_TIME +** -# Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. +*/ +#define CFE_PLATFORM_TIME_CFG_SRC_MET false +#define CFE_PLATFORM_TIME_CFG_SRC_GPS false +#define CFE_PLATFORM_TIME_CFG_SRC_TIME false + +/** +** \cfetimecfg Define the Max Delta Limits for Time Servers using an Ext Time Source +** +** \par Description: +** If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true and one of the external time sources is +** also set to true, then the delta time limits for range checking is used. +** +** When a new time value is received from an external source, the value is +** compared against the "expected" time value. If the delta exceeds the +** following defined amount, then the new time data will be ignored. This range +** checking is only performed after the clock state has been commanded to +** "valid". Until then, external time data is accepted unconditionally. +** +** \par Limits +** Applies only if both #CFE_PLATFORM_TIME_CFG_SERVER and #CFE_PLATFORM_TIME_CFG_SOURCE are set +** to true. +*/ +#define CFE_PLATFORM_TIME_MAX_DELTA_SECS 0 +#define CFE_PLATFORM_TIME_MAX_DELTA_SUBS 500000 + +/** +** \cfetimecfg Define the Local Clock Rollover Value in seconds and subseconds +** +** \par Description: +** Specifies the capability of the local clock. Indicates the time at which +** the local clock rolls over. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_MAX_LOCAL_SECS 27 +#define CFE_PLATFORM_TIME_MAX_LOCAL_SUBS 0 + +/** +** \cfetimecfg Define Timing Limits From One Tone To The Next +** +** \par Description: +** Defines limits to the timing of the 1Hz tone signal. A tone signal is valid +** only if it arrives within one second (plus or minus the tone limit) from +** the previous tone signal.Units are microseconds as measured with the local +** clock. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_CFG_TONE_LIMIT 20000 + +/** +** \cfetimecfg Define Time to Start Flywheel Since Last Tone +** +** \par Description: +** Define time to enter flywheel mode (in seconds since last tone data update) +** Units are microseconds as measured with the local clock. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_CFG_START_FLY 2 + +/** +** \cfetimecfg Define Periodic Time to Update Local Clock Tone Latch +** +** \par Description: +** Define Periodic Time to Update Local Clock Tone Latch. Applies only when +** in flywheel mode. This define dictates the period at which the simulated +** 'last tone' time is updated. Units are seconds. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_CFG_LATCH_FLY 8 + +/** +** \cfetimecfg Define TIME Task Priorities +** +** \par Description: +** Defines the cFE_TIME Task priority. +** Defines the cFE_TIME Tone Task priority. +** Defines the cFE_TIME 1HZ Task priority. +** +** \par Limits +** There is a lower limit of zero and an upper limit of 255 on these +** configuration parameters. Remember that the meaning of each task +** priority is inverted -- a "lower" number has a "higher" priority. +*/ +#define CFE_PLATFORM_TIME_START_TASK_PRIORITY 60 +#define CFE_PLATFORM_TIME_TONE_TASK_PRIORITY 25 +#define CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY 25 + +/** +** \cfetimecfg Define TIME Task Stack Sizes +** +** \par Description: +** Defines the cFE_TIME Main Task Stack Size +** Defines the cFE_TIME Tone Task Stack Size +** Defines the cFE_TIME 1HZ Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on these configuration parameters. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_TIME_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE +#define CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE 4096 +#define CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE 8192 + +#endif diff --git a/modules/time/config/default_cfe_time_mission_cfg.h b/modules/time/config/default_cfe_time_mission_cfg.h new file mode 100644 index 000000000..5e8e973c1 --- /dev/null +++ b/modules/time/config/default_cfe_time_mission_cfg.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Time Services (CFE_TIME) Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TIME_MISSION_CFG_H +#define CFE_TIME_MISSION_CFG_H + +#include "cfe_time_interface_cfg.h" + +#endif diff --git a/modules/time/config/default_cfe_time_msg.h b/modules/time/config/default_cfe_time_msg.h new file mode 100644 index 000000000..12242f5cc --- /dev/null +++ b/modules/time/config/default_cfe_time_msg.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Time Services (CFE_TIME) command and telemetry + * message data types. + * + * This is a compatibility header for the "cfe_time_msg.h" file that has + * traditionally provided the message definitions for cFS apps. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TIME_MSG_H +#define CFE_TIME_MSG_H + +#include "cfe_mission_cfg.h" +#include "cfe_time_msgdefs.h" +#include "cfe_time_msgstruct.h" + +#endif diff --git a/modules/time/config/default_cfe_time_msgdefs.h b/modules/time/config/default_cfe_time_msgdefs.h new file mode 100644 index 000000000..0823706ba --- /dev/null +++ b/modules/time/config/default_cfe_time_msgdefs.h @@ -0,0 +1,50 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Time Services (CFE_TIME) command and telemetry + * message constant definitions. + * + * For CFE_TIME this is only the function/command code definitions + */ +#ifndef CFE_TIME_MSGDEFS_H +#define CFE_TIME_MSGDEFS_H + +#include "cfe_time_fcncodes.h" + +/** \defgroup CFETIMEClkStates cFE Clock State Flag Defines + * \{ + */ +#define CFE_TIME_FLAG_CLKSET 0x8000 /**< \brief The spacecraft time has been set */ +#define CFE_TIME_FLAG_FLYING 0x4000 /**< \brief This instance of Time Services is flywheeling */ +#define CFE_TIME_FLAG_SRCINT 0x2000 /**< \brief The clock source is set to "internal" */ +#define CFE_TIME_FLAG_SIGPRI 0x1000 /**< \brief The clock signal is set to "primary" */ +#define CFE_TIME_FLAG_SRVFLY 0x0800 /**< \brief The Time Server is in flywheel mode */ +#define CFE_TIME_FLAG_CMDFLY 0x0400 /**< \brief This instance of Time Services was commanded into flywheel mode */ +#define CFE_TIME_FLAG_ADDADJ 0x0200 /**< \brief One time STCF Adjustment is to be done in positive direction */ +#define CFE_TIME_FLAG_ADD1HZ 0x0100 /**< \brief 1 Hz STCF Adjustment is to be done in a positive direction */ +#define CFE_TIME_FLAG_ADDTCL 0x0080 /**< \brief Time Client Latency is applied in a positive direction */ +#define CFE_TIME_FLAG_SERVER 0x0040 /**< \brief This instance of Time Services is a Time Server */ +#define CFE_TIME_FLAG_GDTONE 0x0020 /**< \brief The tone received is good compared to the last tone received */ +#define CFE_TIME_FLAG_REFERR \ + 0x0010 /**< \brief GetReference read error, will be set if unable to get a consistent ref value */ +#define CFE_TIME_FLAG_UNUSED 0x000F /**< \brief Reserved flags - should be zero */ +/** \} */ + +#endif diff --git a/modules/time/config/default_cfe_time_msgids.h b/modules/time/config/default_cfe_time_msgids.h new file mode 100644 index 000000000..b2ef0aa32 --- /dev/null +++ b/modules/time/config/default_cfe_time_msgids.h @@ -0,0 +1,49 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Time Services (CFE_TIME) Application Message IDs + */ +#ifndef CFE_TIME_MSGIDS_H +#define CFE_TIME_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_time_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_CMD_MSG /* 0x1805 */ +#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_SEND_HK_MSG /* 0x180D */ +#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_TONE_CMD_MSG /* 0x1810 */ +#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_1HZ_CMD_MSG /* 0x1811 */ + +/* +** cFE Global Command Message Id's +*/ +#define CFE_TIME_DATA_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_DATA_CMD_MSG /* 0x1860 */ +#define CFE_TIME_SEND_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_SEND_CMD_MSG /* 0x1862 */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_HK_TLM_MSG /* 0x0805 */ +#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_DIAG_TLM_MSG /* 0x0806 */ + +#endif diff --git a/modules/time/config/default_cfe_time_msgstruct.h b/modules/time/config/default_cfe_time_msgstruct.h new file mode 100644 index 000000000..a471f315e --- /dev/null +++ b/modules/time/config/default_cfe_time_msgstruct.h @@ -0,0 +1,441 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * cFE Executive Services (TIME) Command and Telemetry packet definition file. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ +#ifndef CFE_TIME_MSGSTRUCT_H +#define CFE_TIME_MSGSTRUCT_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "cfe_mission_cfg.h" +#include "cfe_msg_hdr.h" + +/** + * \brief Generic no argument command + */ +typedef struct CFE_TIME_NoArgsCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ +} CFE_TIME_NoArgsCmd_t; + +/* + * A separate typedef for each of the commands that share this definition + * This follows the convention for command handler prototypes and allows + * each one to independently evolve as necessary. + */ +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_NoopCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_ResetCountersCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_SendDiagnosticCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_1HzCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_ToneSignalCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_FakeToneCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_SendHkCmd_t; + +/** + * \brief Set leap seconds command payload + */ +typedef struct CFE_TIME_LeapsCmd_Payload +{ + int16 LeapSeconds; +} CFE_TIME_LeapsCmd_Payload_t; + +/** + * \brief Set leap seconds command + */ +typedef struct CFE_TIME_SetLeapSecondsCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_LeapsCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_SetLeapSecondsCmd_t; + +/** + * \brief Set clock state command payload + */ +typedef struct CFE_TIME_StateCmd_Payload +{ + CFE_TIME_ClockState_Enum_t ClockState; /**< \brief #CFE_TIME_ClockState_INVALID=Spacecraft time has + not been accurately set, #CFE_TIME_ClockState_VALID=Spacecraft clock + has been accurately set, #CFE_TIME_ClockState_FLYWHEEL=Force into + FLYWHEEL mode */ + /**< Selects the current clock state */ +} CFE_TIME_StateCmd_Payload_t; + +/** + * \brief Set clock state command + */ +typedef struct CFE_TIME_SetStateCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_StateCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_SetStateCmd_t; + +/** + * \brief Set time data source command payload + */ +typedef struct CFE_TIME_SourceCmd_Payload +{ + int16 TimeSource; /**< \brief #CFE_TIME_SourceSelect_INTERNAL=Internal Source, + #CFE_TIME_SourceSelect_EXTERNAL=External Source */ + /**< Selects either the "Internal" and "External" clock source */ +} CFE_TIME_SourceCmd_Payload_t; + +/** + * \brief Set time data source command + */ +typedef struct CFE_TIME_SetSourceCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_SourceCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_SetSourceCmd_t; + +/** + * \brief Set tone signal source command payload + */ +typedef struct CFE_TIME_SignalCmd_Payload +{ + int16 ToneSource; /**< \brief #CFE_TIME_ToneSignalSelect_PRIMARY=Primary Source, + #CFE_TIME_ToneSignalSelect_REDUNDANT=Redundant Source */ + /**< Selects either the "Primary" or "Redundant" tone signal source */ +} CFE_TIME_SignalCmd_Payload_t; + +/** + * \brief Set tone signal source command + */ +typedef struct CFE_TIME_SetSignalCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_SignalCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_SetSignalCmd_t; + +/** + * \brief Generic seconds, microseconds command payload + */ +typedef struct CFE_TIME_TimeCmd_Payload +{ + uint32 Seconds; + uint32 MicroSeconds; +} CFE_TIME_TimeCmd_Payload_t; + +/** + * \brief Generic seconds, microseconds argument command + */ +typedef struct CFE_TIME_TimeCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_TimeCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_TimeCmd_t; + +/* + * A separate typedef for each of the commands that share this definition + * This follows the convention for command handler prototypes and allows + * each one to independently evolve as necessary. + */ +typedef CFE_TIME_TimeCmd_t CFE_TIME_AddDelayCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SubDelayCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SetMETCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SetSTCFCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_AddAdjustCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SubAdjustCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SetTimeCmd_t; + +/** + * \brief Generic seconds, subseconds command payload + */ +typedef struct CFE_TIME_OneHzAdjustmentCmd_Payload +{ + uint32 Seconds; + uint32 Subseconds; +} CFE_TIME_OneHzAdjustmentCmd_Payload_t; + +/** + * \brief Generic seconds, subseconds adjustment command + */ +typedef struct CFE_TIME_OneHzAdjustmentCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_OneHzAdjustmentCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_OneHzAdjustmentCmd_t; + +/* + * A separate typedef for each of the commands that share this definition + * This follows the convention for command handler prototypes and allows + * each one to independently evolve as necessary. + */ +typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Add1HZAdjustmentCmd_t; +typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Sub1HZAdjustmentCmd_t; + +/** + * \brief Time at tone data command payload + */ +typedef struct CFE_TIME_ToneDataCmd_Payload +{ + CFE_TIME_SysTime_t AtToneMET; /**< \brief MET at time of tone */ + CFE_TIME_SysTime_t AtToneSTCF; /**< \brief STCF at time of tone */ + int16 AtToneLeapSeconds; /**< \brief Leap Seconds at time of tone */ + CFE_TIME_ClockState_Enum_t AtToneState; /**< \brief Clock state at time of tone */ +} CFE_TIME_ToneDataCmd_Payload_t; + +/** + * \brief Time at tone data command + */ +typedef struct CFE_TIME_ToneDataCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_TIME_ToneDataCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_ToneDataCmd_t; + +/*************************************************************************/ + +/** +** \cfetimetlm Time Services Housekeeping Packet +**/ +typedef struct CFE_TIME_HousekeepingTlm_Payload +{ + /* + ** Task command interface counters... + */ + uint8 CommandCounter; /**< \cfetlmmnemonic \TIME_CMDPC + \brief Time Command Execution Counter */ + uint8 CommandErrorCounter; /**< \cfetlmmnemonic \TIME_CMDEC + \brief Time Command Error Counter */ + + /* + ** Clock state flags and "as calculated" clock state... + */ + uint16 ClockStateFlags; /**< \cfetlmmnemonic \TIME_STATEFLG + \brief State Flags */ + CFE_TIME_ClockState_Enum_t ClockStateAPI; /**< \cfetlmmnemonic + \TIME_APISTATE \brief API State */ + + /* + ** Leap Seconds... + */ + int16 LeapSeconds; /**< \cfetlmmnemonic \TIME_LEAPSECS + \brief Current Leaps Seconds */ + + /* + ** Current MET and STCF time values... + */ + uint32 SecondsMET; /**< \cfetlmmnemonic \TIME_METSECS + \brief Current MET (seconds) */ + uint32 SubsecsMET; /**< \cfetlmmnemonic \TIME_METSUBSECS + \brief Current MET (sub-seconds) */ + + uint32 SecondsSTCF; /**< \cfetlmmnemonic \TIME_STCFSECS + \brief Current STCF (seconds) */ + uint32 SubsecsSTCF; /**< \cfetlmmnemonic \TIME_STCFSUBSECS + \brief Current STCF (sub-seconds) */ + +/* +** 1Hz STCF adjustment values (server only)... +*/ +#if (CFE_PLATFORM_TIME_CFG_SERVER == true) + uint32 Seconds1HzAdj; /**< \cfetlmmnemonic \TIME_1HZADJSECS + \brief Current 1 Hz SCTF adjustment (seconds) */ + uint32 Subsecs1HzAdj; /**< \cfetlmmnemonic \TIME_1HZADJSSECS + \brief Current 1 Hz SCTF adjustment (sub-seconds) */ +#endif + +/* +** Time at tone delay values (client only)... +*/ +#if (CFE_PLATFORM_TIME_CFG_CLIENT == true) + uint32 SecondsDelay; /**< \cfetlmmnemonic \TIME_1HZDLYSECS + \brief Current 1 Hz SCTF Delay (seconds) */ + uint32 SubsecsDelay; /**< \cfetlmmnemonic \TIME_1HZDLYSSECS + \brief Current 1 Hz SCTF Delay (sub-seconds) */ +#endif +} CFE_TIME_HousekeepingTlm_Payload_t; + +typedef struct CFE_TIME_HousekeepingTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_TIME_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_TIME_HousekeepingTlm_t; + +/*************************************************************************/ + +/** +** \cfetimetlm Time Services Diagnostics Packet +**/ +typedef struct CFE_TIME_DiagnosticTlm_Payload +{ + /* + ** Data values used to compute time (in reference to "tone")... + */ + CFE_TIME_SysTime_t AtToneMET; /**< \cfetlmmnemonic \TIME_TMETS + \brief MET at time of tone */ + CFE_TIME_SysTime_t AtToneSTCF; /**< \cfetlmmnemonic \TIME_STCFS + \brief STCF at time of tone */ + CFE_TIME_SysTime_t AtToneDelay; /**< \cfetlmmnemonic \TIME_LATENTS + \brief Adjustment for slow tone detection */ + CFE_TIME_SysTime_t AtToneLatch; /**< \cfetlmmnemonic \TIME_TVALIDS + \brief Local clock latched at time of tone */ + + int16 AtToneLeapSeconds; /**< \cfetlmmnemonic \TIME_LEAPS + \brief Leap Seconds at time of tone */ + CFE_TIME_ClockState_Enum_t ClockStateAPI; /**< \cfetlmmnemonic \TIME_APISTATE + \brief Clock state as per API */ + + /* + ** Data values that reflect the time (right now)... + */ + CFE_TIME_SysTime_t TimeSinceTone; /**< \cfetlmmnemonic \TIME_ELAPSEDS + \brief Time elapsed since the tone */ + CFE_TIME_SysTime_t CurrentLatch; /**< \cfetlmmnemonic \TIME_LOCALS + \brief Local clock latched just "now" */ + CFE_TIME_SysTime_t CurrentMET; /**< \cfetlmmnemonic \TIME_METS + \brief MET at this instant */ + CFE_TIME_SysTime_t CurrentTAI; /**< \cfetlmmnemonic \TIME_TAIS + \brief TAI at this instant */ + CFE_TIME_SysTime_t CurrentUTC; /**< \cfetlmmnemonic \TIME_UTCS + \brief UTC at this instant */ + + /* + ** Data values used to define the current clock state... + */ + int16 ClockSetState; /**< \cfetlmmnemonic \TIME_VALID + \brief Time has been "set" */ + int16 ClockFlyState; /**< \cfetlmmnemonic \TIME_FLYWHEEL + \brief Current fly-wheel state */ + int16 ClockSource; /**< \cfetlmmnemonic \TIME_SOURCE + \brief Internal vs external, etc. */ + int16 ClockSignal; /**< \cfetlmmnemonic \TIME_SIGNAL + \brief Primary vs redundant, etc. */ + int16 ServerFlyState; /**< \cfetlmmnemonic \TIME_SRVFLY + \brief Used by clients only */ + int16 Forced2Fly; /**< \cfetlmmnemonic \TIME_CMD2FLY + \brief Commanded into fly-wheel */ + + /* + ** Clock state flags... + */ + uint16 ClockStateFlags; /**< \cfetlmmnemonic \TIME_STATEFLAGS + \brief Clock State Flags */ + + /* + ** STCF adjustment direction values... + */ + int16 OneTimeDirection; /**< \cfetlmmnemonic \TIME_ADJUSTDIR + \brief One time STCF adjustment direction (Add = 1, Sub = 2) */ + int16 OneHzDirection; /**< \cfetlmmnemonic \TIME_1HZADJDIR + \brief 1Hz STCF adjustment direction */ + int16 DelayDirection; /**< \cfetlmmnemonic \TIME_LATENTDIR + \brief Client latency adjustment direction */ + + /* + ** STCF adjustment values... + */ + CFE_TIME_SysTime_t OneTimeAdjust; /**< \cfetlmmnemonic \TIME_ADJUSTS + \brief Previous one-time STCF adjustment */ + CFE_TIME_SysTime_t OneHzAdjust; /**< \cfetlmmnemonic \TIME_1HZADJS + \brief Current 1Hz STCF adjustment */ + + /* + ** Most recent local clock latch values... + */ + CFE_TIME_SysTime_t ToneSignalLatch; /**< \cfetlmmnemonic \TIME_TTS + \brief Local Clock latched at most recent tone signal */ + CFE_TIME_SysTime_t ToneDataLatch; /**< \cfetlmmnemonic \TIME_TDS + \brief Local Clock latched at arrival of tone data */ + + /* + ** Miscellaneous counters (subject to reset command)... + */ + uint32 ToneMatchCounter; /**< \cfetlmmnemonic \TIME_VERIFYCNT + \brief Tone signal / data verification count */ + uint32 ToneMatchErrorCounter; /**< \cfetlmmnemonic \TIME_VERIFYER + \brief Tone signal / data verification error count */ + uint32 ToneSignalCounter; /**< \cfetlmmnemonic \TIME_TSDETCNT + \brief Tone signal detected SB message count */ + uint32 ToneDataCounter; /**< \cfetlmmnemonic \TIME_TATTCNT + \brief Time at the tone data SB message count */ + uint32 ToneIntCounter; /**< \cfetlmmnemonic \TIME_TSISRCNT + \brief Tone signal ISR execution count */ + uint32 ToneIntErrorCounter; /**< \cfetlmmnemonic \TIME_TSISRERR + \brief Tone signal ISR error count */ + uint32 ToneTaskCounter; /**< \cfetlmmnemonic \TIME_TSTASKCNT + \brief Tone task execution count */ + uint32 VersionCounter; /**< \cfetlmmnemonic \TIME_VERSIONCNT + \brief Count of mods to time at tone reference data (version) */ + uint32 LocalIntCounter; /**< \cfetlmmnemonic \TIME_1HZISRCNT + \brief Local 1Hz ISR execution count */ + uint32 LocalTaskCounter; /**< \cfetlmmnemonic \TIME_1HZTASKCNT + \brief Local 1Hz task execution count */ + + /* + ** Miscellaneous counters (not subject to reset command)... + */ + uint32 VirtualMET; /**< \cfetlmmnemonic \TIME_LOGICALMET + \brief Software MET */ + + /* + ** Time window verification values (converted from micro-secs)... + ** + ** Regardless of whether the tone follows the time packet, or vice + ** versa, these values define the acceptable window of time for + ** the second event to follow the first. The minimum value may + ** be as little as zero, and the maximum must be something less + ** than a second. + */ + uint32 MinElapsed; /**< \cfetlmmnemonic \TIME_MINWINDOW + \brief Min tone signal / data pkt arrival window (Sub-seconds) */ + uint32 MaxElapsed; /**< \cfetlmmnemonic \TIME_MAXWINDOW + \brief Max tone signal / data pkt arrival window (Sub-seconds) */ + + /* + ** Maximum local clock value (before roll-over)... + */ + CFE_TIME_SysTime_t MaxLocalClock; /**< \cfetlmmnemonic \TIME_WRAPS + \brief Max local clock value before rollover */ + + /* + ** Tone signal tolerance limits... + */ + uint32 ToneOverLimit; /**< \cfetlmmnemonic \TIME_MAXSS + \brief Max between tone signal interrupts */ + uint32 ToneUnderLimit; /**< \cfetlmmnemonic \TIME_MINSS + \brief Min between tone signal interrupts */ + + /* + ** Reset Area... + */ + uint32 DataStoreStatus; /**< \cfetlmmnemonic \TIME_ATASTSTAT + \brief Data Store status (preserved across processor reset) */ +} CFE_TIME_DiagnosticTlm_Payload_t; + +typedef struct CFE_TIME_DiagnosticTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_TIME_DiagnosticTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_TIME_DiagnosticTlm_t; + +#endif diff --git a/modules/time/config/default_cfe_time_platform_cfg.h b/modules/time/config/default_cfe_time_platform_cfg.h new file mode 100644 index 000000000..414213026 --- /dev/null +++ b/modules/time/config/default_cfe_time_platform_cfg.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Time Services (CFE_TIME) Application Platform Configuration Header File + * + * This is a compatibility header for the "platform_cfg.h" file that has + * traditionally provided both public and private config definitions + * for each CFS app. + * + * These definitions are now provided in two separate files, one for + * the public/mission scope and one for internal scope. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_TIME_PLATFORM_CFG_H +#define CFE_TIME_PLATFORM_CFG_H + +#include "cfe_time_mission_cfg.h" +#include "cfe_time_internal_cfg.h" + +#endif diff --git a/modules/time/config/default_cfe_time_topicids.h b/modules/time/config/default_cfe_time_topicids.h new file mode 100644 index 000000000..a3c2ec1ef --- /dev/null +++ b/modules/time/config/default_cfe_time_topicids.h @@ -0,0 +1,64 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Time Services (CFE_TIME) Application Topic IDs + */ +#ifndef CFE_TIME_TOPICIDS_H +#define CFE_TIME_TOPICIDS_H + +/** +** \cfemissioncfg cFE Portable Message Numbers for Commands +** +** \par Description: +** Portable message numbers for the cFE command messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_CMD_MSG 5 +#define CFE_MISSION_TIME_SEND_HK_MSG 13 +#define CFE_MISSION_TIME_TONE_CMD_MSG 16 +#define CFE_MISSION_TIME_1HZ_CMD_MSG 17 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Global Messages +** +** \par Description: +** Portable message numbers for the cFE global messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_DATA_CMD_MSG 0 +#define CFE_MISSION_TIME_SEND_CMD_MSG 2 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Telemetry +** +** \par Description: +** Portable message numbers for the cFE telemetry messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_HK_TLM_MSG 5 +#define CFE_MISSION_TIME_DIAG_TLM_MSG 6 + +#endif diff --git a/modules/time/fsw/inc/cfe_time_events.h b/modules/time/fsw/inc/cfe_time_eventids.h similarity index 100% rename from modules/time/fsw/inc/cfe_time_events.h rename to modules/time/fsw/inc/cfe_time_eventids.h diff --git a/modules/time/fsw/src/cfe_time_module_all.h b/modules/time/fsw/src/cfe_time_module_all.h index 8bd048ad6..cfcb6f89e 100644 --- a/modules/time/fsw/src/cfe_time_module_all.h +++ b/modules/time/fsw/src/cfe_time_module_all.h @@ -40,7 +40,7 @@ #include "cfe_time_core_internal.h" #include "cfe_time_msg.h" -#include "cfe_time_events.h" +#include "cfe_time_eventids.h" #include "cfe_time_utils.h" #include "cfe_time_dispatch.h" diff --git a/modules/time/mission_build.cmake b/modules/time/mission_build.cmake new file mode 100644 index 000000000..4b1deeda0 --- /dev/null +++ b/modules/time/mission_build.cmake @@ -0,0 +1,37 @@ +########################################################### +# +# TIME Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the TIME configuration +set(TIME_MISSION_CONFIG_FILE_LIST + cfe_time_mission_cfg.h + cfe_time_interface_cfg.h + cfe_time_extern_typedefs.h + cfe_time_fcncodes.h + cfe_time_msgdefs.h + cfe_time_msg.h + cfe_time_msgstruct.h + cfe_time_topicids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(TIME_CFGFILE ${TIME_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${TIME_CFGFILE}" NAME_WE) + if (DEFINED TIME_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${TIME_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TIME_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${TIME_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach() From d92d5b928cc3e046e3735f3aa01552103071925f Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 16:28:00 -0400 Subject: [PATCH 162/200] Fix #2320, reorganize EVS header files Organize EVS header file contents according to the convention --- modules/evs/CMakeLists.txt | 2 +- modules/evs/arch_build.cmake | 32 ++ .../config/default_cfe_evs_extern_typedefs.h} | 12 - .../default_cfe_evs_fcncodes.h} | 408 +---------------- .../config/default_cfe_evs_interface_cfg.h | 49 +++ .../evs/config/default_cfe_evs_internal_cfg.h | 199 +++++++++ .../evs/config/default_cfe_evs_mission_cfg.h | 36 ++ modules/evs/config/default_cfe_evs_msg.h | 38 ++ modules/evs/config/default_cfe_evs_msgdefs.h | 43 ++ modules/evs/config/default_cfe_evs_msgids.h | 42 ++ .../evs/config/default_cfe_evs_msgstruct.h | 411 ++++++++++++++++++ .../evs/config/default_cfe_evs_platform_cfg.h | 41 ++ modules/evs/config/default_cfe_evs_topicids.h | 51 +++ .../{cfe_evs_events.h => cfe_evs_eventids.h} | 0 modules/evs/fsw/src/cfe_evs_module_all.h | 8 +- modules/evs/fsw/src/cfe_evs_task.h | 2 +- modules/evs/mission_build.cmake | 37 ++ 17 files changed, 993 insertions(+), 418 deletions(-) create mode 100644 modules/evs/arch_build.cmake rename modules/{core_api/fsw/inc/cfe_evs_extern_typedefs.h => evs/config/default_cfe_evs_extern_typedefs.h} (92%) rename modules/evs/{fsw/inc/cfe_evs_msg.h => config/default_cfe_evs_fcncodes.h} (68%) create mode 100644 modules/evs/config/default_cfe_evs_interface_cfg.h create mode 100644 modules/evs/config/default_cfe_evs_internal_cfg.h create mode 100644 modules/evs/config/default_cfe_evs_mission_cfg.h create mode 100644 modules/evs/config/default_cfe_evs_msg.h create mode 100644 modules/evs/config/default_cfe_evs_msgdefs.h create mode 100644 modules/evs/config/default_cfe_evs_msgids.h create mode 100644 modules/evs/config/default_cfe_evs_msgstruct.h create mode 100644 modules/evs/config/default_cfe_evs_platform_cfg.h create mode 100644 modules/evs/config/default_cfe_evs_topicids.h rename modules/evs/fsw/inc/{cfe_evs_events.h => cfe_evs_eventids.h} (100%) create mode 100644 modules/evs/mission_build.cmake diff --git a/modules/evs/CMakeLists.txt b/modules/evs/CMakeLists.txt index 66cb966c8..2a88e0316 100644 --- a/modules/evs/CMakeLists.txt +++ b/modules/evs/CMakeLists.txt @@ -26,5 +26,5 @@ endif(ENABLE_UNIT_TESTS) cfs_app_check_intf(${DEP} cfe_evs_msg.h - cfe_evs_events.h + cfe_evs_eventids.h ) diff --git a/modules/evs/arch_build.cmake b/modules/evs/arch_build.cmake new file mode 100644 index 000000000..63c50f8e2 --- /dev/null +++ b/modules/evs/arch_build.cmake @@ -0,0 +1,32 @@ +########################################################### +# +# EVS Core Module platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the EVS configuration +set(EVS_PLATFORM_CONFIG_FILE_LIST + cfe_evs_internal_cfg.h + cfe_evs_msgids.h + cfe_evs_platform_cfg.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(EVS_CFGFILE ${EVS_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${EVS_CFGFILE}" NAME_WE) + if (DEFINED EVS_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE "${EVS_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${EVS_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h b/modules/evs/config/default_cfe_evs_extern_typedefs.h similarity index 92% rename from modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h rename to modules/evs/config/default_cfe_evs_extern_typedefs.h index 1b8124d41..d10de9fb8 100644 --- a/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h +++ b/modules/evs/config/default_cfe_evs_extern_typedefs.h @@ -25,16 +25,6 @@ #ifndef CFE_EVS_EXTERN_TYPEDEFS_H #define CFE_EVS_EXTERN_TYPEDEFS_H -/* This header may be generated from an EDS file, - * tools are available and the feature is enabled */ -#ifdef CFE_EDS_ENABLED_BUILD - -/* Use the EDS generated version of these types */ -#include "cfe_evs_eds_typedefs.h" - -#else -/* Use the local definitions of these types */ - #include "common_types.h" /** @@ -167,6 +157,4 @@ enum CFE_EVS_EventOutput */ typedef uint8 CFE_EVS_EventOutput_Enum_t; -#endif /* CFE_EDS_ENABLED_BUILD */ - #endif /* CFE_EVS_EXTERN_TYPEDEFS_H */ diff --git a/modules/evs/fsw/inc/cfe_evs_msg.h b/modules/evs/config/default_cfe_evs_fcncodes.h similarity index 68% rename from modules/evs/fsw/inc/cfe_evs_msg.h rename to modules/evs/config/default_cfe_evs_fcncodes.h index 1a106fcd3..7f639081e 100644 --- a/modules/evs/fsw/inc/cfe_evs_msg.h +++ b/modules/evs/config/default_cfe_evs_fcncodes.h @@ -18,27 +18,15 @@ /** * @file + * Specification for the CFE Event Services (CFE_EVS) command function codes * - * Title: Event Services Message definition header file Header File - * - * Purpose: - * Unit specification for Event services command codes and data structures. - * - * Design Notes: - * - * References: - * Flight Software Branch C Coding Standard Version 1.0a - * + * @note + * This file should be strictly limited to the command/function code (CC) + * macro definitions. Other definitions such as enums, typedefs, or other + * macros should be placed in the msgdefs.h or msg.h files. */ - -#ifndef CFE_EVS_MSG_H -#define CFE_EVS_MSG_H - -/********************************** Include Files ************************************/ -#include "common_types.h" /* Basic data types */ -#include "cfe_msg_hdr.h" /* for header definitions */ -#include "cfe_evs_extern_typedefs.h" /* for EVS-specific types such as CFE_EVS_LogMode_Enum_t */ -#include "cfe_es_extern_typedefs.h" /* for CFE_ES_AppId_t type */ +#ifndef CFE_EVS_FCNCODES_H +#define CFE_EVS_FCNCODES_H /** \name Event Services Command Codes */ /** \{ */ @@ -885,384 +873,4 @@ #define CFE_EVS_CLEAR_LOG_CC 20 /** \} */ -/* Event Type bit masks */ -#define CFE_EVS_DEBUG_BIT 0x0001 -#define CFE_EVS_INFORMATION_BIT 0x0002 -#define CFE_EVS_ERROR_BIT 0x0004 -#define CFE_EVS_CRITICAL_BIT 0x0008 - -/* Output Port bit masks */ -#define CFE_EVS_PORT1_BIT 0x0001 -#define CFE_EVS_PORT2_BIT 0x0002 -#define CFE_EVS_PORT3_BIT 0x0004 -#define CFE_EVS_PORT4_BIT 0x0008 - -/****************** Structure Definitions *********************/ - -/** -** \brief Command with no additional arguments -**/ -typedef struct CFE_EVS_NoArgsCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ -} CFE_EVS_NoArgsCmd_t; - -/* - * The NoArgsCmd is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_NoopCmd_t; -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ResetCountersCmd_t; -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ClearLogCmd_t; -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_SendHkCmd_t; - -/** -** \brief Write Event Log to File Command Payload -** -** For command details, see #CFE_EVS_WRITE_LOG_DATA_FILE_CC -** -**/ -typedef struct CFE_EVS_LogFileCmd_Payload -{ - char LogFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where log data is to be written */ -} CFE_EVS_LogFileCmd_Payload_t; - -/** - * \brief Write Event Log to File Command - */ -typedef struct CFE_EVS_WriteLogDataFileCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_LogFileCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_WriteLogDataFileCmd_t; - -/** -** \brief Write Event Services Application Information to File Command Payload -** -** For command details, see #CFE_EVS_WRITE_APP_DATA_FILE_CC -** -**/ -typedef struct CFE_EVS_AppDataCmd_Payload -{ - char AppDataFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where application data is to be written */ -} CFE_EVS_AppDataCmd_Payload_t; - -/** - * \brief Write Event Services Application Information to File Command - */ -typedef struct CFE_EVS_WriteAppDataFileCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppDataCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_WriteAppDataFileCmd_t; - -/** -** \brief Set Log Mode Command Payload -** -** For command details, see #CFE_EVS_SET_LOG_MODE_CC -** -**/ -typedef struct CFE_EVS_SetLogMode_Payload -{ - CFE_EVS_LogMode_Enum_t LogMode; /**< \brief Mode to use in the command*/ - uint8 Spare; /**< \brief Pad to even byte*/ -} CFE_EVS_SetLogMode_Payload_t; - -/** - * \brief Set Log Mode Command - */ -typedef struct CFE_EVS_SetLogModeCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_SetLogMode_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_SetLogModeCmd_t; - -/** -** \brief Set Event Format Mode Command Payload -** -** For command details, see #CFE_EVS_SET_EVENT_FORMAT_MODE_CC -** -**/ -typedef struct CFE_EVS_SetEventFormatCode_Payload -{ - CFE_EVS_MsgFormat_Enum_t MsgFormat; /**< \brief Mode to use in the command*/ - uint8 Spare; /**< \brief Pad to even byte*/ -} CFE_EVS_SetEventFormatMode_Payload_t; - -/** - * \brief Set Event Format Mode Command - */ -typedef struct CFE_EVS_SetEventFormatModeCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_SetEventFormatMode_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_SetEventFormatModeCmd_t; - -/** -** \brief Generic Bitmask Command Payload -** -** For command details, see #CFE_EVS_ENABLE_EVENT_TYPE_CC, #CFE_EVS_DISABLE_EVENT_TYPE_CC, -** #CFE_EVS_ENABLE_PORTS_CC and/or #CFE_EVS_DISABLE_PORTS_CC -** -**/ -typedef struct CFE_EVS_BitMaskCmd_Payload -{ - uint8 BitMask; /**< \brief BitMask to use in the command */ - uint8 Spare; /**< \brief Pad to even byte*/ -} CFE_EVS_BitMaskCmd_Payload_t; - -/** - * \brief Generic Bitmask Command - */ -typedef struct CFE_EVS_BitMaskCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_BitMaskCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_BitMaskCmd_t; - -/* - * The CFE_EVS_BitMaskCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnablePortsCmd_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisablePortsCmd_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnableEventTypeCmd_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisableEventTypeCmd_t; - -/** -** \brief Generic App Name Command Payload -** -** For command details, see #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC, -** #CFE_EVS_RESET_APP_COUNTER_CC and/or #CFE_EVS_RESET_ALL_FILTERS_CC -** -**/ -typedef struct CFE_EVS_AppNameCmd_Payload -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ -} CFE_EVS_AppNameCmd_Payload_t; - -/** - * \brief Generic App Name Command - */ -typedef struct CFE_EVS_AppNameCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_AppNameCmd_t; - -/* - * The CFE_EVS_AppNameCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_AppNameCmd_t CFE_EVS_EnableAppEventsCmd_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_DisableAppEventsCmd_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAppCounterCmd_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAllFiltersCmd_t; - -/** -** \brief Generic App Name and Event ID Command Payload -** -** For command details, see #CFE_EVS_RESET_FILTER_CC and #CFE_EVS_DELETE_EVENT_FILTER_CC -** -**/ -typedef struct CFE_EVS_AppNameEventIDCmd_Payload -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ - uint16 EventID; /**< \brief Event ID to use in the command*/ -} CFE_EVS_AppNameEventIDCmd_Payload_t; - -/** - * \brief Generic App Name and Event ID Command - */ -typedef struct CFE_EVS_AppNameEventIDCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppNameEventIDCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_AppNameEventIDCmd_t; - -/* - * The CFE_EVS_AppNameEventIDCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_ResetFilterCmd_t; -typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_DeleteEventFilterCmd_t; - -/** -** \brief Generic App Name and Bitmask Command Payload -** -** For command details, see #CFE_EVS_ENABLE_APP_EVENT_TYPE_CC and/or #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC -** -**/ -typedef struct CFE_EVS_AppNameBitMaskCmd_Payload -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ - uint8 BitMask; /**< \brief BitMask to use in the command*/ - uint8 Spare; /**< \brief Pad to even byte*/ -} CFE_EVS_AppNameBitMaskCmd_Payload_t; - -/** - * \brief Generic App Name and Bitmask Command - */ -typedef struct CFE_EVS_AppNameBitMaskCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppNameBitMaskCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_AppNameBitMaskCmd_t; - -/* - * The CFE_EVS_AppNameBitMaskCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_EnableAppEventTypeCmd_t; -typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_DisableAppEventTypeCmd_t; - -/** -** \brief Generic App Name, Event ID, Mask Command Payload -** -** For command details, see #CFE_EVS_SET_FILTER_CC, #CFE_EVS_ADD_EVENT_FILTER_CC -** and/or #CFE_EVS_DELETE_EVENT_FILTER_CC -** -**/ -typedef struct CFE_EVS_AppNameEventIDMaskCmd_Payload -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ - uint16 EventID; /**< \brief Event ID to use in the command*/ - uint16 Mask; /**< \brief Mask to use in the command */ -} CFE_EVS_AppNameEventIDMaskCmd_Payload_t; - -/** - * \brief Generic App Name, Event ID, Mask Command - */ -typedef struct CFE_EVS_AppNameEventIDMaskCmd -{ - CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ - CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload; /**< \brief Command payload */ -} CFE_EVS_AppNameEventIDMaskCmd_t; - -/* - * The CFE_EVS_AppNameEventIDMaskCmd_t is shared by several EVS command handlers. - * Create a unique type for each one so the prototypes will follow the naming pattern, - * allowing each command to evolve independently. - */ -typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_AddEventFilterCmd_t; -typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_SetFilterCmd_t; - -/*************************************************************************/ -/**********************************/ -/* Telemetry Message Data Formats */ -/**********************************/ -typedef struct CFE_EVS_AppTlmData -{ - CFE_ES_AppId_t AppID; /**< \cfetlmmnemonic \EVS_APPID - \brief Numerical application identifier */ - uint16 AppMessageSentCounter; /**< \cfetlmmnemonic \EVS_APPMSGSENTC - \brief Application message sent counter */ - uint8 AppEnableStatus; /**< \cfetlmmnemonic \EVS_APPENASTAT - \brief Application event service enable status */ - uint8 AppMessageSquelchedCounter; /**< \cfetlmmnemonic \EVS_SQUELCHEDC - \brief Number of events squelched */ -} CFE_EVS_AppTlmData_t; - -/** -** \cfeevstlm Event Services Housekeeping Telemetry Packet -**/ -typedef struct CFE_EVS_HousekeepingTlm_Payload -{ - uint8 CommandCounter; /**< \cfetlmmnemonic \EVS_CMDPC - \brief EVS Command Counter */ - uint8 CommandErrorCounter; /**< \cfetlmmnemonic \EVS_CMDEC - \brief EVS Command Error Counter */ - uint8 MessageFormatMode; /**< \cfetlmmnemonic \EVS_MSGFMTMODE - \brief Event message format mode (short/long) */ - uint8 MessageTruncCounter; /**< \cfetlmmnemonic \EVS_MSGTRUNC - \brief Event message truncation counter */ - - uint8 UnregisteredAppCounter; /**< \cfetlmmnemonic \EVS_UNREGAPPC - \brief Unregistered application message send counter */ - uint8 OutputPort; /**< \cfetlmmnemonic \EVS_OUTPUTPORT - \brief Output port mask */ - uint8 LogFullFlag; /**< \cfetlmmnemonic \EVS_LOGFULL - \brief Local event log full flag */ - uint8 LogMode; /**< \cfetlmmnemonic \EVS_LOGMODE - \brief Local event logging mode (overwrite/discard) */ - - uint16 MessageSendCounter; /**< \cfetlmmnemonic \EVS_MSGSENTC - \brief Event message send counter */ - uint16 LogOverflowCounter; /**< \cfetlmmnemonic \EVS_LOGOVERFLOWC - \brief Local event log overflow counter */ - - uint8 LogEnabled; /**< \cfetlmmnemonic \EVS_LOGENABLED - \brief Current event log enable/disable state */ - uint8 Spare1; /**< \cfetlmmnemonic \EVS_HK_SPARE1 - \brief Padding for 32 bit boundary */ - uint8 Spare2; /**< \cfetlmmnemonic \EVS_HK_SPARE2 - \brief Padding for 32 bit boundary */ - uint8 Spare3; /**< \cfetlmmnemonic \EVS_HK_SPARE3 - \brief Padding for 32 bit boundary */ - - CFE_EVS_AppTlmData_t AppData[CFE_MISSION_ES_MAX_APPLICATIONS]; /**< \cfetlmmnemonic \EVS_APP - \brief Array of registered application table data */ -} CFE_EVS_HousekeepingTlm_Payload_t; - -typedef struct CFE_EVS_HousekeepingTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_EVS_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_EVS_HousekeepingTlm_t; - -/** Telemetry packet structures */ - -typedef struct CFE_EVS_PacketID -{ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \EVS_APPNAME - \brief Application name */ - uint16 EventID; /**< \cfetlmmnemonic \EVS_EVENTID - \brief Numerical event identifier */ - uint16 EventType; /**< \cfetlmmnemonic \EVS_EVENTTYPE - \brief Numerical event type identifier */ - uint32 SpacecraftID; /**< \cfetlmmnemonic \EVS_SCID - \brief Spacecraft identifier */ - uint32 ProcessorID; /**< \cfetlmmnemonic \EVS_PROCESSORID - \brief Numerical processor identifier */ -} CFE_EVS_PacketID_t; - -/** -** \cfeevstlm Event Message Telemetry Packet (Long format) -**/ -typedef struct CFE_EVS_LongEventTlm_Payload -{ - CFE_EVS_PacketID_t PacketID; /**< \brief Event packet information */ - char Message[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; /**< \cfetlmmnemonic \EVS_EVENT - \brief Event message string */ - uint8 Spare1; /**< \cfetlmmnemonic \EVS_SPARE1 - \brief Structure padding */ - uint8 Spare2; /**< \cfetlmmnemonic \EVS_SPARE2 - \brief Structure padding */ -} CFE_EVS_LongEventTlm_Payload_t; - -/** -** \cfeevstlm Event Message Telemetry Packet (Short format) -**/ -typedef struct CFE_EVS_ShortEventTlm_Payload -{ - CFE_EVS_PacketID_t PacketID; /**< \brief Event packet information */ -} CFE_EVS_ShortEventTlm_Payload_t; - -typedef struct CFE_EVS_LongEventTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_EVS_LongEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_EVS_LongEventTlm_t; - -typedef struct CFE_EVS_ShortEventTlm -{ - CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ - CFE_EVS_ShortEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ -} CFE_EVS_ShortEventTlm_t; - -#endif /* CFE_EVS_MSG_H */ +#endif diff --git a/modules/evs/config/default_cfe_evs_interface_cfg.h b/modules/evs/config/default_cfe_evs_interface_cfg.h new file mode 100644 index 000000000..a8f6643fc --- /dev/null +++ b/modules/evs/config/default_cfe_evs_interface_cfg.h @@ -0,0 +1,49 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_EVS) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_INTERFACE_CFG_H +#define CFE_EVS_INTERFACE_CFG_H + +/** +** \cfeevscfg Maximum Event Message Length +** +** \par Description: +** Indicates the maximum length (in characters) of the formatted text +** string portion of an event message +** +** This length does not need to include an extra character for NULL termination. +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_EVS_MAX_MESSAGE_LENGTH 122 + +#endif diff --git a/modules/evs/config/default_cfe_evs_internal_cfg.h b/modules/evs/config/default_cfe_evs_internal_cfg.h new file mode 100644 index 000000000..728b7d07d --- /dev/null +++ b/modules/evs/config/default_cfe_evs_internal_cfg.h @@ -0,0 +1,199 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_EVS) Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_INTERNAL_CFG_H +#define CFE_EVS_INTERNAL_CFG_H + +/** +** \cfeescfg Define EVS Task Priority +** +** \par Description: +** Defines the cFE_EVS Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_EVS_START_TASK_PRIORITY 61 + +/** +** \cfeescfg Define EVS Task Stack Size +** +** \par Description: +** Defines the cFE_EVS Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_EVS_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +/** +** \cfeevscfg Define Maximum Number of Event Filters per Application +** +** \par Description: +** Maximum number of events that may be filtered per application. +** +** \par Limits +** There are no restrictions on the lower and upper limits however, +** the maximum number of event filters is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_EVS_MAX_EVENT_FILTERS 8 + +/** +** \cfeevscfg Maximum number of event before squelching +** +** \par Description: +** Maximum number of events that may be emitted per app per second. +** Setting this to 0 will cause events to be unrestricted. +** +** \par Limits +** This number must be less than or equal to INT_MAX/1000 +*/ +#define CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST 32 + +/** +** \cfeevscfg Sustained number of event messages per second per app before squelching +** +** \par Description: +** Sustained number of events that may be emitted per app per second. +** +** \par Limits +** This number must be less than or equal to #CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST. +** Values lower than 8 may cause functional and unit test failures. +*/ +#define CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC 8 + +/** +** \cfeevscfg Default Event Log Filename +** +** \par Description: +** The value of this constant defines the filename used to store the Event +** Services local event log. This filename is used only when no filename is +** specified in the command to dump the event log. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_LOG_FILE "/ram/cfe_evs.log" + +/** +** \cfeevscfg Maximum Number of Events in EVS Local Event Log +** +** \par Description: +** Dictates the EVS local event log capacity. Units are the number of events. +** +** \par Limits +** There are no restrictions on the lower and upper limits however, +** the maximum log size is system dependent and should be verified. +*/ +#define CFE_PLATFORM_EVS_LOG_MAX 20 + +/** +** \cfeevscfg Default EVS Application Data Filename +** +** \par Description: +** The value of this constant defines the filename used to store the EVS +** Application Data(event counts/filtering information). This filename is +** used only when no filename is specified in the command to dump the event +** log. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_APP_DATA_FILE "/ram/cfe_evs_app.dat" + +/** +** \cfeevscfg Default EVS Output Port State +** +** \par Description: +** Defines the default port state (enabled or disabled) for the four output +** ports defined within the Event Service. Port 1 is usually the uart output +** terminal. To enable a port, set the proper bit to a 1. Bit 0 is port 1, +** bit 1 is port2 etc. +** +** \par Limits +** The valid settings are 0x0 to 0xF. +*/ +#define CFE_PLATFORM_EVS_PORT_DEFAULT 0x0001 + +/** +** \cfeevscfg Default EVS Event Type Filter Mask +** +** \par Description: +** Defines a state of on or off for all four event types. The term event +** 'type' refers to the criticality level and may be Debug, Informational, +** Error or Critical. Each event type has a bit position. (bit 0 = Debug, +** bit 1 = Info, bit 2 = Error, bit 3 = Critical). This is a global setting, +** meaning it applies to all applications. To filter an event type, set its +** bit to zero. For example, +** 0xE means Debug = OFF, Info = ON, Error = ON, Critical = ON +** +** \par Limits +** The valid settings are 0x0 to 0xF. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_TYPE_FLAG 0xE + +/** +** \cfeevscfg Default EVS Local Event Log Mode +** +** \par Description: +** Defines a state of overwrite(0) or discard(1) for the operation of the +** EVS local event log. The log may operate in either Overwrite mode = 0, +** where once the log becomes full the oldest event in the log will be +** overwritten, or Discard mode = 1, where once the log becomes full the +** contents of the log are preserved and the new event is discarded. +** Overwrite Mode = 0, Discard Mode = 1. +** +** \par Limits +** The valid settings are 0 or 1 +*/ +#define CFE_PLATFORM_EVS_DEFAULT_LOG_MODE 1 + +/** +** \cfeevscfg Default EVS Message Format Mode +** +** \par Description: +** Defines the default message format (long or short) for event messages being +** sent to the ground. Choose between #CFE_EVS_MsgFormat_LONG or +** #CFE_EVS_MsgFormat_SHORT. +** +** \par Limits +** The valid settings are #CFE_EVS_MsgFormat_LONG or #CFE_EVS_MsgFormat_SHORT +*/ +#define CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE CFE_EVS_MsgFormat_LONG + +#endif diff --git a/modules/evs/config/default_cfe_evs_mission_cfg.h b/modules/evs/config/default_cfe_evs_mission_cfg.h new file mode 100644 index 000000000..5146773c2 --- /dev/null +++ b/modules/evs/config/default_cfe_evs_mission_cfg.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Event Services (CFE_EVS) Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_MISSION_CFG_H +#define CFE_EVS_MISSION_CFG_H + +#include "cfe_evs_interface_cfg.h" + +#endif diff --git a/modules/evs/config/default_cfe_evs_msg.h b/modules/evs/config/default_cfe_evs_msg.h new file mode 100644 index 000000000..6f30ea47f --- /dev/null +++ b/modules/evs/config/default_cfe_evs_msg.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_EVS) command and telemetry + * message data types. + * + * This is a compatibility header for the "cfe_evs_msg.h" file that has + * traditionally provided the message definitions for cFS apps. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_MSG_H +#define CFE_EVS_MSG_H + +#include "cfe_mission_cfg.h" +#include "cfe_evs_fcncodes.h" +#include "cfe_evs_msgstruct.h" + +#endif diff --git a/modules/evs/config/default_cfe_evs_msgdefs.h b/modules/evs/config/default_cfe_evs_msgdefs.h new file mode 100644 index 000000000..654829e29 --- /dev/null +++ b/modules/evs/config/default_cfe_evs_msgdefs.h @@ -0,0 +1,43 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFE Event Services (CFE_EVS) command and telemetry + * message constant definitions. + * + * For CFE_EVS this is only the function/command code definitions + */ +#ifndef CFE_EVS_MSGDEFS_H +#define CFE_EVS_MSGDEFS_H + +#include "cfe_evs_fcncodes.h" + +/* Event Type bit masks */ +#define CFE_EVS_DEBUG_BIT 0x0001 +#define CFE_EVS_INFORMATION_BIT 0x0002 +#define CFE_EVS_ERROR_BIT 0x0004 +#define CFE_EVS_CRITICAL_BIT 0x0008 + +/* Output Port bit masks */ +#define CFE_EVS_PORT1_BIT 0x0001 +#define CFE_EVS_PORT2_BIT 0x0002 +#define CFE_EVS_PORT3_BIT 0x0004 +#define CFE_EVS_PORT4_BIT 0x0008 + +#endif diff --git a/modules/evs/config/default_cfe_evs_msgids.h b/modules/evs/config/default_cfe_evs_msgids.h new file mode 100644 index 000000000..1d31ddb5b --- /dev/null +++ b/modules/evs/config/default_cfe_evs_msgids.h @@ -0,0 +1,42 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_EVS) Application Message IDs + */ +#ifndef CFE_EVS_MSGIDS_H +#define CFE_EVS_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_evs_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_CMD_MSG /* 0x1801 */ +#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_SEND_HK_MSG /* 0x1809 */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_HK_TLM_MSG /* 0x0801 */ +#define CFE_EVS_LONG_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_LONG_EVENT_MSG_MSG /* 0x0808 */ +#define CFE_EVS_SHORT_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG /* 0x0809 */ + +#endif diff --git a/modules/evs/config/default_cfe_evs_msgstruct.h b/modules/evs/config/default_cfe_evs_msgstruct.h new file mode 100644 index 000000000..ba0b394a7 --- /dev/null +++ b/modules/evs/config/default_cfe_evs_msgstruct.h @@ -0,0 +1,411 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * cFE Executive Services (EVS) Command and Telemetry packet definition file. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ +#ifndef CFE_EVS_MSGSTRUCT_H +#define CFE_EVS_MSGSTRUCT_H + +/************************************************************************ + * Includes + ************************************************************************/ +#include "common_types.h" +#include "cfe_evs_msgdefs.h" +#include "cfe_evs_extern_typedefs.h" +#include "cfe_msg_hdr.h" + +/****************** Structure Definitions *********************/ + +/** +** \brief Command with no additional arguments +**/ +typedef struct CFE_EVS_NoArgsCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ +} CFE_EVS_NoArgsCmd_t; + +/* + * The NoArgsCmd is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_NoopCmd_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ResetCountersCmd_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ClearLogCmd_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_SendHkCmd_t; + +/** +** \brief Write Event Log to File Command Payload +** +** For command details, see #CFE_EVS_WRITE_LOG_DATA_FILE_CC +** +**/ +typedef struct CFE_EVS_LogFileCmd_Payload +{ + char LogFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where log data is to be written */ +} CFE_EVS_LogFileCmd_Payload_t; + +/** + * \brief Write Event Log to File Command + */ +typedef struct CFE_EVS_WriteLogDataFileCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_LogFileCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_WriteLogDataFileCmd_t; + +/** +** \brief Write Event Services Application Information to File Command Payload +** +** For command details, see #CFE_EVS_WRITE_APP_DATA_FILE_CC +** +**/ +typedef struct CFE_EVS_AppDataCmd_Payload +{ + char AppDataFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where application data is to be written */ +} CFE_EVS_AppDataCmd_Payload_t; + +/** + * \brief Write Event Services Application Information to File Command + */ +typedef struct CFE_EVS_WriteAppDataFileCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppDataCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_WriteAppDataFileCmd_t; + +/** +** \brief Set Log Mode Command Payload +** +** For command details, see #CFE_EVS_SET_LOG_MODE_CC +** +**/ +typedef struct CFE_EVS_SetLogMode_Payload +{ + CFE_EVS_LogMode_Enum_t LogMode; /**< \brief Mode to use in the command*/ + uint8 Spare; /**< \brief Pad to even byte*/ +} CFE_EVS_SetLogMode_Payload_t; + +/** + * \brief Set Log Mode Command + */ +typedef struct CFE_EVS_SetLogModeCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_SetLogMode_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_SetLogModeCmd_t; + +/** +** \brief Set Event Format Mode Command Payload +** +** For command details, see #CFE_EVS_SET_EVENT_FORMAT_MODE_CC +** +**/ +typedef struct CFE_EVS_SetEventFormatCode_Payload +{ + CFE_EVS_MsgFormat_Enum_t MsgFormat; /**< \brief Mode to use in the command*/ + uint8 Spare; /**< \brief Pad to even byte*/ +} CFE_EVS_SetEventFormatMode_Payload_t; + +/** + * \brief Set Event Format Mode Command + */ +typedef struct CFE_EVS_SetEventFormatModeCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_SetEventFormatMode_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_SetEventFormatModeCmd_t; + +/** +** \brief Generic Bitmask Command Payload +** +** For command details, see #CFE_EVS_ENABLE_EVENT_TYPE_CC, #CFE_EVS_DISABLE_EVENT_TYPE_CC, +** #CFE_EVS_ENABLE_PORTS_CC and/or #CFE_EVS_DISABLE_PORTS_CC +** +**/ +typedef struct CFE_EVS_BitMaskCmd_Payload +{ + uint8 BitMask; /**< \brief BitMask to use in the command */ + uint8 Spare; /**< \brief Pad to even byte*/ +} CFE_EVS_BitMaskCmd_Payload_t; + +/** + * \brief Generic Bitmask Command + */ +typedef struct CFE_EVS_BitMaskCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_BitMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_BitMaskCmd_t; + +/* + * The CFE_EVS_BitMaskCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnablePortsCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisablePortsCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnableEventTypeCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisableEventTypeCmd_t; + +/** +** \brief Generic App Name Command Payload +** +** For command details, see #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC, +** #CFE_EVS_RESET_APP_COUNTER_CC and/or #CFE_EVS_RESET_ALL_FILTERS_CC +** +**/ +typedef struct CFE_EVS_AppNameCmd_Payload +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ +} CFE_EVS_AppNameCmd_Payload_t; + +/** + * \brief Generic App Name Command + */ +typedef struct CFE_EVS_AppNameCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_AppNameCmd_t; + +/* + * The CFE_EVS_AppNameCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_AppNameCmd_t CFE_EVS_EnableAppEventsCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_DisableAppEventsCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAppCounterCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAllFiltersCmd_t; + +/** +** \brief Generic App Name and Event ID Command Payload +** +** For command details, see #CFE_EVS_RESET_FILTER_CC and #CFE_EVS_DELETE_EVENT_FILTER_CC +** +**/ +typedef struct CFE_EVS_AppNameEventIDCmd_Payload +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ + uint16 EventID; /**< \brief Event ID to use in the command*/ +} CFE_EVS_AppNameEventIDCmd_Payload_t; + +/** + * \brief Generic App Name and Event ID Command + */ +typedef struct CFE_EVS_AppNameEventIDCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameEventIDCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_AppNameEventIDCmd_t; + +/* + * The CFE_EVS_AppNameEventIDCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_ResetFilterCmd_t; +typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_DeleteEventFilterCmd_t; + +/** +** \brief Generic App Name and Bitmask Command Payload +** +** For command details, see #CFE_EVS_ENABLE_APP_EVENT_TYPE_CC and/or #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC +** +**/ +typedef struct CFE_EVS_AppNameBitMaskCmd_Payload +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ + uint8 BitMask; /**< \brief BitMask to use in the command*/ + uint8 Spare; /**< \brief Pad to even byte*/ +} CFE_EVS_AppNameBitMaskCmd_Payload_t; + +/** + * \brief Generic App Name and Bitmask Command + */ +typedef struct CFE_EVS_AppNameBitMaskCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameBitMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_AppNameBitMaskCmd_t; + +/* + * The CFE_EVS_AppNameBitMaskCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_EnableAppEventTypeCmd_t; +typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_DisableAppEventTypeCmd_t; + +/** +** \brief Generic App Name, Event ID, Mask Command Payload +** +** For command details, see #CFE_EVS_SET_FILTER_CC, #CFE_EVS_ADD_EVENT_FILTER_CC +** and/or #CFE_EVS_DELETE_EVENT_FILTER_CC +** +**/ +typedef struct CFE_EVS_AppNameEventIDMaskCmd_Payload +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ + uint16 EventID; /**< \brief Event ID to use in the command*/ + uint16 Mask; /**< \brief Mask to use in the command */ +} CFE_EVS_AppNameEventIDMaskCmd_Payload_t; + +/** + * \brief Generic App Name, Event ID, Mask Command + */ +typedef struct CFE_EVS_AppNameEventIDMaskCmd +{ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ + CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_AppNameEventIDMaskCmd_t; + +/* + * The CFE_EVS_AppNameEventIDMaskCmd_t is shared by several EVS command handlers. + * Create a unique type for each one so the prototypes will follow the naming pattern, + * allowing each command to evolve independently. + */ +typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_AddEventFilterCmd_t; +typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_SetFilterCmd_t; + +/*************************************************************************/ +/**********************************/ +/* Telemetry Message Data Formats */ +/**********************************/ +typedef struct CFE_EVS_AppTlmData +{ + CFE_ES_AppId_t AppID; /**< \cfetlmmnemonic \EVS_APPID + \brief Numerical application identifier */ + uint16 AppMessageSentCounter; /**< \cfetlmmnemonic \EVS_APPMSGSENTC + \brief Application message sent counter */ + uint8 AppEnableStatus; /**< \cfetlmmnemonic \EVS_APPENASTAT + \brief Application event service enable status */ + uint8 AppMessageSquelchedCounter; /**< \cfetlmmnemonic \EVS_SQUELCHEDC + \brief Number of events squelched */ +} CFE_EVS_AppTlmData_t; + +/** +** \cfeevstlm Event Services Housekeeping Telemetry Packet +**/ +typedef struct CFE_EVS_HousekeepingTlm_Payload +{ + uint8 CommandCounter; /**< \cfetlmmnemonic \EVS_CMDPC + \brief EVS Command Counter */ + uint8 CommandErrorCounter; /**< \cfetlmmnemonic \EVS_CMDEC + \brief EVS Command Error Counter */ + uint8 MessageFormatMode; /**< \cfetlmmnemonic \EVS_MSGFMTMODE + \brief Event message format mode (short/long) */ + uint8 MessageTruncCounter; /**< \cfetlmmnemonic \EVS_MSGTRUNC + \brief Event message truncation counter */ + + uint8 UnregisteredAppCounter; /**< \cfetlmmnemonic \EVS_UNREGAPPC + \brief Unregistered application message send counter */ + uint8 OutputPort; /**< \cfetlmmnemonic \EVS_OUTPUTPORT + \brief Output port mask */ + uint8 LogFullFlag; /**< \cfetlmmnemonic \EVS_LOGFULL + \brief Local event log full flag */ + uint8 LogMode; /**< \cfetlmmnemonic \EVS_LOGMODE + \brief Local event logging mode (overwrite/discard) */ + + uint16 MessageSendCounter; /**< \cfetlmmnemonic \EVS_MSGSENTC + \brief Event message send counter */ + uint16 LogOverflowCounter; /**< \cfetlmmnemonic \EVS_LOGOVERFLOWC + \brief Local event log overflow counter */ + + uint8 LogEnabled; /**< \cfetlmmnemonic \EVS_LOGENABLED + \brief Current event log enable/disable state */ + uint8 Spare1; /**< \cfetlmmnemonic \EVS_HK_SPARE1 + \brief Padding for 32 bit boundary */ + uint8 Spare2; /**< \cfetlmmnemonic \EVS_HK_SPARE2 + \brief Padding for 32 bit boundary */ + uint8 Spare3; /**< \cfetlmmnemonic \EVS_HK_SPARE3 + \brief Padding for 32 bit boundary */ + + CFE_EVS_AppTlmData_t AppData[CFE_MISSION_ES_MAX_APPLICATIONS]; /**< \cfetlmmnemonic \EVS_APP + \brief Array of registered application table data */ +} CFE_EVS_HousekeepingTlm_Payload_t; + +typedef struct CFE_EVS_HousekeepingTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_EVS_HousekeepingTlm_t; + +/** Telemetry packet structures */ + +typedef struct CFE_EVS_PacketID +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \EVS_APPNAME + \brief Application name */ + uint16 EventID; /**< \cfetlmmnemonic \EVS_EVENTID + \brief Numerical event identifier */ + uint16 EventType; /**< \cfetlmmnemonic \EVS_EVENTTYPE + \brief Numerical event type identifier */ + uint32 SpacecraftID; /**< \cfetlmmnemonic \EVS_SCID + \brief Spacecraft identifier */ + uint32 ProcessorID; /**< \cfetlmmnemonic \EVS_PROCESSORID + \brief Numerical processor identifier */ +} CFE_EVS_PacketID_t; + +/** +** \cfeevstlm Event Message Telemetry Packet (Long format) +**/ +typedef struct CFE_EVS_LongEventTlm_Payload +{ + CFE_EVS_PacketID_t PacketID; /**< \brief Event packet information */ + char Message[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; /**< \cfetlmmnemonic \EVS_EVENT + \brief Event message string */ + uint8 Spare1; /**< \cfetlmmnemonic \EVS_SPARE1 + \brief Structure padding */ + uint8 Spare2; /**< \cfetlmmnemonic \EVS_SPARE2 + \brief Structure padding */ +} CFE_EVS_LongEventTlm_Payload_t; + +/** +** \cfeevstlm Event Message Telemetry Packet (Short format) +**/ +typedef struct CFE_EVS_ShortEventTlm_Payload +{ + CFE_EVS_PacketID_t PacketID; /**< \brief Event packet information */ +} CFE_EVS_ShortEventTlm_Payload_t; + +typedef struct CFE_EVS_LongEventTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_LongEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_EVS_LongEventTlm_t; + +typedef struct CFE_EVS_ShortEventTlm +{ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */ + CFE_EVS_ShortEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ +} CFE_EVS_ShortEventTlm_t; + +#endif diff --git a/modules/evs/config/default_cfe_evs_platform_cfg.h b/modules/evs/config/default_cfe_evs_platform_cfg.h new file mode 100644 index 000000000..83f40168c --- /dev/null +++ b/modules/evs/config/default_cfe_evs_platform_cfg.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE Event Services (CFE_EVS) Application Platform Configuration Header File + * + * This is a compatibility header for the "platform_cfg.h" file that has + * traditionally provided both public and private config definitions + * for each CFS app. + * + * These definitions are now provided in two separate files, one for + * the public/mission scope and one for internal scope. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_EVS_PLATFORM_CFG_H +#define CFE_EVS_PLATFORM_CFG_H + +#include "cfe_evs_mission_cfg.h" +#include "cfe_evs_internal_cfg.h" + +#endif diff --git a/modules/evs/config/default_cfe_evs_topicids.h b/modules/evs/config/default_cfe_evs_topicids.h new file mode 100644 index 000000000..842758da0 --- /dev/null +++ b/modules/evs/config/default_cfe_evs_topicids.h @@ -0,0 +1,51 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Event Services (CFE_EVS) Application Topic IDs + */ +#ifndef CFE_EVS_TOPICIDS_H +#define CFE_EVS_TOPICIDS_H + +/** +** \cfemissioncfg cFE Portable Message Numbers for Commands +** +** \par Description: +** Portable message numbers for the cFE EVS command messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_EVS_CMD_MSG 1 +#define CFE_MISSION_EVS_SEND_HK_MSG 9 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Telemetry +** +** \par Description: +** Portable message numbers for the cFE EVS telemetry messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_EVS_HK_TLM_MSG 1 +#define CFE_MISSION_EVS_LONG_EVENT_MSG_MSG 8 +#define CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG 9 + +#endif diff --git a/modules/evs/fsw/inc/cfe_evs_events.h b/modules/evs/fsw/inc/cfe_evs_eventids.h similarity index 100% rename from modules/evs/fsw/inc/cfe_evs_events.h rename to modules/evs/fsw/inc/cfe_evs_eventids.h diff --git a/modules/evs/fsw/src/cfe_evs_module_all.h b/modules/evs/fsw/src/cfe_evs_module_all.h index 312d60789..206a44e52 100644 --- a/modules/evs/fsw/src/cfe_evs_module_all.h +++ b/modules/evs/fsw/src/cfe_evs_module_all.h @@ -39,10 +39,10 @@ #include "cfe_evs_core_internal.h" -#include "cfe_evs_events.h" /* EVS event IDs */ -#include "cfe_evs_task.h" /* EVS internal definitions */ -#include "cfe_evs_log.h" /* EVS log file definitions */ -#include "cfe_evs_utils.h" /* EVS utility function definitions */ +#include "cfe_evs_eventids.h" /* EVS event IDs */ +#include "cfe_evs_task.h" /* EVS internal definitions */ +#include "cfe_evs_log.h" /* EVS log file definitions */ +#include "cfe_evs_utils.h" /* EVS utility function definitions */ #include "cfe_evs_dispatch.h" #endif /* CFE_EVS_MODULE_ALL_H */ diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index f8274057e..bd111c7a8 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -48,7 +48,7 @@ #include "cfe_evs_api_typedefs.h" #include "cfe_evs_log_typedef.h" #include "cfe_sb_api_typedefs.h" -#include "cfe_evs_events.h" +#include "cfe_evs_eventids.h" /********************* Macro and Constant Type Definitions ***************************/ diff --git a/modules/evs/mission_build.cmake b/modules/evs/mission_build.cmake new file mode 100644 index 000000000..cb1581740 --- /dev/null +++ b/modules/evs/mission_build.cmake @@ -0,0 +1,37 @@ +########################################################### +# +# EVS Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the EVS configuration +set(EVS_MISSION_CONFIG_FILE_LIST + cfe_evs_mission_cfg.h + cfe_evs_interface_cfg.h + cfe_evs_extern_typedefs.h + cfe_evs_fcncodes.h + cfe_evs_msgdefs.h + cfe_evs_msg.h + cfe_evs_msgstruct.h + cfe_evs_topicids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(EVS_CFGFILE ${EVS_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${EVS_CFGFILE}" NAME_WE) + if (DEFINED EVS_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${EVS_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${EVS_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach() From 134b9d743713edfd5ad05cc5381bc0f00b0cdde7 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 16:28:00 -0400 Subject: [PATCH 163/200] Fix #2320, reorganize FS header files Organize FS header file contents according to the convention --- .../config/default_cfe_fs_extern_typedefs.h | 31 ++++++++++++++ .../config/default_cfe_fs_filedef.h} | 30 ++------------ .../fs/config/default_cfe_fs_interface_cfg.h | 41 +++++++++++++++++++ .../fs/config/default_cfe_fs_mission_cfg.h | 36 ++++++++++++++++ modules/fs/mission_build.cmake | 33 +++++++++++++++ 5 files changed, 144 insertions(+), 27 deletions(-) create mode 100644 modules/fs/config/default_cfe_fs_extern_typedefs.h rename modules/{core_api/fsw/inc/cfe_fs_extern_typedefs.h => fs/config/default_cfe_fs_filedef.h} (86%) create mode 100644 modules/fs/config/default_cfe_fs_interface_cfg.h create mode 100644 modules/fs/config/default_cfe_fs_mission_cfg.h create mode 100644 modules/fs/mission_build.cmake diff --git a/modules/fs/config/default_cfe_fs_extern_typedefs.h b/modules/fs/config/default_cfe_fs_extern_typedefs.h new file mode 100644 index 000000000..65f3c6fa5 --- /dev/null +++ b/modules/fs/config/default_cfe_fs_extern_typedefs.h @@ -0,0 +1,31 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Declarations and prototypes for cfe_fs_extern_typedefs module + */ + +#ifndef CFE_FS_EXTERN_TYPEDEFS_H +#define CFE_FS_EXTERN_TYPEDEFS_H + +#include "cfe_mission_cfg.h" +#include "cfe_fs_filedef.h" + +#endif /* CFE_FS_EXTERN_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h b/modules/fs/config/default_cfe_fs_filedef.h similarity index 86% rename from modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h rename to modules/fs/config/default_cfe_fs_filedef.h index 489db9c84..6cda8119c 100644 --- a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h +++ b/modules/fs/config/default_cfe_fs_filedef.h @@ -22,33 +22,11 @@ * Declarations and prototypes for cfe_fs_extern_typedefs module */ -#ifndef CFE_FS_EXTERN_TYPEDEFS_H -#define CFE_FS_EXTERN_TYPEDEFS_H - -/* This header may be generated from an EDS file, - * tools are available and the feature is enabled */ -#ifdef CFE_EDS_ENABLED_BUILD - -/* Use the EDS generated version of these types */ -#include "cfe_fs_eds_typedefs.h" - -#else -/* Use the local definitions of these types */ +#ifndef CFE_FS_FILEHDR_H +#define CFE_FS_FILEHDR_H #include "common_types.h" - -/******************* Macro Definitions ***********************/ - -/* - * NOTE: the value of CFE_FS_HDR_DESC_MAX_LEN, if modified, should - * be constrained to multiples of 4, as it is used within a structure that - * also contains uint32 types. This ensures that the entire structure - * remains 32-bit aligned without the need for implicit padding bytes. - */ - -#define CFE_FS_HDR_DESC_MAX_LEN 32 /**< \brief Max length of description field in a standard cFE File Header */ - -#define CFE_FS_FILE_CONTENT_ID 0x63464531 /**< \brief Magic Number for cFE compliant files (= 'cFE1') */ +#include "cfe_fs_interface_cfg.h" /* to define CFE_FS_HDR_DESC_MAX_LEN */ /** * @brief File subtypes used within cFE @@ -217,6 +195,4 @@ typedef struct CFE_FS_Header char Description[CFE_FS_HDR_DESC_MAX_LEN]; /**< \brief File description */ } CFE_FS_Header_t; -#endif /* CFE_EDS_ENABLED_BUILD */ - #endif /* CFE_FS_EXTERN_TYPEDEFS_H */ diff --git a/modules/fs/config/default_cfe_fs_interface_cfg.h b/modules/fs/config/default_cfe_fs_interface_cfg.h new file mode 100644 index 000000000..3f02853d3 --- /dev/null +++ b/modules/fs/config/default_cfe_fs_interface_cfg.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Declarations and prototypes for cfe_fs_extern_typedefs module + */ + +#ifndef CFE_FS_INTERFACE_CFG_H +#define CFE_FS_INTERFACE_CFG_H + +/******************* Macro Definitions ***********************/ + +/* + * NOTE: the value of CFE_FS_HDR_DESC_MAX_LEN, if modified, should + * be constrained to multiples of 4, as it is used within a structure that + * also contains uint32 types. This ensures that the entire structure + * remains 32-bit aligned without the need for implicit padding bytes. + */ + +#define CFE_FS_HDR_DESC_MAX_LEN 32 /**< \brief Max length of description field in a standard cFE File Header */ + +#define CFE_FS_FILE_CONTENT_ID 0x63464531 /**< \brief Magic Number for cFE compliant files (= 'cFE1') */ + +#endif /* CFE_FS_INTERFACE_CFG_H */ diff --git a/modules/fs/config/default_cfe_fs_mission_cfg.h b/modules/fs/config/default_cfe_fs_mission_cfg.h new file mode 100644 index 000000000..23a583325 --- /dev/null +++ b/modules/fs/config/default_cfe_fs_mission_cfg.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFE File Services (CFE_FS) Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_FS_MISSION_CFG_H +#define CFE_FS_MISSION_CFG_H + +#include "cfe_fs_interface_cfg.h" + +#endif diff --git a/modules/fs/mission_build.cmake b/modules/fs/mission_build.cmake new file mode 100644 index 000000000..80b644e5b --- /dev/null +++ b/modules/fs/mission_build.cmake @@ -0,0 +1,33 @@ +########################################################### +# +# FS Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the FS configuration +set(FS_MISSION_CONFIG_FILE_LIST + cfe_fs_mission_cfg.h + cfe_fs_interface_cfg.h + cfe_fs_filedef.h + cfe_fs_extern_typedefs.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(FS_CFGFILE ${FS_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${FS_CFGFILE}" NAME_WE) + if (DEFINED FS_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${FS_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${FS_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${FS_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach() From ef4d3597320305bc4fcb56c64d508cbb1c8d1962 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 16:28:00 -0400 Subject: [PATCH 164/200] Fix #2320, reorganize CORE_API header files Organize CORE_API header file contents according to the convention --- modules/core_api/arch_build.cmake | 6 + .../config/default_cfe_core_api_base_msgids.h | 72 ++++++++++ .../default_cfe_core_api_interface_cfg.h | 132 ++++++++++++++++++ .../core_api/config/default_cfe_mission_cfg.h | 39 ++++++ modules/core_api/config/default_cfe_msgids.h | 42 ++++++ modules/core_api/mission_build.cmake | 7 + 6 files changed, 298 insertions(+) create mode 100644 modules/core_api/config/default_cfe_core_api_base_msgids.h create mode 100644 modules/core_api/config/default_cfe_core_api_interface_cfg.h create mode 100644 modules/core_api/config/default_cfe_mission_cfg.h create mode 100644 modules/core_api/config/default_cfe_msgids.h diff --git a/modules/core_api/arch_build.cmake b/modules/core_api/arch_build.cmake index fe0b72634..2836d8683 100644 --- a/modules/core_api/arch_build.cmake +++ b/modules/core_api/arch_build.cmake @@ -14,6 +14,12 @@ generate_config_includefile( FILE_NAME "cfe_msgids.h" MATCH_SUFFIX "msgids.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_msgids.h" PREFIXES ${BUILD_CONFIG} ) +generate_config_includefile( + FILE_NAME "cfe_core_api_base_msgids.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_core_api_base_msgids.h" + PREFIXES ${BUILD_CONFIG} +) diff --git a/modules/core_api/config/default_cfe_core_api_base_msgids.h b/modules/core_api/config/default_cfe_core_api_base_msgids.h new file mode 100644 index 000000000..ffb8b6d62 --- /dev/null +++ b/modules/core_api/config/default_cfe_core_api_base_msgids.h @@ -0,0 +1,72 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * This header file contains the Message Id's for messages used by the + * cFE core. + * + */ + +#ifndef CFE_CORE_BASE_MSGIDS_H +#define CFE_CORE_BASE_MSGIDS_H + +/** + * \brief Platform command message ID base offset + * + * Example mechanism for setting default command bits and deconflicting MIDs across multiple + * platforms in a mission. For any sufficiently complex mission this method is + * typically replaced by a centralized message ID management scheme. + * + * 0x1800 - Nominal value for default message ID implementation (V1). This sets the command + * field and the secondary header present field. Typical V1 command MID range + * is 0x1800-1FFF. Additional cpus can deconflict message IDs by incrementing + * this value to provide sub-allocations (0x1900 for example). + * 0x0080 - Command bit for MISSION_MSGID_V2 message ID implementation (V2). Although + * this can be used for the value below due to the relatively small set + * of MIDs in the framework it will not scale so an alternative + * method of deconfliction is recommended. + */ +#define CFE_PLATFORM_CMD_MID_BASE 0x1800 + +/** + * \brief Platform telemetry message ID base offset + * + * 0x0800 - Nominal for message ID V1 + * 0x0000 - Potential value for MISSION_MSGID_V2, but limited to a range of + * 0x0000-0x007F since the command bit is 0x0080. Alternative + * method of deconfliction is recommended. + * + * See #CFE_PLATFORM_CMD_MID_BASE for more information + */ +#define CFE_PLATFORM_TLM_MID_BASE 0x0800 + +/** + * \brief "Global" command message ID base offset + * + * 0x1860 - Nominal value for message ID V1 + * 0x00E0 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080. + * Works in limited cases only, alternative method of deconfliction + * is recommended. + * See #CFE_PLATFORM_CMD_MID_BASE for more information + */ +#define CFE_PLATFORM_CMD_MID_BASE_GLOB 0x1860 + +#endif /* CFE_CORE_BASE_MSGIDS_H */ diff --git a/modules/core_api/config/default_cfe_core_api_interface_cfg.h b/modules/core_api/config/default_cfe_core_api_interface_cfg.h new file mode 100644 index 000000000..1f96eb73e --- /dev/null +++ b/modules/core_api/config/default_cfe_core_api_interface_cfg.h @@ -0,0 +1,132 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * This header file contains the mission configuration parameters and + * typedefs with mission scope. + */ + +#ifndef CFE_CORE_API_INTERFACE_CFG_H +#define CFE_CORE_API_INTERFACE_CFG_H + +/** +** \cfemissioncfg cFE Maximum length for pathnames within data exchange structures +** +** \par Description: +** The value of this constant dictates the size of pathnames within all structures +** used for external data exchange, such as Software bus messages and table definitions. +** This is typically the same as OS_MAX_PATH_LEN but that is OSAL dependent -- +** and as such it definable on a per-processor/OS basis and hence may be different +** across multiple processors. It is recommended to set this to the value of the +** largest OS_MAX_PATH_LEN in use on any CPU on the mission. +** +** This affects only the layout of command/telemetry messages and table definitions; +** internal allocation may use the platform-specific OS_MAX_PATH_LEN value. +** +** This length must include an extra character for NULL termination. +** +** \par Limits +** All CPUs within the same SB domain (mission) and ground tools must share the +** same definition. +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_MAX_PATH_LEN 64 + +/** +** \cfemissioncfg cFE Maximum length for filenames within data exchange structures +** +** \par Description: +** The value of this constant dictates the size of filenames within all structures +** used for external data exchange, such as Software bus messages and table definitions. +** This is typically the same as OS_MAX_FILE_LEN but that is OSAL dependent -- +** and as such it definable on a per-processor/OS basis and hence may be different +** across multiple processors. It is recommended to set this to the value of the +** largest OS_MAX_FILE_LEN in use on any CPU on the mission. +** +** This affects only the layout of command/telemetry messages and table definitions; +** internal allocation may use the platform-specific OS_MAX_FILE_LEN value. +** +** This length must include an extra character for NULL termination. +** +** \par Limits +** All CPUs within the same SB domain (mission) and ground tools must share the +** same definition. +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_MAX_FILE_LEN 20 + +/** +** \cfemissioncfg cFE Maximum length for API names within data exchange structures +** +** \par Description: +** The value of this constant dictates the size of filenames within all structures +** used for external data exchange, such as Software bus messages and table definitions. +** This is typically the same as OS_MAX_API_LEN but that is OSAL dependent -- +** and as such it definable on a per-processor/OS basis and hence may be different +** across multiple processors. It is recommended to set this to the value of the +** largest OS_MAX_API_LEN in use on any CPU on the mission. +** +** This affects only the layout of command/telemetry messages and table definitions; +** internal allocation may use the platform-specific OS_MAX_API_LEN value. +** +** This length must include an extra character for NULL termination. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_MAX_API_LEN 20 + +/** +** \cfemissioncfg cFE Maximum number of files in a message/data exchange +** +** \par Description: +** The value of this constant dictates the maximum number of files within all structures +** used for external data exchange, such as Software bus messages and table definitions. +** This is typically the same as OS_MAX_NUM_OPEN_FILES but that is OSAL dependent -- +** and as such it definable on a per-processor/OS basis and hence may be different +** across multiple processors. It is recommended to set this to the value of the +** largest OS_MAX_NUM_OPEN_FILES in use on any CPU on the mission. +** +** This affects only the layout of command/telemetry messages and table definitions; +** internal allocation may use the platform-specific OS_MAX_NUM_OPEN_FILES value. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +*/ +#define CFE_MISSION_MAX_NUM_FILES 50 + +#endif /* SAMPLE_MISSION_CFG_H */ diff --git a/modules/core_api/config/default_cfe_mission_cfg.h b/modules/core_api/config/default_cfe_mission_cfg.h new file mode 100644 index 000000000..9d7b21cf1 --- /dev/null +++ b/modules/core_api/config/default_cfe_mission_cfg.h @@ -0,0 +1,39 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * This header file contains the mission configuration parameters and + * typedefs with mission scope. + * + */ + +#ifndef CFE_MISSION_CFG_H +#define CFE_MISSION_CFG_H + +#include "cfe_core_api_interface_cfg.h" +#include "cfe_es_mission_cfg.h" +#include "cfe_evs_mission_cfg.h" +#include "cfe_sb_mission_cfg.h" +#include "cfe_tbl_mission_cfg.h" +#include "cfe_time_mission_cfg.h" +#include "cfe_fs_mission_cfg.h" + +#endif /* CFE_MISSION_CFG_H */ diff --git a/modules/core_api/config/default_cfe_msgids.h b/modules/core_api/config/default_cfe_msgids.h new file mode 100644 index 000000000..300734644 --- /dev/null +++ b/modules/core_api/config/default_cfe_msgids.h @@ -0,0 +1,42 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * This header file contains the Message Id's for messages used by the + * cFE core. + * + */ + +#ifndef CFE_MSGIDS_H +#define CFE_MSGIDS_H + +/* +** Includes +*/ + +#include "cfe_es_msgids.h" +#include "cfe_evs_msgids.h" +#include "cfe_sb_msgids.h" +#include "cfe_tbl_msgids.h" +#include "cfe_time_msgids.h" +#include "cfe_test_msgids.h" + +#endif /* CFE_MSGIDS_H */ diff --git a/modules/core_api/mission_build.cmake b/modules/core_api/mission_build.cmake index 6bc99b88b..1139b1bc1 100644 --- a/modules/core_api/mission_build.cmake +++ b/modules/core_api/mission_build.cmake @@ -13,12 +13,19 @@ generate_config_includefile( FILE_NAME "cfe_mission_cfg.h" MATCH_SUFFIX "mission_cfg.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_mission_cfg.h" PREFIXES ${MISSIONCONFIG} cfe ) generate_config_includefile( FILE_NAME "cfe_perfids.h" MATCH_SUFFIX "perfids.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_perfids.h" PREFIXES ${MISSIONCONFIG} cfe ) +generate_config_includefile( + FILE_NAME "cfe_core_api_interface_cfg.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_core_api_interface_cfg.h" + PREFIXES ${BUILD_CONFIG} +) From f0edf1f23e3cea59c21b11296b8aea83528dcf1a Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 2 May 2023 16:28:00 -0400 Subject: [PATCH 165/200] Fix #2320, reorganize CORE_PRIVATE header files Organize CORE_PRIVATE header file contents according to the convention --- modules/core_private/arch_build.cmake | 6 ++ .../default_cfe_core_private_internal_cfg.h | 70 +++++++++++++++++++ .../config/default_cfe_platform_cfg.h | 44 ++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 modules/core_private/config/default_cfe_core_private_internal_cfg.h create mode 100644 modules/core_private/config/default_cfe_platform_cfg.h diff --git a/modules/core_private/arch_build.cmake b/modules/core_private/arch_build.cmake index 6bba56507..0fc3aa355 100644 --- a/modules/core_private/arch_build.cmake +++ b/modules/core_private/arch_build.cmake @@ -13,7 +13,13 @@ generate_config_includefile( FILE_NAME "cfe_platform_cfg.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_platform_cfg.h" MATCH_SUFFIX "platform_cfg.h" PREFIXES ${BUILD_CONFIG} ) +generate_config_includefile( + FILE_NAME "cfe_core_private_internal_cfg.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_core_private_internal_cfg.h" + PREFIXES ${BUILD_CONFIG} +) diff --git a/modules/core_private/config/default_cfe_core_private_internal_cfg.h b/modules/core_private/config/default_cfe_core_private_internal_cfg.h new file mode 100644 index 000000000..f654d66a2 --- /dev/null +++ b/modules/core_private/config/default_cfe_core_private_internal_cfg.h @@ -0,0 +1,70 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Executive Services (CFE_ES) Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef CFE_CORE_PRIVATE_INTERNAL_CFG_H +#define CFE_CORE_PRIVATE_INTERNAL_CFG_H + +/** +** \cfesbcfg Platform Endian Indicator +** +** \par Description: +** The value of this constant indicates the endianess of the target system +** +** \par Limits +** This parameter has a lower limit of 0 and an upper limit of 1. +*/ +#define CFE_PLATFORM_ENDIAN CCSDS_LITTLE_ENDIAN + +/** \cfeescfg CFE core application startup timeout +** +** \par Description: +** The upper limit for the amount of time that the cFE core applications +** (ES, SB, EVS, TIME, TBL) are each allotted to reach their respective +** "ready" states. +** +** The CFE "main" thread starts individual tasks for each of the core applications +** (except FS). Each of these must perform some initialization work before the +** next core application can be started, so the main thread waits to ensure that the +** application has reached the "ready" state before starting the next application. +** +** If any core application fails to start, then it indicates a major problem with +** the system and startup is aborted. +** +** Units are in milliseconds +** +** \par Limits: +** Must be defined as an integer value that is greater than +** or equal to zero. +** +*/ +#define CFE_PLATFORM_CORE_MAX_STARTUP_MSEC 30000 + +#endif diff --git a/modules/core_private/config/default_cfe_platform_cfg.h b/modules/core_private/config/default_cfe_platform_cfg.h new file mode 100644 index 000000000..b61ccb8f0 --- /dev/null +++ b/modules/core_private/config/default_cfe_platform_cfg.h @@ -0,0 +1,44 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Purpose: + * This header file contains the platform configuration parameters. + * + * Notes: + * The impact of changing these configurations from their default value is + * not yet documented. Changing these values may impact the performance + * and functionality of the system. + * + * Author: R.McGraw/SSI + * + */ + +#ifndef CFE_PLATFORM_CFG_H +#define CFE_PLATFORM_CFG_H + +#include "cfe_core_private_internal_cfg.h" +#include "cfe_es_platform_cfg.h" +#include "cfe_evs_platform_cfg.h" +#include "cfe_sb_platform_cfg.h" +#include "cfe_tbl_platform_cfg.h" +#include "cfe_time_platform_cfg.h" + +#endif /* CFE_PLATFORM_CFG_H */ From 2db14ee522f1dfce9313684bb4f4d0c676498ba2 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 4 May 2023 10:22:30 -0400 Subject: [PATCH 166/200] Fix #2320, reorganize CFE_TESTCASE header files Organize CFE_TESTCASE header file contents according to the convention --- modules/cfe_testcase/arch_build.cmake | 30 ++++++++++++ .../config/default_cfe_test_msgids.h | 39 +++++++++++++++ .../default_cfe_test_tbl.h} | 0 .../config/default_cfe_test_topicids.h | 48 +++++++++++++++++++ .../config/default_cfe_testcase_msgids.h | 39 +++++++++++++++ modules/cfe_testcase/mission_build.cmake | 31 ++++++++++++ 6 files changed, 187 insertions(+) create mode 100644 modules/cfe_testcase/arch_build.cmake create mode 100644 modules/cfe_testcase/config/default_cfe_test_msgids.h rename modules/cfe_testcase/{inc/cfe_test_tbl.h => config/default_cfe_test_tbl.h} (100%) create mode 100644 modules/cfe_testcase/config/default_cfe_test_topicids.h create mode 100644 modules/cfe_testcase/config/default_cfe_testcase_msgids.h create mode 100644 modules/cfe_testcase/mission_build.cmake diff --git a/modules/cfe_testcase/arch_build.cmake b/modules/cfe_testcase/arch_build.cmake new file mode 100644 index 000000000..b04904ed0 --- /dev/null +++ b/modules/cfe_testcase/arch_build.cmake @@ -0,0 +1,30 @@ +########################################################### +# +# TEST Core Module platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the TEST configuration +set(TEST_PLATFORM_CONFIG_FILE_LIST + cfe_test_msgids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(TEST_CFGFILE ${TEST_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${TEST_CFGFILE}" NAME_WE) + if (DEFINED TEST_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE "${TEST_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TEST_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${TEST_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/cfe_testcase/config/default_cfe_test_msgids.h b/modules/cfe_testcase/config/default_cfe_test_msgids.h new file mode 100644 index 000000000..a4b41aa30 --- /dev/null +++ b/modules/cfe_testcase/config/default_cfe_test_msgids.h @@ -0,0 +1,39 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Test app (CFE_TEST) Application Message IDs + */ +#ifndef CFE_TEST_MSGIDS_H +#define CFE_TEST_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_test_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */ + +#endif diff --git a/modules/cfe_testcase/inc/cfe_test_tbl.h b/modules/cfe_testcase/config/default_cfe_test_tbl.h similarity index 100% rename from modules/cfe_testcase/inc/cfe_test_tbl.h rename to modules/cfe_testcase/config/default_cfe_test_tbl.h diff --git a/modules/cfe_testcase/config/default_cfe_test_topicids.h b/modules/cfe_testcase/config/default_cfe_test_topicids.h new file mode 100644 index 000000000..6ecca4fb5 --- /dev/null +++ b/modules/cfe_testcase/config/default_cfe_test_topicids.h @@ -0,0 +1,48 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Test app (CFE_TESTCASE) Application Topic IDs + */ +#ifndef CFE_TESTCASE_TOPICIDS_H +#define CFE_TESTCASE_TOPICIDS_H + +/** +** \cfemissioncfg cFE Portable Message Numbers for Commands +** +** \par Description: +** Portable message numbers for the cFE TEST command messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TEST_CMD_MSG 2 + +/** +** \cfemissioncfg cFE Portable Message Numbers for Telemetry +** +** \par Description: +** Portable message numbers for the cFE TEST telemetry messages +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TEST_HK_TLM_MSG 2 + +#endif diff --git a/modules/cfe_testcase/config/default_cfe_testcase_msgids.h b/modules/cfe_testcase/config/default_cfe_testcase_msgids.h new file mode 100644 index 000000000..a4b41aa30 --- /dev/null +++ b/modules/cfe_testcase/config/default_cfe_testcase_msgids.h @@ -0,0 +1,39 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * CFE Test app (CFE_TEST) Application Message IDs + */ +#ifndef CFE_TEST_MSGIDS_H +#define CFE_TEST_MSGIDS_H + +#include "cfe_core_api_base_msgids.h" +#include "cfe_test_topicids.h" + +/* +** cFE Command Message Id's +*/ +#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */ + +/* +** CFE Telemetry Message Id's +*/ +#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */ + +#endif diff --git a/modules/cfe_testcase/mission_build.cmake b/modules/cfe_testcase/mission_build.cmake new file mode 100644 index 000000000..fd1df0bc0 --- /dev/null +++ b/modules/cfe_testcase/mission_build.cmake @@ -0,0 +1,31 @@ +########################################################### +# +# TEST Core Module mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the TEST configuration +set(TEST_MISSION_CONFIG_FILE_LIST + cfe_test_tbl.h + cfe_test_topicids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(TEST_CFGFILE ${TEST_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${TEST_CFGFILE}" NAME_WE) + if (DEFINED TEST_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${TEST_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TEST_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${TEST_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach() From 4bff7972ecd76b2acbfaf65d810f85d221a8f6dd Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 3 May 2023 11:09:10 -0400 Subject: [PATCH 167/200] Fix #2320, adjust scripts and docs for header renames Corrects the paths and references in the documentation build to reflect the header name changes. Removes the overrides from "sample_defs" as these are no longer strictly required, user only needs to override if they really need to change something. --- cmake/mission_build.cmake | 7 +- cmake/sample_defs/cpu1_msgids.h | 131 -- cmake/sample_defs/cpu1_platform_cfg.h | 1733 ------------------------ cmake/sample_defs/sample_mission_cfg.h | 565 -------- docs/src/cfe_frontpage.dox | 10 +- docs/src/cfe_sb.dox | 2 +- 6 files changed, 12 insertions(+), 2436 deletions(-) delete mode 100644 cmake/sample_defs/cpu1_msgids.h delete mode 100644 cmake/sample_defs/cpu1_platform_cfg.h delete mode 100644 cmake/sample_defs/sample_mission_cfg.h diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 2ee6f7094..192c2e6c4 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -308,7 +308,12 @@ function(prepare) "${psp_MISSION_DIR}/psp/fsw/inc/*.h" ) foreach(MODULE core_api ${MISSION_CORE_MODULES}) - list(APPEND SUBMODULE_HEADER_PATHS "${${MODULE}_MISSION_DIR}/fsw/inc/*.h") + if (IS_DIRECTORY "${${MODULE}_MISSION_DIR}/fsw/inc") + list(APPEND SUBMODULE_HEADER_PATHS "${${MODULE}_MISSION_DIR}/fsw/inc/*.h") + endif() + if (IS_DIRECTORY "${${MODULE}_MISSION_DIR}/config") + list(APPEND SUBMODULE_HEADER_PATHS "${${MODULE}_MISSION_DIR}/config/default_*.h") + endif() endforeach() file(GLOB MISSION_USERGUIDE_HEADERFILES ${SUBMODULE_HEADER_PATHS} diff --git a/cmake/sample_defs/cpu1_msgids.h b/cmake/sample_defs/cpu1_msgids.h deleted file mode 100644 index 76fca0ca2..000000000 --- a/cmake/sample_defs/cpu1_msgids.h +++ /dev/null @@ -1,131 +0,0 @@ -/************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” - * - * Copyright (c) 2020 United States Government as represented by the - * Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ************************************************************************/ - -/** - * @file - * - * Purpose: - * This header file contains the Message Id's for messages used by the - * cFE core. - * - * Author: R.McGraw/SSI - * - * Notes: - * This file should not contain messages defined by cFE external - * applications. - * - */ - -#ifndef CPU1_MSGIDS_H -#define CPU1_MSGIDS_H - -/* -** Includes -*/ - -#include "cfe_mission_cfg.h" - -/** - * \brief Platform command message ID base offset - * - * Example mechanism for setting default command bits and deconflicting MIDs across multiple - * platforms in a mission. For any sufficiently complex mission this method is - * typically replaced by a centralized message ID management scheme. - * - * 0x1800 - Nominal value for default message ID implementation (V1). This sets the command - * field and the secondary header present field. Typical V1 command MID range - * is 0x1800-1FFF. Additional cpus can deconflict message IDs by incrementing - * this value to provide sub-allocations (0x1900 for example). - * 0x0080 - Command bit for MISSION_MSGID_V2 message ID implementation (V2). Although - * this can be used for the value below due to the relatively small set - * of MIDs in the framework it will not scale so an alternative - * method of deconfliction is recommended. - */ -#define CFE_PLATFORM_CMD_MID_BASE 0x1800 - -/** - * \brief Platform telemetry message ID base offset - * - * 0x0800 - Nominal for message ID V1 - * 0x0000 - Potential value for MISSION_MSGID_V2, but limited to a range of - * 0x0000-0x007F since the command bit is 0x0080. Alternative - * method of deconfliction is recommended. - * - * See #CFE_PLATFORM_CMD_MID_BASE for more information - */ -#define CFE_PLATFORM_TLM_MID_BASE 0x0800 - -/** - * \brief "Global" command message ID base offset - * - * 0x1860 - Nominal value for message ID V1 - * 0x00E0 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080. - * Works in limited cases only, alternative method of deconfliction - * is recommended. - * See #CFE_PLATFORM_CMD_MID_BASE for more information - */ -#define CFE_PLATFORM_CMD_MID_BASE_GLOB 0x1860 - -/* -** cFE Command Message Id's -*/ -#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_CMD_MSG /* 0x1801 */ -#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */ -#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_CMD_MSG /* 0x1803 */ -#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_CMD_MSG /* 0x1804 */ -#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_CMD_MSG /* 0x1805 */ -#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_CMD_MSG /* 0x1806 */ - -#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_SEND_HK_MSG /* 0x1808 */ -#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_SEND_HK_MSG /* 0x1809 */ -/* Message ID 0x180A is available */ -#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SEND_HK_MSG /* 0x180B */ -#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_SEND_HK_MSG /* 0x180C */ -#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_SEND_HK_MSG /* 0x180D */ - -#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SUB_RPT_CTRL_MSG /* 0x180E */ - -#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_TONE_CMD_MSG /* 0x1810 */ -#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_1HZ_CMD_MSG /* 0x1811 */ - -/* -** cFE Global Command Message Id's -*/ -#define CFE_TIME_DATA_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_DATA_CMD_MSG /* 0x1860 */ -#define CFE_TIME_SEND_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_SEND_CMD_MSG /* 0x1862 */ - -/* -** CFE Telemetry Message Id's -*/ -#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_HK_TLM_MSG /* 0x0800 */ -#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_HK_TLM_MSG /* 0x0801 */ -#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */ -#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_HK_TLM_MSG /* 0x0803 */ -#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_HK_TLM_MSG /* 0x0804 */ -#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_HK_TLM_MSG /* 0x0805 */ -#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_DIAG_TLM_MSG /* 0x0806 */ -#define CFE_EVS_LONG_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_LONG_EVENT_MSG_MSG /* 0x0808 */ -#define CFE_EVS_SHORT_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG /* 0x0809 */ -#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_STATS_TLM_MSG /* 0x080A */ -#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_APP_TLM_MSG /* 0x080B */ -#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_REG_TLM_MSG /* 0x080C */ -#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ALLSUBS_TLM_MSG /* 0x080D */ -#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */ -#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */ - -#endif /* CPU1_MSGIDS_H */ diff --git a/cmake/sample_defs/cpu1_platform_cfg.h b/cmake/sample_defs/cpu1_platform_cfg.h deleted file mode 100644 index b898e7b37..000000000 --- a/cmake/sample_defs/cpu1_platform_cfg.h +++ /dev/null @@ -1,1733 +0,0 @@ -/************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” - * - * Copyright (c) 2020 United States Government as represented by the - * Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ************************************************************************/ - -/** - * @file - * - * Purpose: - * This header file contains the platform configuration parameters. - * - * Notes: - * The impact of changing these configurations from their default value is - * not yet documented. Changing these values may impact the performance - * and functionality of the system. - * - * Author: R.McGraw/SSI - * - */ - -#ifndef CPU1_PLATFORM_CFG_H -#define CPU1_PLATFORM_CFG_H - -/** -** \cfeescfg Default virtual path for persistent storage -** -** \par Description: -** This configures the default location in the virtual file system -** for persistent/non-volatile storage. Files such as the startup -** script, app/library dynamic modules, and configuration tables are -** expected to be stored in this directory. -** -*/ -#define CFE_PLATFORM_ES_NONVOL_DISK_MOUNT_STRING "/cf" - -/** -** \cfeescfg Default virtual path for volatile storage -** -** \par Description: -** The #CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING parameter is used to set the cFE mount path -** for the CFE RAM disk. This is a parameter for missions that do not want to -** use the default value of "/ram", or for missions that need to have a different -** value for different CPUs or Spacecraft. -** Note that the vxWorks OSAL cannot currently handle names that have more than one -** path separator in it. The names "/ram", "/ramdisk", "/disk123" will all work, but -** "/disks/ram" will not. -** Multiple separators can be used with the posix or RTEMS ports. -** -*/ -#define CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING "/ram" - -/** -** \cfesbcfg Maximum Number of Unique Message IDs SB Routing Table can hold -** -** \par Description: -** Dictates the maximum number of unique MsgIds the SB routing table will hold. -** This constant has a direct effect on the size of SB's tables and arrays. -** Keeping this count as low as possible will save memory. -** To see the run-time, high-water mark and the current utilization figures -** regarding this parameter, send an SB command to 'Send Statistics Pkt'. -** -** \par Limits -** This must be a power of two if software bus message routing hash implementation -** is being used. Lower than 64 will cause unit test failures, and -** telemetry reporting is impacted below 32. There is no hard -** upper limit, but impacts memory footprint. For software bus message routing -** search implementation the number of msg ids subscribed to impacts performance. -** -*/ -#define CFE_PLATFORM_SB_MAX_MSG_IDS 256 - -/** -** \cfesbcfg Maximum Number of Unique Pipes SB Routing Table can hold -** -** \par Description: -** Dictates the maximum number of unique Pipes the SB routing table will hold. -** This constant has a direct effect on the size of SB's tables and arrays. -** Keeping this count as low as possible will save memory. -** To see the run-time, high-water mark and the current utilization figures -** regarding this parameter, send an SB command to 'Send Statistics Pkt'. -** -** \par Limits -** This parameter has a lower limit of 1. This parameter must also be less than -** or equal to OS_MAX_QUEUES. -** -*/ -#define CFE_PLATFORM_SB_MAX_PIPES 64 - -/** -** \cfesbcfg Maximum Number of unique local destinations a single MsgId can have -** -** \par Description: -** Dictates the maximum number of unique local destinations a single MsgId can -** have. -** -** \par Limits -** This parameter has a lower limit of 1. There are no restrictions on the upper -** limit however, the maximum number of destinations per packet is system dependent -** and should be verified. Destination number values that are checked against this -** configuration are defined by a 16 bit data word. -** -*/ -#define CFE_PLATFORM_SB_MAX_DEST_PER_PKT 16 - -/** -** \cfesbcfg Default Subscription Message Limit -** -** \par Description: -** Dictates the default Message Limit when using the #CFE_SB_Subscribe API. This will -** limit the number of messages with a specific message ID that can be received through -** a subscription. This only changes the default; other message limits can be set on a per -** subscription basis using #CFE_SB_SubscribeEx . -** -** \par Limits -** This parameter has a lower limit of 4 and an upper limit of 65535. -** -*/ -#define CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT 4 - -/** -** \cfesbcfg Size of the SB buffer memory pool -** -** \par Description: -** Dictates the size of the SB memory pool. For each message the SB -** sends, the SB dynamically allocates from this memory pool, the memory needed -** to process the message. The memory needed to process each message is msg -** size + msg descriptor(CFE_SB_BufferD_t). This memory pool is also used -** to allocate destination descriptors (CFE_SB_DestinationD_t) during the -** subscription process. -** To see the run-time, high-water mark and the current utilization figures -** regarding this parameter, send an SB command to 'Send Statistics Pkt'. -** Some memory statistics have been added to the SB housekeeping packet. -** NOTE: It is important to monitor these statistics to ensure the desired -** memory margin is met. -** -** \par Limits -** This parameter has a lower limit of 512 and an upper limit of UINT_MAX (4 Gigabytes). -** -*/ -#define CFE_PLATFORM_SB_BUF_MEMORY_BYTES 524288 - -/** -** \cfesbcfg Highest Valid Message Id -** -** \par Description: -** The value of this constant dictates the range of valid message ID's, from 0 -** to CFE_PLATFORM_SB_HIGHEST_VALID_MSGID (inclusive). -** -** Although this can be defined differently across platforms, each platform can -** only publish/subscribe to message ids within their allowable range. Typically -** this value is set the same across all mission platforms to avoid this complexity. -** -** \par Limits -** CFE_SB_INVALID_MSG is set to the maximum representable number of type CFE_SB_MsgId_t. -** CFE_PLATFORM_SB_HIGHEST_VALID_MSGID lower limit is 1, up to CFE_SB_INVALID_MSG_ID - 1. -** -** When using the direct message map implementation for software bus routing, this -** value is used to size the map where a value of 0x1FFF results in a 16 KBytes map -** and 0xFFFF is 128 KBytes. -** -** When using the hash implementation for software bus routing, a multiple of the -** CFE_PLATFORM_SB_MAX_MSG_IDS is used to size the message map. In that case -** the range selected here does not impact message map memory use, so it's -** reasonable to use up to the full range supported by the message ID implementation. -*/ -#define CFE_PLATFORM_SB_HIGHEST_VALID_MSGID 0x1FFF - -/** -** \cfesbcfg Platform Endian Indicator -** -** \par Description: -** The value of this constant indicates the endianess of the target system -** -** \par Limits -** This parameter has a lower limit of 0 and an upper limit of 1. -*/ -#define CFE_PLATFORM_ENDIAN CCSDS_LITTLE_ENDIAN - -/** -** \cfesbcfg Default Routing Information Filename -** -** \par Description: -** The value of this constant defines the filename used to store the software -** bus routing information. This filename is used only when no filename is -** specified in the command. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_SB_DEFAULT_ROUTING_FILENAME "/ram/cfe_sb_route.dat" - -/** -** \cfesbcfg Default Pipe Information Filename -** -** \par Description: -** The value of this constant defines the filename used to store the software -** bus pipe information. This filename is used only when no filename is -** specified in the command. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_SB_DEFAULT_PIPE_FILENAME "/ram/cfe_sb_pipe.dat" - -/** -** \cfesbcfg Default Message Map Filename -** -** \par Description: -** The value of this constant defines the filename used to store the software -** bus message map information. This filename is used only when no filename is -** specified in the command. The message map is a lookup table (array of 16bit -** words) that has an element for each possible MsgId value and holds the -** routing table index for that MsgId. The Msg Map provides fast access to the -** destinations of a message. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_SB_DEFAULT_MAP_FILENAME "/ram/cfe_sb_msgmap.dat" - -/** -** \cfesbcfg SB Event Filtering -** -** \par Description: -** This group of configuration parameters dictates what SB events will be -** filtered through EVS. The filtering will begin after the SB task initializes -** and stay in effect until a cmd to EVS changes it. -** This allows the operator to set limits on the number of event messages that -** are sent during system initialization. -** NOTE: Set all unused event values and mask values to zero -** -** \par Limits -** This filtering applies only to SB events. -** These parameters have a lower limit of 0 and an upper limit of 65535. -*/ -#define CFE_PLATFORM_SB_FILTERED_EVENT1 CFE_SB_SEND_NO_SUBS_EID -#define CFE_PLATFORM_SB_FILTER_MASK1 CFE_EVS_FIRST_4_STOP - -#define CFE_PLATFORM_SB_FILTERED_EVENT2 CFE_SB_DUP_SUBSCRIP_EID -#define CFE_PLATFORM_SB_FILTER_MASK2 CFE_EVS_FIRST_4_STOP - -#define CFE_PLATFORM_SB_FILTERED_EVENT3 CFE_SB_MSGID_LIM_ERR_EID -#define CFE_PLATFORM_SB_FILTER_MASK3 CFE_EVS_FIRST_16_STOP - -#define CFE_PLATFORM_SB_FILTERED_EVENT4 CFE_SB_Q_FULL_ERR_EID -#define CFE_PLATFORM_SB_FILTER_MASK4 CFE_EVS_FIRST_16_STOP - -#define CFE_PLATFORM_SB_FILTERED_EVENT5 0 -#define CFE_PLATFORM_SB_FILTER_MASK5 CFE_EVS_NO_FILTER - -#define CFE_PLATFORM_SB_FILTERED_EVENT6 0 -#define CFE_PLATFORM_SB_FILTER_MASK6 CFE_EVS_NO_FILTER - -#define CFE_PLATFORM_SB_FILTERED_EVENT7 0 -#define CFE_PLATFORM_SB_FILTER_MASK7 CFE_EVS_NO_FILTER - -#define CFE_PLATFORM_SB_FILTERED_EVENT8 0 -#define CFE_PLATFORM_SB_FILTER_MASK8 CFE_EVS_NO_FILTER - -/** -** \cfeescfg Define SB Memory Pool Block Sizes -** -** \par Description: -** Software Bus Memory Pool Block Sizes -** -** \par Limits -** These sizes MUST be increasing and MUST be an integral multiple of 4. -** The number of block sizes defined cannot exceed -** #CFE_PLATFORM_ES_POOL_MAX_BUCKETS -*/ -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_01 8 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_02 16 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_03 20 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_04 36 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_05 64 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_06 96 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_07 128 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_08 160 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_09 256 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_10 512 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_11 1024 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_12 2048 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_13 4096 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_14 8192 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_15 16384 -#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_16 32768 -#define CFE_PLATFORM_SB_MAX_BLOCK_SIZE (CFE_MISSION_SB_MAX_SB_MSG_SIZE + 128) - -/** -** \cfetimecfg Time Server or Time Client Selection -** -** \par Description: -** This configuration parameter selects whether the Time task functions as a -** time "server" or "client". A time server generates the "time at the tone" -** packet which is received by time clients. -** -** \par Limits -** Enable one, and only one by defining either CFE_PLATFORM_TIME_CFG_SERVER or -** CFE_PLATFORM_TIME_CFG_CLIENT AS true. The other must be defined as false. -*/ -#define CFE_PLATFORM_TIME_CFG_SERVER true -#define CFE_PLATFORM_TIME_CFG_CLIENT false - -/** -** \cfetimecfg Time Tone In Big-Endian Order -** -** \par Description: -** If this configuration parameter is defined, the CFE time server will -** publish time tones with payloads in big-endian order, and time clients -** will expect the tones to be in big-endian order. This is useful for -** mixed-endian environments. This will become obsolete once EDS is -** available and the CFE time tone message is defined. -*/ -#undef CFE_PLATFORM_TIME_CFG_BIGENDIAN - -/** -** \cfetimecfg Local MET or Virtual MET Selection for Time Servers -** -** \par Description: -** Depending on the specific hardware system configuration, it may be possible -** for Time Servers to read the "local" MET from a h/w register rather than -** having to track the MET as the count of tone signal interrupts (virtual MET) -** -** Time Clients must be defined as using a virtual MET. Also, a Time Server -** cannot be defined as having both a h/w MET and an external time source (they -** both cannot synchronize to the same tone). -** -** Note: "disable" this define (set to false) only for Time Servers with local hardware -** that supports a h/w MET that is synchronized to the tone signal !!! -** -** \par Limits -** Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. -*/ -#define CFE_PLATFORM_TIME_CFG_VIRTUAL true - -/** -** \cfetimecfg Include or Exclude the Primary/Redundant Tone Selection Cmd -** -** \par Description: -** Depending on the specific hardware system configuration, it may be possible -** to switch between a primary and redundant tone signal. If supported by -** hardware, this definition will enable command interfaces to select the -** active tone signal. Both Time Clients and Time Servers support this feature. -** Note: Set the CFE_PLATFORM_TIME_CFG_SIGNAL define to true to enable tone signal commands. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_TIME_CFG_SIGNAL false - -/** -** \cfetimecfg Include or Exclude the Internal/External Time Source Selection Cmd -** -** \par Description: -** By default, Time Servers maintain time using an internal MET which may be a -** h/w register or software counter, depending on available hardware. The -** following definition enables command interfaces to switch between an -** internal MET, or external time data received from one of several supported -** external time sources. Only a Time Server may be configured to use external -** time data. -** Note: Set the CFE_PLATFORM_TIME_CFG_SOURCE define to true to include the Time Source -** Selection Command (command allows selection between the internal -** or external time source). Then choose the external source with the -** CFE_TIME_CFG_SRC_??? define. -** -** \par Limits -** Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. -*/ -#define CFE_PLATFORM_TIME_CFG_SOURCE false - -/** -** \cfetimecfg Choose the External Time Source for Server only -** -** \par Description: -** If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true, then one of the following external time -** source types must also be set to true. Do not set any of the external time -** source types to true unless #CFE_PLATFORM_TIME_CFG_SOURCE is set to true. -** -** \par Limits -** -# If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true then one and only one of the following -** three external time sources can and must be set true: -** #CFE_PLATFORM_TIME_CFG_SRC_MET, #CFE_PLATFORM_TIME_CFG_SRC_GPS, #CFE_PLATFORM_TIME_CFG_SRC_TIME -** -# Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. -*/ -#define CFE_PLATFORM_TIME_CFG_SRC_MET false -#define CFE_PLATFORM_TIME_CFG_SRC_GPS false -#define CFE_PLATFORM_TIME_CFG_SRC_TIME false - -/** -** \cfetimecfg Define the Max Delta Limits for Time Servers using an Ext Time Source -** -** \par Description: -** If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true and one of the external time sources is -** also set to true, then the delta time limits for range checking is used. -** -** When a new time value is received from an external source, the value is -** compared against the "expected" time value. If the delta exceeds the -** following defined amount, then the new time data will be ignored. This range -** checking is only performed after the clock state has been commanded to -** "valid". Until then, external time data is accepted unconditionally. -** -** \par Limits -** Applies only if both #CFE_PLATFORM_TIME_CFG_SERVER and #CFE_PLATFORM_TIME_CFG_SOURCE are set -** to true. -*/ -#define CFE_PLATFORM_TIME_MAX_DELTA_SECS 0 -#define CFE_PLATFORM_TIME_MAX_DELTA_SUBS 500000 - -/** -** \cfetimecfg Define the Local Clock Rollover Value in seconds and subseconds -** -** \par Description: -** Specifies the capability of the local clock. Indicates the time at which -** the local clock rolls over. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_TIME_MAX_LOCAL_SECS 27 -#define CFE_PLATFORM_TIME_MAX_LOCAL_SUBS 0 - -/** -** \cfetimecfg Define Timing Limits From One Tone To The Next -** -** \par Description: -** Defines limits to the timing of the 1Hz tone signal. A tone signal is valid -** only if it arrives within one second (plus or minus the tone limit) from -** the previous tone signal.Units are microseconds as measured with the local -** clock. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_TIME_CFG_TONE_LIMIT 20000 - -/** -** \cfetimecfg Define Time to Start Flywheel Since Last Tone -** -** \par Description: -** Define time to enter flywheel mode (in seconds since last tone data update) -** Units are microseconds as measured with the local clock. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_TIME_CFG_START_FLY 2 - -/** -** \cfetimecfg Define Periodic Time to Update Local Clock Tone Latch -** -** \par Description: -** Define Periodic Time to Update Local Clock Tone Latch. Applies only when -** in flywheel mode. This define dictates the period at which the simulated -** 'last tone' time is updated. Units are seconds. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_TIME_CFG_LATCH_FLY 8 - -/** -** \cfeescfg Define Max Number of Applications -** -** \par Description: -** Defines the maximum number of applications that can be loaded into the -** system. This number does not include child tasks. -** -** \par Limits -** There is a lower limit of 6. The lower limit corresponds to the cFE internal -** applications. There are no restrictions on the upper limit however, the -** maximum number of applications is system dependent and should be verified. -** AppIDs that are checked against this configuration are defined by a 32 bit -** data word. -*/ -#define CFE_PLATFORM_ES_MAX_APPLICATIONS 32 - -/** -** \cfeescfg Define Max Number of Shared libraries -** -** \par Description: -** Defines the maximum number of cFE Shared libraries that can be loaded into -** the system. -** -** \par Limits -** There is a lower limit of 1. There are no restrictions on the upper limit -** however, the maximum number of libraries is system dependent and should be -** verified. -*/ -#define CFE_PLATFORM_ES_MAX_LIBRARIES 10 - -/** -** \cfeescfg Define Max Number of ER (Exception and Reset) log entries -** -** \par Description: -** Defines the maximum number of ER (Exception and Reset) log entries -** -** \par Limits -** There is a lower limit of 1. There are no restrictions on the upper limit -** however, the maximum number of log entries is system dependent and should be -** verified. -*/ -#define CFE_PLATFORM_ES_ER_LOG_ENTRIES 20 - -/** \cfeescfg Maximum size of CPU Context in ES Error Log -** -** \par Description: -** This should be large enough to accommodate the CPU context -** information supplied by the PSP on the given platform. -** -** \par Limits: -** Must be greater than zero and a multiple of sizeof(uint32). -** Limited only by the available memory and the number of entries -** in the error log. Any context information beyond this size will -** be truncated. -*/ -#define CFE_PLATFORM_ES_ER_LOG_MAX_CONTEXT_SIZE 256 - -/** -** \cfeescfg Define Size of the cFE System Log. -** -** \par Description: -** Defines the size in bytes of the cFE system log. The system log holds -** variable length strings that are terminated by a linefeed and null -** character. -** -** \par Limits -** There is a lower limit of 512. There are no restrictions on the upper limit -** however, the maximum system log size is system dependent and should be -** verified. -*/ -#define CFE_PLATFORM_ES_SYSTEM_LOG_SIZE 3072 - -/** -** \cfeescfg Define Number of entries in the ES Object table -** -** \par Description: -** Defines the number of entries in the ES Object table. This table controls -** the core cFE startup. -** -** \par Limits -** There is a lower limit of 15. There are no restrictions on the upper limit -** however, the maximum object table size is system dependent and should be -** verified. -*/ -#define CFE_PLATFORM_ES_OBJECT_TABLE_SIZE 30 - -/** -** \cfeescfg Define Max Number of Generic Counters -** -** \par Description: -** Defines the maximum number of Generic Counters that can be registered. -** -** \par Limits -** This parameter has a lower limit of 1 and an upper limit of 65535. -*/ -#define CFE_PLATFORM_ES_MAX_GEN_COUNTERS 8 - -/** -** \cfeescfg Define ES Application Control Scan Rate -** -** \par Description: -** ES Application Control Scan Rate. This parameter controls the speed that ES -** scans the Application Table looking for App Delete/Restart/Reload requests. -** All Applications are deleted, restarted, or reloaded by the ES Application. -** ES will periodically scan for control requests to process. The scan rate is -** controlled by this parameter, which is given in milliseconds. A value of -** 1000 means that ES will scan the Application Table once per second. Be -** careful not to set the value of this too low, because ES will use more CPU -** cycles scanning the table. -** -** \par Limits -** There is a lower limit of 100 and an upper limit of 20000 on this -** configuration parameter. millisecond units. -*/ -#define CFE_PLATFORM_ES_APP_SCAN_RATE 1000 - -/** -** \cfeescfg Define ES Application Kill Timeout -** -** \par Description: -** ES Application Kill Timeout. This parameter controls the number of -** "scan periods" that ES will wait for an application to Exit after getting -** the signal Delete, Reload or Restart. The sequence works as follows: -** -# ES will set the control request for an App to Delete/Restart/Reload and -** set this kill timer to the value in this parameter. -** -# If the App is responding and Calls it's RunLoop function, it will drop out -** of it's main loop and call CFE_ES_ExitApp. Once it calls Exit App, then -** ES can delete, restart, or reload the app the next time it scans the app -** table. -** -# If the App is not responding, the ES App will decrement this Kill Timeout -** value each time it runs. If the timeout value reaches zero, ES will kill -** the app. -** -** The Kill timeout value depends on the #CFE_PLATFORM_ES_APP_SCAN_RATE. If the Scan Rate -** is 1000, or 1 second, and this #CFE_PLATFORM_ES_APP_KILL_TIMEOUT is set to 5, then it -** will take 5 seconds to kill a non-responding App. -** If the Scan Rate is 250, or 1/4 second, and the #CFE_PLATFORM_ES_APP_KILL_TIMEOUT is -** set to 2, then it will take 1/2 second to time out. -** -** \par Limits -** There is a lower limit of 1 and an upper limit of 100 on this configuration -** parameter. Units are number of #CFE_PLATFORM_ES_APP_SCAN_RATE cycles. -*/ -#define CFE_PLATFORM_ES_APP_KILL_TIMEOUT 5 - -/** -** \cfeescfg ES Ram Disk Sector Size -** -** \par Description: -** Defines the ram disk sector size. The ram disk is 1 of 4 memory areas that -** are preserved on a processor reset. -** NOTE: Changing this value changes memory allocation, and may -** require changes to platform specific values (in CFE_PSP) such as -** USER_RESERVED_MEM in VxWorks depending on the memory areas -** being used for preserved data and on OS specific behavior. -** -** \par Limits -** There is a lower limit of 128. There are no restrictions on the upper limit -** however, the maximum RAM disk sector size is system dependent and should be -** verified. -*/ -#define CFE_PLATFORM_ES_RAM_DISK_SECTOR_SIZE 512 - -/** -** \cfeescfg ES Ram Disk Number of Sectors -** -** \par Description: -** Defines the ram disk number of sectors. The ram disk is one of four memory -** areas that are preserved on a processor reset. -** NOTE: Changing this value changes memory allocation, and may -** require changes to platform specific values (in CFE_PSP) such as -** USER_RESERVED_MEM in VxWorks depending on the memory areas -** being used for preserved data and on OS specific behavior. -** -** \par Limits -** There is a lower limit of 128. There are no restrictions on the upper limit -** however, the maximum number of RAM sectors is system dependent and should be -** verified. -*/ -#define CFE_PLATFORM_ES_RAM_DISK_NUM_SECTORS 4096 - -/** -** \cfeescfg Percentage of Ram Disk Reserved for Decompressing Apps -** -** \par Description: -** The #CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED parameter is used to make sure that the -** Volatile ( RAM ) Disk has a defined amount of free space during a processor -** reset. The cFE uses the Volatile disk to decompress cFE applications during -** system startup. If this Volatile disk happens to get filled with logs and -** misc files, then a processor reset may not work, because there will be no -** room to decompress cFE apps. To solve that problem, this parameter sets the -** "Low Water Mark" for disk space on a Processor reset. It should be set to -** allow the largest cFE Application to be decompressed. -** During a Processor reset, if there is not sufficient space left on the disk, -** it will be re-formatted in order to clear up some space. -** -** This feature can be turned OFF by setting the parameter to 0. -** -** \par Limits -** There is a lower limit of 0 and an upper limit of 75 on this configuration -** parameter.Units are percentage. A setting of zero will turn this feature -** off. -*/ -#define CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED 30 - -/** -** \cfeescfg Define Critical Data Store Size -** -** \par Description: -** Defines the Critical Data Store (CDS) area size in bytes size. The CDS is -** one of four memory areas that are preserved during a processor reset. -** NOTE: Changing this value changes memory allocation, and may -** require changes to platform specific values (in CFE_PSP) such as -** USER_RESERVED_MEM in VxWorks depending on the memory areas -** being used for preserved data and on OS specific behavior. -** -** \par Limits -** There is a lower limit of 8192 and an upper limit of UINT_MAX (4 Gigabytes) -** on this configuration parameter. -*/ -#define CFE_PLATFORM_ES_CDS_SIZE (128 * 1024) - -/** -** \cfeescfg Define User Reserved Memory Size -** -** \par Description: -** User Reserved Memory Size. This is the size in bytes of the cFE User -** reserved Memory area. This is a block of memory that is available for cFE -** application use. The address is obtained by calling -** #CFE_PSP_GetUserReservedArea. The User Reserved Memory is one of four memory -** areas that are preserved during a processor reset. -** NOTE: Changing this value changes memory allocation, and may -** require changes to platform specific values (in CFE_PSP) such as -** USER_RESERVED_MEM in VxWorks depending on the memory areas -** being used for preserved data and on OS specific behavior. -** -** \par Limits -** There is a lower limit of 1024 and an upper limit of UINT_MAX (4 Gigabytes) -** on this configuration parameter. -*/ -#define CFE_PLATFORM_ES_USER_RESERVED_SIZE (1024 * 1024) - -/** -** \cfeescfg Define ES Reset Area Size -** -** \par Description: -** The ES Reset Area Size. This is the size in bytes of the cFE Reset variable -** and log area. This is a block of memory used by the cFE to store the system -** log ER Log and critical reset variables. This is 4 of 4 of the memory areas -** that are preserved during a processor reset. -** Note: This area must be sized large enough to hold all of the data -** structures. It should be automatically sized based on the CFE_ES_ResetData_t -** type, but circular dependencies in the headers prevent it from being defined -** this way. -** NOTE: Changing this value changes memory allocation, and may -** require changes to platform specific values (in CFE_PSP) such as -** USER_RESERVED_MEM in VxWorks depending on the memory areas -** being used for preserved data and on OS specific behavior. -** -** \par Limits -** There is a lower limit of 153600 (150KBytes) and an upper limit of UINT_MAX -** (4 Gigabytes) on this configuration parameter. -*/ -#define CFE_PLATFORM_ES_RESET_AREA_SIZE (170 * 1024) - -/** -** \cfeescfg Define Memory Pool Alignment Size -** -** \par Description: -** Ensures that buffers obtained from a memory pool are aligned -** to a certain minimum block size. Note the allocator will always -** align to the minimum required by the CPU architecture. This may -** be set greater than the CPU requirement as desired for optimal -** performance. -** -** For some architectures/applications it may be beneficial to set this -** to the cache line size of the target CPU, or to use special SIMD -** instructions that require a more stringent memory alignment. -** -** \par Limits -** This must always be a power of 2, as it is used as a binary address mask. -*/ -#define CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN 4 - -/** -** \cfeescfg ES Nonvolatile Startup Filename -** -** \par Description: -** The value of this constant defines the path and name of the file that -** contains a list of modules that will be loaded and started by the cFE after -** the cFE finishes its startup sequence. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_ES_NONVOL_STARTUP_FILE "/cf/cfe_es_startup.scr" - -/** -** \cfeescfg ES Volatile Startup Filename -** -** \par Description: -** The value of this constant defines the path and name of the file that -** contains a list of modules that will be loaded and started by the cFE after -** the cFE finishes its startup sequence. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_ES_VOLATILE_STARTUP_FILE "/ram/cfe_es_startup.scr" - -/** -** \cfeescfg Default Application Information Filename -** -** \par Description: -** The value of this constant defines the filename used to store information -** pertaining to all of the Applications that are registered with Executive -** Services. This filename is used only when no filename is specified in the -** the command to query all system apps. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_ES_DEFAULT_APP_LOG_FILE "/ram/cfe_es_app_info.log" - -/** -** \cfeescfg Default Application Information Filename -** -** \par Description: -** The value of this constant defines the filename used to store information -** pertaining to all of the Applications that are registered with Executive -** Services. This filename is used only when no filename is specified in the -** the command to query all system tasks. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_ES_DEFAULT_TASK_LOG_FILE "/ram/cfe_es_taskinfo.log" - -/** -** \cfeescfg Default System Log Filename -** -** \par Description: -** The value of this constant defines the filename used to store important -** information (as ASCII text strings) that might not be able to be sent in an -** Event Message. This filename is used only when no filename is specified in -** the command to dump the system log. No file specified in the cmd means the -** first character in the cmd filename is a NULL terminator (zero). -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_ES_DEFAULT_SYSLOG_FILE "/ram/cfe_es_syslog.log" - -/** -** \cfeescfg Default Exception and Reset (ER) Log Filename -** -** \par Description: -** The value of this constant defines the filename used to store the -** Exception and Reset (ER) Log. This filename is used only when no filename is -** specified in the command to dump the ER log. No file specified in the cmd -** means the first character in the cmd filename is a NULL terminator (zero). -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_ES_DEFAULT_ER_LOG_FILE "/ram/cfe_erlog.log" - -/** -** \cfeescfg Default Performance Data Filename -** -** \par Description: -** The value of this constant defines the filename used to store the -** Performance Data. This filename is used only when no filename is specified -** in the command to stop performance data collecting. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_ES_DEFAULT_PERF_DUMP_FILENAME "/ram/cfe_es_perf.dat" - -/** -** \cfeescfg Default Critical Data Store Registry Filename -** -** \par Description: -** The value of this constant defines the filename used to store the -** Critical Data Store Registry. This filename is used only when no filename is -** specified in the command to stop performance data collecting. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_ES_DEFAULT_CDS_REG_DUMP_FILE "/ram/cfe_cds_reg.log" - -/** -** \cfeescfg Define Default System Log Mode following Power On Reset -** -** \par Description: -** Defines the default mode for the operation of the ES System log following a power -** on reset. The log may operate in either Overwrite mode = 0, where once the -** log becomes full the oldest message in the log will be overwritten, or -** Discard mode = 1, where once the log becomes full the contents of the log are -** preserved and the new event is discarded. This constant may hold a value of -** either 0 or 1 depending on the desired default. -** Overwrite Mode = 0, Discard Mode = 1. -** -** \par Limits -** There is a lower limit of 0 and an upper limit of 1 on this configuration -** parameter. -*/ -#define CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE 0 - -/** -** \cfeescfg Define Default System Log Mode following Processor Reset -** -** \par Description: -** Defines the default mode for the operation of the ES System log following a -** processor reset. The log may operate in either Overwrite mode = 0, where once -** the log becomes full the oldest message in the log will be overwritten, or -** Discard mode = 1, where once the log becomes full the contents of the log are -** preserved and the new event is discarded. This constant may hold a value of -** either 0 or 1 depending on the desired default. -** Overwrite Mode = 0, Discard Mode = 1. -** -** \par Limits -** There is a lower limit of 0 and an upper limit of 1 on this configuration -** parameter. -*/ -#define CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE 1 - -/** -** \cfeescfg Define Max Size of Performance Data Buffer -** -** \par Description: -** Defines the maximum size of the performance data buffer. Units are number of -** performance data entries. An entry is defined by a 32 bit data word followed -** by a 64 bit time stamp. -** -** \par Limits -** There is a lower limit of 1025. There are no restrictions on the upper limit -** however, the maximum buffer size is system dependent and should be verified. -** The units are number of entries. An entry is defined by a 32 bit data word followed -** by a 64 bit time stamp. -*/ -#define CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE 10000 - -/** -** \cfeescfg Define Filter Mask Setting for Disabling All Performance Entries -** -** \par Description: -** Defines the filter mask for disabling all performance entries. The value is a -** bit mask. For each bit, 0 means the corresponding entry is disabled and -** 1 means it is enabled. -*/ -#define CFE_PLATFORM_ES_PERF_FILTMASK_NONE 0 - -/** -** \cfeescfg Define Filter Mask Setting for Enabling All Performance Entries -** -** \par Description: -** Defines the filter mask for enabling all performance entries. The value is a -** bit mask. For each bit, 0 means the corresponding entry is disabled and -** 1 means it is enabled. -*/ -#define CFE_PLATFORM_ES_PERF_FILTMASK_ALL ~CFE_PLATFORM_ES_PERF_FILTMASK_NONE - -/** -** \cfeescfg Define Default Filter Mask Setting for Performance Data Buffer -** -** \par Description: -** Defines the default filter mask for the performance data buffer. The value is a -** bit mask. For each bit, 0 means the corresponding entry is disabled and 1 -** means it is enabled. -** -*/ -#define CFE_PLATFORM_ES_PERF_FILTMASK_INIT CFE_PLATFORM_ES_PERF_FILTMASK_ALL - -/** -** \cfeescfg Define Default Filter Trigger Setting for Disabling All Performance Entries -** -** \par Description: -** Defines the default trigger mask for disabling all performance data entries. The value -** is a bit mask. For each bit, 0 means the trigger for the corresponding entry is -** disabled and 1 means it is enabled. -** -*/ -#define CFE_PLATFORM_ES_PERF_TRIGMASK_NONE 0 - -/** -** \cfeescfg Define Filter Trigger Setting for Enabling All Performance Entries -** -** \par Description: -** Defines the trigger mask for enabling all performance data entries. The value is -** a bit mask. For each bit, 0 means the trigger for the corresponding entry is -** disabled and 1 means it is enabled. -** -*/ -#define CFE_PLATFORM_ES_PERF_TRIGMASK_ALL ~CFE_PLATFORM_ES_PERF_TRIGMASK_NONE - -/** -** \cfeescfg Define Default Filter Trigger Setting for Performance Data Buffer -** -** \par Description: -** Defines the default trigger mask for the performance data buffer. The value is a -** 32-bit mask. For each bit, 0 means the trigger for the corresponding entry is -** disabled and 1 means it is enabled. -** -*/ -#define CFE_PLATFORM_ES_PERF_TRIGMASK_INIT CFE_PLATFORM_ES_PERF_TRIGMASK_NONE - -/** -** \cfeescfg Define Performance Analyzer Child Task Priority -** -** \par Description: -** This parameter defines the priority of the child task spawned by the -** Executive Services to write performance data to a file. Lower numbers -** are higher priority, with 1 being the highest priority in the case of a -** child task. -** -** \par Limits -** Valid range for a child task is 1 to 255 however, the priority cannot -** be higher (lower number) than the ES parent application priority. -*/ -#define CFE_PLATFORM_ES_PERF_CHILD_PRIORITY 200 - -/** -** \cfeescfg Define Performance Analyzer Child Task Stack Size -** -** \par Description: -** This parameter defines the stack size of the child task spawned by the -** Executive Services to write performance data to a file. -** -** \par Limits -** It is recommended this parameter be greater than or equal to 4KB. This parameter -** is limited by the maximum value allowed by the data type. In this case, the data -** type is an unsigned 32-bit integer, so the valid range is 0 to 0xFFFFFFFF. -*/ -#define CFE_PLATFORM_ES_PERF_CHILD_STACK_SIZE 4096 - -/** -** \cfeescfg Define Performance Analyzer Child Task Delay -** -** \par Description: -** This parameter defines the delay time (in milliseconds) between performance -** data file writes performed by the Executive Services Performance Analyzer -** Child Task. -** -** \par Limits -** It is recommended this parameter be greater than or equal to 20ms. This parameter -** is limited by the maximum value allowed by the data type. In this case, the data -** type is an unsigned 32-bit integer, so the valid range is 0 to 0xFFFFFFFF. -*/ -#define CFE_PLATFORM_ES_PERF_CHILD_MS_DELAY 20 - -/** -** \cfeescfg Define Performance Analyzer Child Task Number of Entries Between Delay -** -** \par Description: -** This parameter defines the number of performance analyzer entries the Performance -** Analyzer Child Task will write to the file between delays. -** -*/ -#define CFE_PLATFORM_ES_PERF_ENTRIES_BTWN_DLYS 50 - -/** -** \cfeescfg Define Default Stack Size for an Application -** -** \par Description: -** This parameter defines a default stack size. This parameter is used by the -** cFE Core Applications. -** -** \par Limits -** There is a lower limit of 2048. There are no restrictions on the upper limit -** however, the maximum stack size is system dependent and should be verified. -** Most operating systems provide tools for measuring the amount of stack used by a -** task during operation. It is always a good idea to verify that no more than 1/2 -** of the stack is used. -*/ -#define CFE_PLATFORM_ES_DEFAULT_STACK_SIZE 8192 - -/** -** \cfeescfg Define EVS Task Priority -** -** \par Description: -** Defines the cFE_EVS Task priority. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_EVS_START_TASK_PRIORITY 61 - -/** -** \cfeescfg Define EVS Task Stack Size -** -** \par Description: -** Defines the cFE_EVS Task Stack Size -** -** \par Limits -** There is a lower limit of 2048 on this configuration parameter. There -** are no restrictions on the upper limit however, the maximum stack size -** is system dependent and should be verified. Most operating systems provide -** tools for measuring the amount of stack used by a task during operation. It -** is always a good idea to verify that no more than 1/2 of the stack is used. -*/ -#define CFE_PLATFORM_EVS_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE - -/** -** \cfeescfg Define SB Task Priority -** -** \par Description: -** Defines the cFE_SB Task priority. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_SB_START_TASK_PRIORITY 64 - -/** -** \cfeescfg Define SB Task Stack Size -** -** \par Description: -** Defines the cFE_SB Task Stack Size -** -** \par Limits -** There is a lower limit of 2048 on this configuration parameter. There -** are no restrictions on the upper limit however, the maximum stack size -** is system dependent and should be verified. Most operating systems provide -** tools for measuring the amount of stack used by a task during operation. It -** is always a good idea to verify that no more than 1/2 of the stack is used. -*/ -#define CFE_PLATFORM_SB_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE - -/** -** \cfeescfg Define ES Task Priority -** -** \par Description: -** Defines the cFE_ES Task priority. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_ES_START_TASK_PRIORITY 68 - -/** -** \cfeescfg Define ES Task Stack Size -** -** \par Description: -** Defines the cFE_ES Task Stack Size -** -** \par Limits -** There is a lower limit of 2048 on this configuration parameter. There -** are no restrictions on the upper limit however, the maximum stack size -** is system dependent and should be verified. Most operating systems provide -** tools for measuring the amount of stack used by a task during operation. It -** is always a good idea to verify that no more than 1/2 of the stack is used. -*/ -#define CFE_PLATFORM_ES_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE - -/** -** \cfetimecfg Define TIME Task Priorities -** -** \par Description: -** Defines the cFE_TIME Task priority. -** Defines the cFE_TIME Tone Task priority. -** Defines the cFE_TIME 1HZ Task priority. -** -** \par Limits -** There is a lower limit of zero and an upper limit of 255 on these -** configuration parameters. Remember that the meaning of each task -** priority is inverted -- a "lower" number has a "higher" priority. -*/ -#define CFE_PLATFORM_TIME_START_TASK_PRIORITY 60 -#define CFE_PLATFORM_TIME_TONE_TASK_PRIORITY 25 -#define CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY 25 - -/** -** \cfetimecfg Define TIME Task Stack Sizes -** -** \par Description: -** Defines the cFE_TIME Main Task Stack Size -** Defines the cFE_TIME Tone Task Stack Size -** Defines the cFE_TIME 1HZ Task Stack Size -** -** \par Limits -** There is a lower limit of 2048 on these configuration parameters. There -** are no restrictions on the upper limit however, the maximum stack size -** is system dependent and should be verified. Most operating systems provide -** tools for measuring the amount of stack used by a task during operation. It -** is always a good idea to verify that no more than 1/2 of the stack is used. -*/ -#define CFE_PLATFORM_TIME_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE -#define CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE 4096 -#define CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE 8192 - -/** -** \cfeescfg Define TBL Task Priority -** -** \par Description: -** Defines the cFE_TBL Task priority. -** -** \par Limits -** Not Applicable -*/ -#define CFE_PLATFORM_TBL_START_TASK_PRIORITY 70 - -/** -** \cfeescfg Define TBL Task Stack Size -** -** \par Description: -** Defines the cFE_TBL Task Stack Size -** -** \par Limits -** There is a lower limit of 2048 on this configuration parameter. There -** are no restrictions on the upper limit however, the maximum stack size -** is system dependent and should be verified. Most operating systems provide -** tools for measuring the amount of stack used by a task during operation. It -** is always a good idea to verify that no more than 1/2 of the stack is used. -*/ -#define CFE_PLATFORM_TBL_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE - -/** -** \cfeescfg Define Maximum Number of Registered CDS Blocks -** -** \par Description: -** Maximum number of registered CDS Blocks -** -** \par Limits -** There is a lower limit of 8. There are no restrictions on the upper limit -** however, the maximum number of CDS entries is system dependent and -** should be verified. -*/ -#define CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES 512 - -/** -** \cfeescfg Define Number of Processor Resets Before a Power On Reset -** -** \par Description: -** Number of Processor Resets before a Power On Reset is called. If set to 2, -** then 2 processor resets will occur, and the 3rd processor reset will be a -** power on reset instead. -** -** \par Limits -** There is a lower limit of 0. There are no restrictions on the upper limit -** however, the maximum number of processor resets may be system dependent and -** should be verified. -*/ -#define CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS 2 - -/** \cfeescfg Maximum number of block sizes in pool structures -** -** \par Description: -** The upper limit for the number of block sizes supported in the generic -** pool implementation, which in turn implements the memory pools and CDS. -** -** \par Limits: -** Must be at least one. No specific upper limit, but the number is -** anticipated to be reasonably small (i.e. tens, not hundreds). Large -** values have not been tested. -** -** The ES and CDS block size lists must correlate with this value -*/ -#define CFE_PLATFORM_ES_POOL_MAX_BUCKETS 17 - -/** \cfeescfg Maximum number of memory pools -** -** \par Description: -** The upper limit for the number of memory pools that can concurrently -** exist within the system. -** -** The CFE_SB and CFE_TBL core subsystems each define a memory pool. -** -** Individual applications may also create memory pools, so this value -** should be set sufficiently high enough to support the applications -** being used on this platform. -** -** \par Limits: -** Must be at least 2 to support CFE core - SB and TBL pools. No -** specific upper limit. -*/ -#define CFE_PLATFORM_ES_MAX_MEMORY_POOLS 10 - -/** -** \cfeescfg Define Default ES Memory Pool Block Sizes -** -** \par Description: -** Default Intermediate ES Memory Pool Block Sizes. If an application -** is using the CFE_ES Memory Pool APIs (#CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, -** #CFE_ES_GetPoolBuf and #CFE_ES_PutPoolBuf) but finds these sizes -** inappropriate for their use, they may wish to use the #CFE_ES_PoolCreateEx -** API to specify their own intermediate block sizes -** -** \par Limits -** These sizes MUST be increasing and MUST be an integral multiple of 4. Also, -** CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_MISSION_SB_MAX_SB_MSG_SIZE and both -** CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE and CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE. Note that if Table -** Services have been removed from the CFE, the table size limits are still -** enforced although the table size definitions may be reduced. -*/ -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 8 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02 16 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_03 32 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_04 48 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_05 64 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_06 96 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_07 128 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_08 160 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_09 256 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_10 512 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_11 1024 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_12 2048 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_13 4096 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_14 8192 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_15 16384 -#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16 32768 -#define CFE_PLATFORM_ES_MAX_BLOCK_SIZE 80000 - -/** -** \cfeescfg Define ES Critical Data Store Memory Pool Block Sizes -** -** \par Description: -** Intermediate ES Critical Data Store Memory Pool Block Sizes -** -** \par Limits -** These sizes MUST be increasing and MUST be an integral multiple of 4. -*/ -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_01 8 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_02 16 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_03 32 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_04 48 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_05 64 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_06 96 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_07 128 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_08 160 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_09 256 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_10 512 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_11 1024 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_12 2048 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_13 4096 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_14 8192 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_15 16384 -#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_16 32768 -#define CFE_PLATFORM_ES_CDS_MAX_BLOCK_SIZE 80000 - -/** -** \cfeevscfg Define Maximum Number of Event Filters per Application -** -** \par Description: -** Maximum number of events that may be filtered per application. -** -** \par Limits -** There are no restrictions on the lower and upper limits however, -** the maximum number of event filters is system dependent and should be -** verified. -*/ -#define CFE_PLATFORM_EVS_MAX_EVENT_FILTERS 8 - -/** -** \cfeevscfg Maximum number of event before squelching -** -** \par Description: -** Maximum number of events that may be emitted per app per second. -** Setting this to 0 will cause events to be unrestricted. -** -** \par Limits -** This number must be less than or equal to INT_MAX/1000 -*/ -#define CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST 32 - -/** -** \cfeevscfg Sustained number of event messages per second per app before squelching -** -** \par Description: -** Sustained number of events that may be emitted per app per second. -** -** \par Limits -** This number must be less than or equal to #CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST. -** Values lower than 8 may cause functional and unit test failures. -*/ -#define CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC 8 - -/** -** \cfeevscfg Default Event Log Filename -** -** \par Description: -** The value of this constant defines the filename used to store the Event -** Services local event log. This filename is used only when no filename is -** specified in the command to dump the event log. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_EVS_DEFAULT_LOG_FILE "/ram/cfe_evs.log" - -/** -** \cfeevscfg Maximum Number of Events in EVS Local Event Log -** -** \par Description: -** Dictates the EVS local event log capacity. Units are the number of events. -** -** \par Limits -** There are no restrictions on the lower and upper limits however, -** the maximum log size is system dependent and should be verified. -*/ -#define CFE_PLATFORM_EVS_LOG_MAX 20 - -/** -** \cfeevscfg Default EVS Application Data Filename -** -** \par Description: -** The value of this constant defines the filename used to store the EVS -** Application Data(event counts/filtering information). This filename is -** used only when no filename is specified in the command to dump the event -** log. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_EVS_DEFAULT_APP_DATA_FILE "/ram/cfe_evs_app.dat" - -/** -** \cfeevscfg Default EVS Output Port State -** -** \par Description: -** Defines the default port state (enabled or disabled) for the four output -** ports defined within the Event Service. Port 1 is usually the uart output -** terminal. To enable a port, set the proper bit to a 1. Bit 0 is port 1, -** bit 1 is port2 etc. -** -** \par Limits -** The valid settings are 0x0 to 0xF. -*/ -#define CFE_PLATFORM_EVS_PORT_DEFAULT 0x0001 - -/** -** \cfeevscfg Default EVS Event Type Filter Mask -** -** \par Description: -** Defines a state of on or off for all four event types. The term event -** 'type' refers to the criticality level and may be Debug, Informational, -** Error or Critical. Each event type has a bit position. (bit 0 = Debug, -** bit 1 = Info, bit 2 = Error, bit 3 = Critical). This is a global setting, -** meaning it applies to all applications. To filter an event type, set its -** bit to zero. For example, -** 0xE means Debug = OFF, Info = ON, Error = ON, Critical = ON -** -** \par Limits -** The valid settings are 0x0 to 0xF. -*/ -#define CFE_PLATFORM_EVS_DEFAULT_TYPE_FLAG 0xE - -/** -** \cfeevscfg Default EVS Local Event Log Mode -** -** \par Description: -** Defines a state of overwrite(0) or discard(1) for the operation of the -** EVS local event log. The log may operate in either Overwrite mode = 0, -** where once the log becomes full the oldest event in the log will be -** overwritten, or Discard mode = 1, where once the log becomes full the -** contents of the log are preserved and the new event is discarded. -** Overwrite Mode = 0, Discard Mode = 1. -** -** \par Limits -** The valid settings are 0 or 1 -*/ -#define CFE_PLATFORM_EVS_DEFAULT_LOG_MODE 1 - -/** -** \cfeevscfg Default EVS Message Format Mode -** -** \par Description: -** Defines the default message format (long or short) for event messages being -** sent to the ground. Choose between #CFE_EVS_MsgFormat_LONG or -** #CFE_EVS_MsgFormat_SHORT. -** -** \par Limits -** The valid settings are #CFE_EVS_MsgFormat_LONG or #CFE_EVS_MsgFormat_SHORT -*/ -#define CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE CFE_EVS_MsgFormat_LONG - -/* Platform Configuration Parameters for Table Service (TBL) */ - -/** -** \cfetblcfg Size of Table Services Table Memory Pool -** -** \par Description: -** Defines the TOTAL size of the memory pool that cFE Table Services allocates -** from the system. The size must be large enough to provide memory for each -** registered table, the inactive buffers for double buffered tables and for -** the shared inactive buffers for single buffered tables. -** -** \par Limits -** The cFE does not place a limit on the size of this parameter. -*/ -#define CFE_PLATFORM_TBL_BUF_MEMORY_BYTES 524288 - -/** -** \cfetblcfg Maximum Size Allowed for a Double Buffered Table -** -** \par Description: -** Defines the maximum allowed size (in bytes) of a double buffered table. -** -** \par Limits -** The cFE does not place a limit on the size of this parameter but it must be -** less than half of #CFE_PLATFORM_TBL_BUF_MEMORY_BYTES. -*/ -#define CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE 16384 - -/** -** \cfetblcfg Maximum Size Allowed for a Single Buffered Table -** -** \par Description: -** Defines the maximum allowed size (in bytes) of a single buffered table. -** \b NOTE: This size determines the size of all shared table buffers. -** Therefore, this size will be multiplied by #CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS -** below when allocating memory for shared tables. -** -** \par Limits -** The cFE does not place a limit on the size of this parameter but it must be -** small enough to allow for #CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS number of tables -** to fit into #CFE_PLATFORM_TBL_BUF_MEMORY_BYTES. -*/ -#define CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE 16384 - -/** -** \cfetblcfg Maximum Number of Tables Allowed to be Registered -** -** \par Description: -** Defines the maximum number of tables supported by this processor's Table Services. -** -** \par Limits -** This number must be less than 32767. It should be recognized that this parameter -** determines the size of the Table Registry. An excessively high number will waste -** memory. -*/ -#define CFE_PLATFORM_TBL_MAX_NUM_TABLES 128 - -/** -** \cfetblcfg Maximum Number of Critical Tables that can be Registered -** -** \par Description: -** Defines the maximum number of critical tables supported by this processor's Table Services. -** -** \par Limits -** This number must be less than 32767. It should be recognized that this parameter -** determines the size of the Critical Table Registry which is maintained in the Critical -** Data Store. An excessively high number will waste Critical Data Store memory. Therefore, -** this number must not exceed the value defined in CFE_ES_CDS_MAX_CRITICAL_TABLES. -*/ -#define CFE_PLATFORM_TBL_MAX_CRITICAL_TABLES 32 - -/** -** \cfetblcfg Maximum Number of Table Handles -** -** \par Description: -** Defines the maximum number of Table Handles. -** -** \par Limits -** This number must be less than 32767. This number must be at least as big as -** the number of tables (#CFE_PLATFORM_TBL_MAX_NUM_TABLES) and should be set higher if tables -** are shared between applications. -*/ -#define CFE_PLATFORM_TBL_MAX_NUM_HANDLES 256 - -/** -** \cfetblcfg Maximum Number of Simultaneous Loads to Support -** -** \par Description: -** Defines the maximum number of single buffered tables that can be -** loaded simultaneously. This number is used to determine the number -** of shared buffers to allocate. -** -** \par Limits -** This number must be less than 32767. An excessively high number will -** degrade system performance and waste memory. A number less than 5 is -** suggested but not required. -*/ -#define CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS 4 - -/** -** \cfetblcfg Maximum Number of Simultaneous Table Validations -** -** \par Description: -** Defines the maximum number of pending validations that -** the Table Services can handle at any one time. When a -** table has a validation function, a validation request is -** made of the application to perform that validation. This -** number determines how many of those requests can be -** outstanding at any one time. -** -** \par Limits -** This number must be less than 32767. An excessively high number will -** degrade system performance and waste memory. A number less than 20 is -** suggested but not required. -*/ -#define CFE_PLATFORM_TBL_MAX_NUM_VALIDATIONS 10 - -/** -** \cfetblcfg Default Filename for a Table Registry Dump -** -** \par Description: -** Defines the file name used to store the table registry when -** no filename is specified in the dump registry command. -** -** \par Limits -** The length of each string, including the NULL terminator cannot exceed the -** #OS_MAX_PATH_LEN value. -*/ -#define CFE_PLATFORM_TBL_DEFAULT_REG_DUMP_FILE "/ram/cfe_tbl_reg.log" - -/** -** \cfetblcfg Number of Spacecraft ID's specified for validation -** -** \par Description: -** Defines the number of specified spacecraft ID values that -** are verified during table loads. If the number is zero -** then no validation of the spacecraft ID field in the table -** file header is performed when tables are loaded. Non-zero -** values indicate how many values from the list of spacecraft -** ID's defined below are compared to the spacecraft ID field -** in the table file header. The ELF2CFETBL tool may be used -** to create table files with specified spacecraft ID values. -** -** \par Limits -** This number must be greater than or equal to zero and -** less than or equal to 2. -*/ -#define CFE_PLATFORM_TBL_VALID_SCID_COUNT 0 - -/* macro to construct 32 bit value from 4 chars */ -#define CFE_PLATFORM_TBL_U32FROM4CHARS(_C1, _C2, _C3, _C4) \ - ((uint32)(_C1) << 24 | (uint32)(_C2) << 16 | (uint32)(_C3) << 8 | (uint32)(_C4)) - -/** -** \cfetblcfg Spacecraft ID values used for table load validation -** -** \par Description: -** Defines the spacecraft ID values used for validating the -** spacecraft ID field in the table file header. To be valid, -** the spacecraft ID specified in the table file header must -** match one of the values defined here. -** -** \par Limits -** This value can be any 32 bit unsigned integer. -*/ -#define CFE_PLATFORM_TBL_VALID_SCID_1 (0x42) -#define CFE_PLATFORM_TBL_VALID_SCID_2 (CFE_PLATFORM_TBL_U32FROM4CHARS('a', 'b', 'c', 'd')) - -/** -** \cfetblcfg Number of Processor ID's specified for validation -** -** \par Description: -** Defines the number of specified processor ID values that -** are verified during table loads. If the number is zero -** then no validation of the processor ID field in the table -** file header is performed when tables are loaded. Non-zero -** values indicate how many values from the list of processor -** ID's defined below are compared to the processor ID field -** in the table file header. The ELF2CFETBL tool may be used -** to create table files with specified processor ID values. -** -** \par Limits -** This number must be greater than or equal to zero and -** less than or equal to 4. -*/ -#define CFE_PLATFORM_TBL_VALID_PRID_COUNT 0 - -/** -** \cfetblcfg Processor ID values used for table load validation -** -** \par Description: -** Defines the processor ID values used for validating the -** processor ID field in the table file header. To be valid, -** the spacecraft ID specified in the table file header must -** match one of the values defined here. -** -** \par Limits -** This value can be any 32 bit unsigned integer. -*/ -#define CFE_PLATFORM_TBL_VALID_PRID_1 (1) -#define CFE_PLATFORM_TBL_VALID_PRID_2 (CFE_PLATFORM_TBL_U32FROM4CHARS('a', 'b', 'c', 'd')) -#define CFE_PLATFORM_TBL_VALID_PRID_3 0 -#define CFE_PLATFORM_TBL_VALID_PRID_4 0 - -/** \cfeescfg Poll timer for startup sync delay -** -** \par Description: -** During startup, some tasks may need to synchronize their own initialization -** with the initialization of other applications in the system. -** -** CFE ES implements an API to accomplish this, that performs a task delay (sleep) -** while polling the overall system state until other tasks are ready. -** -** This value controls the amount of time that the CFE_ES_ApplicationSyncDelay -** will sleep between each check of the system state. This should be large enough -** to allow other tasks to run, but not so large as to noticeably delay the startup -** completion. -** -** Units are in milliseconds -** -** \par Limits: -** Must be defined as an integer value that is greater than -** or equal to zero. -*/ -#define CFE_PLATFORM_ES_STARTUP_SYNC_POLL_MSEC 50 - -/** \cfeescfg CFE core application startup timeout -** -** \par Description: -** The upper limit for the amount of time that the cFE core applications -** (ES, SB, EVS, TIME, TBL) are each allotted to reach their respective -** "ready" states. -** -** The CFE "main" thread starts individual tasks for each of the core applications -** (except FS). Each of these must perform some initialization work before the -** next core application can be started, so the main thread waits to ensure that the -** application has reached the "ready" state before starting the next application. -** -** If any core application fails to start, then it indicates a major problem with -** the system and startup is aborted. -** -** Units are in milliseconds -** -** \par Limits: -** Must be defined as an integer value that is greater than -** or equal to zero. -** -*/ -#define CFE_PLATFORM_CORE_MAX_STARTUP_MSEC 30000 - -/** \cfeescfg Startup script timeout -** -** \par Description: -** The upper limit for the total amount of time that all apps listed in the CFE ES startup -** script may take to all become ready. -** -** Unlike the "core" app timeout, this is a soft limit; if the allotted time is exceeded, -** it probably indicates an issue with one of the apps, but does not cause CFE ES to take -** any additional action other than logging the event to the syslog. -** -** Units are in milliseconds -** -** \par Limits: -** Must be defined as an integer value that is greater than -** or equal to zero. -*/ -#define CFE_PLATFORM_ES_STARTUP_SCRIPT_TIMEOUT_MSEC 1000 - -#endif /* CPU1_PLATFORM_CFG_H */ diff --git a/cmake/sample_defs/sample_mission_cfg.h b/cmake/sample_defs/sample_mission_cfg.h deleted file mode 100644 index f59f23930..000000000 --- a/cmake/sample_defs/sample_mission_cfg.h +++ /dev/null @@ -1,565 +0,0 @@ -/************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” - * - * Copyright (c) 2020 United States Government as represented by the - * Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ************************************************************************/ - -/** - * @file - * - * Purpose: - * This header file contains the mission configuration parameters and - * typedefs with mission scope. - * - * Notes: - * The impact of changing these configurations from their default value is - * not yet documented. Changing these values may impact the performance - * and functionality of the system. - * - * Author: R.McGraw/SSI - * - */ - -#ifndef SAMPLE_MISSION_CFG_H -#define SAMPLE_MISSION_CFG_H - -/** -** \cfesbcfg Maximum SB Message Size -** -** \par Description: -** The following definition dictates the maximum message size allowed on -** the software bus. SB checks the pkt length field in the header of all -** messages sent. If the pkt length field indicates the message is larger -** than this define, SB sends an event and rejects the send. -** -** \par Limits -** This parameter has a lower limit of 6 (CCSDS primary header size). There -** are no restrictions on the upper limit however, the maximum message size is -** system dependent and should be verified. Total message size values that are -** checked against this configuration are defined by a 16 bit data word. -*/ -#define CFE_MISSION_SB_MAX_SB_MSG_SIZE 32768 - -/** -** \cfetimecfg Default Time Format -** -** \par Description: -** The following definitions select either UTC or TAI as the default -** (mission specific) time format. Although it is possible for an -** application to request time in a specific format, most callers -** should use CFE_TIME_GetTime(), which returns time in the default -** format. This avoids having to modify each individual caller -** when the default choice is changed. -** -** \par Limits -** if CFE_MISSION_TIME_CFG_DEFAULT_TAI is defined as true then CFE_MISSION_TIME_CFG_DEFAULT_UTC must be -** defined as false. -** if CFE_MISSION_TIME_CFG_DEFAULT_TAI is defined as false then CFE_MISSION_TIME_CFG_DEFAULT_UTC must be -** defined as true. -*/ -#define CFE_MISSION_TIME_CFG_DEFAULT_TAI true -#define CFE_MISSION_TIME_CFG_DEFAULT_UTC false - -/** -** \cfetimecfg Default Time Format -** -** \par Description: -** The following definition enables the use of a simulated time at -** the tone signal using a software bus message. -** -** \par Limits -** Not Applicable -*/ -#define CFE_MISSION_TIME_CFG_FAKE_TONE true - -/** -** \cfetimecfg Default Time and Tone Order -** -** \par Description: -** Time Services may be configured to expect the time at the tone -** data packet to either precede or follow the tone signal. If the -** time at the tone data packet follows the tone signal, then the -** data within the packet describes what the time "was" at the tone. -** If the time at the tone data packet precedes the tone signal, then -** the data within the packet describes what the time "will be" at -** the tone. One, and only one, of the following symbols must be set to true: -** - CFE_MISSION_TIME_AT_TONE_WAS -** - CFE_MISSION_TIME_AT_TONE_WILL_BE -** Note: If Time Services is defined as using a simulated tone signal -** (see #CFE_MISSION_TIME_CFG_FAKE_TONE above), then the tone data packet -** must follow the tone signal. -** -** \par Limits -** Either CFE_MISSION_TIME_AT_TONE_WAS or CFE_MISSION_TIME_AT_TONE_WILL_BE must be set to true. -** They may not both be true and they may not both be false. -*/ -#define CFE_MISSION_TIME_AT_TONE_WAS true -#define CFE_MISSION_TIME_AT_TONE_WILL_BE false - -/** -** \cfetimecfg Min and Max Time Elapsed -** -** \par Description: -** Based on the definition of Time and Tone Order -** (CFE_MISSION_TIME_AT_TONE_WAS/WILL_BE) either the "time at the tone" signal or -** data packet will follow the other. This definition sets the valid window -** of time for the second of the pair to lag behind the first. Time -** Services will invalidate both the tone and packet if the second does not -** arrive within this window following the first. -** -** For example, if the data packet follows the tone, it might be valid for -** the data packet to arrive between zero and 100,000 micro-seconds after -** the tone. But, if the tone follows the packet, it might be valid -** only if the packet arrived between 200,000 and 700,000 micro-seconds -** before the tone. -** -** Note: units are in micro-seconds -** -** \par Limits -** 0 to 999,999 decimal -*/ -#define CFE_MISSION_TIME_MIN_ELAPSED 0 -#define CFE_MISSION_TIME_MAX_ELAPSED 200000 - -/** -** \cfetimecfg Default Time Values -** -** \par Description: -** Default time values are provided to avoid problems due to time -** calculations performed after startup but before commands can be -** processed. For example, if the default time format is UTC then -** it is important that the sum of MET and STCF always exceed the -** value of Leap Seconds to prevent the UTC time calculation -** (time = MET + STCF - Leap Seconds) from resulting in a negative -** (very large) number.

    -** Some past missions have also created known (albeit wrong) default -** timestamps. For example, assume the epoch is defined as Jan 1, 1970 -** and further assume the default time values are set to create a timestamp -** of Jan 1, 2000. Even though the year 2000 timestamps are wrong, it -** may be of value to keep the time within some sort of bounds acceptable -** to the software.

    -** Note: Sub-second units are in micro-seconds (0 to 999,999) and -** all values must be defined -** -** \par Limits -** Not Applicable -*/ -#define CFE_MISSION_TIME_DEF_MET_SECS 1000 -#define CFE_MISSION_TIME_DEF_MET_SUBS 0 - -#define CFE_MISSION_TIME_DEF_STCF_SECS 1000000 -#define CFE_MISSION_TIME_DEF_STCF_SUBS 0 - -#define CFE_MISSION_TIME_DEF_LEAPS 37 - -#define CFE_MISSION_TIME_DEF_DELAY_SECS 0 -#define CFE_MISSION_TIME_DEF_DELAY_SUBS 1000 - -/** -** \cfetimecfg Default EPOCH Values -** -** \par Description: -** Default ground time epoch values -** Note: these values are used only by the CFE_TIME_Print() API function -** -** \par Limits -** Year - must be within 136 years -** Day - Jan 1 = 1, Feb 1 = 32, etc. -** Hour - 0 to 23 -** Minute - 0 to 59 -** Second - 0 to 59 -** Micros - 0 to 999999 -*/ -#define CFE_MISSION_TIME_EPOCH_YEAR 1980 -#define CFE_MISSION_TIME_EPOCH_DAY 1 -#define CFE_MISSION_TIME_EPOCH_HOUR 0 -#define CFE_MISSION_TIME_EPOCH_MINUTE 0 -#define CFE_MISSION_TIME_EPOCH_SECOND 0 -#define CFE_MISSION_TIME_EPOCH_MICROS 0 - -/** -** \cfetimecfg Time File System Factor -** -** \par Description: -** Define the s/c vs file system time conversion constant... -** -** Note: this value is intended for use only by CFE TIME API functions to -** convert time values based on the ground system epoch (s/c time) to -** and from time values based on the file system epoch (fs time). -** -** FS time = S/C time + factor -** S/C time = FS time - factor -** -** Worksheet: -** -** S/C epoch = Jan 1, 2005 (LRO ground system epoch) -** FS epoch = Jan 1, 1980 (vxWorks DOS file system epoch) -** -** Delta = 25 years, 0 days, 0 hours, 0 minutes, 0 seconds -** -** Leap years = 1980, 1984, 1988, 1992, 1996, 2000, 2004 -** (divisible by 4 -- except if by 100 -- unless also by 400) -** -** 1 year = 31,536,000 seconds -** 1 day = 86,400 seconds -** 1 hour = 3,600 seconds -** 1 minute = 60 seconds -** -** 25 years = 788,400,000 seconds -** 7 extra leap days = 604,800 seconds -** -** total delta = 789,004,800 seconds -** -** \par Limits -** Not Applicable -*/ -#define CFE_MISSION_TIME_FS_FACTOR 789004800 - -/** -** \cfeescfg Maximum Length of CDS Name -** -** \par Description: -** Indicates the maximum length (in characters) of the CDS name ('CDSName') -** portion of a Full CDS Name of the following form: -** "ApplicationName.CDSName" -** -** This length does not need to include an extra character for NULL termination. -** -** \par Limits -** This value should be kept as a multiple of 4, to maintain alignment of -** any possible neighboring fields without implicit padding. -** -*/ -#define CFE_MISSION_ES_CDS_MAX_NAME_LENGTH 16 - -/** -** \cfeevscfg Maximum Event Message Length -** -** \par Description: -** Indicates the maximum length (in characters) of the formatted text -** string portion of an event message -** -** This length does not need to include an extra character for NULL termination. -** -** \par Limits -** Not Applicable -*/ -#define CFE_MISSION_EVS_MAX_MESSAGE_LENGTH 122 - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* These names have been converted to an enum in cfe_es_api_typedefs.h */ - -/** \name Checksum/CRC algorithm identifiers */ - -#define CFE_MISSION_ES_CRC_8 CFE_ES_CrcType_CRC_8 /* 1 */ -#define CFE_MISSION_ES_CRC_16 CFE_ES_CrcType_CRC_16 /* 2 */ -#define CFE_MISSION_ES_CRC_32 CFE_ES_CrcType_CRC_32 /* 3 */ - -#endif - -/** -** \cfeescfg Mission Default CRC algorithm -** -** \par Description: -** Indicates the which CRC algorithm should be used as the default -** for verifying the contents of Critical Data Stores and when calculating -** Table Image data integrity values. -** -** \par Limits -** Currently only CFE_ES_CrcType_CRC_16 is supported (see brief in CFE_ES_CrcType_Enum -** definition in cfe_es_api_typedefs.h) -*/ -#define CFE_MISSION_ES_DEFAULT_CRC CFE_ES_CrcType_CRC_16 - -/** -** \cfetblcfg Maximum Table Name Length -** -** \par Description: -** Indicates the maximum length (in characters) of the table name -** ('TblName') portion of a Full Table Name of the following -** form: "ApplicationName.TblName" -** -** This length does not need to include an extra character for NULL termination. -** -** \par Limits -** This value should be kept as a multiple of 4, to maintain alignment of -** any possible neighboring fields without implicit padding. -*/ -#define CFE_MISSION_TBL_MAX_NAME_LENGTH 16 - -/** -** \cfemissioncfg cFE Portable Message Numbers for Commands -** -** \par Description: -** Portable message numbers for the cFE command messages -** NOTE: cFE MsgIds are the sum of the base numbers and the portable msg -** numbers. -** -** \par Limits -** Not Applicable -*/ -#define CFE_MISSION_EVS_CMD_MSG 1 -#define CFE_MISSION_TEST_CMD_MSG 2 -#define CFE_MISSION_SB_CMD_MSG 3 -#define CFE_MISSION_TBL_CMD_MSG 4 -#define CFE_MISSION_TIME_CMD_MSG 5 -#define CFE_MISSION_ES_CMD_MSG 6 - -#define CFE_MISSION_ES_SEND_HK_MSG 8 -#define CFE_MISSION_EVS_SEND_HK_MSG 9 -/* Offset 10 is available */ -#define CFE_MISSION_SB_SEND_HK_MSG 11 -#define CFE_MISSION_TBL_SEND_HK_MSG 12 -#define CFE_MISSION_TIME_SEND_HK_MSG 13 - -#define CFE_MISSION_SB_SUB_RPT_CTRL_MSG 14 - -#define CFE_MISSION_TIME_TONE_CMD_MSG 16 -#define CFE_MISSION_TIME_1HZ_CMD_MSG 17 - -/** -** \cfemissioncfg cFE Portable Message Numbers for Global Messages -** -** \par Description: -** Portable message numbers for the cFE global messages -** NOTE: cFE MsgIds are the sum of the base numbers and the portable msg -** numbers. -** -** \par Limits -** Not Applicable -*/ -#define CFE_MISSION_TIME_DATA_CMD_MSG 0 -#define CFE_MISSION_TIME_SEND_CMD_MSG 2 - -/** -** \cfemissioncfg cFE Portable Message Numbers for Telemetry -** -** \par Description: -** Portable message numbers for the cFE telemetry messages -** NOTE: cFE MsgIds are the sum of the base numbers and the portable msg -** numbers. -** -** \par Limits -** Not Applicable -*/ -#define CFE_MISSION_ES_HK_TLM_MSG 0 -#define CFE_MISSION_EVS_HK_TLM_MSG 1 -#define CFE_MISSION_TEST_HK_TLM_MSG 2 -#define CFE_MISSION_SB_HK_TLM_MSG 3 -#define CFE_MISSION_TBL_HK_TLM_MSG 4 -#define CFE_MISSION_TIME_HK_TLM_MSG 5 -#define CFE_MISSION_TIME_DIAG_TLM_MSG 6 - -#define CFE_MISSION_EVS_LONG_EVENT_MSG_MSG 8 -#define CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG 9 -#define CFE_MISSION_SB_STATS_TLM_MSG 10 -#define CFE_MISSION_ES_APP_TLM_MSG 11 -#define CFE_MISSION_TBL_REG_TLM_MSG 12 -#define CFE_MISSION_SB_ALLSUBS_TLM_MSG 13 -#define CFE_MISSION_SB_ONESUB_TLM_MSG 14 -#define CFE_MISSION_ES_MEMSTATS_TLM_MSG 16 - -/** -** \cfeescfg Mission Max Apps in a message -** -** \par Description: -** Indicates the maximum number of apps in a telemetry housekeeping message -** -** This affects the layout of command/telemetry messages but does not affect run -** time behavior or internal allocation. -** -** \par Limits -** All CPUs within the same SB domain (mission) must share the same definition -** Note this affects the size of messages, so it must not cause any message -** to exceed the max length. -*/ -#define CFE_MISSION_ES_MAX_APPLICATIONS 16 - -/** -** \cfeescfg Define Max Number of Performance IDs for messages -** -** \par Description: -** Defines the maximum number of perf ids allowed in command/telemetry messages -** -** This affects the layout of command/telemetry messages but does not affect run -** time behavior or internal allocation. -** -** \par Limits -** All CPUs within the same SB domain (mission) must share the same definition -** Note this affects the size of messages, so it must not cause any message -** to exceed the max length. -** -*/ -#define CFE_MISSION_ES_PERF_MAX_IDS 128 - -/** \cfeescfg Maximum number of block sizes in pool structures -** -** \par Description: -** The upper limit for the number of block sizes supported in the generic -** pool implementation, which in turn implements the memory pools and CDS. -** This definition is used as the array size with the pool stats structure, -** and therefore should be consistent across all CPUs in a mission, as well -** as with the ground station. -** -** There is also a platform-specific limit which may be fewer than this -** value. -** -** \par Limits: -** Must be at least one. No specific upper limit, but the number is -** anticipated to be reasonably small (i.e. tens, not hundreds). Large -** values have not been tested. -** -** -*/ -#define CFE_MISSION_ES_POOL_MAX_BUCKETS 17 - -/** -** \cfetblcfg Maximum Length of Full Table Name in messages -** -** \par Description: -** Indicates the maximum length (in characters) of the entire table name -** within software bus messages, in "AppName.TableName" notation. -** -** This affects the layout of command/telemetry messages but does not affect run -** time behavior or internal allocation. -** -** \par Limits -** All CPUs within the same SB domain (mission) must share the same definition -** Note this affects the size of messages, so it must not cause any message -** to exceed the max length. -** -** This value should be kept as a multiple of 4, to maintain alignment of -** any possible neighboring fields without implicit padding. -*/ -#define CFE_MISSION_TBL_MAX_FULL_NAME_LEN (CFE_MISSION_TBL_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) - -/** -** \cfesbcfg Maximum Number of pipes that SB command/telemetry messages may hold -** -** \par Description: -** Dictates the maximum number of unique Pipes the SB message definitions will hold. -** -** This affects the layout of command/telemetry messages but does not affect run -** time behavior or internal allocation. -** -** \par Limits -** All CPUs within the same SB domain (mission) must share the same definition -** Note this affects the size of messages, so it must not cause any message -** to exceed the max length. -** -*/ -#define CFE_MISSION_SB_MAX_PIPES 64 - -/** -** \cfemissioncfg cFE Maximum length for pathnames within data exchange structures -** -** \par Description: -** The value of this constant dictates the size of pathnames within all structures -** used for external data exchange, such as Software bus messages and table definitions. -** This is typically the same as OS_MAX_PATH_LEN but that is OSAL dependent -- -** and as such it definable on a per-processor/OS basis and hence may be different -** across multiple processors. It is recommended to set this to the value of the -** largest OS_MAX_PATH_LEN in use on any CPU on the mission. -** -** This affects only the layout of command/telemetry messages and table definitions; -** internal allocation may use the platform-specific OS_MAX_PATH_LEN value. -** -** This length must include an extra character for NULL termination. -** -** \par Limits -** All CPUs within the same SB domain (mission) and ground tools must share the -** same definition. -** Note this affects the size of messages, so it must not cause any message -** to exceed the max length. -** -** This value should be kept as a multiple of 4, to maintain alignment of -** any possible neighboring fields without implicit padding. -*/ -#define CFE_MISSION_MAX_PATH_LEN 64 - -/** -** \cfemissioncfg cFE Maximum length for filenames within data exchange structures -** -** \par Description: -** The value of this constant dictates the size of filenames within all structures -** used for external data exchange, such as Software bus messages and table definitions. -** This is typically the same as OS_MAX_FILE_LEN but that is OSAL dependent -- -** and as such it definable on a per-processor/OS basis and hence may be different -** across multiple processors. It is recommended to set this to the value of the -** largest OS_MAX_FILE_LEN in use on any CPU on the mission. -** -** This affects only the layout of command/telemetry messages and table definitions; -** internal allocation may use the platform-specific OS_MAX_FILE_LEN value. -** -** This length must include an extra character for NULL termination. -** -** \par Limits -** All CPUs within the same SB domain (mission) and ground tools must share the -** same definition. -** Note this affects the size of messages, so it must not cause any message -** to exceed the max length. -** -** This value should be kept as a multiple of 4, to maintain alignment of -** any possible neighboring fields without implicit padding. -*/ -#define CFE_MISSION_MAX_FILE_LEN 20 - -/** -** \cfemissioncfg cFE Maximum length for API names within data exchange structures -** -** \par Description: -** The value of this constant dictates the size of filenames within all structures -** used for external data exchange, such as Software bus messages and table definitions. -** This is typically the same as OS_MAX_API_LEN but that is OSAL dependent -- -** and as such it definable on a per-processor/OS basis and hence may be different -** across multiple processors. It is recommended to set this to the value of the -** largest OS_MAX_API_LEN in use on any CPU on the mission. -** -** This affects only the layout of command/telemetry messages and table definitions; -** internal allocation may use the platform-specific OS_MAX_API_LEN value. -** -** This length must include an extra character for NULL termination. -** -** \par Limits -** All CPUs within the same SB domain (mission) must share the same definition -** Note this affects the size of messages, so it must not cause any message -** to exceed the max length. -** -** This value should be kept as a multiple of 4, to maintain alignment of -** any possible neighboring fields without implicit padding. -*/ -#define CFE_MISSION_MAX_API_LEN 20 - -/** -** \cfeescfg Maximum Length of Full CDS Name in messages -** -** \par Description: -** Indicates the maximum length (in characters) of the entire CDS name -** of the following form: "ApplicationName.CDSName" -** -** This affects the layout of command/telemetry messages but does not affect run -** time behavior or internal allocation. -** -** \par Limits -** All CPUs within the same SB domain (mission) must share the same definition -** Note this affects the size of messages, so it must not cause any message -** to exceed the max length. -** -** This value should be kept as a multiple of 4, to maintain alignment of -** any possible neighboring fields without implicit padding. -*/ -#define CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) - -#endif /* SAMPLE_MISSION_CFG_H */ diff --git a/docs/src/cfe_frontpage.dox b/docs/src/cfe_frontpage.dox index 9d6fb21ee..d25c48d58 100644 --- a/docs/src/cfe_frontpage.dox +++ b/docs/src/cfe_frontpage.dox @@ -16,7 +16,7 @@
  • \subpage cfeesovr
  • \subpage cfeescmds
  • \subpage cfeestlm -
  • \subpage cfe_es_events.h "ES Event Message Reference" +
  • \subpage cfe_es_eventids.h "ES Event Message Reference"
  • \subpage cfeescfg
  • Events Services (EVS) @@ -24,7 +24,7 @@
  • \subpage cfeevsovr
  • \subpage cfeevscmds
  • \subpage cfeevstlm -
  • \subpage cfe_evs_events.h "EVS Event Message Reference" +
  • \subpage cfe_evs_eventids.h "EVS Event Message Reference"
  • \subpage cfeevscfg
  • Software Bus Services (SB) @@ -32,7 +32,7 @@
  • \subpage cfesbovr
  • \subpage cfesbcmds
  • \subpage cfesbtlm -
  • \subpage cfe_sb_events.h "SB Event Message Reference" +
  • \subpage cfe_sb_eventids.h "SB Event Message Reference"
  • \subpage cfesbcfg
  • Table Services (TBL) @@ -40,7 +40,7 @@
  • \subpage cfetblovr
  • \subpage cfetblcmds
  • \subpage cfetbltlm -
  • \subpage cfe_tbl_events.h "TBL Event Message Reference" +
  • \subpage cfe_tbl_eventids.h "TBL Event Message Reference"
  • \subpage cfetblcfg
  • Time Services (TIME) @@ -48,7 +48,7 @@
  • \subpage cfetimeovr
  • \subpage cfetimecmds
  • \subpage cfetimetlm -
  • \subpage cfe_time_events.h "TIME Event Message Reference" +
  • \subpage cfe_time_eventids.h "TIME Event Message Reference"
  • \subpage cfetimecfg
  • \subpage cfeevents diff --git a/docs/src/cfe_sb.dox b/docs/src/cfe_sb.dox index f97aeb2f7..243b8f4b0 100644 --- a/docs/src/cfe_sb.dox +++ b/docs/src/cfe_sb.dox @@ -484,7 +484,7 @@ the condition is happening by viewing the counter in SB HK telemetry. If the condition is happening, you can view the SB filter information through the EVS App Data Main page by clicking the 'go to' button for SB. The event Id for these - events can be learned through a previous event or from the cfe_sb_events.h file. + events can be learned through a previous event or from the cfe_sb_eventids.h file. (Q) From dc0027e24fb8628510525e28b106b2b2b4fb2f22 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 4 May 2023 15:55:12 -0400 Subject: [PATCH 168/200] Bump to v7.0.0-rc4+dev304 --- CHANGELOG.md | 6 ++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e5f5e828..870ca5c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Development Build: v7.0.0-rc4+dev304 +- reorganize headers +- Update XML files per interoperability testing +- uniqueness of tbl target names +- See , , and + ## Development Build: v7.0.0-rc4+dev287 - document CFS component file naming - Add EVS port timestamp and simplify port selection diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index d00df42b9..40ab3c02f 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 287 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 304 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From ca5106fbe382740058b48d1a29b11af04cfa9fd3 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 4 May 2023 16:47:30 -0400 Subject: [PATCH 169/200] Fix #2320, do not assume cfe_test is present This is an optional component and thus may not be part of the build. Hotfix based on workflow testing. --- modules/cfe_testcase/src/sb_sendrecv_test.c | 1 + modules/cfe_testcase/src/sb_subscription_test.c | 1 + modules/cfe_testcase/src/tbl_information_test.c | 1 + modules/cfe_testcase/src/tbl_registration_test.c | 1 + modules/core_api/config/default_cfe_msgids.h | 1 - 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index 79abe472e..81909d0e5 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -29,6 +29,7 @@ #include "cfe_test.h" #include "cfe_msgids.h" +#include "cfe_test_msgids.h" #define CFE_FT_STRINGBUF_SIZE 12 diff --git a/modules/cfe_testcase/src/sb_subscription_test.c b/modules/cfe_testcase/src/sb_subscription_test.c index 491c8d526..a55c73716 100644 --- a/modules/cfe_testcase/src/sb_subscription_test.c +++ b/modules/cfe_testcase/src/sb_subscription_test.c @@ -29,6 +29,7 @@ #include "cfe_test.h" #include "cfe_msgids.h" +#include "cfe_test_msgids.h" /* * This test procedure should be agnostic to specific MID values, but it should diff --git a/modules/cfe_testcase/src/tbl_information_test.c b/modules/cfe_testcase/src/tbl_information_test.c index 3b0988ac8..1a85f2bca 100644 --- a/modules/cfe_testcase/src/tbl_information_test.c +++ b/modules/cfe_testcase/src/tbl_information_test.c @@ -30,6 +30,7 @@ #include "cfe_test.h" #include "cfe_test_table.h" #include "cfe_msgids.h" +#include "cfe_test_msgids.h" void TestGetStatus(void) { diff --git a/modules/cfe_testcase/src/tbl_registration_test.c b/modules/cfe_testcase/src/tbl_registration_test.c index 68c3bfd58..d14c6c897 100644 --- a/modules/cfe_testcase/src/tbl_registration_test.c +++ b/modules/cfe_testcase/src/tbl_registration_test.c @@ -30,6 +30,7 @@ #include "cfe_test.h" #include "cfe_test_table.h" #include "cfe_msgids.h" +#include "cfe_test_msgids.h" int32 CallbackFunc(void *TblPtr) { diff --git a/modules/core_api/config/default_cfe_msgids.h b/modules/core_api/config/default_cfe_msgids.h index 300734644..e5759d437 100644 --- a/modules/core_api/config/default_cfe_msgids.h +++ b/modules/core_api/config/default_cfe_msgids.h @@ -37,6 +37,5 @@ #include "cfe_sb_msgids.h" #include "cfe_tbl_msgids.h" #include "cfe_time_msgids.h" -#include "cfe_test_msgids.h" #endif /* CFE_MSGIDS_H */ From 4eeba0893678b60a9cfe43ba20e1fa1ed58d40af Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Thu, 30 Mar 2023 06:23:57 +1000 Subject: [PATCH 170/200] Fix #1407, Add error report on EVS failure during log header write --- modules/evs/fsw/inc/cfe_evs_eventids.h | 11 +++++++++++ modules/evs/fsw/src/cfe_evs_log.c | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/modules/evs/fsw/inc/cfe_evs_eventids.h b/modules/evs/fsw/inc/cfe_evs_eventids.h index 72003ed3e..050485052 100644 --- a/modules/evs/fsw/inc/cfe_evs_eventids.h +++ b/modules/evs/fsw/inc/cfe_evs_eventids.h @@ -179,6 +179,17 @@ */ #define CFE_EVS_ERR_CRDATFILE_EID 13 +/** + * \brief EVS Write File Header to Log File Failure Event ID + * + * \par Type: ERROR + * + * \par Cause: + * + * Bytes written during Write File Header to Log File was not equal to the expected header size. + */ +#define CFE_EVS_WRITE_HEADER_ERR_EID 14 + /** * \brief EVS Invalid Command Code Received Event ID * diff --git a/modules/evs/fsw/src/cfe_evs_log.c b/modules/evs/fsw/src/cfe_evs_log.c index 63ed9b541..c1c237560 100644 --- a/modules/evs/fsw/src/cfe_evs_log.c +++ b/modules/evs/fsw/src/cfe_evs_log.c @@ -216,6 +216,12 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data) LogFilename); } } + else + { + EVS_SendEvent(CFE_EVS_WRITE_HEADER_ERR_EID, CFE_EVS_EventType_ERROR, + "Write File Header to Log File Error: WriteHdr RC: %d, Expected: %d, filename = %s", + (int)BytesWritten, (int)sizeof(LogFileHdr), LogFilename); + } OS_close(LogFileHandle); } From e65be5fccf46d07d89fea186e8832442446be33a Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 5 May 2023 11:25:21 -0400 Subject: [PATCH 171/200] Fix #2301, adjust UT pool buffer size for platform config If the CFE_PLATFORM_ES_MAX_BLOCK_SIZE is increased, then increase the UT pool buffer accordingly. This had been hardcoded to 128k. Also consider pool exhaustion to be a fatal error, as continuing the test will certainly segfault and this makes the original error harder to spot. --- modules/core_api/ut-stubs/src/cfe_es_handlers.c | 2 ++ modules/core_private/ut-stubs/src/ut_support.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core_api/ut-stubs/src/cfe_es_handlers.c b/modules/core_api/ut-stubs/src/cfe_es_handlers.c index 91e0f4323..e51c58f9a 100644 --- a/modules/core_api/ut-stubs/src/cfe_es_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_es_handlers.c @@ -420,6 +420,8 @@ void UT_DefaultHandler_CFE_ES_GetPoolBuf(void *UserObj, UT_EntryKey_t FuncKey, c */ UtAssert_Failed("Pool buffer empty in %s: need at least %lu bytes, given %lu", __func__, (unsigned long)PositionEnd, (unsigned long)PoolSize); + + UtAssert_Abort("Configuration error, pool buffer too small for test cases"); } } diff --git a/modules/core_private/ut-stubs/src/ut_support.c b/modules/core_private/ut-stubs/src/ut_support.c index 887ce1125..b352e05b9 100644 --- a/modules/core_private/ut-stubs/src/ut_support.c +++ b/modules/core_private/ut-stubs/src/ut_support.c @@ -50,7 +50,7 @@ typedef union long long int AlignLong; long double AlignDbl; void * AlignPtr; - char Content[128 * 1024]; + char Content[2 * CFE_PLATFORM_ES_MAX_BLOCK_SIZE]; } UT_Buffer_t; static UT_Buffer_t UT_CFE_ES_MemoryPool; From ee1f32ab599a312eac46ff05f5f2e8e8cbf59b2f Mon Sep 17 00:00:00 2001 From: "Martinez Pedraza, Jose F. (GSFC-5820)" Date: Mon, 8 May 2023 12:08:16 -0400 Subject: [PATCH 172/200] Fix #2327, Remove unused CFE_PLATFORM_ES_RESET_AREA_SIZE --- .../es/config/default_cfe_es_internal_cfg.h | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/modules/es/config/default_cfe_es_internal_cfg.h b/modules/es/config/default_cfe_es_internal_cfg.h index 3eaf81527..cb9bbee28 100644 --- a/modules/es/config/default_cfe_es_internal_cfg.h +++ b/modules/es/config/default_cfe_es_internal_cfg.h @@ -328,29 +328,6 @@ */ #define CFE_PLATFORM_ES_USER_RESERVED_SIZE (1024 * 1024) -/** -** \cfeescfg Define ES Reset Area Size -** -** \par Description: -** The ES Reset Area Size. This is the size in bytes of the cFE Reset variable -** and log area. This is a block of memory used by the cFE to store the system -** log ER Log and critical reset variables. This is 4 of 4 of the memory areas -** that are preserved during a processor reset. -** Note: This area must be sized large enough to hold all of the data -** structures. It should be automatically sized based on the CFE_ES_ResetData_t -** type, but circular dependencies in the headers prevent it from being defined -** this way. -** NOTE: Changing this value changes memory allocation, and may -** require changes to platform specific values (in CFE_PSP) such as -** USER_RESERVED_MEM in VxWorks depending on the memory areas -** being used for preserved data and on OS specific behavior. -** -** \par Limits -** There is a lower limit of 153600 (150KBytes) and an upper limit of UINT_MAX -** (4 Gigabytes) on this configuration parameter. -*/ -#define CFE_PLATFORM_ES_RESET_AREA_SIZE (170 * 1024) - /** ** \cfeescfg Define Memory Pool Alignment Size ** From 2a0a7667a3d33c6cff651c21995d32cd97d20433 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 12 May 2023 13:50:16 -0400 Subject: [PATCH 173/200] Bump to v7.0.0-rc4+dev312 --- CHANGELOG.md | 5 +++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 870ca5c88..59bc61b04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Development Build: v7.0.0-rc4+dev312 +- adjust UT pool buffer size for platform config +- Remove unused CFE_PLATFORM_ES_RESET_AREA_SIZE +- See and + ## Development Build: v7.0.0-rc4+dev304 - reorganize headers - Update XML files per interoperability testing diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 40ab3c02f..6711cef17 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 304 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 312 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 8786265d1cb81d6206507d2c956a2c951407bf35 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 18 May 2023 10:42:44 -0400 Subject: [PATCH 174/200] Fix #2337, add msg verify capability Adds a "verify" API to the msg module. This always returns success in the default implementation, because checksums were not historically enforced. However it can be made more strict in a custom implementation. --- modules/core_api/fsw/inc/cfe_msg.h | 26 ++++++++ modules/msg/CMakeLists.txt | 25 ++++---- modules/msg/fsw/src/cfe_msg_verify.c | 48 +++++++++++++++ modules/msg/ut-coverage/CMakeLists.txt | 38 +++++------- modules/msg/ut-coverage/msg_UT.c | 2 + modules/msg/ut-coverage/test_cfe_msg_verify.c | 59 +++++++++++++++++++ modules/msg/ut-coverage/test_cfe_msg_verify.h | 36 +++++++++++ 7 files changed, 200 insertions(+), 34 deletions(-) create mode 100644 modules/msg/fsw/src/cfe_msg_verify.c create mode 100644 modules/msg/ut-coverage/test_cfe_msg_verify.c create mode 100644 modules/msg/ut-coverage/test_cfe_msg_verify.h diff --git a/modules/core_api/fsw/inc/cfe_msg.h b/modules/core_api/fsw/inc/cfe_msg.h index ba91e77b8..0c1b9b949 100644 --- a/modules/core_api/fsw/inc/cfe_msg.h +++ b/modules/core_api/fsw/inc/cfe_msg.h @@ -700,4 +700,30 @@ CFE_Status_t CFE_MSG_GetTypeFromMsgId(CFE_SB_MsgId_t MsgId, CFE_MSG_Type_t *Type /**\}*/ +/** \defgroup CFEAPIMSGMsgVerify cFE Message Checking APIs + * \{ + */ +/*****************************************************************************/ +/** + * \brief Checks message headers against expected values + * + * \par Description + * This routine validates that any error-control field(s) in the message header + * matches the expected value. + * + * The specific function of this API is entirely dependent on the header fields + * and may be a no-op if no error checking is implemented. In that case, it + * will always output "true". + * + * \param[in] MsgPtr Message Pointer @nonnull + * \param[out] VerifyStatus Output variable to be set to verification result @nonnull + * + * \return Execution status, see \ref CFEReturnCodes + * \retval #CFE_SUCCESS \copybrief CFE_SUCCESS + * \retval #CFE_MSG_BAD_ARGUMENT \copybrief CFE_MSG_BAD_ARGUMENT + */ +CFE_Status_t CFE_MSG_Verify(const CFE_MSG_Message_t *MsgPtr, bool *VerifyStatus); + +/**\}*/ + #endif /* CFE_MSG_H */ diff --git a/modules/msg/CMakeLists.txt b/modules/msg/CMakeLists.txt index 9018021a1..4cc69762c 100644 --- a/modules/msg/CMakeLists.txt +++ b/modules/msg/CMakeLists.txt @@ -16,35 +16,36 @@ # Add the basic set of files which are always built # Defined as absolute so this list can also be used to build unit tests set(${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_ccsdspri.c - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_init.c - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_msgid_shared.c - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_sechdr_checksum.c - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_sechdr_fc.c - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_sechdr_time.c + fsw/src/cfe_msg_ccsdspri.c + fsw/src/cfe_msg_init.c + fsw/src/cfe_msg_verify.c + fsw/src/cfe_msg_msgid_shared.c + fsw/src/cfe_msg_sechdr_checksum.c + fsw/src/cfe_msg_sechdr_fc.c + fsw/src/cfe_msg_sechdr_time.c ) # Source selection for if CCSDS extended header is included, and MsgId version use if (MISSION_INCLUDE_CCSDSEXT_HEADER) message(STATUS "CCSDS primary and extended header included in message header") list(APPEND ${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_ccsdsext.c - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_initdefaulthdr_priext.c) + fsw/src/cfe_msg_ccsdsext.c + fsw/src/cfe_msg_initdefaulthdr_priext.c) if (MISSION_MSGID_V2) # MsgId v2 or v1 can be used with extended headers message(STATUS "Message Id version 2 in use (MsgId V2)") list(APPEND ${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_msgid_v2.c) + fsw/src/cfe_msg_msgid_v2.c) else (MISSION_MSGID_V2) message(STATUS "Message Id version 1 in use (MsgId V1)") list(APPEND ${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_msgid_v1.c) + fsw/src/cfe_msg_msgid_v1.c) endif (MISSION_MSGID_V2) else (MISSION_INCLUDE_CCSDSEXT_HEADER) message(STATUS "CCSDS primary header included in message header (not including CCSDS extended header)") message(STATUS "Message Id version 1 in use (MsgId V1)") list(APPEND ${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_initdefaulthdr_pri.c - ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_msgid_v1.c) + fsw/src/cfe_msg_initdefaulthdr_pri.c + fsw/src/cfe_msg_msgid_v1.c) if (MISSION_MSGID_V2) message(FATAL_ERROR "Message Id (MsgId) version 2 can only be used if MISSION_INCLUDE_CCSDSEXT_HEADER is set") endif (MISSION_MSGID_V2) diff --git a/modules/msg/fsw/src/cfe_msg_verify.c b/modules/msg/fsw/src/cfe_msg_verify.c new file mode 100644 index 000000000..b712ff3f6 --- /dev/null +++ b/modules/msg/fsw/src/cfe_msg_verify.c @@ -0,0 +1,48 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +#include "cfe_msg.h" +#include "cfe_msg_priv.h" +#include "cfe_msg_defaults.h" +#include "cfe_time.h" + +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +CFE_Status_t CFE_MSG_Verify(const CFE_MSG_Message_t *MsgPtr, bool *VerifyStatus) +{ + if (MsgPtr == NULL || VerifyStatus == NULL) + { + return CFE_MSG_BAD_ARGUMENT; + } + + /* + * In the default implementation, there is not anything to check here. + * Only commands have a checksum, but the value of that checksum was historically + * not enforced by CFE. + * + * This is mainly a hook for user expansion, in case a custom implementation + * has message verification capability. + */ + *VerifyStatus = true; + + return CFE_SUCCESS; +} \ No newline at end of file diff --git a/modules/msg/ut-coverage/CMakeLists.txt b/modules/msg/ut-coverage/CMakeLists.txt index e7c509576..dd2c3bad1 100644 --- a/modules/msg/ut-coverage/CMakeLists.txt +++ b/modules/msg/ut-coverage/CMakeLists.txt @@ -7,23 +7,23 @@ # ################################################################## -# Unit test object library sources, options, and includes -add_library(ut_${DEP}_objs OBJECT ${${DEP}_SRC}) -target_compile_options(ut_${DEP}_objs PRIVATE ${UT_COVERAGE_COMPILE_FLAGS}) -target_include_directories(ut_${DEP}_objs PRIVATE - $) +set(UNIT_SRCS) +foreach(SRC ${${DEP}_SRC}) + get_filename_component(UNITNAME "${SRC}" NAME) + list(APPEND UNIT_SRCS "../${SRC}") +endforeach() set (ut_${DEP}_tests msg_UT.c test_msg_not.c test_msg_pri_not.c test_cfe_msg_init.c + test_cfe_msg_verify.c test_cfe_msg_ccsdspri.c test_cfe_msg_msgid_shared.c test_cfe_msg_checksum.c test_cfe_msg_fc.c - test_cfe_msg_time.c - $) + test_cfe_msg_time.c) # Add extended header tests if appropriate if (MISSION_INCLUDE_CCSDSEXT_HEADER) @@ -44,21 +44,15 @@ else (MISSION_MSGID_V2) test_cfe_msg_msgid_v1.c) endif (MISSION_MSGID_V2) -# Add executable -add_executable(${DEP}_UT ${ut_${DEP}_tests}) -# Add include to get private defaults -target_include_directories(${DEP}_UT PRIVATE ../fsw/src) +add_cfe_coverage_test(${DEP} ALL + "msg_UT.c;${ut_${DEP}_tests}" # This list needs to be passed as a single argument + "${UNIT_SRCS}" +) -# Also add the UT_COVERAGE_LINK_FLAGS to the link command -# This should enable coverage analysis on platforms that support this -target_link_libraries(${DEP}_UT - ${UT_COVERAGE_LINK_FLAGS} - ut_core_private_stubs - ut_core_api_stubs - ut_assert) +# This permits UT test cases to directly access private headers in the fsw/src dir +target_include_directories(coverage-${DEP}-ALL-testrunner PRIVATE + ../fsw/src +) -add_test(${DEP}_UT ${DEP}_UT) -foreach(TGT ${INSTALL_TARGET_LIST}) - install(TARGETS ${DEP}_UT DESTINATION ${TGT}/${UT_INSTALL_SUBDIR}) -endforeach() +target_link_libraries(coverage-${DEP}-ALL-testrunner ut_core_private_stubs) diff --git a/modules/msg/ut-coverage/msg_UT.c b/modules/msg/ut-coverage/msg_UT.c index ea83b5f8c..97bc8e662 100644 --- a/modules/msg/ut-coverage/msg_UT.c +++ b/modules/msg/ut-coverage/msg_UT.c @@ -28,6 +28,7 @@ #include "test_cfe_msg_init.h" #include "test_cfe_msg_ccsdspri.h" #include "test_cfe_msg_ccsdsext.h" +#include "test_cfe_msg_verify.h" #include "test_cfe_msg_msgid_shared.h" #include "test_cfe_msg_msgid.h" #include "test_cfe_msg_fc.h" @@ -46,6 +47,7 @@ void UtTest_Setup(void) Test_MSG_CCSDSPri(); Test_MSG_CCSDSExt(); Test_MSG_MsgId_Shared(); + UT_ADD_TEST(Test_MSG_Verify); UT_ADD_TEST(Test_MSG_MsgId); UT_ADD_TEST(Test_MSG_Checksum); UT_ADD_TEST(Test_MSG_FcnCode); diff --git a/modules/msg/ut-coverage/test_cfe_msg_verify.c b/modules/msg/ut-coverage/test_cfe_msg_verify.c new file mode 100644 index 000000000..87c5faa73 --- /dev/null +++ b/modules/msg/ut-coverage/test_cfe_msg_verify.c @@ -0,0 +1,59 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/* + * Test message verify + */ + +/* + * Includes + */ +#include "utassert.h" +#include "ut_support.h" +#include "cfe_msg.h" +#include "test_cfe_msg_verify.h" +#include "cfe_error.h" +#include "cfe_msg_defaults.h" + +#include + +/* + * Test MSG Verify + */ +void Test_MSG_Verify(void) +{ + union + { + CFE_MSG_Message_t msg; + CFE_MSG_CommandHeader_t cmd; + CFE_MSG_TelemetryHeader_t tlm; + } LocalBuf; + bool Result; + + memset(&LocalBuf, 0, sizeof(LocalBuf)); + Result = false; + + /* bad buffer */ + UtAssert_INT32_EQ(CFE_MSG_Verify(NULL, &Result), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Verify(&LocalBuf.msg, NULL), CFE_MSG_BAD_ARGUMENT); + + /* nominal */ + Result = false; + CFE_UtAssert_SUCCESS(CFE_MSG_Verify(&LocalBuf.msg, &Result)); + UtAssert_BOOL_TRUE(Result); +} diff --git a/modules/msg/ut-coverage/test_cfe_msg_verify.h b/modules/msg/ut-coverage/test_cfe_msg_verify.h new file mode 100644 index 000000000..f017560e2 --- /dev/null +++ b/modules/msg/ut-coverage/test_cfe_msg_verify.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * cfe_msg_verify test header + */ +#ifndef TEST_CFE_MSG_VERIFY_H +#define TEST_CFE_MSG_VERIFY_H + +/* + * Includes + */ + +/* + * Functions + */ +void Test_MSG_Verify(void); + +#endif /* TEST_CFE_MSG_VERIFY_H */ From 393a0159895ee7c23ce8c9fec2c3fed68e4ee565 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 17 May 2023 16:15:09 -0400 Subject: [PATCH 175/200] Fix #2335, generalize update header parameter Expand the "Increment Sequence" boolean on transmit message functions to be a more general "Update Header" boolean, so it can be used for other fields like timestamps, checksums, or user-defined fields too. --- modules/cfe_testcase/src/sb_sendrecv_test.c | 13 +++--- modules/core_api/fsw/inc/cfe_msg.h | 25 +++++++++++ modules/core_api/fsw/inc/cfe_sb.h | 30 +++++++++---- .../core_api/ut-stubs/src/cfe_config_stubs.c | 4 +- .../core_api/ut-stubs/src/cfe_error_stubs.c | 43 +++++++++++++++++++ modules/core_api/ut-stubs/src/cfe_es_stubs.c | 21 ++------- modules/core_api/ut-stubs/src/cfe_msg_stubs.c | 17 ++++++++ modules/core_api/ut-stubs/src/cfe_sb_stubs.c | 8 ++-- .../core_api/ut-stubs/src/cfe_time_stubs.c | 2 + modules/msg/fsw/src/cfe_msg_init.c | 32 ++++++++++++++ modules/msg/ut-coverage/msg_UT.c | 1 + modules/msg/ut-coverage/test_cfe_msg_init.c | 37 ++++++++++++++++ modules/msg/ut-coverage/test_cfe_msg_init.h | 1 + modules/sb/fsw/src/cfe_sb_api.c | 22 +++++----- modules/sb/fsw/src/cfe_sb_priv.h | 2 +- modules/sb/ut-coverage/sb_UT.c | 24 +++++------ modules/sb/ut-coverage/sb_UT.h | 4 +- modules/tbl/fsw/src/cfe_tbl_internal.c | 2 +- modules/time/fsw/src/cfe_time_tone.c | 14 +++--- 19 files changed, 231 insertions(+), 71 deletions(-) create mode 100644 modules/core_api/ut-stubs/src/cfe_error_stubs.c diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index 81909d0e5..4f8be7ac2 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -145,8 +145,9 @@ void TestBasicTransmitRecv(void) UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf, PipeId1, -100), CFE_SB_BAD_ARGUMENT); /* - * Note, the CFE_SB_TransmitMsg ignores the "IncrementSequence" flag for commands. - * Thus, all the sequence numbers should come back with the original value set (11) + * Note, the CFE_SB_TransmitMsg now adheres to the "UpdateHeader" flag. + * Thus, the sequence numbers should come back with the value from the Route (1-2) + * rather than the value the message was filled with initially. * * Note this also utilizes the CFE_SB_PEND_FOREVER flag - if working correctly, * there should be a message in the queue, so it should not block. @@ -157,7 +158,7 @@ void TestBasicTransmitRecv(void) CFE_Assert_MSGID_EQ(MsgId, CFE_FT_CMD_MSGID); CmdPtr = (const CFE_FT_TestCmdMessage_t *)MsgBuf; UtAssert_UINT32_EQ(CmdPtr->CmdPayload, 0x0c0ffee); - UtAssert_UINT32_EQ(Seq1, 11); + UtAssert_UINT32_EQ(Seq1, 1); UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf, PipeId1, CFE_SB_PEND_FOREVER), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&MsgBuf->Msg, &MsgId), CFE_SUCCESS); @@ -165,7 +166,7 @@ void TestBasicTransmitRecv(void) CFE_Assert_MSGID_EQ(MsgId, CFE_FT_CMD_MSGID); CmdPtr = (const CFE_FT_TestCmdMessage_t *)MsgBuf; UtAssert_UINT32_EQ(CmdPtr->CmdPayload, 0x1c0ffee); - UtAssert_UINT32_EQ(Seq1, 11); + UtAssert_UINT32_EQ(Seq1, 2); UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf, PipeId1, CFE_SB_PEND_FOREVER), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&MsgBuf->Msg, &MsgId), CFE_SUCCESS); @@ -480,7 +481,7 @@ void TestZeroCopyTransmitRecv(void) /* Receive and get initial sequence count */ UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf, PipeId1, CFE_SB_POLL), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&MsgBuf->Msg, &SeqCmd1), CFE_SUCCESS); - UtAssert_UINT32_EQ(SeqCmd1, 1234); /* NOTE: commands currently do NOT honor "Increment" flag */ + UtAssert_UINT32_EQ(SeqCmd1, 6); /* NOTE: commands now honor "Update" flag */ UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf, PipeId2, CFE_SB_POLL), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&MsgBuf->Msg, &SeqTlm1), CFE_SUCCESS); @@ -497,7 +498,7 @@ void TestZeroCopyTransmitRecv(void) /* Receive and get current sequence count */ UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf, PipeId1, CFE_SB_POLL), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&MsgBuf->Msg, &SeqCmd2), CFE_SUCCESS); - UtAssert_UINT32_EQ(SeqCmd2, 1234); /* NOTE: commands currently do NOT honor "Increment" flag */ + UtAssert_UINT32_EQ(SeqCmd2, 7); /* NOTE: commands now honor "Update" flag */ UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&MsgBuf, PipeId2, CFE_SB_POLL), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&MsgBuf->Msg, &SeqTlm2), CFE_SUCCESS); UtAssert_UINT32_EQ(SeqTlm2, CFE_MSG_GetNextSequenceCount(SeqTlm1)); /* should be +1 from the previous */ diff --git a/modules/core_api/fsw/inc/cfe_msg.h b/modules/core_api/fsw/inc/cfe_msg.h index ba91e77b8..96a92d10b 100644 --- a/modules/core_api/fsw/inc/cfe_msg.h +++ b/modules/core_api/fsw/inc/cfe_msg.h @@ -59,6 +59,31 @@ * \retval #CFE_MSG_BAD_ARGUMENT \copybrief CFE_MSG_BAD_ARGUMENT */ CFE_Status_t CFE_MSG_Init(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId, CFE_MSG_Size_t Size); + +/*****************************************************************************/ +/** + * \brief Set/compute all dynamically-updated headers on a message + * + * \par Description + * This routine updates all dynamic header fields on a message, and is typically + * invoked via SB just prior to broadcasting the message. Dynamic headers include + * are values that should be computed/updated per message, including: + * - the sequence number + * - the timestamp, if present + * - any error control or checksum fields, if present + * + * The MSG module implementation determines which header fields meet this criteria + * and how they should be computed. + * + * \param[inout] MsgPtr A pointer to the buffer that contains the message @nonnull. + * \param[in] SeqCnt The current sequence number from the message route + * + * \return Execution status, see \ref CFEReturnCodes + * \retval #CFE_SUCCESS \copybrief CFE_SUCCESS + * \retval #CFE_MSG_BAD_ARGUMENT \copybrief CFE_MSG_BAD_ARGUMENT + */ +CFE_Status_t CFE_MSG_UpdateHeader(CFE_MSG_Message_t *MsgPtr, CFE_MSG_SequenceCount_t SeqCnt); + /**\}*/ /** \defgroup CFEAPIMSGHeaderPri cFE Message Primary Header APIs diff --git a/modules/core_api/fsw/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h index 99973882b..a670d0120 100644 --- a/modules/core_api/fsw/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -402,18 +402,26 @@ CFE_Status_t CFE_SB_UnsubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeI ** software bus will read the message ID from the message header to ** determine which pipes should receive the message. ** +** In general, the "UpdateHeader" parameter should be passed as "true" +** if the message was newly constructed by the sender and is being sent +** for the first time. When forwarding a message that originated from +** an external entity (e.g. messages passing through CI or SBN), the +** parameter should be passed as "false" to not overwrite existing data. +** ** \par Assumptions, External Events, and Notes: ** - This routine will not normally wait for the receiver tasks to ** process the message before returning control to the caller's task. ** - However, if a higher priority task is pending and subscribed to ** this message, that task may get to run before returning ** control to the caller. +** - In previous versions of CFE, the boolean parameter referred to the +** sequence number header of telemetry messages only. This has been +** extended to apply more generically to any headers, as determined by +** the CFE MSG implementation. ** ** \param[in] MsgPtr A pointer to the message to be sent @nonnull. This must point ** to the first byte of the message header. -** \param[in] IncrementSequenceCount Boolean to increment the internally tracked -** sequence count and update the message if the -** buffer contains a telemetry message +** \param[in] UpdateHeader Update the headers of the message ** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS @@ -421,7 +429,7 @@ CFE_Status_t CFE_SB_UnsubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeI ** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG ** \retval #CFE_SB_BUF_ALOC_ERR \covtest \copybrief CFE_SB_BUF_ALOC_ERR **/ -CFE_Status_t CFE_SB_TransmitMsg(const CFE_MSG_Message_t *MsgPtr, bool IncrementSequenceCount); +CFE_Status_t CFE_SB_TransmitMsg(const CFE_MSG_Message_t *MsgPtr, bool UpdateHeader); /*****************************************************************************/ /** @@ -536,6 +544,12 @@ CFE_Status_t CFE_SB_ReleaseMessageBuffer(CFE_SB_Buffer_t *BufPtr); ** internal buffer. The "zero copy" interface can be used to improve ** performance in high-rate, high-volume software bus traffic. ** +** In general, the "UpdateHeader" parameter should be passed as "true" +** if the message was newly constructed by the sender and is being sent +** for the first time. When forwarding a message that originated from +** an external entity (e.g. messages passing through CI or SBN), the +** parameter should be passed as "false" to not overwrite existing data. +** ** \par Assumptions, External Events, and Notes: ** -# A handle returned by #CFE_SB_AllocateMessageBuffer is "consumed" by ** a _successful_ call to #CFE_SB_TransmitBuffer. @@ -553,17 +567,15 @@ CFE_Status_t CFE_SB_ReleaseMessageBuffer(CFE_SB_Buffer_t *BufPtr); ** -# This function will increment and apply the internally tracked ** sequence counter if set to do so. ** -** \param[in] BufPtr A pointer to the buffer to be sent @nonnull. -** \param[in] IncrementSequenceCount Boolean to increment the internally tracked -** sequence count and update the message if the -** buffer contains a telemetry message +** \param[in] BufPtr A pointer to the buffer to be sent @nonnull. +** \param[in] UpdateHeader Update the headers of the message ** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT ** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG **/ -CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequenceCount); +CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool UpdateHeader); /** @} */ diff --git a/modules/core_api/ut-stubs/src/cfe_config_stubs.c b/modules/core_api/ut-stubs/src/cfe_config_stubs.c index 6a90f1b93..1ac7943a8 100644 --- a/modules/core_api/ut-stubs/src/cfe_config_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_config_stubs.c @@ -25,8 +25,8 @@ #include "cfe_config.h" #include "utgenstub.h" -extern void UT_DefaultHandler_CFE_Config_GetObjPointer(void *, UT_EntryKey_t, const UT_StubContext_t *); -extern void UT_DefaultHandler_CFE_Config_GetString(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_Config_GetObjPointer(void *, UT_EntryKey_t, const UT_StubContext_t *); +void UT_DefaultHandler_CFE_Config_GetString(void *, UT_EntryKey_t, const UT_StubContext_t *); /* * ---------------------------------------------------- diff --git a/modules/core_api/ut-stubs/src/cfe_error_stubs.c b/modules/core_api/ut-stubs/src/cfe_error_stubs.c new file mode 100644 index 000000000..540769933 --- /dev/null +++ b/modules/core_api/ut-stubs/src/cfe_error_stubs.c @@ -0,0 +1,43 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * Auto-Generated stub implementations for functions defined in cfe_error header + */ + +#include "cfe_error.h" +#include "utgenstub.h" + +/* + * ---------------------------------------------------- + * Generated stub function for CFE_ES_StatusToString() + * ---------------------------------------------------- + */ +char *CFE_ES_StatusToString(CFE_Status_t status, CFE_StatusString_t *status_string) +{ + UT_GenStub_SetupReturnBuffer(CFE_ES_StatusToString, char *); + + UT_GenStub_AddParam(CFE_ES_StatusToString, CFE_Status_t, status); + UT_GenStub_AddParam(CFE_ES_StatusToString, CFE_StatusString_t *, status_string); + + UT_GenStub_Execute(CFE_ES_StatusToString, Basic, NULL); + + return UT_GenStub_GetReturnValue(CFE_ES_StatusToString, char *); +} diff --git a/modules/core_api/ut-stubs/src/cfe_es_stubs.c b/modules/core_api/ut-stubs/src/cfe_es_stubs.c index 9dfdf261b..d990609ed 100644 --- a/modules/core_api/ut-stubs/src/cfe_es_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_es_stubs.c @@ -69,6 +69,7 @@ CFE_Status_t CFE_ES_AppID_ToIndex(CFE_ES_AppId_t AppID, uint32 *Idx) */ void CFE_ES_BackgroundWakeup(void) { + UT_GenStub_Execute(CFE_ES_BackgroundWakeup, Basic, NULL); } @@ -216,6 +217,7 @@ void CFE_ES_ExitApp(uint32 ExitStatus) */ void CFE_ES_ExitChildTask(void) { + UT_GenStub_Execute(CFE_ES_ExitChildTask, Basic, NULL); } @@ -602,6 +604,7 @@ CFE_Status_t CFE_ES_IncrementGenCounter(CFE_ES_CounterId_t CounterId) */ void CFE_ES_IncrementTaskCounter(void) { + UT_GenStub_Execute(CFE_ES_IncrementTaskCounter, Basic, NULL); } @@ -731,6 +734,7 @@ int32 CFE_ES_PoolDelete(CFE_ES_MemHandle_t PoolID) */ void CFE_ES_ProcessAsyncEvent(void) { + UT_GenStub_Execute(CFE_ES_ProcessAsyncEvent, Basic, NULL); } @@ -950,20 +954,3 @@ CFE_Status_t CFE_ES_WriteToSysLog(const char *SpecStringPtr, ...) return UT_GenStub_GetReturnValue(CFE_ES_WriteToSysLog, CFE_Status_t); } - -/* - * ---------------------------------------------------- - * Generated stub function for CFE_ES_StatusToString() - * ---------------------------------------------------- - */ -char *CFE_ES_StatusToString(CFE_Status_t status, CFE_StatusString_t *status_string) -{ - UT_GenStub_SetupReturnBuffer(CFE_ES_StatusToString, char *); - - UT_GenStub_AddParam(CFE_ES_StatusToString, CFE_Status_t, status); - UT_GenStub_AddParam(CFE_ES_StatusToString, CFE_StatusString_t *, status_string); - - UT_GenStub_Execute(CFE_ES_StatusToString, Basic, NULL); - - return UT_GenStub_GetReturnValue(CFE_ES_StatusToString, char *); -} diff --git a/modules/core_api/ut-stubs/src/cfe_msg_stubs.c b/modules/core_api/ut-stubs/src/cfe_msg_stubs.c index cf59efc6c..066f8e8d1 100644 --- a/modules/core_api/ut-stubs/src/cfe_msg_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_msg_stubs.c @@ -621,6 +621,23 @@ CFE_Status_t CFE_MSG_SetType(CFE_MSG_Message_t *MsgPtr, CFE_MSG_Type_t Type) return UT_GenStub_GetReturnValue(CFE_MSG_SetType, CFE_Status_t); } +/* + * ---------------------------------------------------- + * Generated stub function for CFE_MSG_UpdateHeader() + * ---------------------------------------------------- + */ +CFE_Status_t CFE_MSG_UpdateHeader(CFE_MSG_Message_t *MsgPtr, CFE_MSG_SequenceCount_t SeqCnt) +{ + UT_GenStub_SetupReturnBuffer(CFE_MSG_UpdateHeader, CFE_Status_t); + + UT_GenStub_AddParam(CFE_MSG_UpdateHeader, CFE_MSG_Message_t *, MsgPtr); + UT_GenStub_AddParam(CFE_MSG_UpdateHeader, CFE_MSG_SequenceCount_t, SeqCnt); + + UT_GenStub_Execute(CFE_MSG_UpdateHeader, Basic, NULL); + + return UT_GenStub_GetReturnValue(CFE_MSG_UpdateHeader, CFE_Status_t); +} + /* * ---------------------------------------------------- * Generated stub function for CFE_MSG_ValidateChecksum() diff --git a/modules/core_api/ut-stubs/src/cfe_sb_stubs.c b/modules/core_api/ut-stubs/src/cfe_sb_stubs.c index f31ef71f8..3f541d54c 100644 --- a/modules/core_api/ut-stubs/src/cfe_sb_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_sb_stubs.c @@ -384,12 +384,12 @@ void CFE_SB_TimeStampMsg(CFE_MSG_Message_t *MsgPtr) * Generated stub function for CFE_SB_TransmitBuffer() * ---------------------------------------------------- */ -CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequenceCount) +CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool UpdateHeader) { UT_GenStub_SetupReturnBuffer(CFE_SB_TransmitBuffer, CFE_Status_t); UT_GenStub_AddParam(CFE_SB_TransmitBuffer, CFE_SB_Buffer_t *, BufPtr); - UT_GenStub_AddParam(CFE_SB_TransmitBuffer, bool, IncrementSequenceCount); + UT_GenStub_AddParam(CFE_SB_TransmitBuffer, bool, UpdateHeader); UT_GenStub_Execute(CFE_SB_TransmitBuffer, Basic, UT_DefaultHandler_CFE_SB_TransmitBuffer); @@ -401,12 +401,12 @@ CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequen * Generated stub function for CFE_SB_TransmitMsg() * ---------------------------------------------------- */ -CFE_Status_t CFE_SB_TransmitMsg(const CFE_MSG_Message_t *MsgPtr, bool IncrementSequenceCount) +CFE_Status_t CFE_SB_TransmitMsg(const CFE_MSG_Message_t *MsgPtr, bool UpdateHeader) { UT_GenStub_SetupReturnBuffer(CFE_SB_TransmitMsg, CFE_Status_t); UT_GenStub_AddParam(CFE_SB_TransmitMsg, const CFE_MSG_Message_t *, MsgPtr); - UT_GenStub_AddParam(CFE_SB_TransmitMsg, bool, IncrementSequenceCount); + UT_GenStub_AddParam(CFE_SB_TransmitMsg, bool, UpdateHeader); UT_GenStub_Execute(CFE_SB_TransmitMsg, Basic, UT_DefaultHandler_CFE_SB_TransmitMsg); diff --git a/modules/core_api/ut-stubs/src/cfe_time_stubs.c b/modules/core_api/ut-stubs/src/cfe_time_stubs.c index 40519dfb1..999f06008 100644 --- a/modules/core_api/ut-stubs/src/cfe_time_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_time_stubs.c @@ -113,6 +113,7 @@ void CFE_TIME_ExternalTime(CFE_TIME_SysTime_t NewTime) */ void CFE_TIME_ExternalTone(void) { + UT_GenStub_Execute(CFE_TIME_ExternalTone, Basic, NULL); } @@ -263,6 +264,7 @@ CFE_TIME_SysTime_t CFE_TIME_GetUTC(void) */ void CFE_TIME_Local1HzISR(void) { + UT_GenStub_Execute(CFE_TIME_Local1HzISR, Basic, NULL); } diff --git a/modules/msg/fsw/src/cfe_msg_init.c b/modules/msg/fsw/src/cfe_msg_init.c index 3c29432a4..ab988f4bb 100644 --- a/modules/msg/fsw/src/cfe_msg_init.c +++ b/modules/msg/fsw/src/cfe_msg_init.c @@ -22,6 +22,7 @@ #include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_msg_defaults.h" +#include "cfe_time.h" #include "string.h" /*---------------------------------------------------------------- @@ -52,3 +53,34 @@ CFE_Status_t CFE_MSG_Init(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId, CFE_M return status; } + +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +CFE_Status_t CFE_MSG_UpdateHeader(CFE_MSG_Message_t *MsgPtr, CFE_MSG_SequenceCount_t SeqCnt) +{ + if (MsgPtr == NULL) + { + return CFE_MSG_BAD_ARGUMENT; + } + + /* Sequence count is in the basic CCSDS Primary Hdr, so all msgs have it */ + CFE_MSG_SetSequenceCount(MsgPtr, SeqCnt); + + /* + * TLM packets have a timestamp in the secondary header. + * This may fail if this is not a TLM packet (that is OK) + */ + CFE_MSG_SetMsgTime(MsgPtr, CFE_TIME_GetTime()); + + /* + * CMD packets have a checksum in the secondary header. + * This may fail if this is not a CMD packet (that is OK) + */ + CFE_MSG_GenerateChecksum(MsgPtr); + + return CFE_SUCCESS; +} \ No newline at end of file diff --git a/modules/msg/ut-coverage/msg_UT.c b/modules/msg/ut-coverage/msg_UT.c index ea83b5f8c..e0bd532ff 100644 --- a/modules/msg/ut-coverage/msg_UT.c +++ b/modules/msg/ut-coverage/msg_UT.c @@ -43,6 +43,7 @@ void UtTest_Setup(void) UtPrintf("Message header coverage test..."); UT_ADD_TEST(Test_MSG_Init); + UT_ADD_TEST(Test_MSG_UpdateHeader); Test_MSG_CCSDSPri(); Test_MSG_CCSDSExt(); Test_MSG_MsgId_Shared(); diff --git a/modules/msg/ut-coverage/test_cfe_msg_init.c b/modules/msg/ut-coverage/test_cfe_msg_init.c index a072566ae..a707c3618 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_init.c +++ b/modules/msg/ut-coverage/test_cfe_msg_init.c @@ -124,3 +124,40 @@ void Test_MSG_Init(void) UtAssert_UINT32_EQ(Test_MSG_Pri_NotZero(CFE_MSG_PTR(cmd)) & ~MSG_HDRVER_FLAG, MSG_APID_FLAG | MSG_HASSEC_FLAG | MSG_TYPE_FLAG | MSG_LENGTH_FLAG | MSG_SEGMENT_FLAG); } + +/* + * Test MSG Update Header + */ +void Test_MSG_UpdateHeader(void) +{ + union + { + CFE_MSG_Message_t msg; + CFE_MSG_CommandHeader_t cmd; + CFE_MSG_TelemetryHeader_t tlm; + + } LocalBuf; + CFE_MSG_SequenceCount_t SeqCnt; + CFE_MSG_SequenceCount_t CheckCnt; + + memset(&LocalBuf, 0, sizeof(LocalBuf)); + SeqCnt = 1; + CheckCnt = 0; + + /* bad buffer */ + UtAssert_INT32_EQ(CFE_MSG_UpdateHeader(NULL, SeqCnt), CFE_MSG_BAD_ARGUMENT); + + /* nominal, cmd */ + CFE_MSG_SetType(&LocalBuf.msg, CFE_MSG_Type_Cmd); + CFE_UtAssert_SUCCESS(CFE_MSG_UpdateHeader(&LocalBuf.msg, SeqCnt)); + CFE_MSG_GetSequenceCount(&LocalBuf.msg, &CheckCnt); + UtAssert_UINT32_EQ(CheckCnt, SeqCnt); + ++SeqCnt; + + /* nominal, tlm */ + CFE_MSG_SetType(&LocalBuf.msg, CFE_MSG_Type_Tlm); + CFE_UtAssert_SUCCESS(CFE_MSG_UpdateHeader(&LocalBuf.msg, SeqCnt)); + CFE_MSG_GetSequenceCount(&LocalBuf.msg, &CheckCnt); + UtAssert_UINT32_EQ(CheckCnt, SeqCnt); + ++SeqCnt; +} diff --git a/modules/msg/ut-coverage/test_cfe_msg_init.h b/modules/msg/ut-coverage/test_cfe_msg_init.h index a80362d03..3c5b25f62 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_init.h +++ b/modules/msg/ut-coverage/test_cfe_msg_init.h @@ -33,5 +33,6 @@ */ /* Test extended header mission functionality */ void Test_MSG_Init(void); +void Test_MSG_UpdateHeader(void); #endif /* TEST_CFE_MSG_INIT_H */ diff --git a/modules/sb/fsw/src/cfe_sb_api.c b/modules/sb/fsw/src/cfe_sb_api.c index 674c20cca..1b9574260 100644 --- a/modules/sb/fsw/src/cfe_sb_api.c +++ b/modules/sb/fsw/src/cfe_sb_api.c @@ -1287,7 +1287,7 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, uint8 * See description in header file for argument/return detail * *-----------------------------------------------------------------*/ -CFE_Status_t CFE_SB_TransmitMsg(const CFE_MSG_Message_t *MsgPtr, bool IncrementSequenceCount) +CFE_Status_t CFE_SB_TransmitMsg(const CFE_MSG_Message_t *MsgPtr, bool UpdateHeader) { int32 Status; CFE_MSG_Size_t Size = 0; @@ -1347,9 +1347,9 @@ CFE_Status_t CFE_SB_TransmitMsg(const CFE_MSG_Message_t *MsgPtr, bool IncrementS { /* Copy actual message content into buffer and set its metadata */ memcpy(&BufDscPtr->Content, MsgPtr, Size); - BufDscPtr->MsgId = MsgId; - BufDscPtr->ContentSize = Size; - BufDscPtr->AutoSequence = IncrementSequenceCount; + BufDscPtr->MsgId = MsgId; + BufDscPtr->ContentSize = Size; + BufDscPtr->NeedsUpdate = UpdateHeader; CFE_MSG_GetType(MsgPtr, &BufDscPtr->ContentType); /* @@ -1551,13 +1551,15 @@ void CFE_SB_BroadcastBufferToRoute(CFE_SB_BufferD_t *BufDscPtr, CFE_SBR_RouteId_ if (CFE_SBR_IsValidRouteId(RouteId)) { /* Set the seq count if requested (while locked) before actually sending */ - /* For some reason this is only done for TLM types (historical, TBD) */ - if (BufDscPtr->AutoSequence && BufDscPtr->ContentType == CFE_MSG_Type_Tlm) + if (BufDscPtr->NeedsUpdate) { CFE_SBR_IncrementSequenceCounter(RouteId); - /* Write the sequence into the message header itself (overwrites whatever was there) */ - CFE_MSG_SetSequenceCount(&BufDscPtr->Content.Msg, CFE_SBR_GetSequenceCounter(RouteId)); + /* Update all MSG headers based on the current sequence */ + CFE_MSG_UpdateHeader(&BufDscPtr->Content.Msg, CFE_SBR_GetSequenceCounter(RouteId)); + + /* Clear the flag, just in case */ + BufDscPtr->NeedsUpdate = false; } /* Send the packet to all destinations */ @@ -2116,7 +2118,7 @@ CFE_Status_t CFE_SB_ReleaseMessageBuffer(CFE_SB_Buffer_t *BufPtr) * See description in header file for argument/return detail * *-----------------------------------------------------------------*/ -CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequenceCount) +CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool UpdateHeader) { int32 Status; CFE_SB_BufferD_t *BufDscPtr; @@ -2141,7 +2143,7 @@ CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequen */ if (Status == CFE_SUCCESS) { - BufDscPtr->AutoSequence = IncrementSequenceCount; + BufDscPtr->NeedsUpdate = UpdateHeader; CFE_MSG_GetType(&BufPtr->Msg, &BufDscPtr->ContentType); /* Now broadcast the message, which consumes the buffer */ diff --git a/modules/sb/fsw/src/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h index 9443c6094..737682936 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -150,7 +150,7 @@ typedef struct CFE_SB_BufferD size_t ContentSize; /**< Actual size of message content currently stored in the buffer */ CFE_MSG_Type_t ContentType; /**< Type of message content currently stored in the buffer */ - bool AutoSequence; /**< If message should get its sequence number assigned from the route */ + bool NeedsUpdate; /**< If message should get its header fields automatically updated */ uint16 UseCount; /**< Number of active references to this buffer in the system */ diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index ba6a3dded..78c89bab5 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -2850,7 +2850,7 @@ void Test_TransmitMsg_API(void) SB_UT_ADD_SUBTEST(Test_TransmitMsg_NoSubscribers); SB_UT_ADD_SUBTEST(Test_TransmitMsg_MaxMsgSizePlusOne); SB_UT_ADD_SUBTEST(Test_TransmitMsg_BasicSend); - SB_UT_ADD_SUBTEST(Test_TransmitMsg_SequenceCount); + SB_UT_ADD_SUBTEST(Test_TransmitMsg_UpdateHeader); SB_UT_ADD_SUBTEST(Test_TransmitMsg_QueuePutError); SB_UT_ADD_SUBTEST(Test_TransmitMsg_PipeFull); SB_UT_ADD_SUBTEST(Test_TransmitMsg_MsgLimitExceeded); @@ -2962,9 +2962,9 @@ static int32 UT_CheckSetSequenceCount(void *UserObj, int32 StubRetcode, uint32 C } /* -** Test successful send/receive for packet sequence count +** Test successful send with header update */ -void Test_TransmitMsg_SequenceCount(void) +void Test_TransmitMsg_UpdateHeader(void) { CFE_SB_PipeId_t PipeId = CFE_SB_INVALID_PIPE; CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; @@ -2977,8 +2977,8 @@ void Test_TransmitMsg_SequenceCount(void) memset(&TlmPkt, 0, sizeof(TlmPkt)); - /* Set up hook for checking CFE_MSG_SetSequenceCount calls */ - UT_SetHookFunction(UT_KEY(CFE_MSG_SetSequenceCount), UT_CheckSetSequenceCount, &SeqCnt); + /* Set up hook for checking CFE_MSG_UpdateHeader calls */ + UT_SetHookFunction(UT_KEY(CFE_MSG_UpdateHeader), UT_CheckSetSequenceCount, &SeqCnt); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "SeqCntTestPipe")); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); @@ -2991,7 +2991,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); - UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 1); + UtAssert_STUB_COUNT(CFE_MSG_UpdateHeader, 1); UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 1); UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); @@ -3002,7 +3002,7 @@ void Test_TransmitMsg_SequenceCount(void) /* Assert sequence count wasn't set */ UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 1); - UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 1); + UtAssert_STUB_COUNT(CFE_MSG_UpdateHeader, 1); SeqCntExpected = 2; UT_SetDefaultReturnValue(UT_KEY(CFE_MSG_GetNextSequenceCount), SeqCntExpected); @@ -3011,7 +3011,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); - UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 2); + UtAssert_STUB_COUNT(CFE_MSG_UpdateHeader, 2); UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 2); CFE_UtAssert_EVENTCOUNT(2); @@ -3025,7 +3025,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); /* increment to 3 */ - UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 3); + UtAssert_STUB_COUNT(CFE_MSG_UpdateHeader, 3); UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 3); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); /* resubscribe so we can receive a msg */ @@ -3037,7 +3037,7 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); /* increment to 4 */ UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); - UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 4); + UtAssert_STUB_COUNT(CFE_MSG_UpdateHeader, 4); UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 4); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); @@ -3288,8 +3288,8 @@ void Test_TransmitBuffer_IncrementSeqCnt(void) CFE_MSG_Size_t Size = sizeof(SB_UT_Test_Tlm_t); CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; - /* Set up hook for checking CFE_MSG_SetSequenceCount calls */ - UT_SetHookFunction(UT_KEY(CFE_MSG_SetSequenceCount), UT_CheckSetSequenceCount, &SeqCnt); + /* Set up hook for checking CFE_MSG_UpdateHeader calls */ + UT_SetHookFunction(UT_KEY(CFE_MSG_UpdateHeader), UT_CheckSetSequenceCount, &SeqCnt); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "ZeroCpyTestPipe")); diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index ad510d305..6a4f59270 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -1854,7 +1854,7 @@ void Test_TransmitMsg_BasicSend(void); /*****************************************************************************/ /** -** \brief Test successful send/receive for packet sequence count +** \brief Test successful send of messages with header update ** ** \par Description ** This function tests successful send/receive for packet sequence @@ -1866,7 +1866,7 @@ void Test_TransmitMsg_BasicSend(void); ** \returns ** This function does not return a value. ******************************************************************************/ -void Test_TransmitMsg_SequenceCount(void); +void Test_TransmitMsg_UpdateHeader(void); /*****************************************************************************/ /** diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index bb72f3477..18991d96e 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -1379,7 +1379,7 @@ int32 CFE_TBL_SendNotificationMsg(CFE_TBL_RegistryRec_t *RegRecPtr) CFE_TBL_Global.NotifyMsg.Payload.Parameter = RegRecPtr->NotificationParam; CFE_SB_TimeStampMsg(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader)); - Status = CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), false); + Status = CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), true); if (Status != CFE_SUCCESS) { diff --git a/modules/time/fsw/src/cfe_time_tone.c b/modules/time/fsw/src/cfe_time_tone.c index 9e8ca3a50..b3a431386 100644 --- a/modules/time/fsw/src/cfe_time_tone.c +++ b/modules/time/fsw/src/cfe_time_tone.c @@ -150,7 +150,7 @@ void CFE_TIME_ToneSend(void) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), false); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), true); /* ** Count of "time at the tone" commands sent with internal data... @@ -275,7 +275,7 @@ int32 CFE_TIME_ToneSendMET(CFE_TIME_SysTime_t NewMET) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, false); + CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); /* ** Count of "time at the tone" commands sent with external data... @@ -415,7 +415,7 @@ int32 CFE_TIME_ToneSendGPS(CFE_TIME_SysTime_t NewTime, int16 NewLeaps) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, false); + CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); /* ** Count of "time at the tone" commands sent with external data... @@ -555,7 +555,7 @@ int32 CFE_TIME_ToneSendTime(CFE_TIME_SysTime_t NewTime) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, false); + CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); /* ** Count of "time at the tone" commands sent with external data... @@ -1088,7 +1088,7 @@ void CFE_TIME_Tone1HzTask(void) /* ** Send tone signal command packet... */ - CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneSignalCmd.CommandHeader), false); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneSignalCmd.CommandHeader), true); #if (CFE_MISSION_TIME_CFG_FAKE_TONE == true) /* @@ -1096,7 +1096,7 @@ void CFE_TIME_Tone1HzTask(void) ** to send the tone to other time clients. ** (this is done by scheduler in non-fake mode) */ - CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneSendCmd.CommandHeader), false); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneSendCmd.CommandHeader), true); #endif /* @@ -1287,7 +1287,7 @@ void CFE_TIME_Local1HzTask(void) ** This used to be optional in previous CFE versions, but it is now required ** as TIME subscribes to this itself to do state machine tasks. */ - CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.Local1HzCmd.CommandHeader), false); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.Local1HzCmd.CommandHeader), true); CFE_TIME_Global.LocalTaskCounter++; From 57f4374ea002cb02622df0ed8cd0b729ad2f2189 Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 22 May 2023 16:50:52 -0400 Subject: [PATCH 176/200] Bump to v7.0.0-rc4+dev318 --- CHANGELOG.md | 5 +++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59bc61b04..39367249b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Development Build: v7.0.0-rc4+dev318 +- generalize update header parameter +- add msg verify capability +- See and + ## Development Build: v7.0.0-rc4+dev312 - adjust UT pool buffer size for platform config - Remove unused CFE_PLATFORM_ES_RESET_AREA_SIZE diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 6711cef17..da6fa34a5 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 312 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 318 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From f156312229eab4bc6876899dc4657cc4fee1cf8c Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 25 May 2023 11:25:24 -0400 Subject: [PATCH 177/200] Fix #2353, Update README_Functionaltest.md --- docs/README_functionaltest.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/README_functionaltest.md b/docs/README_functionaltest.md index dddb45484..0c9b7d5fd 100644 --- a/docs/README_functionaltest.md +++ b/docs/README_functionaltest.md @@ -29,10 +29,14 @@ cases. It also must be loaded after `cfe_assert`. To execute tests at startup, the following lines can be added to `cfe_es_startup.scr` on the designated test target: - CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0; - CFE_APP, cfe_testcase, CFE_TestMain, CFE_TEST_APP, 100, 16384, 0x0, 0; + CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0; + CFE_APP, cfe_testcase, CFE_TestMain, CFE_TEST_APP, 100, 16384, 0x0, 0; + CFE_LIB, sample_lib, SAMPLE_LIB_Init, SAMPLE_LIB, 0, 0, 0x0, 0; + CFE_APP, sample_app, SAMPLE_APP_Main, SAMPLE_APP, 50, 16384, 0x0, 0; It is important that `cfe_assert` is loaded first, as all other test applications depend on symbols provided in this library. The order of loading other test cases should not matter with respect to symbol resolution, but note that test apps may be executed in -a different order than they are listed in the startup script. +a different order than they are listed in the startup script. It is also worth noting +that sample_app is included in the startup script by default because the cFE functional +tests are dependent on it for requirements verification. From ddd01d5699fd0e6a9da5af1da20022250cb6e3eb Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 24 May 2023 15:24:45 -0400 Subject: [PATCH 178/200] Fix #2349, Format update for additional counters in summary --- modules/cfe_assert/src/cfe_assert_io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/cfe_assert/src/cfe_assert_io.c b/modules/cfe_assert/src/cfe_assert_io.c index 255c6122f..5cfe4f341 100644 --- a/modules/cfe_assert/src/cfe_assert_io.c +++ b/modules/cfe_assert/src/cfe_assert_io.c @@ -126,6 +126,10 @@ void UT_BSP_DoText(uint8 MessageType, const char *OutputMessage) void UT_BSP_EndTest(const UtAssert_TestCounter_t *TestCounters) { + + CFE_ES_WriteToSysLog("TEST COMPLETE: %u tests Segment(s) executed\n\n", + (unsigned int)TestCounters->TestSegmentCount); + /* * Only output a "summary" if there is more than one test Segment. * Otherwise it is a duplicate of the report already given. @@ -134,7 +138,4 @@ void UT_BSP_EndTest(const UtAssert_TestCounter_t *TestCounters) { UtAssert_DoTestSegmentReport("SUMMARY", TestCounters); } - - CFE_ES_WriteToSysLog("TEST COMPLETE: %u tests Segment(s) executed\n\n", - (unsigned int)TestCounters->TestSegmentCount); } From aa9da9a2325747a6960a0204c9ff1cfb65bd9f10 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 25 May 2023 14:41:33 -0400 Subject: [PATCH 179/200] Fix #2352, make shared tbl configurable --- modules/cfe_testcase/src/cfe_test.h | 8 ++++++++ modules/cfe_testcase/src/tbl_content_access_test.c | 2 +- modules/cfe_testcase/src/tbl_information_test.c | 2 +- modules/cfe_testcase/src/tbl_registration_test.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/cfe_testcase/src/cfe_test.h b/modules/cfe_testcase/src/cfe_test.h index afe5325a8..1bd1c4e65 100644 --- a/modules/cfe_testcase/src/cfe_test.h +++ b/modules/cfe_testcase/src/cfe_test.h @@ -60,6 +60,14 @@ extern CFE_FT_Global_t CFE_FT_Global; */ #define CFE_ASSERT_LOG_FILE_NAME "/cf/cfe_test.log" +/** + * Name of the shared table used by CFE_TEST_APP for requirements verification + * + * This filename was made configurable such that projects can replace the + * sample app table with a project specific table for the purpose of CI/CD. + */ +#define CFE_ASSERT_SHARED_TBL_NAME "SAMPLE_APP.SampleAppTable" + void TimeInRange(CFE_TIME_SysTime_t Start, CFE_TIME_SysTime_t Time, CFE_TIME_SysTime_t Range, const char *Str); void CFE_TestMain(void); diff --git a/modules/cfe_testcase/src/tbl_content_access_test.c b/modules/cfe_testcase/src/tbl_content_access_test.c index 9492eee49..c36223616 100644 --- a/modules/cfe_testcase/src/tbl_content_access_test.c +++ b/modules/cfe_testcase/src/tbl_content_access_test.c @@ -45,7 +45,7 @@ void TestGetAddress(void) TBL_TEST_Table_t TestTable = {1, 2}; CFE_TBL_Handle_t SharedTblHandle = CFE_TBL_BAD_TABLE_HANDLE; - const char * SharedTblName = "SAMPLE_APP.SampleAppTable"; + const char * SharedTblName = CFE_ASSERT_SHARED_TBL_NAME; UtPrintf("Testing: CFE_TBL_GetAddress"); diff --git a/modules/cfe_testcase/src/tbl_information_test.c b/modules/cfe_testcase/src/tbl_information_test.c index 1a85f2bca..1d530688e 100644 --- a/modules/cfe_testcase/src/tbl_information_test.c +++ b/modules/cfe_testcase/src/tbl_information_test.c @@ -77,7 +77,7 @@ void TestGetInfo(void) void TestNotifyByMessage(void) { CFE_TBL_Handle_t SharedTblHandle = CFE_TBL_BAD_TABLE_HANDLE; - const char * SharedTblName = "SAMPLE_APP.SampleAppTable"; + const char * SharedTblName = CFE_ASSERT_SHARED_TBL_NAME; CFE_SB_MsgId_t TestMsgId = CFE_SB_ValueToMsgId(CFE_TEST_CMD_MID); CFE_MSG_FcnCode_t TestCmdCode = 0; uint32 TestParameter = 0; diff --git a/modules/cfe_testcase/src/tbl_registration_test.c b/modules/cfe_testcase/src/tbl_registration_test.c index d14c6c897..c4f237d4e 100644 --- a/modules/cfe_testcase/src/tbl_registration_test.c +++ b/modules/cfe_testcase/src/tbl_registration_test.c @@ -190,7 +190,7 @@ void TestTableShare(void) { UtPrintf("Testing: CFE_TBL_Share"); CFE_TBL_Handle_t SharedTblHandle; - const char * SharedTblName = "SAMPLE_APP.SampleAppTable"; + const char * SharedTblName = CFE_ASSERT_SHARED_TBL_NAME; const char * BadTblName = "SampleAppTable"; UtAssert_INT32_EQ(CFE_TBL_Share(NULL, SharedTblName), CFE_TBL_BAD_ARGUMENT); From ba01055f1d9edd83f6e467807e04e7204fc5a878 Mon Sep 17 00:00:00 2001 From: Chris Knight Date: Fri, 26 May 2023 09:45:13 -0700 Subject: [PATCH 180/200] Fix #2316, CFE_TIME_Print() calls strftime() --- modules/core_api/fsw/inc/cfe_time.h | 8 +- .../core_api/ut-stubs/src/cfe_time_handlers.c | 3 +- .../core_api/ut-stubs/src/cfe_time_stubs.c | 6 +- .../config/default_cfe_time_interface_cfg.h | 15 +- modules/time/fsw/src/cfe_time_api.c | 158 +++--------------- modules/time/ut-coverage/time_UT.c | 26 ++- 6 files changed, 49 insertions(+), 167 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_time.h b/modules/core_api/fsw/inc/cfe_time.h index ac2cf98ce..d4dfbc943 100644 --- a/modules/core_api/fsw/inc/cfe_time.h +++ b/modules/core_api/fsw/inc/cfe_time.h @@ -691,6 +691,8 @@ CFE_Status_t CFE_TIME_UnregisterSynchCallback(CFE_TIME_SynchCallbackPtr_t Callba ** - \c \\0 = trailing null ** ** \par Assumptions, External Events, and Notes: +** - This function calls strftime to format the output. Systems without this +** C99-standard function will have to write their own implementation. ** - The value of the time argument is simply added to the configuration ** definitions for the ground epoch and converted into a fixed length ** string in the buffer provided by the caller. @@ -706,8 +708,12 @@ CFE_Status_t CFE_TIME_UnregisterSynchCallback(CFE_TIME_SynchCallbackPtr_t Callba ** ** \param[in] TimeToPrint The time to print into the character array. ** +** \return Execution status, see \ref CFEReturnCodes +** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS +** \retval #CFE_TIME_BAD_ARGUMENT \copybrief CFE_TIME_BAD_ARGUMENT +** ******************************************************************************/ -void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint); +CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint); /*****************************************************************************/ /** diff --git a/modules/core_api/ut-stubs/src/cfe_time_handlers.c b/modules/core_api/ut-stubs/src/cfe_time_handlers.c index ec9f8b5e9..c277bb721 100644 --- a/modules/core_api/ut-stubs/src/cfe_time_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_time_handlers.c @@ -45,13 +45,14 @@ * Default handler for CFE_TIME_Print coverage stub function * *------------------------------------------------------------*/ -void UT_DefaultHandler_CFE_TIME_Print(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) +CFE_Status_t UT_DefaultHandler_CFE_TIME_Print(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) { char * PrintBuffer = UT_Hook_GetArgValueByName(Context, "PrintBuffer", char *); CFE_TIME_SysTime_t TimeToPrint = UT_Hook_GetArgValueByName(Context, "TimeToPrint", CFE_TIME_SysTime_t); snprintf(PrintBuffer, CFE_TIME_PRINTED_STRING_SIZE, "UT %u.%u -", (unsigned int)TimeToPrint.Seconds, (unsigned int)TimeToPrint.Subseconds); + return CFE_SUCCESS; } /*------------------------------------------------------------ diff --git a/modules/core_api/ut-stubs/src/cfe_time_stubs.c b/modules/core_api/ut-stubs/src/cfe_time_stubs.c index 999f06008..ca99702db 100644 --- a/modules/core_api/ut-stubs/src/cfe_time_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_time_stubs.c @@ -305,12 +305,16 @@ uint32 CFE_TIME_Micro2SubSecs(uint32 MicroSeconds) * Generated stub function for CFE_TIME_Print() * ---------------------------------------------------- */ -void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) +CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) { + UT_GenStub_SetupReturnBuffer(CFE_TIME_Print, CFE_Status_t); + UT_GenStub_AddParam(CFE_TIME_Print, char *, PrintBuffer); UT_GenStub_AddParam(CFE_TIME_Print, CFE_TIME_SysTime_t, TimeToPrint); UT_GenStub_Execute(CFE_TIME_Print, Basic, UT_DefaultHandler_CFE_TIME_Print); + + return UT_GenStub_GetReturnValue(CFE_TIME_Print, CFE_Status_t); } /* diff --git a/modules/time/config/default_cfe_time_interface_cfg.h b/modules/time/config/default_cfe_time_interface_cfg.h index 3e614f154..151d38c09 100644 --- a/modules/time/config/default_cfe_time_interface_cfg.h +++ b/modules/time/config/default_cfe_time_interface_cfg.h @@ -151,23 +151,14 @@ ** \cfetimecfg Default EPOCH Values ** ** \par Description: -** Default ground time epoch values +** Default ground time epoch values (from Jan. 1, 1970 00:00:00) ** Note: these values are used only by the CFE_TIME_Print() API function ** ** \par Limits -** Year - must be within 136 years -** Day - Jan 1 = 1, Feb 1 = 32, etc. -** Hour - 0 to 23 -** Minute - 0 to 59 -** Second - 0 to 59 ** Micros - 0 to 999999 */ -#define CFE_MISSION_TIME_EPOCH_YEAR 1980 -#define CFE_MISSION_TIME_EPOCH_DAY 1 -#define CFE_MISSION_TIME_EPOCH_HOUR 0 -#define CFE_MISSION_TIME_EPOCH_MINUTE 0 -#define CFE_MISSION_TIME_EPOCH_SECOND 0 -#define CFE_MISSION_TIME_EPOCH_MICROS 0 +#define CFE_MISSION_TIME_EPOCH_SECONDS 315532800 /* Jan. 1, 1980 00:00:00 */ +#define CFE_MISSION_TIME_EPOCH_MICROS 0 /** ** \cfetimecfg Time File System Factor diff --git a/modules/time/fsw/src/cfe_time_api.c b/modules/time/fsw/src/cfe_time_api.c index 1cd7e99d7..f8e8b35b6 100644 --- a/modules/time/fsw/src/cfe_time_api.c +++ b/modules/time/fsw/src/cfe_time_api.c @@ -34,6 +34,8 @@ #include +#include + /*---------------------------------------------------------------- * * Implemented per public API @@ -563,150 +565,30 @@ uint32 CFE_TIME_Micro2SubSecs(uint32 MicroSeconds) * See description in header file for argument/return detail * *-----------------------------------------------------------------*/ -void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) +CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) { - uint32 NumberOfYears; - uint32 NumberOfDays; - uint32 NumberOfHours; - uint32 NumberOfMinutes; - uint32 NumberOfSeconds; - uint32 NumberOfMicros; - uint32 DaysInThisYear; - - bool StillCountingYears = true; + size_t FmtLen = 0; + uint32 Micros = (CFE_TIME_Sub2MicroSecs(TimeToPrint.Subseconds) + CFE_MISSION_TIME_EPOCH_MICROS) / 10; + struct tm tm; if (PrintBuffer == NULL) { - CFE_ES_WriteToSysLog("%s: Failed invalid arguments\n", __func__); - return; - } - - /* - ** Convert the cFE time (offset from epoch) into calendar time... - */ - NumberOfMicros = CFE_TIME_Sub2MicroSecs(TimeToPrint.Subseconds) + CFE_MISSION_TIME_EPOCH_MICROS; - - NumberOfMinutes = (NumberOfMicros / 60000000) + (TimeToPrint.Seconds / 60) + CFE_MISSION_TIME_EPOCH_MINUTE; - NumberOfMicros = NumberOfMicros % 60000000; - - NumberOfSeconds = (NumberOfMicros / 1000000) + (TimeToPrint.Seconds % 60) + CFE_MISSION_TIME_EPOCH_SECOND; - NumberOfMicros = NumberOfMicros % 1000000; - /* - ** Adding the epoch "seconds" after computing the minutes avoids - ** overflow problems when the input time value (seconds) is - ** at, or near, 0xFFFFFFFF... - */ - while (NumberOfSeconds >= 60) - { - NumberOfMinutes++; - NumberOfSeconds -= 60; - } - - /* - ** Compute the years/days/hours/minutes... - */ - NumberOfHours = (NumberOfMinutes / 60) + CFE_MISSION_TIME_EPOCH_HOUR; - NumberOfMinutes = (NumberOfMinutes % 60); - - /* - ** Unlike hours and minutes, epoch days are counted as Jan 1 = day 1... - */ - NumberOfDays = (NumberOfHours / 24) + (CFE_MISSION_TIME_EPOCH_DAY - 1); - NumberOfHours = (NumberOfHours % 24); - - NumberOfYears = CFE_MISSION_TIME_EPOCH_YEAR; - - /* - ** Convert total number of days into years and remainder days... - */ - while (StillCountingYears) - { - /* - ** Set number of days in this year (leap year?)... - */ - DaysInThisYear = 365; - - if ((NumberOfYears % 4) == 0) - { - if ((NumberOfYears % 100) != 0) - { - DaysInThisYear = 366; - } - else if ((NumberOfYears % 400) == 0) - { - DaysInThisYear = 366; - } - else - { - /* Do Nothing. Non-leap year. */ - } - } - - /* - ** When we have less than a years worth of days, we're done... - */ - if (NumberOfDays < DaysInThisYear) - { - StillCountingYears = false; - } - else - { - /* - ** Add a year and remove the number of days in that year... - */ - NumberOfYears++; - NumberOfDays -= DaysInThisYear; - } + return CFE_TIME_BAD_ARGUMENT; } - /* - ** Unlike hours and minutes, days are displayed as Jan 1 = day 1... - */ - NumberOfDays++; - - /* - ** After computing microseconds, convert to 5 digits from 6 digits... - */ - NumberOfMicros = NumberOfMicros / 10; - - /* - ** Build formatted output string (yyyy-ddd-hh:mm:ss.xxxxx)... - */ - *PrintBuffer++ = '0' + (char)(NumberOfYears / 1000); - NumberOfYears = NumberOfYears % 1000; - *PrintBuffer++ = '0' + (char)(NumberOfYears / 100); - NumberOfYears = NumberOfYears % 100; - *PrintBuffer++ = '0' + (char)(NumberOfYears / 10); - *PrintBuffer++ = '0' + (char)(NumberOfYears % 10); - *PrintBuffer++ = '-'; - - *PrintBuffer++ = '0' + (char)(NumberOfDays / 100); - NumberOfDays = NumberOfDays % 100; - *PrintBuffer++ = '0' + (char)(NumberOfDays / 10); - *PrintBuffer++ = '0' + (char)(NumberOfDays % 10); - *PrintBuffer++ = '-'; - - *PrintBuffer++ = '0' + (char)(NumberOfHours / 10); - *PrintBuffer++ = '0' + (char)(NumberOfHours % 10); - *PrintBuffer++ = ':'; - - *PrintBuffer++ = '0' + (char)(NumberOfMinutes / 10); - *PrintBuffer++ = '0' + (char)(NumberOfMinutes % 10); - *PrintBuffer++ = ':'; - - *PrintBuffer++ = '0' + (char)(NumberOfSeconds / 10); - *PrintBuffer++ = '0' + (char)(NumberOfSeconds % 10); - *PrintBuffer++ = '.'; - - *PrintBuffer++ = '0' + (char)(NumberOfMicros / 10000); - NumberOfMicros = NumberOfMicros % 10000; - *PrintBuffer++ = '0' + (char)(NumberOfMicros / 1000); - NumberOfMicros = NumberOfMicros % 1000; - *PrintBuffer++ = '0' + (char)(NumberOfMicros / 100); - NumberOfMicros = NumberOfMicros % 100; - *PrintBuffer++ = '0' + (char)(NumberOfMicros / 10); - *PrintBuffer++ = '0' + (char)(NumberOfMicros % 10); - *PrintBuffer++ = '\0'; + time_t sec = TimeToPrint.Seconds + CFE_MISSION_TIME_EPOCH_SECONDS; // epoch is Jan 1, 1980 + gmtime_r(&sec, &tm); + FmtLen = strftime(PrintBuffer, CFE_TIME_PRINTED_STRING_SIZE - 6, "%Y-%j-%H:%M:%S", &tm); + PrintBuffer += FmtLen; + *(PrintBuffer++) = '.'; + + *(PrintBuffer++) = '0' + (char)((Micros % 100000) / 10000); + *(PrintBuffer++) = '0' + (char)((Micros % 10000) / 1000); + *(PrintBuffer++) = '0' + (char)((Micros % 1000) / 100); + *(PrintBuffer++) = '0' + (char)((Micros % 100) / 10); + *(PrintBuffer++) = '0' + (char)(Micros % 10); + *PrintBuffer = '\0'; + return CFE_SUCCESS; } /*---------------------------------------------------------------- diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index 3a4961ac1..20161b427 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -821,7 +821,7 @@ void Test_ConvertTime(void) ** ** NOTE: Test results depend on the epoch values in cfe_mission_cfg.h (the ** tests below assume an epoch of 1980-001-00:00:00.00000). Full -** coverage is possible only when CFE_MISSION_TIME_EPOCH_SECOND > 0 +** coverage is possible only when CFE_MISSION_TIME_EPOCH_SECONDS > 0 */ void Test_Print(void) { @@ -834,8 +834,7 @@ void Test_Print(void) UtPrintf("Begin Test Print"); - if (CFE_MISSION_TIME_EPOCH_YEAR != 1980 || CFE_MISSION_TIME_EPOCH_DAY != 1 || CFE_MISSION_TIME_EPOCH_HOUR != 0 || - CFE_MISSION_TIME_EPOCH_MINUTE != 0 || CFE_MISSION_TIME_EPOCH_SECOND != 0 || CFE_MISSION_TIME_EPOCH_MICROS != 0) + if (CFE_MISSION_TIME_EPOCH_SECONDS != 0 || CFE_MISSION_TIME_EPOCH_MICROS != 0) { UtPrintf("Custom epoch time requires manual inspection for CFE_TIME_Print"); usingDefaultEpoch = false; @@ -843,11 +842,10 @@ void Test_Print(void) /* Test print with null print buffer argument */ UT_InitData(); - UtAssert_VOIDCALL(CFE_TIME_Print(NULL, time)); - CFE_UtAssert_SYSLOG(TIME_SYSLOG_MSGS[6]); + UtAssert_INT32_EQ(CFE_TIME_Print(NULL, time), CFE_TIME_BAD_ARGUMENT); /* Test with zero time value */ - CFE_TIME_Print(timeBuf, time); + CFE_UtAssert_SUCCESS(CFE_TIME_Print(timeBuf, time)); if (usingDefaultEpoch) { strcpy(expectedBuf, "1980-001-00:00:00.00000"); @@ -860,12 +858,12 @@ void Test_Print(void) } /* Test with a time value that causes seconds >= 60 when - * CFE_MISSION_TIME_EPOCH_SECOND > 0 + * CFE_MISSION_TIME_EPOCH_SECONDS > 0 */ time.Subseconds = 0; time.Seconds = 59; - CFE_TIME_Print(timeBuf, time); + CFE_UtAssert_SUCCESS(CFE_TIME_Print(timeBuf, time)); if (usingDefaultEpoch) { strcpy(expectedBuf, "1980-001-00:00:59.00000"); @@ -881,7 +879,7 @@ void Test_Print(void) time.Subseconds = 215000; time.Seconds = 1041472984; - CFE_TIME_Print(timeBuf, time); + CFE_UtAssert_SUCCESS(CFE_TIME_Print(timeBuf, time)); if (usingDefaultEpoch) { strcpy(expectedBuf, "2013-001-02:03:04.00005"); @@ -893,14 +891,14 @@ void Test_Print(void) (unsigned int)time.Seconds, (unsigned int)time.Subseconds, timeBuf); } - /* Test with maximum seconds and subseconds values */ - time.Subseconds = 0xffffffff; - time.Seconds = 0xffffffff; + /* Test with sufficiently-large seconds and subseconds values */ + time.Subseconds = 0x7fffffff; + time.Seconds = 0x7fffffff; - CFE_TIME_Print(timeBuf, time); + CFE_UtAssert_SUCCESS(CFE_TIME_Print(timeBuf, time)); if (usingDefaultEpoch) { - strcpy(expectedBuf, "2116-038-06:28:15.99999"); + strcpy(expectedBuf, "2048-019-03:14:07.49999"); UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); } else From 317840d9bf59c03323b8d0a6cbb8a0858986d3cf Mon Sep 17 00:00:00 2001 From: Justin Figueroa Date: Tue, 30 May 2023 18:29:30 -0400 Subject: [PATCH 181/200] Fix #2360, Adds utassert message descriptions to README_Functionaltest.md --- docs/README_functionaltest.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/README_functionaltest.md b/docs/README_functionaltest.md index dddb45484..83c82fbe2 100644 --- a/docs/README_functionaltest.md +++ b/docs/README_functionaltest.md @@ -36,3 +36,21 @@ It is important that `cfe_assert` is loaded first, as all other test application symbols provided in this library. The order of loading other test cases should not matter with respect to symbol resolution, but note that test apps may be executed in a different order than they are listed in the startup script. + +## Utassert messages + +Below are various types of messages that can be generated by a test. + + "ABORT", /**< Test sequence abort (major failure, cannot continue) */ + "FAIL", /**< Test case failure status messages */ + "TSF", /**< Test Setup Failure (TSF) status messages */ + "TTF", /**< Test Teardown Failure (TTF) status messages */ + "MIR", /**< Manual Inspection Required (MIR) status messages */ + "WARN", /**< Test was unable to run (WARN) status messages (e.g. initial condition wrong) */ + "N/A", /**< Test Not Applicable (NA) status messages */ + "BEGIN", /**< Beginning of test status messages */ + "END", /**< End of test status messages */ + "INFO", /**< All other informational status messages */ + "PASS", /**< Test case passed (normal) status messages */ + "FLOW", /**< Other condition checks/messages that record test flow, but are not assertions */ + "DEBUG", /**< Debugging messages */ \ No newline at end of file From d455c7a900f561d18dedfb86ca30c636a1eaf216 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 1 Jun 2023 09:32:26 -0400 Subject: [PATCH 182/200] Fix #2363, Increase slp time in funct test workflow --- .github/workflows/functional-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 121c088dc..a985edef3 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -89,7 +89,7 @@ jobs: counter=$(grep -c "BEGIN" cf/cfe_test.tmp) echo "Waiting for CFE Tests" - sleep 60 + sleep 120 done ../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002 From e22abc6f92d29d1e698588a5ec33aee800080a61 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 1 Jun 2023 09:50:08 -0400 Subject: [PATCH 183/200] Fix #2365, Increase CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC to 15 --- modules/evs/config/default_cfe_evs_internal_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/evs/config/default_cfe_evs_internal_cfg.h b/modules/evs/config/default_cfe_evs_internal_cfg.h index 728b7d07d..d4fc64b0c 100644 --- a/modules/evs/config/default_cfe_evs_internal_cfg.h +++ b/modules/evs/config/default_cfe_evs_internal_cfg.h @@ -93,7 +93,7 @@ ** This number must be less than or equal to #CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST. ** Values lower than 8 may cause functional and unit test failures. */ -#define CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC 8 +#define CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC 15 /** ** \cfeevscfg Default Event Log Filename From e3f52c3083dc82d1772f44059fabf02c95642dd4 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 1 Jun 2023 15:22:14 -0400 Subject: [PATCH 184/200] Bump to v7.0.0-rc4+dev334 --- CHANGELOG.md | 10 ++++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39367249b..66f6ffee6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## Development Build: v7.0.0-rc4+dev334 +- Format update for additional counters in summary +- make shared tbl configurable +- Update README_Functionaltest.md +- Increase CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC to 15 +- Increase slp time in funct test workflow +- CFE_TIME_Print() calls strftime() +- Adds utassert message descriptions to README_Functionaltest.md +- See , , , , , , and + ## Development Build: v7.0.0-rc4+dev318 - generalize update header parameter - add msg verify capability diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index da6fa34a5..3f88f13e1 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 318 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 334 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From f21e8631c3e8ba587ee2690df9e3a150327d7386 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 6 Jun 2023 16:16:38 -0400 Subject: [PATCH 185/200] Fix #2368, cFE Functional Test 23 --- modules/cfe_testcase/src/es_misc_test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/cfe_testcase/src/es_misc_test.c b/modules/cfe_testcase/src/es_misc_test.c index 83d34f1e6..86a4b92e4 100644 --- a/modules/cfe_testcase/src/es_misc_test.c +++ b/modules/cfe_testcase/src/es_misc_test.c @@ -84,7 +84,10 @@ void TestWriteToSysLog(void) { break; } - CFE_Assert_STATUS_MUST_BE(CFE_SUCCESS); + if (!CFE_Assert_STATUS_MAY_BE(CFE_ES_ERR_SYS_LOG_TRUNCATED)) + { + CFE_Assert_STATUS_MUST_BE(CFE_SUCCESS); + } } UtAssert_MIR("MIR (Manual Inspection Required) for CFE_ES_WriteToSysLog"); From 089fd3c8e9af1ff05185c16ec7f9f9d159330369 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 8 Jun 2023 18:38:57 +0000 Subject: [PATCH 186/200] Updating documentation and version numbers for v7.0.0-rc4+dev342 --- CHANGELOG.md | 16 +++++++++++++++- modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66f6ffee6..712ec25fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Development Build: v7.0.0-rc4+dev342 +- 'Fix #2368, cFE Functional Test 23' +- 'Fix #1407, Add error report on EVS failure during log header write' +- 'Fix #1515, Remove unnecessary memset from CFE_TBL_LoadFromFile' +- See: + + ## Development Build: v7.0.0-rc4+dev334 - Format update for additional counters in summary - make shared tbl configurable @@ -95,7 +102,14 @@ - See ## Development Build: v7.0.0-rc4+dev197 -- Remove Changelog in Doxygen Config +- Remove # Changelog + +## Development Build: v7.0.0-rc4+dev342 +- 'Fix #2368, cFE Functional Test 23' +- 'Fix #1407, Add error report on EVS failure during log header write' +- 'Fix #1515, Remove unnecessary memset from CFE_TBL_LoadFromFile' +- See: + in Doxygen Config - See ## Development Build: v7.0.0-rc4+dev193 diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 3f88f13e1..97b5295cd 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 334 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 342 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From a682f18e02797599a580307b28136325b2e3324e Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 26 Jun 2023 15:47:10 -0400 Subject: [PATCH 187/200] Fix#2388, Revert "Merge pull request #2356 from CDKnightNASA/fix-2316-time_fmt" This reverts commit 7c27c0e6bee72a2729929f9573fa928ca9639658, reversing changes made to b5b90b498b7f58143331e4d993f15f70a00647ef. --- modules/core_api/fsw/inc/cfe_time.h | 8 +- .../core_api/ut-stubs/src/cfe_time_handlers.c | 3 +- .../core_api/ut-stubs/src/cfe_time_stubs.c | 6 +- .../config/default_cfe_time_interface_cfg.h | 15 +- modules/time/fsw/src/cfe_time_api.c | 158 +++++++++++++++--- modules/time/ut-coverage/time_UT.c | 26 +-- 6 files changed, 167 insertions(+), 49 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_time.h b/modules/core_api/fsw/inc/cfe_time.h index d4dfbc943..ac2cf98ce 100644 --- a/modules/core_api/fsw/inc/cfe_time.h +++ b/modules/core_api/fsw/inc/cfe_time.h @@ -691,8 +691,6 @@ CFE_Status_t CFE_TIME_UnregisterSynchCallback(CFE_TIME_SynchCallbackPtr_t Callba ** - \c \\0 = trailing null ** ** \par Assumptions, External Events, and Notes: -** - This function calls strftime to format the output. Systems without this -** C99-standard function will have to write their own implementation. ** - The value of the time argument is simply added to the configuration ** definitions for the ground epoch and converted into a fixed length ** string in the buffer provided by the caller. @@ -708,12 +706,8 @@ CFE_Status_t CFE_TIME_UnregisterSynchCallback(CFE_TIME_SynchCallbackPtr_t Callba ** ** \param[in] TimeToPrint The time to print into the character array. ** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_TIME_BAD_ARGUMENT \copybrief CFE_TIME_BAD_ARGUMENT -** ******************************************************************************/ -CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint); +void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint); /*****************************************************************************/ /** diff --git a/modules/core_api/ut-stubs/src/cfe_time_handlers.c b/modules/core_api/ut-stubs/src/cfe_time_handlers.c index c277bb721..ec9f8b5e9 100644 --- a/modules/core_api/ut-stubs/src/cfe_time_handlers.c +++ b/modules/core_api/ut-stubs/src/cfe_time_handlers.c @@ -45,14 +45,13 @@ * Default handler for CFE_TIME_Print coverage stub function * *------------------------------------------------------------*/ -CFE_Status_t UT_DefaultHandler_CFE_TIME_Print(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) +void UT_DefaultHandler_CFE_TIME_Print(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) { char * PrintBuffer = UT_Hook_GetArgValueByName(Context, "PrintBuffer", char *); CFE_TIME_SysTime_t TimeToPrint = UT_Hook_GetArgValueByName(Context, "TimeToPrint", CFE_TIME_SysTime_t); snprintf(PrintBuffer, CFE_TIME_PRINTED_STRING_SIZE, "UT %u.%u -", (unsigned int)TimeToPrint.Seconds, (unsigned int)TimeToPrint.Subseconds); - return CFE_SUCCESS; } /*------------------------------------------------------------ diff --git a/modules/core_api/ut-stubs/src/cfe_time_stubs.c b/modules/core_api/ut-stubs/src/cfe_time_stubs.c index ca99702db..999f06008 100644 --- a/modules/core_api/ut-stubs/src/cfe_time_stubs.c +++ b/modules/core_api/ut-stubs/src/cfe_time_stubs.c @@ -305,16 +305,12 @@ uint32 CFE_TIME_Micro2SubSecs(uint32 MicroSeconds) * Generated stub function for CFE_TIME_Print() * ---------------------------------------------------- */ -CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) +void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) { - UT_GenStub_SetupReturnBuffer(CFE_TIME_Print, CFE_Status_t); - UT_GenStub_AddParam(CFE_TIME_Print, char *, PrintBuffer); UT_GenStub_AddParam(CFE_TIME_Print, CFE_TIME_SysTime_t, TimeToPrint); UT_GenStub_Execute(CFE_TIME_Print, Basic, UT_DefaultHandler_CFE_TIME_Print); - - return UT_GenStub_GetReturnValue(CFE_TIME_Print, CFE_Status_t); } /* diff --git a/modules/time/config/default_cfe_time_interface_cfg.h b/modules/time/config/default_cfe_time_interface_cfg.h index 151d38c09..3e614f154 100644 --- a/modules/time/config/default_cfe_time_interface_cfg.h +++ b/modules/time/config/default_cfe_time_interface_cfg.h @@ -151,14 +151,23 @@ ** \cfetimecfg Default EPOCH Values ** ** \par Description: -** Default ground time epoch values (from Jan. 1, 1970 00:00:00) +** Default ground time epoch values ** Note: these values are used only by the CFE_TIME_Print() API function ** ** \par Limits +** Year - must be within 136 years +** Day - Jan 1 = 1, Feb 1 = 32, etc. +** Hour - 0 to 23 +** Minute - 0 to 59 +** Second - 0 to 59 ** Micros - 0 to 999999 */ -#define CFE_MISSION_TIME_EPOCH_SECONDS 315532800 /* Jan. 1, 1980 00:00:00 */ -#define CFE_MISSION_TIME_EPOCH_MICROS 0 +#define CFE_MISSION_TIME_EPOCH_YEAR 1980 +#define CFE_MISSION_TIME_EPOCH_DAY 1 +#define CFE_MISSION_TIME_EPOCH_HOUR 0 +#define CFE_MISSION_TIME_EPOCH_MINUTE 0 +#define CFE_MISSION_TIME_EPOCH_SECOND 0 +#define CFE_MISSION_TIME_EPOCH_MICROS 0 /** ** \cfetimecfg Time File System Factor diff --git a/modules/time/fsw/src/cfe_time_api.c b/modules/time/fsw/src/cfe_time_api.c index f8e8b35b6..1cd7e99d7 100644 --- a/modules/time/fsw/src/cfe_time_api.c +++ b/modules/time/fsw/src/cfe_time_api.c @@ -34,8 +34,6 @@ #include -#include - /*---------------------------------------------------------------- * * Implemented per public API @@ -565,30 +563,150 @@ uint32 CFE_TIME_Micro2SubSecs(uint32 MicroSeconds) * See description in header file for argument/return detail * *-----------------------------------------------------------------*/ -CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) +void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) { - size_t FmtLen = 0; - uint32 Micros = (CFE_TIME_Sub2MicroSecs(TimeToPrint.Subseconds) + CFE_MISSION_TIME_EPOCH_MICROS) / 10; - struct tm tm; + uint32 NumberOfYears; + uint32 NumberOfDays; + uint32 NumberOfHours; + uint32 NumberOfMinutes; + uint32 NumberOfSeconds; + uint32 NumberOfMicros; + uint32 DaysInThisYear; + + bool StillCountingYears = true; if (PrintBuffer == NULL) { - return CFE_TIME_BAD_ARGUMENT; + CFE_ES_WriteToSysLog("%s: Failed invalid arguments\n", __func__); + return; + } + + /* + ** Convert the cFE time (offset from epoch) into calendar time... + */ + NumberOfMicros = CFE_TIME_Sub2MicroSecs(TimeToPrint.Subseconds) + CFE_MISSION_TIME_EPOCH_MICROS; + + NumberOfMinutes = (NumberOfMicros / 60000000) + (TimeToPrint.Seconds / 60) + CFE_MISSION_TIME_EPOCH_MINUTE; + NumberOfMicros = NumberOfMicros % 60000000; + + NumberOfSeconds = (NumberOfMicros / 1000000) + (TimeToPrint.Seconds % 60) + CFE_MISSION_TIME_EPOCH_SECOND; + NumberOfMicros = NumberOfMicros % 1000000; + /* + ** Adding the epoch "seconds" after computing the minutes avoids + ** overflow problems when the input time value (seconds) is + ** at, or near, 0xFFFFFFFF... + */ + while (NumberOfSeconds >= 60) + { + NumberOfMinutes++; + NumberOfSeconds -= 60; + } + + /* + ** Compute the years/days/hours/minutes... + */ + NumberOfHours = (NumberOfMinutes / 60) + CFE_MISSION_TIME_EPOCH_HOUR; + NumberOfMinutes = (NumberOfMinutes % 60); + + /* + ** Unlike hours and minutes, epoch days are counted as Jan 1 = day 1... + */ + NumberOfDays = (NumberOfHours / 24) + (CFE_MISSION_TIME_EPOCH_DAY - 1); + NumberOfHours = (NumberOfHours % 24); + + NumberOfYears = CFE_MISSION_TIME_EPOCH_YEAR; + + /* + ** Convert total number of days into years and remainder days... + */ + while (StillCountingYears) + { + /* + ** Set number of days in this year (leap year?)... + */ + DaysInThisYear = 365; + + if ((NumberOfYears % 4) == 0) + { + if ((NumberOfYears % 100) != 0) + { + DaysInThisYear = 366; + } + else if ((NumberOfYears % 400) == 0) + { + DaysInThisYear = 366; + } + else + { + /* Do Nothing. Non-leap year. */ + } + } + + /* + ** When we have less than a years worth of days, we're done... + */ + if (NumberOfDays < DaysInThisYear) + { + StillCountingYears = false; + } + else + { + /* + ** Add a year and remove the number of days in that year... + */ + NumberOfYears++; + NumberOfDays -= DaysInThisYear; + } } - time_t sec = TimeToPrint.Seconds + CFE_MISSION_TIME_EPOCH_SECONDS; // epoch is Jan 1, 1980 - gmtime_r(&sec, &tm); - FmtLen = strftime(PrintBuffer, CFE_TIME_PRINTED_STRING_SIZE - 6, "%Y-%j-%H:%M:%S", &tm); - PrintBuffer += FmtLen; - *(PrintBuffer++) = '.'; - - *(PrintBuffer++) = '0' + (char)((Micros % 100000) / 10000); - *(PrintBuffer++) = '0' + (char)((Micros % 10000) / 1000); - *(PrintBuffer++) = '0' + (char)((Micros % 1000) / 100); - *(PrintBuffer++) = '0' + (char)((Micros % 100) / 10); - *(PrintBuffer++) = '0' + (char)(Micros % 10); - *PrintBuffer = '\0'; - return CFE_SUCCESS; + /* + ** Unlike hours and minutes, days are displayed as Jan 1 = day 1... + */ + NumberOfDays++; + + /* + ** After computing microseconds, convert to 5 digits from 6 digits... + */ + NumberOfMicros = NumberOfMicros / 10; + + /* + ** Build formatted output string (yyyy-ddd-hh:mm:ss.xxxxx)... + */ + *PrintBuffer++ = '0' + (char)(NumberOfYears / 1000); + NumberOfYears = NumberOfYears % 1000; + *PrintBuffer++ = '0' + (char)(NumberOfYears / 100); + NumberOfYears = NumberOfYears % 100; + *PrintBuffer++ = '0' + (char)(NumberOfYears / 10); + *PrintBuffer++ = '0' + (char)(NumberOfYears % 10); + *PrintBuffer++ = '-'; + + *PrintBuffer++ = '0' + (char)(NumberOfDays / 100); + NumberOfDays = NumberOfDays % 100; + *PrintBuffer++ = '0' + (char)(NumberOfDays / 10); + *PrintBuffer++ = '0' + (char)(NumberOfDays % 10); + *PrintBuffer++ = '-'; + + *PrintBuffer++ = '0' + (char)(NumberOfHours / 10); + *PrintBuffer++ = '0' + (char)(NumberOfHours % 10); + *PrintBuffer++ = ':'; + + *PrintBuffer++ = '0' + (char)(NumberOfMinutes / 10); + *PrintBuffer++ = '0' + (char)(NumberOfMinutes % 10); + *PrintBuffer++ = ':'; + + *PrintBuffer++ = '0' + (char)(NumberOfSeconds / 10); + *PrintBuffer++ = '0' + (char)(NumberOfSeconds % 10); + *PrintBuffer++ = '.'; + + *PrintBuffer++ = '0' + (char)(NumberOfMicros / 10000); + NumberOfMicros = NumberOfMicros % 10000; + *PrintBuffer++ = '0' + (char)(NumberOfMicros / 1000); + NumberOfMicros = NumberOfMicros % 1000; + *PrintBuffer++ = '0' + (char)(NumberOfMicros / 100); + NumberOfMicros = NumberOfMicros % 100; + *PrintBuffer++ = '0' + (char)(NumberOfMicros / 10); + *PrintBuffer++ = '0' + (char)(NumberOfMicros % 10); + *PrintBuffer++ = '\0'; } /*---------------------------------------------------------------- diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index 20161b427..3a4961ac1 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -821,7 +821,7 @@ void Test_ConvertTime(void) ** ** NOTE: Test results depend on the epoch values in cfe_mission_cfg.h (the ** tests below assume an epoch of 1980-001-00:00:00.00000). Full -** coverage is possible only when CFE_MISSION_TIME_EPOCH_SECONDS > 0 +** coverage is possible only when CFE_MISSION_TIME_EPOCH_SECOND > 0 */ void Test_Print(void) { @@ -834,7 +834,8 @@ void Test_Print(void) UtPrintf("Begin Test Print"); - if (CFE_MISSION_TIME_EPOCH_SECONDS != 0 || CFE_MISSION_TIME_EPOCH_MICROS != 0) + if (CFE_MISSION_TIME_EPOCH_YEAR != 1980 || CFE_MISSION_TIME_EPOCH_DAY != 1 || CFE_MISSION_TIME_EPOCH_HOUR != 0 || + CFE_MISSION_TIME_EPOCH_MINUTE != 0 || CFE_MISSION_TIME_EPOCH_SECOND != 0 || CFE_MISSION_TIME_EPOCH_MICROS != 0) { UtPrintf("Custom epoch time requires manual inspection for CFE_TIME_Print"); usingDefaultEpoch = false; @@ -842,10 +843,11 @@ void Test_Print(void) /* Test print with null print buffer argument */ UT_InitData(); - UtAssert_INT32_EQ(CFE_TIME_Print(NULL, time), CFE_TIME_BAD_ARGUMENT); + UtAssert_VOIDCALL(CFE_TIME_Print(NULL, time)); + CFE_UtAssert_SYSLOG(TIME_SYSLOG_MSGS[6]); /* Test with zero time value */ - CFE_UtAssert_SUCCESS(CFE_TIME_Print(timeBuf, time)); + CFE_TIME_Print(timeBuf, time); if (usingDefaultEpoch) { strcpy(expectedBuf, "1980-001-00:00:00.00000"); @@ -858,12 +860,12 @@ void Test_Print(void) } /* Test with a time value that causes seconds >= 60 when - * CFE_MISSION_TIME_EPOCH_SECONDS > 0 + * CFE_MISSION_TIME_EPOCH_SECOND > 0 */ time.Subseconds = 0; time.Seconds = 59; - CFE_UtAssert_SUCCESS(CFE_TIME_Print(timeBuf, time)); + CFE_TIME_Print(timeBuf, time); if (usingDefaultEpoch) { strcpy(expectedBuf, "1980-001-00:00:59.00000"); @@ -879,7 +881,7 @@ void Test_Print(void) time.Subseconds = 215000; time.Seconds = 1041472984; - CFE_UtAssert_SUCCESS(CFE_TIME_Print(timeBuf, time)); + CFE_TIME_Print(timeBuf, time); if (usingDefaultEpoch) { strcpy(expectedBuf, "2013-001-02:03:04.00005"); @@ -891,14 +893,14 @@ void Test_Print(void) (unsigned int)time.Seconds, (unsigned int)time.Subseconds, timeBuf); } - /* Test with sufficiently-large seconds and subseconds values */ - time.Subseconds = 0x7fffffff; - time.Seconds = 0x7fffffff; + /* Test with maximum seconds and subseconds values */ + time.Subseconds = 0xffffffff; + time.Seconds = 0xffffffff; - CFE_UtAssert_SUCCESS(CFE_TIME_Print(timeBuf, time)); + CFE_TIME_Print(timeBuf, time); if (usingDefaultEpoch) { - strcpy(expectedBuf, "2048-019-03:14:07.49999"); + strcpy(expectedBuf, "2116-038-06:28:15.99999"); UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); } else From 5b726a5f38cd44fe9a4a25df3c94fad260e300b4 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 12 Jul 2023 09:49:38 -0400 Subject: [PATCH 188/200] Fix #2391, add cfe to prefix list for msgids.h and platform_cfg.h This allows the script to pick up the file if it was named simply "cfe_msgids.h" or "cfe_platform_cfg.h", rather than insisting it be named with a platform-specific prefix --- modules/core_api/arch_build.cmake | 2 +- modules/core_private/arch_build.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core_api/arch_build.cmake b/modules/core_api/arch_build.cmake index 2836d8683..738d770bd 100644 --- a/modules/core_api/arch_build.cmake +++ b/modules/core_api/arch_build.cmake @@ -15,7 +15,7 @@ generate_config_includefile( FILE_NAME "cfe_msgids.h" MATCH_SUFFIX "msgids.h" FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_msgids.h" - PREFIXES ${BUILD_CONFIG} + PREFIXES ${BUILD_CONFIG} cfe ) generate_config_includefile( diff --git a/modules/core_private/arch_build.cmake b/modules/core_private/arch_build.cmake index 0fc3aa355..0413232b3 100644 --- a/modules/core_private/arch_build.cmake +++ b/modules/core_private/arch_build.cmake @@ -15,7 +15,7 @@ generate_config_includefile( FILE_NAME "cfe_platform_cfg.h" FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_platform_cfg.h" MATCH_SUFFIX "platform_cfg.h" - PREFIXES ${BUILD_CONFIG} + PREFIXES ${BUILD_CONFIG} cfe ) generate_config_includefile( From d3ca736d15a740ac99fc8e0d288dd8c5599c1019 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 13 Jul 2023 14:51:18 -0400 Subject: [PATCH 189/200] Fix #2393, set AtLeapSeconds in ExternalTone test case Setting this value to 0 allows it to get the same result regardless of the setting of CFE_MISSION_TIME_CFG_DEFAULT_UTC. --- modules/time/ut-coverage/time_UT.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index 3a4961ac1..bdfdbeae3 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -1278,6 +1278,7 @@ void Test_External(void) CFE_TIME_Global.ReferenceState[0].AtToneDelay.Subseconds = 0; CFE_TIME_Global.ReferenceState[0].AtToneLatch.Seconds = 0; CFE_TIME_Global.ReferenceState[0].AtToneLatch.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneLeapSeconds = 0; CFE_TIME_Global.MaxDelta.Seconds = 0; CFE_TIME_Global.MaxDelta.Subseconds = 1; CFE_TIME_Global.MaxLocalClock.Seconds = 0; From 31908e2e56834e977041bbfa9692bf5f30b8d215 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 14 Jul 2023 09:47:18 -0400 Subject: [PATCH 190/200] Fix #2395, do not directly use cfe_test_msgids.h For a user that has customized cfe_msgids.h, this will get conflicting values. If/when users have migrated to module-specific msgid files, this will be OK, but for now this can break things. --- modules/cfe_testcase/src/sb_sendrecv_test.c | 1 - modules/cfe_testcase/src/sb_subscription_test.c | 1 - modules/cfe_testcase/src/tbl_information_test.c | 1 - modules/cfe_testcase/src/tbl_registration_test.c | 1 - modules/core_api/config/default_cfe_msgids.h | 1 + 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index 4f8be7ac2..0d34b25fd 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -29,7 +29,6 @@ #include "cfe_test.h" #include "cfe_msgids.h" -#include "cfe_test_msgids.h" #define CFE_FT_STRINGBUF_SIZE 12 diff --git a/modules/cfe_testcase/src/sb_subscription_test.c b/modules/cfe_testcase/src/sb_subscription_test.c index a55c73716..491c8d526 100644 --- a/modules/cfe_testcase/src/sb_subscription_test.c +++ b/modules/cfe_testcase/src/sb_subscription_test.c @@ -29,7 +29,6 @@ #include "cfe_test.h" #include "cfe_msgids.h" -#include "cfe_test_msgids.h" /* * This test procedure should be agnostic to specific MID values, but it should diff --git a/modules/cfe_testcase/src/tbl_information_test.c b/modules/cfe_testcase/src/tbl_information_test.c index 1d530688e..750e7ba04 100644 --- a/modules/cfe_testcase/src/tbl_information_test.c +++ b/modules/cfe_testcase/src/tbl_information_test.c @@ -30,7 +30,6 @@ #include "cfe_test.h" #include "cfe_test_table.h" #include "cfe_msgids.h" -#include "cfe_test_msgids.h" void TestGetStatus(void) { diff --git a/modules/cfe_testcase/src/tbl_registration_test.c b/modules/cfe_testcase/src/tbl_registration_test.c index c4f237d4e..ad5d591b4 100644 --- a/modules/cfe_testcase/src/tbl_registration_test.c +++ b/modules/cfe_testcase/src/tbl_registration_test.c @@ -30,7 +30,6 @@ #include "cfe_test.h" #include "cfe_test_table.h" #include "cfe_msgids.h" -#include "cfe_test_msgids.h" int32 CallbackFunc(void *TblPtr) { diff --git a/modules/core_api/config/default_cfe_msgids.h b/modules/core_api/config/default_cfe_msgids.h index e5759d437..300734644 100644 --- a/modules/core_api/config/default_cfe_msgids.h +++ b/modules/core_api/config/default_cfe_msgids.h @@ -37,5 +37,6 @@ #include "cfe_sb_msgids.h" #include "cfe_tbl_msgids.h" #include "cfe_time_msgids.h" +#include "cfe_test_msgids.h" #endif /* CFE_MSGIDS_H */ From 1c9f44b7ae791c3b109fc8d56c7b02be454b2e81 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 17 Jul 2023 16:40:25 -0400 Subject: [PATCH 191/200] Revert "Fix #2395, do not directly use cfe_test_msgids.h" --- modules/cfe_testcase/src/sb_sendrecv_test.c | 1 + modules/cfe_testcase/src/sb_subscription_test.c | 1 + modules/cfe_testcase/src/tbl_information_test.c | 1 + modules/cfe_testcase/src/tbl_registration_test.c | 1 + modules/core_api/config/default_cfe_msgids.h | 1 - 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index 0d34b25fd..4f8be7ac2 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -29,6 +29,7 @@ #include "cfe_test.h" #include "cfe_msgids.h" +#include "cfe_test_msgids.h" #define CFE_FT_STRINGBUF_SIZE 12 diff --git a/modules/cfe_testcase/src/sb_subscription_test.c b/modules/cfe_testcase/src/sb_subscription_test.c index 491c8d526..a55c73716 100644 --- a/modules/cfe_testcase/src/sb_subscription_test.c +++ b/modules/cfe_testcase/src/sb_subscription_test.c @@ -29,6 +29,7 @@ #include "cfe_test.h" #include "cfe_msgids.h" +#include "cfe_test_msgids.h" /* * This test procedure should be agnostic to specific MID values, but it should diff --git a/modules/cfe_testcase/src/tbl_information_test.c b/modules/cfe_testcase/src/tbl_information_test.c index 750e7ba04..1d530688e 100644 --- a/modules/cfe_testcase/src/tbl_information_test.c +++ b/modules/cfe_testcase/src/tbl_information_test.c @@ -30,6 +30,7 @@ #include "cfe_test.h" #include "cfe_test_table.h" #include "cfe_msgids.h" +#include "cfe_test_msgids.h" void TestGetStatus(void) { diff --git a/modules/cfe_testcase/src/tbl_registration_test.c b/modules/cfe_testcase/src/tbl_registration_test.c index ad5d591b4..c4f237d4e 100644 --- a/modules/cfe_testcase/src/tbl_registration_test.c +++ b/modules/cfe_testcase/src/tbl_registration_test.c @@ -30,6 +30,7 @@ #include "cfe_test.h" #include "cfe_test_table.h" #include "cfe_msgids.h" +#include "cfe_test_msgids.h" int32 CallbackFunc(void *TblPtr) { diff --git a/modules/core_api/config/default_cfe_msgids.h b/modules/core_api/config/default_cfe_msgids.h index 300734644..e5759d437 100644 --- a/modules/core_api/config/default_cfe_msgids.h +++ b/modules/core_api/config/default_cfe_msgids.h @@ -37,6 +37,5 @@ #include "cfe_sb_msgids.h" #include "cfe_tbl_msgids.h" #include "cfe_time_msgids.h" -#include "cfe_test_msgids.h" #endif /* CFE_MSGIDS_H */ From 0900e5dc6c5afc88b4b37542911fb4ce22e425b9 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 26 Jul 2023 15:54:04 -0400 Subject: [PATCH 192/200] Fix #2415, use correct object extension in table build Do not assume ".o" for object files, use ${CMAKE_C_OUTPUT_EXTENSION} --- cmake/arch_build.cmake | 1 + cmake/tables/elf2cfetbl_rules.mk | 2 +- cmake/tables/generate_elf_table_rules.cmake | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index a120dd8b3..04c44d97a 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -312,6 +312,7 @@ function(add_cfe_tables TABLE_FQNAME TBL_DEFAULT_SRC_FILES) -DOUTPUT_FILE="${TABLE_RULEFILE}" -DTABLE_NAME="${TABLE_BASENAME}" -DSOURCES="${TBL_SRC}" + -DOBJEXT="${CMAKE_C_OUTPUT_EXTENSION}" -P "${TABLE_GENSCRIPT}" WORKING_DIRECTORY ${WORKING_DIRECTORY} diff --git a/cmake/tables/elf2cfetbl_rules.mk b/cmake/tables/elf2cfetbl_rules.mk index fa36a6bf0..21e63e84d 100644 --- a/cmake/tables/elf2cfetbl_rules.mk +++ b/cmake/tables/elf2cfetbl_rules.mk @@ -1,5 +1,5 @@ # Rule for traditional CFE table generation via elf2cfetbl -elf/%.o: +elf/%: @mkdir -pv $(dir $(@)) cd $(dir $(@)) && $(AR) x $(abspath $(<)) $(notdir $(@)) diff --git a/cmake/tables/generate_elf_table_rules.cmake b/cmake/tables/generate_elf_table_rules.cmake index 35068e060..12da18bc7 100644 --- a/cmake/tables/generate_elf_table_rules.cmake +++ b/cmake/tables/generate_elf_table_rules.cmake @@ -22,7 +22,7 @@ set(TABLE_RULES) foreach(TBL_SRC ${SOURCES}) get_filename_component(DEP_FILE ${TBL_SRC} NAME) - set(DEP_FILE "${TMP_DIR}/${DEP_FILE}.o") + set(DEP_FILE "${TMP_DIR}/${DEP_FILE}${OBJEXT}") string(APPEND TABLE_RULES "${DEP_FILE}: ${ARCHIVE_FILE}\n" "${TABLE_BINARY}: ${DEP_FILE}\n" From 6cc5645b892c44dca7e5eb4375eaa4dbe27a08fa Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 27 Jul 2023 18:51:31 +0000 Subject: [PATCH 193/200] Updating documentation and version numbers for v7.0.0-rc4+dev356 --- CHANGELOG.md | 10 ++++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 712ec25fe..c8ce6b7be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Development Build: v7.0.0-rc4+dev356 +- 'Fix #2415, use correct object extension in table build' +- See: + + ## Development Build: v7.0.0-rc4+dev342 - 'Fix #2368, cFE Functional Test 23' - 'Fix #1407, Add error report on EVS failure during log header write' @@ -104,6 +109,11 @@ ## Development Build: v7.0.0-rc4+dev197 - Remove # Changelog +## Development Build: v7.0.0-rc4+dev356 +- 'Fix #2415, use correct object extension in table build' +- See: + + ## Development Build: v7.0.0-rc4+dev342 - 'Fix #2368, cFE Functional Test 23' - 'Fix #1407, Add error report on EVS failure during log header write' diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 97b5295cd..78597cc63 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 342 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 356 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 56e1539493ec73223672523dd870a32989d1f9da Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 9 Aug 2023 10:49:20 -0400 Subject: [PATCH 194/200] Fix #2421, adjust dependencies on table lib Instead of having the intermediate table library build as part of the "all" target, attach it as a dependency under the custom rule. This way it will only be built in the context of the cfetables top level target, not both. --- cmake/arch_build.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index 04c44d97a..e94f86fe4 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -324,7 +324,7 @@ function(add_cfe_tables TABLE_FQNAME TBL_DEFAULT_SRC_FILES) # Add a custom target to generate the config file add_custom_target(generate_table_${TGT}_${APP_NAME}_${TABLE_BASENAME} - DEPENDS "${TABLE_RULEFILE}" + DEPENDS "${TABLE_RULEFILE}" ${TABLE_LIBNAME} ) add_dependencies(cfetables generate_table_${TGT}_${APP_NAME}_${TABLE_BASENAME}) @@ -335,7 +335,7 @@ function(add_cfe_tables TABLE_FQNAME TBL_DEFAULT_SRC_FILES) # On older versions one may not reference the TARGET_OBJECTS property from the custom command. # As a workaround this is built into a static library, and then the desired object is extracted # before passing to elf2cfetbl. It is roundabout but it works. - add_library(${TABLE_LIBNAME} STATIC ${TABLE_SELECTED_SRCS}) + add_library(${TABLE_LIBNAME} STATIC EXCLUDE_FROM_ALL ${TABLE_SELECTED_SRCS}) target_compile_definitions(${TABLE_LIBNAME} PRIVATE CFE_CPU_NAME=${TGT} ) From 0cdb4e42ed903806fd8566d899327e7f19a7b045 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 10 Aug 2023 15:45:09 -0400 Subject: [PATCH 195/200] Fix #2423, avoid use of abspath make function The abspath function does not work in GNU make v3.80, which is still used as it is packaged with the Wind River tools as part of VxWorks 6.x. The $(abspath ...) function was used in two places related to generating tables - first for extraction of the ELF file from an intermediate lib, second for conversion of that ELF file to a table file. In the first case, the path should already be absolute, as it comes from CMake. In the second case, the path should always be relative, because it is intended to match another pattern rule starting with "elf/%". For the second rule, prefixing with $(CURDIR) should achieve the same effect. --- cmake/tables/elf2cfetbl_rules.mk | 9 +++++++-- cmake/tables/tabletool_rule.mk | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cmake/tables/elf2cfetbl_rules.mk b/cmake/tables/elf2cfetbl_rules.mk index 21e63e84d..c17443579 100644 --- a/cmake/tables/elf2cfetbl_rules.mk +++ b/cmake/tables/elf2cfetbl_rules.mk @@ -1,5 +1,10 @@ # Rule for traditional CFE table generation via elf2cfetbl +# The dependency of this target should always be an absolute pathname to +# the intermediate library file as it is generated by a CMake script via +# the TARGET_FILE property. Therefore, the same path should still work +# after the "cd" command. The "cd" is so the ar tool writes the object file +# into a separate dir, in case of similarly-named files on different cpus. elf/%: - @mkdir -pv $(dir $(@)) - cd $(dir $(@)) && $(AR) x $(abspath $(<)) $(notdir $(@)) + @mkdir -pv "$(dir $(@))" + cd "$(dir $(@))" && $(AR) x "$(<)" "$(notdir $(@))" diff --git a/cmake/tables/tabletool_rule.mk b/cmake/tables/tabletool_rule.mk index 0e2e178f2..6b34c7561 100644 --- a/cmake/tables/tabletool_rule.mk +++ b/cmake/tables/tabletool_rule.mk @@ -4,7 +4,12 @@ cfetables: @echo "Table build completed" -#%.tbl: $(TBLTOOL) +# The dependency of this rule should always be a relative path starting with elf/, +# at least with the current rule generator script, so it matches the elf/% pattern rule. +# But because elf2cfetbl only writes its output to the current working dir, it has to be run +# after changing dirs into the staging area. Thus the path to the elf file needs to be adjusted. +# Ideally this chould be done with the $(abspath f...) function but this doesn't exist in older versions. +# As a workaround, $CURDIR is used. staging/%.tbl: - @mkdir -pv $(dir $(@)) - cd $(dir $(@)) && $(TBLTOOL) $(TBLTOOL_FLAGS) $(abspath $(^)) + @mkdir -pv "$(dir $(@))" + cd "$(dir $(@))" && $(TBLTOOL) $(TBLTOOL_FLAGS) "$(CURDIR)/$(<)" From d2d77fea6310b6925a5ce51417604c47f39a138e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 15 Aug 2023 11:21:44 +0000 Subject: [PATCH 196/200] Updating documentation and version numbers for v7.0.0-rc4+dev362 --- CHANGELOG.md | 12 ++++++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8ce6b7be..f08dc99b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Development Build: v7.0.0-rc4+dev362 +- 'Fix #2421, adjust dependencies on table lib' +- 'Fix #2423, avoid use of abspath make function' +- See: + + ## Development Build: v7.0.0-rc4+dev356 - 'Fix #2415, use correct object extension in table build' - See: @@ -109,6 +115,12 @@ ## Development Build: v7.0.0-rc4+dev197 - Remove # Changelog +## Development Build: v7.0.0-rc4+dev362 +- 'Fix #2421, adjust dependencies on table lib' +- 'Fix #2423, avoid use of abspath make function' +- See: + + ## Development Build: v7.0.0-rc4+dev356 - 'Fix #2415, use correct object extension in table build' - See: diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 78597cc63..d9c6df8cf 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 356 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 362 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 25ccc0ce10a70bae49aa50439394b4c8faaa02da Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 17 Aug 2023 13:51:57 -0400 Subject: [PATCH 197/200] Fix #2427, Race condition in TestCreateChild --- modules/cfe_testcase/src/es_task_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/cfe_testcase/src/es_task_test.c b/modules/cfe_testcase/src/es_task_test.c index 21cdf1377..f3ce24171 100644 --- a/modules/cfe_testcase/src/es_task_test.c +++ b/modules/cfe_testcase/src/es_task_test.c @@ -101,6 +101,7 @@ void TestCreateChild(void) size_t StackSize = CFE_PLATFORM_ES_PERF_CHILD_STACK_SIZE; CFE_ES_TaskPriority_Atom_t Priority = CFE_PLATFORM_ES_PERF_CHILD_PRIORITY; uint32 Flags = 0; + uint32 Index = 0; int32 ExpectedCount = 5; int32 RetryCount; char TaskNameBuf[16]; @@ -110,7 +111,11 @@ void TestCreateChild(void) CFE_FT_Global.Count = 0; UtAssert_INT32_EQ(CFE_ES_CreateChildTask(&TaskId, TaskName, TaskFunction, StackPointer, StackSize, Priority, Flags), CFE_SUCCESS); - OS_TaskDelay(500); + while (CFE_FT_Global.Count != ExpectedCount && Index < 100) + { + OS_TaskDelay(10); + Index ++; + } UtAssert_INT32_GT(CFE_FT_Global.Count, ExpectedCount - 1); UtAssert_INT32_LT(CFE_FT_Global.Count, ExpectedCount + 1); From 6c4d587f6b25a39441a57dae9dc04117aad2366a Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 18 Aug 2023 10:56:00 +0000 Subject: [PATCH 198/200] Updating documentation and version numbers for v7.0.0-rc4+dev366 --- CHANGELOG.md | 10 ++++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f08dc99b2..c4db39067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Development Build: v7.0.0-rc4+dev366 +- 'Fix #2427, Race condition in TestCreateChild' +- See: + + ## Development Build: v7.0.0-rc4+dev362 - 'Fix #2421, adjust dependencies on table lib' - 'Fix #2423, avoid use of abspath make function' @@ -115,6 +120,11 @@ ## Development Build: v7.0.0-rc4+dev197 - Remove # Changelog +## Development Build: v7.0.0-rc4+dev366 +- 'Fix #2427, Race condition in TestCreateChild' +- See: + + ## Development Build: v7.0.0-rc4+dev362 - 'Fix #2421, adjust dependencies on table lib' - 'Fix #2423, avoid use of abspath make function' diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index d9c6df8cf..392068b08 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 362 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 366 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ From 5449c15747d5aaac591b9fb1dad47f9f12057fb5 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 18 Aug 2023 12:08:00 -0400 Subject: [PATCH 199/200] Fix #2430, reinstate example header files. These files may still be relevant to some users, and keeping them in sample_defs helps convey the fact that they are still supported for backward compatibility. --- cmake/sample_defs/example_mission_cfg.h | 590 ++++++++ cmake/sample_defs/example_platform_cfg.h | 1751 ++++++++++++++++++++++ 2 files changed, 2341 insertions(+) create mode 100644 cmake/sample_defs/example_mission_cfg.h create mode 100644 cmake/sample_defs/example_platform_cfg.h diff --git a/cmake/sample_defs/example_mission_cfg.h b/cmake/sample_defs/example_mission_cfg.h new file mode 100644 index 000000000..07600e81f --- /dev/null +++ b/cmake/sample_defs/example_mission_cfg.h @@ -0,0 +1,590 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + + /** + * @file + * + * This header file contains the mission configuration parameters and + * typedefs with mission scope. + * + * This provides values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + * @note It is no longer necessary to provide this file directly in the defs + * directory, but if present, this file is still supported/usable for backward + * compatibility. To use this file, is should be called "cfe_mission_cfg.h". + * + * Going forward, more fine-grained (module/purposes-specific) header files are + * included with each submodule. These may be overridden as necessary, but only + * if a definition within that file needs to be changed from the default. This + * approach will reduce the amount of duplicate/cloned definitions and better + * support alternative build configurations in the future. + * + * Note that if this file is present, the fine-grained header files noted above + * will _not_ be used. + */ + +#ifndef EXAMPLE_MISSION_CFG_H +#define EXAMPLE_MISSION_CFG_H + +/** +** \cfemissioncfg cFE Maximum length for pathnames within data exchange structures +** +** \par Description: +** The value of this constant dictates the size of pathnames within all structures +** used for external data exchange, such as Software bus messages and table definitions. +** This is typically the same as OS_MAX_PATH_LEN but that is OSAL dependent -- +** and as such it definable on a per-processor/OS basis and hence may be different +** across multiple processors. It is recommended to set this to the value of the +** largest OS_MAX_PATH_LEN in use on any CPU on the mission. +** +** This affects only the layout of command/telemetry messages and table definitions; +** internal allocation may use the platform-specific OS_MAX_PATH_LEN value. +** +** This length must include an extra character for NULL termination. +** +** \par Limits +** All CPUs within the same SB domain (mission) and ground tools must share the +** same definition. +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_MAX_PATH_LEN 64 + +/** +** \cfemissioncfg cFE Maximum length for filenames within data exchange structures +** +** \par Description: +** The value of this constant dictates the size of filenames within all structures +** used for external data exchange, such as Software bus messages and table definitions. +** This is typically the same as OS_MAX_FILE_LEN but that is OSAL dependent -- +** and as such it definable on a per-processor/OS basis and hence may be different +** across multiple processors. It is recommended to set this to the value of the +** largest OS_MAX_FILE_LEN in use on any CPU on the mission. +** +** This affects only the layout of command/telemetry messages and table definitions; +** internal allocation may use the platform-specific OS_MAX_FILE_LEN value. +** +** This length must include an extra character for NULL termination. +** +** \par Limits +** All CPUs within the same SB domain (mission) and ground tools must share the +** same definition. +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_MAX_FILE_LEN 20 + +/** +** \cfemissioncfg cFE Maximum length for API names within data exchange structures +** +** \par Description: +** The value of this constant dictates the size of filenames within all structures +** used for external data exchange, such as Software bus messages and table definitions. +** This is typically the same as OS_MAX_API_LEN but that is OSAL dependent -- +** and as such it definable on a per-processor/OS basis and hence may be different +** across multiple processors. It is recommended to set this to the value of the +** largest OS_MAX_API_LEN in use on any CPU on the mission. +** +** This affects only the layout of command/telemetry messages and table definitions; +** internal allocation may use the platform-specific OS_MAX_API_LEN value. +** +** This length must include an extra character for NULL termination. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_MAX_API_LEN 20 + +/** +** \cfemissioncfg cFE Maximum number of files in a message/data exchange +** +** \par Description: +** The value of this constant dictates the maximum number of files within all structures +** used for external data exchange, such as Software bus messages and table definitions. +** This is typically the same as OS_MAX_NUM_OPEN_FILES but that is OSAL dependent -- +** and as such it definable on a per-processor/OS basis and hence may be different +** across multiple processors. It is recommended to set this to the value of the +** largest OS_MAX_NUM_OPEN_FILES in use on any CPU on the mission. +** +** This affects only the layout of command/telemetry messages and table definitions; +** internal allocation may use the platform-specific OS_MAX_NUM_OPEN_FILES value. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +*/ +#define CFE_MISSION_MAX_NUM_FILES 50 + +/****************************************************************************** + * CFE Executive Services (CFE_ES) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + */ + +/** +** \cfeescfg Mission Max Apps in a message +** +** \par Description: +** Indicates the maximum number of apps in a telemetry housekeeping message +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +*/ +#define CFE_MISSION_ES_MAX_APPLICATIONS 16 + +/** +** \cfeescfg Define Max Number of Performance IDs for messages +** +** \par Description: +** Defines the maximum number of perf ids allowed in command/telemetry messages +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +*/ +#define CFE_MISSION_ES_PERF_MAX_IDS 128 + +/** \cfeescfg Maximum number of block sizes in pool structures +** +** \par Description: +** The upper limit for the number of block sizes supported in the generic +** pool implementation, which in turn implements the memory pools and CDS. +** This definition is used as the array size with the pool stats structure, +** and therefore should be consistent across all CPUs in a mission, as well +** as with the ground station. +** +** There is also a platform-specific limit which may be fewer than this +** value. +** +** \par Limits: +** Must be at least one. No specific upper limit, but the number is +** anticipated to be reasonably small (i.e. tens, not hundreds). Large +** values have not been tested. +** +** +*/ +#define CFE_MISSION_ES_POOL_MAX_BUCKETS 17 + +/** +** \cfeescfg Maximum Length of CDS Name +** +** \par Description: +** Indicates the maximum length (in characters) of the CDS name ('CDSName') +** portion of a Full CDS Name of the following form: +** "ApplicationName.CDSName" +** +** This length does not need to include an extra character for NULL termination. +** +** \par Limits +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +** +*/ +#define CFE_MISSION_ES_CDS_MAX_NAME_LENGTH 16 + +/** +** \cfeescfg Mission Default CRC algorithm +** +** \par Description: +** Indicates the which CRC algorithm should be used as the default +** for verifying the contents of Critical Data Stores and when calculating +** Table Image data integrity values. +** +** \par Limits +** Currently only CFE_ES_CrcType_CRC_16 is supported (see brief in CFE_ES_CrcType_Enum +** definition in cfe_es_api_typedefs.h) +*/ +#define CFE_MISSION_ES_DEFAULT_CRC CFE_ES_CrcType_CRC_16 + +/** +** \cfeescfg Maximum Length of Full CDS Name in messages +** +** \par Description: +** Indicates the maximum length (in characters) of the entire CDS name +** of the following form: "ApplicationName.CDSName" +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) + +#ifndef CFE_OMIT_DEPRECATED_6_8 +/* These names have been converted to an enum in cfe_es_api_typedefs.h */ + +/** \name Checksum/CRC algorithm identifiers */ + +#define CFE_MISSION_ES_CRC_8 CFE_ES_CrcType_CRC_8 /* 1 */ +#define CFE_MISSION_ES_CRC_16 CFE_ES_CrcType_CRC_16 /* 2 */ +#define CFE_MISSION_ES_CRC_32 CFE_ES_CrcType_CRC_32 /* 3 */ + +#endif + +/****************************************************************************** + * CFE Event Services (CFE_EVS) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + */ + +/** +** \cfeevscfg Maximum Event Message Length +** +** \par Description: +** Indicates the maximum length (in characters) of the formatted text +** string portion of an event message +** +** This length does not need to include an extra character for NULL termination. +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_EVS_MAX_MESSAGE_LENGTH 122 + +/****************************************************************************** + * CFE File Services (CFE_FS) Public Definitions + * + */ + +/* + * NOTE: the value of CFE_FS_HDR_DESC_MAX_LEN, if modified, should + * be constrained to multiples of 4, as it is used within a structure that + * also contains uint32 types. This ensures that the entire structure + * remains 32-bit aligned without the need for implicit padding bytes. + */ + +#define CFE_FS_HDR_DESC_MAX_LEN 32 /**< \brief Max length of description field in a standard cFE File Header */ + +#define CFE_FS_FILE_CONTENT_ID 0x63464531 /**< \brief Magic Number for cFE compliant files (= 'cFE1') */ + + +/****************************************************************************** + * CFE Software Bus (CFE_SB) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + */ + +/** +** \cfesbcfg Maximum SB Message Size +** +** \par Description: +** The following definition dictates the maximum message size allowed on +** the software bus. SB checks the pkt length field in the header of all +** messages sent. If the pkt length field indicates the message is larger +** than this define, SB sends an event and rejects the send. +** +** \par Limits +** This parameter has a lower limit of 6 (CCSDS primary header size). There +** are no restrictions on the upper limit however, the maximum message size is +** system dependent and should be verified. Total message size values that are +** checked against this configuration are defined by a 16 bit data word. +*/ +#define CFE_MISSION_SB_MAX_SB_MSG_SIZE 32768 + +/** +** \cfesbcfg Maximum Number of pipes that SB command/telemetry messages may hold +** +** \par Description: +** Dictates the maximum number of unique Pipes the SB message definitions will hold. +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +*/ +#define CFE_MISSION_SB_MAX_PIPES 64 + +/****************************************************************************** + * CFE Table Services (CFE_TBL) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + */ + +/** +** \cfetblcfg Maximum Table Name Length +** +** \par Description: +** Indicates the maximum length (in characters) of the table name +** ('TblName') portion of a Full Table Name of the following +** form: "ApplicationName.TblName" +** +** This length does not need to include an extra character for NULL termination. +** +** \par Limits +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_TBL_MAX_NAME_LENGTH 16 + +/** +** \cfetblcfg Maximum Length of Full Table Name in messages +** +** \par Description: +** Indicates the maximum length (in characters) of the entire table name +** within software bus messages, in "AppName.TableName" notation. +** +** This affects the layout of command/telemetry messages but does not affect run +** time behavior or internal allocation. +** +** \par Limits +** All CPUs within the same SB domain (mission) must share the same definition +** Note this affects the size of messages, so it must not cause any message +** to exceed the max length. +** +** This value should be kept as a multiple of 4, to maintain alignment of +** any possible neighboring fields without implicit padding. +*/ +#define CFE_MISSION_TBL_MAX_FULL_NAME_LEN (CFE_MISSION_TBL_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) + + +/****************************************************************************** + * CFE Time Services (CFE_TIME) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and any other data products that + * serve to exchange information with other entities. + * + */ + +/** +** \cfetimecfg Default Time Format +** +** \par Description: +** The following definitions select either UTC or TAI as the default +** (mission specific) time format. Although it is possible for an +** application to request time in a specific format, most callers +** should use CFE_TIME_GetTime(), which returns time in the default +** format. This avoids having to modify each individual caller +** when the default choice is changed. +** +** \par Limits +** if CFE_MISSION_TIME_CFG_DEFAULT_TAI is defined as true then CFE_MISSION_TIME_CFG_DEFAULT_UTC must be +** defined as false. +** if CFE_MISSION_TIME_CFG_DEFAULT_TAI is defined as false then CFE_MISSION_TIME_CFG_DEFAULT_UTC must be +** defined as true. +*/ +#define CFE_MISSION_TIME_CFG_DEFAULT_TAI true +#define CFE_MISSION_TIME_CFG_DEFAULT_UTC false + +/** +** \cfetimecfg Default Time Format +** +** \par Description: +** The following definition enables the use of a simulated time at +** the tone signal using a software bus message. +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_CFG_FAKE_TONE true + +/** +** \cfetimecfg Default Time and Tone Order +** +** \par Description: +** Time Services may be configured to expect the time at the tone +** data packet to either precede or follow the tone signal. If the +** time at the tone data packet follows the tone signal, then the +** data within the packet describes what the time "was" at the tone. +** If the time at the tone data packet precedes the tone signal, then +** the data within the packet describes what the time "will be" at +** the tone. One, and only one, of the following symbols must be set to true: +** - CFE_MISSION_TIME_AT_TONE_WAS +** - CFE_MISSION_TIME_AT_TONE_WILL_BE +** Note: If Time Services is defined as using a simulated tone signal +** (see #CFE_MISSION_TIME_CFG_FAKE_TONE above), then the tone data packet +** must follow the tone signal. +** +** \par Limits +** Either CFE_MISSION_TIME_AT_TONE_WAS or CFE_MISSION_TIME_AT_TONE_WILL_BE must be set to true. +** They may not both be true and they may not both be false. +*/ +#define CFE_MISSION_TIME_AT_TONE_WAS true +#define CFE_MISSION_TIME_AT_TONE_WILL_BE false + +/** +** \cfetimecfg Min and Max Time Elapsed +** +** \par Description: +** Based on the definition of Time and Tone Order +** (CFE_MISSION_TIME_AT_TONE_WAS/WILL_BE) either the "time at the tone" signal or +** data packet will follow the other. This definition sets the valid window +** of time for the second of the pair to lag behind the first. Time +** Services will invalidate both the tone and packet if the second does not +** arrive within this window following the first. +** +** For example, if the data packet follows the tone, it might be valid for +** the data packet to arrive between zero and 100,000 micro-seconds after +** the tone. But, if the tone follows the packet, it might be valid +** only if the packet arrived between 200,000 and 700,000 micro-seconds +** before the tone. +** +** Note: units are in micro-seconds +** +** \par Limits +** 0 to 999,999 decimal +*/ +#define CFE_MISSION_TIME_MIN_ELAPSED 0 +#define CFE_MISSION_TIME_MAX_ELAPSED 200000 + +/** +** \cfetimecfg Default Time Values +** +** \par Description: +** Default time values are provided to avoid problems due to time +** calculations performed after startup but before commands can be +** processed. For example, if the default time format is UTC then +** it is important that the sum of MET and STCF always exceed the +** value of Leap Seconds to prevent the UTC time calculation +** (time = MET + STCF - Leap Seconds) from resulting in a negative +** (very large) number.

    +** Some past missions have also created known (albeit wrong) default +** timestamps. For example, assume the epoch is defined as Jan 1, 1970 +** and further assume the default time values are set to create a timestamp +** of Jan 1, 2000. Even though the year 2000 timestamps are wrong, it +** may be of value to keep the time within some sort of bounds acceptable +** to the software.

    +** Note: Sub-second units are in micro-seconds (0 to 999,999) and +** all values must be defined +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_DEF_MET_SECS 1000 +#define CFE_MISSION_TIME_DEF_MET_SUBS 0 + +#define CFE_MISSION_TIME_DEF_STCF_SECS 1000000 +#define CFE_MISSION_TIME_DEF_STCF_SUBS 0 + +#define CFE_MISSION_TIME_DEF_LEAPS 37 + +#define CFE_MISSION_TIME_DEF_DELAY_SECS 0 +#define CFE_MISSION_TIME_DEF_DELAY_SUBS 1000 + +/** +** \cfetimecfg Default EPOCH Values +** +** \par Description: +** Default ground time epoch values +** Note: these values are used only by the CFE_TIME_Print() API function +** +** \par Limits +** Year - must be within 136 years +** Day - Jan 1 = 1, Feb 1 = 32, etc. +** Hour - 0 to 23 +** Minute - 0 to 59 +** Second - 0 to 59 +** Micros - 0 to 999999 +*/ +#define CFE_MISSION_TIME_EPOCH_YEAR 1980 +#define CFE_MISSION_TIME_EPOCH_DAY 1 +#define CFE_MISSION_TIME_EPOCH_HOUR 0 +#define CFE_MISSION_TIME_EPOCH_MINUTE 0 +#define CFE_MISSION_TIME_EPOCH_SECOND 0 +#define CFE_MISSION_TIME_EPOCH_MICROS 0 + +/** +** \cfetimecfg Time File System Factor +** +** \par Description: +** Define the s/c vs file system time conversion constant... +** +** Note: this value is intended for use only by CFE TIME API functions to +** convert time values based on the ground system epoch (s/c time) to +** and from time values based on the file system epoch (fs time). +** +** FS time = S/C time + factor +** S/C time = FS time - factor +** +** Worksheet: +** +** S/C epoch = Jan 1, 2005 (LRO ground system epoch) +** FS epoch = Jan 1, 1980 (vxWorks DOS file system epoch) +** +** Delta = 25 years, 0 days, 0 hours, 0 minutes, 0 seconds +** +** Leap years = 1980, 1984, 1988, 1992, 1996, 2000, 2004 +** (divisible by 4 -- except if by 100 -- unless also by 400) +** +** 1 year = 31,536,000 seconds +** 1 day = 86,400 seconds +** 1 hour = 3,600 seconds +** 1 minute = 60 seconds +** +** 25 years = 788,400,000 seconds +** 7 extra leap days = 604,800 seconds +** +** total delta = 789,004,800 seconds +** +** \par Limits +** Not Applicable +*/ +#define CFE_MISSION_TIME_FS_FACTOR 789004800 + +#endif /* EXAMPLE_MISSION_CFG_H */ diff --git a/cmake/sample_defs/example_platform_cfg.h b/cmake/sample_defs/example_platform_cfg.h new file mode 100644 index 000000000..c40f44e7d --- /dev/null +++ b/cmake/sample_defs/example_platform_cfg.h @@ -0,0 +1,1751 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + + /** + * @file + * + * This header file contains the internal configuration parameters and + * typedefs with platform scope. + * + * This provides default values for configurable items that do NOT affect + * the interface(s) of this module. This includes internal parameters, + * path names, and limit value(s) that are relevant for a specific platform. + * + * @note It is no longer necessary to provide this file directly in the defs + * directory, but if present, this file is still supported/usable for backward + * compatibility. To use this file, is should be called "cfe_platform_cfg.h". + * + * Going forward, more fine-grained (module/purposes-specific) header files are + * included with each submodule. These may be overridden as necessary, but only + * if a definition within that file needs to be changed from the default. This + * approach will reduce the amount of duplicate/cloned definitions and better + * support alternative build configurations in the future. + * + * Note that if this file is present, the fine-grained header files noted above + * will _not_ be used. + */ + +#ifndef EXAMPLE_PLATFORM_CFG_H +#define EXAMPLE_PLATFORM_CFG_H + +/*******************************************************************************/ +/* + * CFE Core Private Config Definitions + */ + +/** +** \cfesbcfg Platform Endian Indicator +** +** \par Description: +** The value of this constant indicates the endianess of the target system +** +** \par Limits +** This parameter has a lower limit of 0 and an upper limit of 1. +*/ +#define CFE_PLATFORM_ENDIAN CCSDS_LITTLE_ENDIAN + +/** \cfeescfg CFE core application startup timeout +** +** \par Description: +** The upper limit for the amount of time that the cFE core applications +** (ES, SB, EVS, TIME, TBL) are each allotted to reach their respective +** "ready" states. +** +** The CFE "main" thread starts individual tasks for each of the core applications +** (except FS). Each of these must perform some initialization work before the +** next core application can be started, so the main thread waits to ensure that the +** application has reached the "ready" state before starting the next application. +** +** If any core application fails to start, then it indicates a major problem with +** the system and startup is aborted. +** +** Units are in milliseconds +** +** \par Limits: +** Must be defined as an integer value that is greater than +** or equal to zero. +** +*/ +#define CFE_PLATFORM_CORE_MAX_STARTUP_MSEC 30000 + + +/*******************************************************************************/ +/* + * CFE Executive Services (CFE_ES) Application Private Config Definitions + */ + +/** +** \cfeescfg Define ES Task Priority +** +** \par Description: +** Defines the cFE_ES Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_ES_START_TASK_PRIORITY 68 + +/** +** \cfeescfg Define ES Task Stack Size +** +** \par Description: +** Defines the cFE_ES Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_ES_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +/** +** \cfeescfg Default virtual path for persistent storage +** +** \par Description: +** This configures the default location in the virtual file system +** for persistent/non-volatile storage. Files such as the startup +** script, app/library dynamic modules, and configuration tables are +** expected to be stored in this directory. +** +*/ +#define CFE_PLATFORM_ES_NONVOL_DISK_MOUNT_STRING "/cf" + +/** +** \cfeescfg Default virtual path for volatile storage +** +** \par Description: +** The #CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING parameter is used to set the cFE mount path +** for the CFE RAM disk. This is a parameter for missions that do not want to +** use the default value of "/ram", or for missions that need to have a different +** value for different CPUs or Spacecraft. +** Note that the vxWorks OSAL cannot currently handle names that have more than one +** path separator in it. The names "/ram", "/ramdisk", "/disk123" will all work, but +** "/disks/ram" will not. +** Multiple separators can be used with the posix or RTEMS ports. +** +*/ +#define CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING "/ram" + +/** +** \cfeescfg Define Max Number of Applications +** +** \par Description: +** Defines the maximum number of applications that can be loaded into the +** system. This number does not include child tasks. +** +** \par Limits +** There is a lower limit of 6. The lower limit corresponds to the cFE internal +** applications. There are no restrictions on the upper limit however, the +** maximum number of applications is system dependent and should be verified. +** AppIDs that are checked against this configuration are defined by a 32 bit +** data word. +*/ +#define CFE_PLATFORM_ES_MAX_APPLICATIONS 32 + +/** +** \cfeescfg Define Max Number of Shared libraries +** +** \par Description: +** Defines the maximum number of cFE Shared libraries that can be loaded into +** the system. +** +** \par Limits +** There is a lower limit of 1. There are no restrictions on the upper limit +** however, the maximum number of libraries is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_MAX_LIBRARIES 10 + +/** +** \cfeescfg Define Max Number of ER (Exception and Reset) log entries +** +** \par Description: +** Defines the maximum number of ER (Exception and Reset) log entries +** +** \par Limits +** There is a lower limit of 1. There are no restrictions on the upper limit +** however, the maximum number of log entries is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_ER_LOG_ENTRIES 20 + +/** \cfeescfg Maximum size of CPU Context in ES Error Log +** +** \par Description: +** This should be large enough to accommodate the CPU context +** information supplied by the PSP on the given platform. +** +** \par Limits: +** Must be greater than zero and a multiple of sizeof(uint32). +** Limited only by the available memory and the number of entries +** in the error log. Any context information beyond this size will +** be truncated. +*/ +#define CFE_PLATFORM_ES_ER_LOG_MAX_CONTEXT_SIZE 256 + +/** +** \cfeescfg Define Size of the cFE System Log. +** +** \par Description: +** Defines the size in bytes of the cFE system log. The system log holds +** variable length strings that are terminated by a linefeed and null +** character. +** +** \par Limits +** There is a lower limit of 512. There are no restrictions on the upper limit +** however, the maximum system log size is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_SYSTEM_LOG_SIZE 3072 + +/** +** \cfeescfg Define Number of entries in the ES Object table +** +** \par Description: +** Defines the number of entries in the ES Object table. This table controls +** the core cFE startup. +** +** \par Limits +** There is a lower limit of 15. There are no restrictions on the upper limit +** however, the maximum object table size is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_OBJECT_TABLE_SIZE 30 + +/** +** \cfeescfg Define Max Number of Generic Counters +** +** \par Description: +** Defines the maximum number of Generic Counters that can be registered. +** +** \par Limits +** This parameter has a lower limit of 1 and an upper limit of 65535. +*/ +#define CFE_PLATFORM_ES_MAX_GEN_COUNTERS 8 + +/** +** \cfeescfg Define ES Application Control Scan Rate +** +** \par Description: +** ES Application Control Scan Rate. This parameter controls the speed that ES +** scans the Application Table looking for App Delete/Restart/Reload requests. +** All Applications are deleted, restarted, or reloaded by the ES Application. +** ES will periodically scan for control requests to process. The scan rate is +** controlled by this parameter, which is given in milliseconds. A value of +** 1000 means that ES will scan the Application Table once per second. Be +** careful not to set the value of this too low, because ES will use more CPU +** cycles scanning the table. +** +** \par Limits +** There is a lower limit of 100 and an upper limit of 20000 on this +** configuration parameter. millisecond units. +*/ +#define CFE_PLATFORM_ES_APP_SCAN_RATE 1000 + +/** +** \cfeescfg Define ES Application Kill Timeout +** +** \par Description: +** ES Application Kill Timeout. This parameter controls the number of +** "scan periods" that ES will wait for an application to Exit after getting +** the signal Delete, Reload or Restart. The sequence works as follows: +** -# ES will set the control request for an App to Delete/Restart/Reload and +** set this kill timer to the value in this parameter. +** -# If the App is responding and Calls it's RunLoop function, it will drop out +** of it's main loop and call CFE_ES_ExitApp. Once it calls Exit App, then +** ES can delete, restart, or reload the app the next time it scans the app +** table. +** -# If the App is not responding, the ES App will decrement this Kill Timeout +** value each time it runs. If the timeout value reaches zero, ES will kill +** the app. +** +** The Kill timeout value depends on the #CFE_PLATFORM_ES_APP_SCAN_RATE. If the Scan Rate +** is 1000, or 1 second, and this #CFE_PLATFORM_ES_APP_KILL_TIMEOUT is set to 5, then it +** will take 5 seconds to kill a non-responding App. +** If the Scan Rate is 250, or 1/4 second, and the #CFE_PLATFORM_ES_APP_KILL_TIMEOUT is +** set to 2, then it will take 1/2 second to time out. +** +** \par Limits +** There is a lower limit of 1 and an upper limit of 100 on this configuration +** parameter. Units are number of #CFE_PLATFORM_ES_APP_SCAN_RATE cycles. +*/ +#define CFE_PLATFORM_ES_APP_KILL_TIMEOUT 5 + +/** +** \cfeescfg ES Ram Disk Sector Size +** +** \par Description: +** Defines the ram disk sector size. The ram disk is 1 of 4 memory areas that +** are preserved on a processor reset. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 128. There are no restrictions on the upper limit +** however, the maximum RAM disk sector size is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_RAM_DISK_SECTOR_SIZE 512 + +/** +** \cfeescfg ES Ram Disk Number of Sectors +** +** \par Description: +** Defines the ram disk number of sectors. The ram disk is one of four memory +** areas that are preserved on a processor reset. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 128. There are no restrictions on the upper limit +** however, the maximum number of RAM sectors is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_ES_RAM_DISK_NUM_SECTORS 4096 + +/** +** \cfeescfg Percentage of Ram Disk Reserved for Decompressing Apps +** +** \par Description: +** The #CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED parameter is used to make sure that the +** Volatile ( RAM ) Disk has a defined amount of free space during a processor +** reset. The cFE uses the Volatile disk to decompress cFE applications during +** system startup. If this Volatile disk happens to get filled with logs and +** misc files, then a processor reset may not work, because there will be no +** room to decompress cFE apps. To solve that problem, this parameter sets the +** "Low Water Mark" for disk space on a Processor reset. It should be set to +** allow the largest cFE Application to be decompressed. +** During a Processor reset, if there is not sufficient space left on the disk, +** it will be re-formatted in order to clear up some space. +** +** This feature can be turned OFF by setting the parameter to 0. +** +** \par Limits +** There is a lower limit of 0 and an upper limit of 75 on this configuration +** parameter.Units are percentage. A setting of zero will turn this feature +** off. +*/ +#define CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED 30 + +/** +** \cfeescfg Define Critical Data Store Size +** +** \par Description: +** Defines the Critical Data Store (CDS) area size in bytes size. The CDS is +** one of four memory areas that are preserved during a processor reset. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 8192 and an upper limit of UINT_MAX (4 Gigabytes) +** on this configuration parameter. +*/ +#define CFE_PLATFORM_ES_CDS_SIZE (128 * 1024) + +/** +** \cfeescfg Define User Reserved Memory Size +** +** \par Description: +** User Reserved Memory Size. This is the size in bytes of the cFE User +** reserved Memory area. This is a block of memory that is available for cFE +** application use. The address is obtained by calling +** #CFE_PSP_GetUserReservedArea. The User Reserved Memory is one of four memory +** areas that are preserved during a processor reset. +** NOTE: Changing this value changes memory allocation, and may +** require changes to platform specific values (in CFE_PSP) such as +** USER_RESERVED_MEM in VxWorks depending on the memory areas +** being used for preserved data and on OS specific behavior. +** +** \par Limits +** There is a lower limit of 1024 and an upper limit of UINT_MAX (4 Gigabytes) +** on this configuration parameter. +*/ +#define CFE_PLATFORM_ES_USER_RESERVED_SIZE (1024 * 1024) + +/** +** \cfeescfg Define Memory Pool Alignment Size +** +** \par Description: +** Ensures that buffers obtained from a memory pool are aligned +** to a certain minimum block size. Note the allocator will always +** align to the minimum required by the CPU architecture. This may +** be set greater than the CPU requirement as desired for optimal +** performance. +** +** For some architectures/applications it may be beneficial to set this +** to the cache line size of the target CPU, or to use special SIMD +** instructions that require a more stringent memory alignment. +** +** \par Limits +** This must always be a power of 2, as it is used as a binary address mask. +*/ +#define CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN 4 + +/** +** \cfeescfg ES Nonvolatile Startup Filename +** +** \par Description: +** The value of this constant defines the path and name of the file that +** contains a list of modules that will be loaded and started by the cFE after +** the cFE finishes its startup sequence. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_NONVOL_STARTUP_FILE "/cf/cfe_es_startup.scr" + +/** +** \cfeescfg ES Volatile Startup Filename +** +** \par Description: +** The value of this constant defines the path and name of the file that +** contains a list of modules that will be loaded and started by the cFE after +** the cFE finishes its startup sequence. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_VOLATILE_STARTUP_FILE "/ram/cfe_es_startup.scr" + +/** +** \cfeescfg Default Application Information Filename +** +** \par Description: +** The value of this constant defines the filename used to store information +** pertaining to all of the Applications that are registered with Executive +** Services. This filename is used only when no filename is specified in the +** the command to query all system apps. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_APP_LOG_FILE "/ram/cfe_es_app_info.log" + +/** +** \cfeescfg Default Application Information Filename +** +** \par Description: +** The value of this constant defines the filename used to store information +** pertaining to all of the Applications that are registered with Executive +** Services. This filename is used only when no filename is specified in the +** the command to query all system tasks. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_TASK_LOG_FILE "/ram/cfe_es_taskinfo.log" + +/** +** \cfeescfg Default System Log Filename +** +** \par Description: +** The value of this constant defines the filename used to store important +** information (as ASCII text strings) that might not be able to be sent in an +** Event Message. This filename is used only when no filename is specified in +** the command to dump the system log. No file specified in the cmd means the +** first character in the cmd filename is a NULL terminator (zero). +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_SYSLOG_FILE "/ram/cfe_es_syslog.log" + +/** +** \cfeescfg Default Exception and Reset (ER) Log Filename +** +** \par Description: +** The value of this constant defines the filename used to store the +** Exception and Reset (ER) Log. This filename is used only when no filename is +** specified in the command to dump the ER log. No file specified in the cmd +** means the first character in the cmd filename is a NULL terminator (zero). +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_ER_LOG_FILE "/ram/cfe_erlog.log" + +/** +** \cfeescfg Default Performance Data Filename +** +** \par Description: +** The value of this constant defines the filename used to store the +** Performance Data. This filename is used only when no filename is specified +** in the command to stop performance data collecting. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_PERF_DUMP_FILENAME "/ram/cfe_es_perf.dat" + +/** +** \cfeescfg Default Critical Data Store Registry Filename +** +** \par Description: +** The value of this constant defines the filename used to store the +** Critical Data Store Registry. This filename is used only when no filename is +** specified in the command to stop performance data collecting. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_ES_DEFAULT_CDS_REG_DUMP_FILE "/ram/cfe_cds_reg.log" + +/** +** \cfeescfg Define Default System Log Mode following Power On Reset +** +** \par Description: +** Defines the default mode for the operation of the ES System log following a power +** on reset. The log may operate in either Overwrite mode = 0, where once the +** log becomes full the oldest message in the log will be overwritten, or +** Discard mode = 1, where once the log becomes full the contents of the log are +** preserved and the new event is discarded. This constant may hold a value of +** either 0 or 1 depending on the desired default. +** Overwrite Mode = 0, Discard Mode = 1. +** +** \par Limits +** There is a lower limit of 0 and an upper limit of 1 on this configuration +** parameter. +*/ +#define CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE 0 + +/** +** \cfeescfg Define Default System Log Mode following Processor Reset +** +** \par Description: +** Defines the default mode for the operation of the ES System log following a +** processor reset. The log may operate in either Overwrite mode = 0, where once +** the log becomes full the oldest message in the log will be overwritten, or +** Discard mode = 1, where once the log becomes full the contents of the log are +** preserved and the new event is discarded. This constant may hold a value of +** either 0 or 1 depending on the desired default. +** Overwrite Mode = 0, Discard Mode = 1. +** +** \par Limits +** There is a lower limit of 0 and an upper limit of 1 on this configuration +** parameter. +*/ +#define CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE 1 + +/** +** \cfeescfg Define Max Size of Performance Data Buffer +** +** \par Description: +** Defines the maximum size of the performance data buffer. Units are number of +** performance data entries. An entry is defined by a 32 bit data word followed +** by a 64 bit time stamp. +** +** \par Limits +** There is a lower limit of 1025. There are no restrictions on the upper limit +** however, the maximum buffer size is system dependent and should be verified. +** The units are number of entries. An entry is defined by a 32 bit data word followed +** by a 64 bit time stamp. +*/ +#define CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE 10000 + +/** +** \cfeescfg Define Filter Mask Setting for Disabling All Performance Entries +** +** \par Description: +** Defines the filter mask for disabling all performance entries. The value is a +** bit mask. For each bit, 0 means the corresponding entry is disabled and +** 1 means it is enabled. +*/ +#define CFE_PLATFORM_ES_PERF_FILTMASK_NONE 0 + +/** +** \cfeescfg Define Filter Mask Setting for Enabling All Performance Entries +** +** \par Description: +** Defines the filter mask for enabling all performance entries. The value is a +** bit mask. For each bit, 0 means the corresponding entry is disabled and +** 1 means it is enabled. +*/ +#define CFE_PLATFORM_ES_PERF_FILTMASK_ALL ~CFE_PLATFORM_ES_PERF_FILTMASK_NONE + +/** +** \cfeescfg Define Default Filter Mask Setting for Performance Data Buffer +** +** \par Description: +** Defines the default filter mask for the performance data buffer. The value is a +** bit mask. For each bit, 0 means the corresponding entry is disabled and 1 +** means it is enabled. +** +*/ +#define CFE_PLATFORM_ES_PERF_FILTMASK_INIT CFE_PLATFORM_ES_PERF_FILTMASK_ALL + +/** +** \cfeescfg Define Default Filter Trigger Setting for Disabling All Performance Entries +** +** \par Description: +** Defines the default trigger mask for disabling all performance data entries. The value +** is a bit mask. For each bit, 0 means the trigger for the corresponding entry is +** disabled and 1 means it is enabled. +** +*/ +#define CFE_PLATFORM_ES_PERF_TRIGMASK_NONE 0 + +/** +** \cfeescfg Define Filter Trigger Setting for Enabling All Performance Entries +** +** \par Description: +** Defines the trigger mask for enabling all performance data entries. The value is +** a bit mask. For each bit, 0 means the trigger for the corresponding entry is +** disabled and 1 means it is enabled. +** +*/ +#define CFE_PLATFORM_ES_PERF_TRIGMASK_ALL ~CFE_PLATFORM_ES_PERF_TRIGMASK_NONE + +/** +** \cfeescfg Define Default Filter Trigger Setting for Performance Data Buffer +** +** \par Description: +** Defines the default trigger mask for the performance data buffer. The value is a +** 32-bit mask. For each bit, 0 means the trigger for the corresponding entry is +** disabled and 1 means it is enabled. +** +*/ +#define CFE_PLATFORM_ES_PERF_TRIGMASK_INIT CFE_PLATFORM_ES_PERF_TRIGMASK_NONE + +/** +** \cfeescfg Define Performance Analyzer Child Task Priority +** +** \par Description: +** This parameter defines the priority of the child task spawned by the +** Executive Services to write performance data to a file. Lower numbers +** are higher priority, with 1 being the highest priority in the case of a +** child task. +** +** \par Limits +** Valid range for a child task is 1 to 255 however, the priority cannot +** be higher (lower number) than the ES parent application priority. +*/ +#define CFE_PLATFORM_ES_PERF_CHILD_PRIORITY 200 + +/** +** \cfeescfg Define Performance Analyzer Child Task Stack Size +** +** \par Description: +** This parameter defines the stack size of the child task spawned by the +** Executive Services to write performance data to a file. +** +** \par Limits +** It is recommended this parameter be greater than or equal to 4KB. This parameter +** is limited by the maximum value allowed by the data type. In this case, the data +** type is an unsigned 32-bit integer, so the valid range is 0 to 0xFFFFFFFF. +*/ +#define CFE_PLATFORM_ES_PERF_CHILD_STACK_SIZE 4096 + +/** +** \cfeescfg Define Performance Analyzer Child Task Delay +** +** \par Description: +** This parameter defines the delay time (in milliseconds) between performance +** data file writes performed by the Executive Services Performance Analyzer +** Child Task. +** +** \par Limits +** It is recommended this parameter be greater than or equal to 20ms. This parameter +** is limited by the maximum value allowed by the data type. In this case, the data +** type is an unsigned 32-bit integer, so the valid range is 0 to 0xFFFFFFFF. +*/ +#define CFE_PLATFORM_ES_PERF_CHILD_MS_DELAY 20 + +/** +** \cfeescfg Define Performance Analyzer Child Task Number of Entries Between Delay +** +** \par Description: +** This parameter defines the number of performance analyzer entries the Performance +** Analyzer Child Task will write to the file between delays. +** +*/ +#define CFE_PLATFORM_ES_PERF_ENTRIES_BTWN_DLYS 50 + +/** +** \cfeescfg Define Default Stack Size for an Application +** +** \par Description: +** This parameter defines a default stack size. This parameter is used by the +** cFE Core Applications. +** +** \par Limits +** There is a lower limit of 2048. There are no restrictions on the upper limit +** however, the maximum stack size is system dependent and should be verified. +** Most operating systems provide tools for measuring the amount of stack used by a +** task during operation. It is always a good idea to verify that no more than 1/2 +** of the stack is used. +*/ +#define CFE_PLATFORM_ES_DEFAULT_STACK_SIZE 8192 + +/** +** \cfeescfg Define Maximum Number of Registered CDS Blocks +** +** \par Description: +** Maximum number of registered CDS Blocks +** +** \par Limits +** There is a lower limit of 8. There are no restrictions on the upper limit +** however, the maximum number of CDS entries is system dependent and +** should be verified. +*/ +#define CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES 512 + +/** +** \cfeescfg Define Number of Processor Resets Before a Power On Reset +** +** \par Description: +** Number of Processor Resets before a Power On Reset is called. If set to 2, +** then 2 processor resets will occur, and the 3rd processor reset will be a +** power on reset instead. +** +** \par Limits +** There is a lower limit of 0. There are no restrictions on the upper limit +** however, the maximum number of processor resets may be system dependent and +** should be verified. +*/ +#define CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS 2 + +/** \cfeescfg Maximum number of block sizes in pool structures +** +** \par Description: +** The upper limit for the number of block sizes supported in the generic +** pool implementation, which in turn implements the memory pools and CDS. +** +** \par Limits: +** Must be at least one. No specific upper limit, but the number is +** anticipated to be reasonably small (i.e. tens, not hundreds). Large +** values have not been tested. +** +** The ES and CDS block size lists must correlate with this value +*/ +#define CFE_PLATFORM_ES_POOL_MAX_BUCKETS 17 + +/** \cfeescfg Maximum number of memory pools +** +** \par Description: +** The upper limit for the number of memory pools that can concurrently +** exist within the system. +** +** The CFE_SB and CFE_TBL core subsystems each define a memory pool. +** +** Individual applications may also create memory pools, so this value +** should be set sufficiently high enough to support the applications +** being used on this platform. +** +** \par Limits: +** Must be at least 2 to support CFE core - SB and TBL pools. No +** specific upper limit. +*/ +#define CFE_PLATFORM_ES_MAX_MEMORY_POOLS 10 + +/** +** \cfeescfg Define Default ES Memory Pool Block Sizes +** +** \par Description: +** Default Intermediate ES Memory Pool Block Sizes. If an application +** is using the CFE_ES Memory Pool APIs (#CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, +** #CFE_ES_GetPoolBuf and #CFE_ES_PutPoolBuf) but finds these sizes +** inappropriate for their use, they may wish to use the #CFE_ES_PoolCreateEx +** API to specify their own intermediate block sizes +** +** \par Limits +** These sizes MUST be increasing and MUST be an integral multiple of 4. Also, +** CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_MISSION_SB_MAX_SB_MSG_SIZE and both +** CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE and CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE. Note that if Table +** Services have been removed from the CFE, the table size limits are still +** enforced although the table size definitions may be reduced. +*/ +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 8 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02 16 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_03 32 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_04 48 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_05 64 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_06 96 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_07 128 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_08 160 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_09 256 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_10 512 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_11 1024 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_12 2048 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_13 4096 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_14 8192 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_15 16384 +#define CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16 32768 +#define CFE_PLATFORM_ES_MAX_BLOCK_SIZE 80000 + +/** +** \cfeescfg Define ES Critical Data Store Memory Pool Block Sizes +** +** \par Description: +** Intermediate ES Critical Data Store Memory Pool Block Sizes +** +** \par Limits +** These sizes MUST be increasing and MUST be an integral multiple of 4. +*/ +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_01 8 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_02 16 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_03 32 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_04 48 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_05 64 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_06 96 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_07 128 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_08 160 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_09 256 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_10 512 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_11 1024 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_12 2048 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_13 4096 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_14 8192 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_15 16384 +#define CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_16 32768 +#define CFE_PLATFORM_ES_CDS_MAX_BLOCK_SIZE 80000 + +/** \cfeescfg Poll timer for startup sync delay +** +** \par Description: +** During startup, some tasks may need to synchronize their own initialization +** with the initialization of other applications in the system. +** +** CFE ES implements an API to accomplish this, that performs a task delay (sleep) +** while polling the overall system state until other tasks are ready. +** +** This value controls the amount of time that the CFE_ES_ApplicationSyncDelay +** will sleep between each check of the system state. This should be large enough +** to allow other tasks to run, but not so large as to noticeably delay the startup +** completion. +** +** Units are in milliseconds +** +** \par Limits: +** Must be defined as an integer value that is greater than +** or equal to zero. +*/ +#define CFE_PLATFORM_ES_STARTUP_SYNC_POLL_MSEC 50 + +/** \cfeescfg Startup script timeout +** +** \par Description: +** The upper limit for the total amount of time that all apps listed in the CFE ES startup +** script may take to all become ready. +** +** Unlike the "core" app timeout, this is a soft limit; if the allotted time is exceeded, +** it probably indicates an issue with one of the apps, but does not cause CFE ES to take +** any additional action other than logging the event to the syslog. +** +** Units are in milliseconds +** +** \par Limits: +** Must be defined as an integer value that is greater than +** or equal to zero. +*/ +#define CFE_PLATFORM_ES_STARTUP_SCRIPT_TIMEOUT_MSEC 1000 + +/********************************************************************************/ +/* + * CFE Event Services (CFE_EVS) Application Private Config Definitions + */ + +/** +** \cfeescfg Define EVS Task Priority +** +** \par Description: +** Defines the cFE_EVS Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_EVS_START_TASK_PRIORITY 61 + +/** +** \cfeescfg Define EVS Task Stack Size +** +** \par Description: +** Defines the cFE_EVS Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_EVS_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +/** +** \cfeevscfg Define Maximum Number of Event Filters per Application +** +** \par Description: +** Maximum number of events that may be filtered per application. +** +** \par Limits +** There are no restrictions on the lower and upper limits however, +** the maximum number of event filters is system dependent and should be +** verified. +*/ +#define CFE_PLATFORM_EVS_MAX_EVENT_FILTERS 8 + +/** +** \cfeevscfg Maximum number of event before squelching +** +** \par Description: +** Maximum number of events that may be emitted per app per second. +** Setting this to 0 will cause events to be unrestricted. +** +** \par Limits +** This number must be less than or equal to INT_MAX/1000 +*/ +#define CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST 32 + +/** +** \cfeevscfg Sustained number of event messages per second per app before squelching +** +** \par Description: +** Sustained number of events that may be emitted per app per second. +** +** \par Limits +** This number must be less than or equal to #CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST. +** Values lower than 8 may cause functional and unit test failures. +*/ +#define CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC 15 + +/** +** \cfeevscfg Default Event Log Filename +** +** \par Description: +** The value of this constant defines the filename used to store the Event +** Services local event log. This filename is used only when no filename is +** specified in the command to dump the event log. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_LOG_FILE "/ram/cfe_evs.log" + +/** +** \cfeevscfg Maximum Number of Events in EVS Local Event Log +** +** \par Description: +** Dictates the EVS local event log capacity. Units are the number of events. +** +** \par Limits +** There are no restrictions on the lower and upper limits however, +** the maximum log size is system dependent and should be verified. +*/ +#define CFE_PLATFORM_EVS_LOG_MAX 20 + +/** +** \cfeevscfg Default EVS Application Data Filename +** +** \par Description: +** The value of this constant defines the filename used to store the EVS +** Application Data(event counts/filtering information). This filename is +** used only when no filename is specified in the command to dump the event +** log. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_APP_DATA_FILE "/ram/cfe_evs_app.dat" + +/** +** \cfeevscfg Default EVS Output Port State +** +** \par Description: +** Defines the default port state (enabled or disabled) for the four output +** ports defined within the Event Service. Port 1 is usually the uart output +** terminal. To enable a port, set the proper bit to a 1. Bit 0 is port 1, +** bit 1 is port2 etc. +** +** \par Limits +** The valid settings are 0x0 to 0xF. +*/ +#define CFE_PLATFORM_EVS_PORT_DEFAULT 0x0001 + +/** +** \cfeevscfg Default EVS Event Type Filter Mask +** +** \par Description: +** Defines a state of on or off for all four event types. The term event +** 'type' refers to the criticality level and may be Debug, Informational, +** Error or Critical. Each event type has a bit position. (bit 0 = Debug, +** bit 1 = Info, bit 2 = Error, bit 3 = Critical). This is a global setting, +** meaning it applies to all applications. To filter an event type, set its +** bit to zero. For example, +** 0xE means Debug = OFF, Info = ON, Error = ON, Critical = ON +** +** \par Limits +** The valid settings are 0x0 to 0xF. +*/ +#define CFE_PLATFORM_EVS_DEFAULT_TYPE_FLAG 0xE + +/** +** \cfeevscfg Default EVS Local Event Log Mode +** +** \par Description: +** Defines a state of overwrite(0) or discard(1) for the operation of the +** EVS local event log. The log may operate in either Overwrite mode = 0, +** where once the log becomes full the oldest event in the log will be +** overwritten, or Discard mode = 1, where once the log becomes full the +** contents of the log are preserved and the new event is discarded. +** Overwrite Mode = 0, Discard Mode = 1. +** +** \par Limits +** The valid settings are 0 or 1 +*/ +#define CFE_PLATFORM_EVS_DEFAULT_LOG_MODE 1 + +/** +** \cfeevscfg Default EVS Message Format Mode +** +** \par Description: +** Defines the default message format (long or short) for event messages being +** sent to the ground. Choose between #CFE_EVS_MsgFormat_LONG or +** #CFE_EVS_MsgFormat_SHORT. +** +** \par Limits +** The valid settings are #CFE_EVS_MsgFormat_LONG or #CFE_EVS_MsgFormat_SHORT +*/ +#define CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE CFE_EVS_MsgFormat_LONG + +/********************************************************************/ +/* + * CFE Software Bus (CFE_SB) Application Private Config Definitions + */ + +/** +** \cfesbcfg Maximum Number of Unique Message IDs SB Routing Table can hold +** +** \par Description: +** Dictates the maximum number of unique MsgIds the SB routing table will hold. +** This constant has a direct effect on the size of SB's tables and arrays. +** Keeping this count as low as possible will save memory. +** To see the run-time, high-water mark and the current utilization figures +** regarding this parameter, send an SB command to 'Send Statistics Pkt'. +** +** \par Limits +** This must be a power of two if software bus message routing hash implementation +** is being used. Lower than 64 will cause unit test failures, and +** telemetry reporting is impacted below 32. There is no hard +** upper limit, but impacts memory footprint. For software bus message routing +** search implementation the number of msg ids subscribed to impacts performance. +** +*/ +#define CFE_PLATFORM_SB_MAX_MSG_IDS 256 + +/** +** \cfesbcfg Maximum Number of Unique Pipes SB Routing Table can hold +** +** \par Description: +** Dictates the maximum number of unique Pipes the SB routing table will hold. +** This constant has a direct effect on the size of SB's tables and arrays. +** Keeping this count as low as possible will save memory. +** To see the run-time, high-water mark and the current utilization figures +** regarding this parameter, send an SB command to 'Send Statistics Pkt'. +** +** \par Limits +** This parameter has a lower limit of 1. This parameter must also be less than +** or equal to OS_MAX_QUEUES. +** +*/ +#define CFE_PLATFORM_SB_MAX_PIPES 64 + +/** +** \cfesbcfg Maximum Number of unique local destinations a single MsgId can have +** +** \par Description: +** Dictates the maximum number of unique local destinations a single MsgId can +** have. +** +** \par Limits +** This parameter has a lower limit of 1. There are no restrictions on the upper +** limit however, the maximum number of destinations per packet is system dependent +** and should be verified. Destination number values that are checked against this +** configuration are defined by a 16 bit data word. +** +*/ +#define CFE_PLATFORM_SB_MAX_DEST_PER_PKT 16 + +/** +** \cfesbcfg Default Subscription Message Limit +** +** \par Description: +** Dictates the default Message Limit when using the #CFE_SB_Subscribe API. This will +** limit the number of messages with a specific message ID that can be received through +** a subscription. This only changes the default; other message limits can be set on a per +** subscription basis using #CFE_SB_SubscribeEx . +** +** \par Limits +** This parameter has a lower limit of 4 and an upper limit of 65535. +** +*/ +#define CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT 4 + +/** +** \cfesbcfg Size of the SB buffer memory pool +** +** \par Description: +** Dictates the size of the SB memory pool. For each message the SB +** sends, the SB dynamically allocates from this memory pool, the memory needed +** to process the message. The memory needed to process each message is msg +** size + msg descriptor(CFE_SB_BufferD_t). This memory pool is also used +** to allocate destination descriptors (CFE_SB_DestinationD_t) during the +** subscription process. +** To see the run-time, high-water mark and the current utilization figures +** regarding this parameter, send an SB command to 'Send Statistics Pkt'. +** Some memory statistics have been added to the SB housekeeping packet. +** NOTE: It is important to monitor these statistics to ensure the desired +** memory margin is met. +** +** \par Limits +** This parameter has a lower limit of 512 and an upper limit of UINT_MAX (4 Gigabytes). +** +*/ +#define CFE_PLATFORM_SB_BUF_MEMORY_BYTES 524288 + +/** +** \cfesbcfg Highest Valid Message Id +** +** \par Description: +** The value of this constant dictates the range of valid message ID's, from 0 +** to CFE_PLATFORM_SB_HIGHEST_VALID_MSGID (inclusive). +** +** Although this can be defined differently across platforms, each platform can +** only publish/subscribe to message ids within their allowable range. Typically +** this value is set the same across all mission platforms to avoid this complexity. +** +** \par Limits +** CFE_SB_INVALID_MSG is set to the maximum representable number of type CFE_SB_MsgId_t. +** CFE_PLATFORM_SB_HIGHEST_VALID_MSGID lower limit is 1, up to CFE_SB_INVALID_MSG_ID - 1. +** +** When using the direct message map implementation for software bus routing, this +** value is used to size the map where a value of 0x1FFF results in a 16 KBytes map +** and 0xFFFF is 128 KBytes. +** +** When using the hash implementation for software bus routing, a multiple of the +** CFE_PLATFORM_SB_MAX_MSG_IDS is used to size the message map. In that case +** the range selected here does not impact message map memory use, so it's +** reasonable to use up to the full range supported by the message ID implementation. +*/ +#define CFE_PLATFORM_SB_HIGHEST_VALID_MSGID 0x1FFF + +/** +** \cfesbcfg Default Routing Information Filename +** +** \par Description: +** The value of this constant defines the filename used to store the software +** bus routing information. This filename is used only when no filename is +** specified in the command. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_SB_DEFAULT_ROUTING_FILENAME "/ram/cfe_sb_route.dat" + +/** +** \cfesbcfg Default Pipe Information Filename +** +** \par Description: +** The value of this constant defines the filename used to store the software +** bus pipe information. This filename is used only when no filename is +** specified in the command. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_SB_DEFAULT_PIPE_FILENAME "/ram/cfe_sb_pipe.dat" + +/** +** \cfesbcfg Default Message Map Filename +** +** \par Description: +** The value of this constant defines the filename used to store the software +** bus message map information. This filename is used only when no filename is +** specified in the command. The message map is a lookup table (array of 16bit +** words) that has an element for each possible MsgId value and holds the +** routing table index for that MsgId. The Msg Map provides fast access to the +** destinations of a message. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_SB_DEFAULT_MAP_FILENAME "/ram/cfe_sb_msgmap.dat" + +/** +** \cfesbcfg SB Event Filtering +** +** \par Description: +** This group of configuration parameters dictates what SB events will be +** filtered through SB. The filtering will begin after the SB task initializes +** and stay in effect until a cmd to SB changes it. +** This allows the operator to set limits on the number of event messages that +** are sent during system initialization. +** NOTE: Set all unused event values and mask values to zero +** +** \par Limits +** This filtering applies only to SB events. +** These parameters have a lower limit of 0 and an upper limit of 65535. +*/ +#define CFE_PLATFORM_SB_FILTERED_EVENT1 CFE_SB_SEND_NO_SUBS_EID +#define CFE_PLATFORM_SB_FILTER_MASK1 CFE_EVS_FIRST_4_STOP + +#define CFE_PLATFORM_SB_FILTERED_EVENT2 CFE_SB_DUP_SUBSCRIP_EID +#define CFE_PLATFORM_SB_FILTER_MASK2 CFE_EVS_FIRST_4_STOP + +#define CFE_PLATFORM_SB_FILTERED_EVENT3 CFE_SB_MSGID_LIM_ERR_EID +#define CFE_PLATFORM_SB_FILTER_MASK3 CFE_EVS_FIRST_16_STOP + +#define CFE_PLATFORM_SB_FILTERED_EVENT4 CFE_SB_Q_FULL_ERR_EID +#define CFE_PLATFORM_SB_FILTER_MASK4 CFE_EVS_FIRST_16_STOP + +#define CFE_PLATFORM_SB_FILTERED_EVENT5 0 +#define CFE_PLATFORM_SB_FILTER_MASK5 CFE_EVS_NO_FILTER + +#define CFE_PLATFORM_SB_FILTERED_EVENT6 0 +#define CFE_PLATFORM_SB_FILTER_MASK6 CFE_EVS_NO_FILTER + +#define CFE_PLATFORM_SB_FILTERED_EVENT7 0 +#define CFE_PLATFORM_SB_FILTER_MASK7 CFE_EVS_NO_FILTER + +#define CFE_PLATFORM_SB_FILTERED_EVENT8 0 +#define CFE_PLATFORM_SB_FILTER_MASK8 CFE_EVS_NO_FILTER + +/** +** \cfeescfg Define SB Memory Pool Block Sizes +** +** \par Description: +** Software Bus Memory Pool Block Sizes +** +** \par Limits +** These sizes MUST be increasing and MUST be an integral multiple of 4. +** The number of block sizes defined cannot exceed +** #CFE_PLATFORM_ES_POOL_MAX_BUCKETS +*/ +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_01 8 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_02 16 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_03 20 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_04 36 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_05 64 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_06 96 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_07 128 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_08 160 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_09 256 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_10 512 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_11 1024 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_12 2048 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_13 4096 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_14 8192 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_15 16384 +#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_16 32768 +#define CFE_PLATFORM_SB_MAX_BLOCK_SIZE (CFE_MISSION_SB_MAX_SB_MSG_SIZE + 128) + +/** +** \cfeescfg Define SB Task Priority +** +** \par Description: +** Defines the cFE_SB Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_SB_START_TASK_PRIORITY 64 + +/** +** \cfeescfg Define SB Task Stack Size +** +** \par Description: +** Defines the cFE_SB Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_SB_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +/***************************************************************************/ +/* + * CFE Table Services (CFE_TBL) Application Private Config Definitions + */ + +/** +** \cfeescfg Define TBL Task Priority +** +** \par Description: +** Defines the cFE_TBL Task priority. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TBL_START_TASK_PRIORITY 70 + +/** +** \cfeescfg Define TBL Task Stack Size +** +** \par Description: +** Defines the cFE_TBL Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on this configuration parameter. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_TBL_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE + +/* Platform Configuration Parameters for Table Service (TBL) */ + +/** +** \cfetblcfg Size of Table Services Table Memory Pool +** +** \par Description: +** Defines the TOTAL size of the memory pool that cFE Table Services allocates +** from the system. The size must be large enough to provide memory for each +** registered table, the inactive buffers for double buffered tables and for +** the shared inactive buffers for single buffered tables. +** +** \par Limits +** The cFE does not place a limit on the size of this parameter. +*/ +#define CFE_PLATFORM_TBL_BUF_MEMORY_BYTES 524288 + +/** +** \cfetblcfg Maximum Size Allowed for a Double Buffered Table +** +** \par Description: +** Defines the maximum allowed size (in bytes) of a double buffered table. +** +** \par Limits +** The cFE does not place a limit on the size of this parameter but it must be +** less than half of #CFE_PLATFORM_TBL_BUF_MEMORY_BYTES. +*/ +#define CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE 16384 + +/** +** \cfetblcfg Maximum Size Allowed for a Single Buffered Table +** +** \par Description: +** Defines the maximum allowed size (in bytes) of a single buffered table. +** \b NOTE: This size determines the size of all shared table buffers. +** Therefore, this size will be multiplied by #CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS +** below when allocating memory for shared tables. +** +** \par Limits +** The cFE does not place a limit on the size of this parameter but it must be +** small enough to allow for #CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS number of tables +** to fit into #CFE_PLATFORM_TBL_BUF_MEMORY_BYTES. +*/ +#define CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE 16384 + +/** +** \cfetblcfg Maximum Number of Tables Allowed to be Registered +** +** \par Description: +** Defines the maximum number of tables supported by this processor's Table Services. +** +** \par Limits +** This number must be less than 32767. It should be recognized that this parameter +** determines the size of the Table Registry. An excessively high number will waste +** memory. +*/ +#define CFE_PLATFORM_TBL_MAX_NUM_TABLES 128 + +/** +** \cfetblcfg Maximum Number of Critical Tables that can be Registered +** +** \par Description: +** Defines the maximum number of critical tables supported by this processor's Table Services. +** +** \par Limits +** This number must be less than 32767. It should be recognized that this parameter +** determines the size of the Critical Table Registry which is maintained in the Critical +** Data Store. An excessively high number will waste Critical Data Store memory. Therefore, +** this number must not exceed the value defined in CFE_ES_CDS_MAX_CRITICAL_TABLES. +*/ +#define CFE_PLATFORM_TBL_MAX_CRITICAL_TABLES 32 + +/** +** \cfetblcfg Maximum Number of Table Handles +** +** \par Description: +** Defines the maximum number of Table Handles. +** +** \par Limits +** This number must be less than 32767. This number must be at least as big as +** the number of tables (#CFE_PLATFORM_TBL_MAX_NUM_TABLES) and should be set higher if tables +** are shared between applications. +*/ +#define CFE_PLATFORM_TBL_MAX_NUM_HANDLES 256 + +/** +** \cfetblcfg Maximum Number of Simultaneous Loads to Support +** +** \par Description: +** Defines the maximum number of single buffered tables that can be +** loaded simultaneously. This number is used to determine the number +** of shared buffers to allocate. +** +** \par Limits +** This number must be less than 32767. An excessively high number will +** degrade system performance and waste memory. A number less than 5 is +** suggested but not required. +*/ +#define CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS 4 + +/** +** \cfetblcfg Maximum Number of Simultaneous Table Validations +** +** \par Description: +** Defines the maximum number of pending validations that +** the Table Services can handle at any one time. When a +** table has a validation function, a validation request is +** made of the application to perform that validation. This +** number determines how many of those requests can be +** outstanding at any one time. +** +** \par Limits +** This number must be less than 32767. An excessively high number will +** degrade system performance and waste memory. A number less than 20 is +** suggested but not required. +*/ +#define CFE_PLATFORM_TBL_MAX_NUM_VALIDATIONS 10 + +/** +** \cfetblcfg Default Filename for a Table Registry Dump +** +** \par Description: +** Defines the file name used to store the table registry when +** no filename is specified in the dump registry command. +** +** \par Limits +** The length of each string, including the NULL terminator cannot exceed the +** #OS_MAX_PATH_LEN value. +*/ +#define CFE_PLATFORM_TBL_DEFAULT_REG_DUMP_FILE "/ram/cfe_tbl_reg.log" + +/** +** \cfetblcfg Number of Spacecraft ID's specified for validation +** +** \par Description: +** Defines the number of specified spacecraft ID values that +** are verified during table loads. If the number is zero +** then no validation of the spacecraft ID field in the table +** file header is performed when tables are loaded. Non-zero +** values indicate how many values from the list of spacecraft +** ID's defined below are compared to the spacecraft ID field +** in the table file header. The ELF2CFETBL tool may be used +** to create table files with specified spacecraft ID values. +** +** \par Limits +** This number must be greater than or equal to zero and +** less than or equal to 2. +*/ +#define CFE_PLATFORM_TBL_VALID_SCID_COUNT 0 + +/* macro to construct 32 bit value from 4 chars */ +#define CFE_PLATFORM_TBL_U32FROM4CHARS(_C1, _C2, _C3, _C4) \ + ((uint32)(_C1) << 24 | (uint32)(_C2) << 16 | (uint32)(_C3) << 8 | (uint32)(_C4)) + +/** +** \cfetblcfg Spacecraft ID values used for table load validation +** +** \par Description: +** Defines the spacecraft ID values used for validating the +** spacecraft ID field in the table file header. To be valid, +** the spacecraft ID specified in the table file header must +** match one of the values defined here. +** +** \par Limits +** This value can be any 32 bit unsigned integer. +*/ +#define CFE_PLATFORM_TBL_VALID_SCID_1 (0x42) +#define CFE_PLATFORM_TBL_VALID_SCID_2 (CFE_PLATFORM_TBL_U32FROM4CHARS('a', 'b', 'c', 'd')) + +/** +** \cfetblcfg Number of Processor ID's specified for validation +** +** \par Description: +** Defines the number of specified processor ID values that +** are verified during table loads. If the number is zero +** then no validation of the processor ID field in the table +** file header is performed when tables are loaded. Non-zero +** values indicate how many values from the list of processor +** ID's defined below are compared to the processor ID field +** in the table file header. The ELF2CFETBL tool may be used +** to create table files with specified processor ID values. +** +** \par Limits +** This number must be greater than or equal to zero and +** less than or equal to 4. +*/ +#define CFE_PLATFORM_TBL_VALID_PRID_COUNT 0 + +/** +** \cfetblcfg Processor ID values used for table load validation +** +** \par Description: +** Defines the processor ID values used for validating the +** processor ID field in the table file header. To be valid, +** the spacecraft ID specified in the table file header must +** match one of the values defined here. +** +** \par Limits +** This value can be any 32 bit unsigned integer. +*/ +#define CFE_PLATFORM_TBL_VALID_PRID_1 (1) +#define CFE_PLATFORM_TBL_VALID_PRID_2 (CFE_PLATFORM_TBL_U32FROM4CHARS('a', 'b', 'c', 'd')) +#define CFE_PLATFORM_TBL_VALID_PRID_3 0 +#define CFE_PLATFORM_TBL_VALID_PRID_4 0 + +/*************************************************************************/ +/* + * CFE Time Service (CFE_TIME) Application Private Config Definitions + */ + +/** +** \cfetimecfg Time Server or Time Client Selection +** +** \par Description: +** This configuration parameter selects whether the Time task functions as a +** time "server" or "client". A time server generates the "time at the tone" +** packet which is received by time clients. +** +** \par Limits +** Enable one, and only one by defining either CFE_PLATFORM_TIME_CFG_SERVER or +** CFE_PLATFORM_TIME_CFG_CLIENT AS true. The other must be defined as false. +*/ +#define CFE_PLATFORM_TIME_CFG_SERVER true +#define CFE_PLATFORM_TIME_CFG_CLIENT false + +/** +** \cfetimecfg Time Tone In Big-Endian Order +** +** \par Description: +** If this configuration parameter is defined, the CFE time server will +** publish time tones with payloads in big-endian order, and time clients +** will expect the tones to be in big-endian order. This is useful for +** mixed-endian environments. This will become obsolete once EDS is +** available and the CFE time tone message is defined. +*/ +#undef CFE_PLATFORM_TIME_CFG_BIGENDIAN + +/** +** \cfetimecfg Local MET or Virtual MET Selection for Time Servers +** +** \par Description: +** Depending on the specific hardware system configuration, it may be possible +** for Time Servers to read the "local" MET from a h/w register rather than +** having to track the MET as the count of tone signal interrupts (virtual MET) +** +** Time Clients must be defined as using a virtual MET. Also, a Time Server +** cannot be defined as having both a h/w MET and an external time source (they +** both cannot synchronize to the same tone). +** +** Note: "disable" this define (set to false) only for Time Servers with local hardware +** that supports a h/w MET that is synchronized to the tone signal !!! +** +** \par Limits +** Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. +*/ +#define CFE_PLATFORM_TIME_CFG_VIRTUAL true + +/** +** \cfetimecfg Include or Exclude the Primary/Redundant Tone Selection Cmd +** +** \par Description: +** Depending on the specific hardware system configuration, it may be possible +** to switch between a primary and redundant tone signal. If supported by +** hardware, this definition will enable command interfaces to select the +** active tone signal. Both Time Clients and Time Servers support this feature. +** Note: Set the CFE_PLATFORM_TIME_CFG_SIGNAL define to true to enable tone signal commands. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_CFG_SIGNAL false + +/** +** \cfetimecfg Include or Exclude the Internal/External Time Source Selection Cmd +** +** \par Description: +** By default, Time Servers maintain time using an internal MET which may be a +** h/w register or software counter, depending on available hardware. The +** following definition enables command interfaces to switch between an +** internal MET, or external time data received from one of several supported +** external time sources. Only a Time Server may be configured to use external +** time data. +** Note: Set the CFE_PLATFORM_TIME_CFG_SOURCE define to true to include the Time Source +** Selection Command (command allows selection between the internal +** or external time source). Then choose the external source with the +** CFE_TIME_CFG_SRC_??? define. +** +** \par Limits +** Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. +*/ +#define CFE_PLATFORM_TIME_CFG_SOURCE false + +/** +** \cfetimecfg Choose the External Time Source for Server only +** +** \par Description: +** If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true, then one of the following external time +** source types must also be set to true. Do not set any of the external time +** source types to true unless #CFE_PLATFORM_TIME_CFG_SOURCE is set to true. +** +** \par Limits +** -# If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true then one and only one of the following +** three external time sources can and must be set true: +** #CFE_PLATFORM_TIME_CFG_SRC_MET, #CFE_PLATFORM_TIME_CFG_SRC_GPS, #CFE_PLATFORM_TIME_CFG_SRC_TIME +** -# Only applies if #CFE_PLATFORM_TIME_CFG_SERVER is set to true. +*/ +#define CFE_PLATFORM_TIME_CFG_SRC_MET false +#define CFE_PLATFORM_TIME_CFG_SRC_GPS false +#define CFE_PLATFORM_TIME_CFG_SRC_TIME false + +/** +** \cfetimecfg Define the Max Delta Limits for Time Servers using an Ext Time Source +** +** \par Description: +** If #CFE_PLATFORM_TIME_CFG_SOURCE is set to true and one of the external time sources is +** also set to true, then the delta time limits for range checking is used. +** +** When a new time value is received from an external source, the value is +** compared against the "expected" time value. If the delta exceeds the +** following defined amount, then the new time data will be ignored. This range +** checking is only performed after the clock state has been commanded to +** "valid". Until then, external time data is accepted unconditionally. +** +** \par Limits +** Applies only if both #CFE_PLATFORM_TIME_CFG_SERVER and #CFE_PLATFORM_TIME_CFG_SOURCE are set +** to true. +*/ +#define CFE_PLATFORM_TIME_MAX_DELTA_SECS 0 +#define CFE_PLATFORM_TIME_MAX_DELTA_SUBS 500000 + +/** +** \cfetimecfg Define the Local Clock Rollover Value in seconds and subseconds +** +** \par Description: +** Specifies the capability of the local clock. Indicates the time at which +** the local clock rolls over. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_MAX_LOCAL_SECS 27 +#define CFE_PLATFORM_TIME_MAX_LOCAL_SUBS 0 + +/** +** \cfetimecfg Define Timing Limits From One Tone To The Next +** +** \par Description: +** Defines limits to the timing of the 1Hz tone signal. A tone signal is valid +** only if it arrives within one second (plus or minus the tone limit) from +** the previous tone signal.Units are microseconds as measured with the local +** clock. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_CFG_TONE_LIMIT 20000 + +/** +** \cfetimecfg Define Time to Start Flywheel Since Last Tone +** +** \par Description: +** Define time to enter flywheel mode (in seconds since last tone data update) +** Units are microseconds as measured with the local clock. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_CFG_START_FLY 2 + +/** +** \cfetimecfg Define Periodic Time to Update Local Clock Tone Latch +** +** \par Description: +** Define Periodic Time to Update Local Clock Tone Latch. Applies only when +** in flywheel mode. This define dictates the period at which the simulated +** 'last tone' time is updated. Units are seconds. +** +** \par Limits +** Not Applicable +*/ +#define CFE_PLATFORM_TIME_CFG_LATCH_FLY 8 + +/** +** \cfetimecfg Define TIME Task Priorities +** +** \par Description: +** Defines the cFE_TIME Task priority. +** Defines the cFE_TIME Tone Task priority. +** Defines the cFE_TIME 1HZ Task priority. +** +** \par Limits +** There is a lower limit of zero and an upper limit of 255 on these +** configuration parameters. Remember that the meaning of each task +** priority is inverted -- a "lower" number has a "higher" priority. +*/ +#define CFE_PLATFORM_TIME_START_TASK_PRIORITY 60 +#define CFE_PLATFORM_TIME_TONE_TASK_PRIORITY 25 +#define CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY 25 + +/** +** \cfetimecfg Define TIME Task Stack Sizes +** +** \par Description: +** Defines the cFE_TIME Main Task Stack Size +** Defines the cFE_TIME Tone Task Stack Size +** Defines the cFE_TIME 1HZ Task Stack Size +** +** \par Limits +** There is a lower limit of 2048 on these configuration parameters. There +** are no restrictions on the upper limit however, the maximum stack size +** is system dependent and should be verified. Most operating systems provide +** tools for measuring the amount of stack used by a task during operation. It +** is always a good idea to verify that no more than 1/2 of the stack is used. +*/ +#define CFE_PLATFORM_TIME_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE +#define CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE 4096 +#define CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE 8192 + +#endif /* EXAMPLE_PLATFORM_CFG_H */ + From df1517d2d3385a92581c90aeb480f3871e2abb0a Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 24 Aug 2023 18:23:49 +0000 Subject: [PATCH 200/200] Updating documentation and version numbers for v7.0.0-rc4+dev370 --- CHANGELOG.md | 5 +++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4db39067..e99c3ec74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Development Build: v7.0.0-rc4+dev370 +- 'Fix #2430, reinstate example header files.' +- See: + + ## Development Build: v7.0.0-rc4+dev366 - 'Fix #2427, Race condition in TestCreateChild' - See: diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 392068b08..4052751d4 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 366 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 370 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */