From c934a7198bcfa0a254a54a1d696bcebb77e57d95 Mon Sep 17 00:00:00 2001 From: astrogeco <59618057+astrogeco@users.noreply.github.com> Date: Sun, 9 Aug 2020 21:37:40 -0400 Subject: [PATCH] Close #51, Add buildnumber and baseline Add macros to include build number and baseline Add new macro for version string Modify startup message to report version string --- fsw/src/ci_lab_app.c | 6 +++-- fsw/src/ci_lab_version.h | 54 +++++++++++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/fsw/src/ci_lab_app.c b/fsw/src/ci_lab_app.c index b4bcecb..5504afc 100644 --- a/fsw/src/ci_lab_app.c +++ b/fsw/src/ci_lab_app.c @@ -203,8 +203,10 @@ void CI_LAB_TaskInit(void) CFE_SB_InitMsg(&CI_LAB_Global.HkBuffer.HkTlm, CI_LAB_HK_TLM_MID, CI_LAB_HK_TLM_LNGTH, true); - CFE_EVS_SendEvent(CI_LAB_STARTUP_INF_EID, CFE_EVS_EventType_INFORMATION, "CI Lab Initialized. Version %d.%d.%d.%d", - CI_LAB_MAJOR_VERSION, CI_LAB_MINOR_VERSION, CI_LAB_REVISION, CI_LAB_MISSION_REV); + CFE_EVS_SendEvent (CI_LAB_STARTUP_INF_EID, + CFE_EVS_EventType_INFORMATION, + "CI Lab Initialized.%s", + CI_LAB_VERSION_STRING); } /* End of CI_LAB_TaskInit() */ diff --git a/fsw/src/ci_lab_version.h b/fsw/src/ci_lab_version.h index 31e3178..42689ff 100644 --- a/fsw/src/ci_lab_version.h +++ b/fsw/src/ci_lab_version.h @@ -18,23 +18,49 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: ci_lab_version.h -** -** Purpose: -** The CI Lab Application header file containing version number -** -** Notes: -** *************************************************************************/ -#ifndef _ci_lab_version_h_ -#define _ci_lab_version_h_ -#define CI_LAB_MAJOR_VERSION 2 -#define CI_LAB_MINOR_VERSION 3 -#define CI_LAB_REVISION 5 -#define CI_LAB_MISSION_REV 0 +/*! @file ci_lab_version.h + * @brief Purpose: + * + * The CI Lab App header file containing version information + * + */ + +#ifndef CI_LAB_VERSION_H +#define CI_LAB_VERSION_H + +/* Development Build Macro Definitions */ + +#define CI_LAB_BUILD_NUMBER 35 /*!< Development Build: Number of commits since baseline */ +#define CI_LAB_BUILD_BASELINE "v2.3.0" /*!< Development Build: git tag that is the base for the current development */ + +/* Version Macro Definitions */ + +#define CI_LAB_MAJOR_VERSION 2 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */ +#define CI_LAB_MINOR_VERSION 3 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */ +#define CI_LAB_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. */ +#define CI_LAB_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */ + +#define CI_LAB_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer macros */ +#define CI_LAB_STR(x) CI_LAB_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer macros */ + +/*! @brief Development Build Version Number. + * @details Baseline git tag + Number of commits since baseline. @n + * See @ref cfsversions for format differences between development and release versions. + */ +#define CI_LAB_VERSION CI_LAB_BUILD_BASELINE "+dev" CI_LAB_STR(CI_LAB_BUILD_NUMBER) + +/*! @brief Development Build Version String. + * @details Reports the current development build's baseline, number, and name. Also includes a note about the latest official version. @n + * See @ref cfsversions for format differences between development and release versions. +*/ +#define CI_LAB_VERSION_STRING \ + " Sample App DEVELOPMENT BUILD " \ + CI_LAB_VERSION \ + ", Last Official Release: v1.1.0" /* For full support please use this version */ -#endif /* _ci_lab_version_h_ */ +#endif /* CI_LAB_VERSION_H */ /************************/ /* End of File Comment */