diff --git a/cmake/target/src/target_config.c b/cmake/target/src/target_config.c index 0b389f079..ebb6ed17e 100644 --- a/cmake/target/src/target_config.c +++ b/cmake/target/src/target_config.c @@ -36,7 +36,7 @@ #include "cfe_es.h" #include "cfe_time.h" #include "cfe_es_resetdata_typedef.h" -#include "cfe_version.h" /* for CFE_VERSION_STRING */ +#include "cfe_version.h" /* for CFE version information */ #include "osapi-version.h" /* for OS_VERSION_STRING */ #ifndef CFE_CPU_NAME_VALUE diff --git a/modules/config/fsw/src/cfe_config_get.c b/modules/config/fsw/src/cfe_config_get.c index 1c47f0bc2..b9fa88ec8 100644 --- a/modules/config/fsw/src/cfe_config_get.c +++ b/modules/config/fsw/src/cfe_config_get.c @@ -159,3 +159,16 @@ void CFE_Config_IterateAll(void *Arg, CFE_Config_Callback_t Callback) ++NamePtr; } } + +/*---------------------------------------------------------------- + * + * Defined per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ +void CFE_Config_GetVersionString(char *Buf, int Size, const char *Component, const char *BuildType, + const char *SrcVersion, const char *CodeName, const char *LastOffcRel) +{ + snprintf(Buf, Size, "%s %s %s (Codename %s), Last Official Release: %s %s)", + Component, BuildType, SrcVersion, CodeName, Component, LastOffcRel); +} diff --git a/modules/config/fsw/src/cfe_config_init.c b/modules/config/fsw/src/cfe_config_init.c index 19cde5248..a5c958c2d 100644 --- a/modules/config/fsw/src/cfe_config_init.c +++ b/modules/config/fsw/src/cfe_config_init.c @@ -170,6 +170,7 @@ void CFE_Config_SetupModuleVersions(CFE_ConfigName_t *ModuleListSet[], size_t Se void CFE_Config_SetupBasicBuildInfo(void) { const char *KeyVal; + char VersionString[256]; /* Global mission name */ CFE_Config_SetString(CFE_CONFIGID_MISSION_NAME, GLOBAL_CONFIGDATA.MissionName); @@ -184,7 +185,9 @@ void CFE_Config_SetupBasicBuildInfo(void) 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); + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); + CFE_Config_SetString(CFE_CONFIGID_CORE_VERSION_DESCRIPTION, VersionString); /* * Initialize values from the "target_config" CFE internal object diff --git a/modules/core_api/fsw/inc/cfe_config.h b/modules/core_api/fsw/inc/cfe_config.h index 7307c42e4..a51d852e9 100644 --- a/modules/core_api/fsw/inc/cfe_config.h +++ b/modules/core_api/fsw/inc/cfe_config.h @@ -119,4 +119,31 @@ CFE_ConfigId_t CFE_Config_GetIdByName(const char *Name); */ void CFE_Config_IterateAll(void *Arg, CFE_Config_Callback_t Callback); +/** + * @brief Obtain the version string for a cFS component or app + * + * Assembles a standardized version string associated with the specified + * component/app. + * + * 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] Buf Buffer to place version string in. Will be populated + * with standard version string containing the provided + parameters (i.e.: + * "cFE DEVELOPMENT BUILD equuleus-rc1+dev0 (Codename + equueleus), Last Official Release: cFE 6.7.0" + * @param[in] Size Size of the provided buffer + * @param[in] Component Component for which to get version string + * (i.e. "cFE") + * @param[in] BuildType Type of build (i.e. "DEVELOPMENT BUILD") + * @param[in] SrcVersion Source version identifier (i.e. "equuleus-rc1+dev0") + * @param[in] CodeName Code name for the build (i.e. "equuleus") + * @param[in] LastOffcRel Last official release (i.e. "6.7.0") + */ +void CFE_Config_GetVersionString(char *Buf, int Size, + const char *Component, const char *BuildType, const char *SrcVersion, + const char *CodeName, const char *LastOffcRel); + #endif /* CFE_CONFIG_H */ diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 584b8d417..862388ae2 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,8 +26,9 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 405 /**< @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 */ +#define CFE_BUILD_NUMBER 405 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_BASELINE "equuleus-rc1" /**< @brief Development: Reference git tag for build number */ +#define CFE_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */ /* See \ref cfsversions for definitions */ #define CFE_MAJOR_VERSION 6 /*!< @brief Major version number */ @@ -41,7 +42,7 @@ * cFS open-source development use (pending resolution of nasa/cFS#440) * */ -#define CFE_MISSION_REV 0xFF +#define CFE_MISSION_REV 0x00 #define CFE_STR_HELPER(x) #x /**< @brief Convert argument to string */ #define CFE_STR(x) CFE_STR_HELPER(x) /**< @brief Expand macro before conversion */ @@ -54,13 +55,4 @@ */ #define CFE_SRC_VERSION CFE_BUILD_BASELINE "+dev" CFE_STR(CFE_BUILD_NUMBER) -/** - * @brief Long Build Version String - * - * Long freeform string identifying the build, see @ref cfsversions for suggested format for development - * and official releases. - */ -#define CFE_VERSION_STRING \ - " cFE DEVELOPMENT BUILD " CFE_SRC_VERSION " (Codename: Draco), Last Official Release: cfe v6.7.0" - #endif /* CFE_VERSION_H */ diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index a862ffabf..b53e64fb5 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -277,6 +277,7 @@ int32 CFE_ES_TaskInit(void) uint32 SizeofCfeSegment; cpuaddr CfeSegmentAddr; uint8 VersionNumber[4]; + char VersionString[256]; /* ** Initialize task command execution counters @@ -394,8 +395,10 @@ int32 CFE_ES_TaskInit(void) /* ** Task startup event message. */ + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); Status = CFE_EVS_SendEvent(CFE_ES_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "cFE ES Initialized: %s", - CFE_VERSION_STRING); + VersionString); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("%s: Error sending init event:RC=0x%08X\n", __func__, (unsigned int)Status); diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index 01352f49d..cc8a9d238 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -260,6 +260,7 @@ int32 CFE_EVS_TaskInit(void) { int32 Status; CFE_ES_AppId_t AppID; + char VersionString[256]; /* Query and verify the AppID */ Status = CFE_ES_GetAppID(&AppID); @@ -302,7 +303,9 @@ int32 CFE_EVS_TaskInit(void) /* Write the AppID to the global location, now that the rest of initialization is done */ CFE_EVS_Global.EVS_AppID = AppID; - EVS_SendEvent(CFE_EVS_STARTUP_EID, CFE_EVS_EventType_INFORMATION, "cFE EVS Initialized: %s", CFE_VERSION_STRING); + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); + EVS_SendEvent(CFE_EVS_STARTUP_EID, CFE_EVS_EventType_INFORMATION, "cFE EVS Initialized: %s", VersionString); return CFE_SUCCESS; } @@ -315,7 +318,10 @@ int32 CFE_EVS_TaskInit(void) *-----------------------------------------------------------------*/ int32 CFE_EVS_NoopCmd(const CFE_EVS_NoopCmd_t *data) { - EVS_SendEvent(CFE_EVS_NOOP_EID, CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd: %s", CFE_VERSION_STRING); + char VersionString[256]; + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); + EVS_SendEvent(CFE_EVS_NOOP_EID, CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd: %s", VersionString); return CFE_SUCCESS; } diff --git a/modules/sb/fsw/src/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c index 2f99e48f0..fbfce37ab 100644 --- a/modules/sb/fsw/src/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -119,6 +119,7 @@ int32 CFE_SB_AppInit(void) uint32 CfgFileEventsToFilter = 0; CFE_ES_MemPoolBuf_t TmpPtr; int32 Status; + char VersionString[256]; /* Get the assigned Application ID for the SB Task */ CFE_ES_GetAppID(&CFE_SB_Global.AppId); @@ -266,8 +267,10 @@ int32 CFE_SB_AppInit(void) return Status; } + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); Status = - CFE_EVS_SendEvent(CFE_SB_INIT_EID, CFE_EVS_EventType_INFORMATION, "cFE SB Initialized: %s", CFE_VERSION_STRING); + CFE_EVS_SendEvent(CFE_SB_INIT_EID, CFE_EVS_EventType_INFORMATION, "cFE SB Initialized: %s", VersionString); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("%s: Error sending init event:RC=0x%08X\n", __func__, (unsigned int)Status); @@ -285,7 +288,10 @@ int32 CFE_SB_AppInit(void) *-----------------------------------------------------------------*/ int32 CFE_SB_NoopCmd(const CFE_SB_NoopCmd_t *data) { - CFE_EVS_SendEvent(CFE_SB_CMD0_RCVD_EID, CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd: %s", CFE_VERSION_STRING); + char VersionString[256]; + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); + CFE_EVS_SendEvent(CFE_SB_CMD0_RCVD_EID, CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd: %s", VersionString); CFE_SB_Global.HKTlmMsg.Payload.CommandCounter++; return CFE_SUCCESS; diff --git a/modules/tbl/fsw/src/cfe_tbl_task.c b/modules/tbl/fsw/src/cfe_tbl_task.c index fa055b8f2..93b448dae 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.c +++ b/modules/tbl/fsw/src/cfe_tbl_task.c @@ -110,6 +110,7 @@ void CFE_TBL_TaskMain(void) int32 CFE_TBL_TaskInit(void) { int32 Status; + char VersionString[256]; /* ** Initialize global Table Services data @@ -162,8 +163,10 @@ int32 CFE_TBL_TaskInit(void) /* ** Task startup event message */ + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); Status = CFE_EVS_SendEvent(CFE_TBL_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "cFE TBL Initialized: %s", - CFE_VERSION_STRING); + VersionString); if (Status != CFE_SUCCESS) { diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c index 3f4ef27c9..aa7adf5c8 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -310,8 +310,11 @@ void CFE_TBL_GetTblRegData(void) *-----------------------------------------------------------------*/ int32 CFE_TBL_NoopCmd(const CFE_TBL_NoopCmd_t *data) { + char VersionString[256]; /* Acknowledge receipt of NOOP with Event Message */ - CFE_EVS_SendEvent(CFE_TBL_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd: %s", CFE_VERSION_STRING); + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); + CFE_EVS_SendEvent(CFE_TBL_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd: %s", VersionString); return CFE_TBL_INC_CMD_CTR; } diff --git a/modules/time/fsw/src/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c index f392e6627..19b0bccc6 100644 --- a/modules/time/fsw/src/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -127,6 +127,7 @@ int32 CFE_TIME_TaskInit(void) int32 OsStatus; osal_id_t TimeBaseId; osal_id_t TimerId; + char VersionString[256]; Status = CFE_EVS_Register(NULL, 0, 0); if (Status != CFE_SUCCESS) @@ -258,9 +259,11 @@ int32 CFE_TIME_TaskInit(void) CFE_ES_WriteToSysLog("%s: Error subscribing to time task gnd cmds:RC=0x%08X\n", __func__, (unsigned int)Status); return Status; } - + + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); Status = CFE_EVS_SendEvent(CFE_TIME_INIT_EID, CFE_EVS_EventType_INFORMATION, "cFE TIME Initialized: %s", - CFE_VERSION_STRING); + VersionString); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("%s: Error sending init event:RC=0x%08X\n", __func__, (unsigned int)Status); @@ -443,9 +446,13 @@ int32 CFE_TIME_ToneSendCmd(const CFE_TIME_FakeToneCmd_t *data) *-----------------------------------------------------------------*/ int32 CFE_TIME_NoopCmd(const CFE_TIME_NoopCmd_t *data) { + char VersionString[256]; + CFE_TIME_Global.CommandCounter++; - CFE_EVS_SendEvent(CFE_TIME_NOOP_EID, CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd: %s", CFE_VERSION_STRING); + CFE_Config_GetVersionString(VersionString, "cFE", "DEVELOPMENT BUILD", + CFE_SRC_VERSION, "Equuleus", "v6.7.0"); + CFE_EVS_SendEvent(CFE_TIME_NOOP_EID, CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd: %s", VersionString); return CFE_SUCCESS; }