From ab534a7fbed653cc265f2ef5e18dafc646a2654d Mon Sep 17 00:00:00 2001 From: astrogeco <59618057+astrogeco@users.noreply.github.com> Date: Sun, 9 Aug 2020 21:47:27 -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 Add change to readme --- README.md | 9 +++++-- fsw/src/ci_lab_app.c | 6 +++-- fsw/src/ci_lab_version.h | 53 +++++++++++++++++++++++++++++----------- 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 7b0c63a..13afd07 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,15 @@ ci_lab is a simple command uplink application that accepts CCSDS telecommand pac ## Version History +### Development Build: 2.3.0+dev36 + +- Add build name and build number to version reporting +- See + ### Development Build: 2.3.5 -- Replace references to `ccsds.h` types with the `cfe_sb.h`-provided type. -- See +- Replace references to `ccsds.h` types with the `cfe_sb.h`-provided type. +- See ### Development Build: 2.3.4 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..e580164 100644 --- a/fsw/src/ci_lab_version.h +++ b/fsw/src/ci_lab_version.h @@ -18,23 +18,48 @@ ** 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 36 /*!< 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 \ + " CI Lab App DEVELOPMENT BUILD " CI_LAB_VERSION \ + ", Last Official Release: v2.3.0" /* For full support please use this version */ -#endif /* _ci_lab_version_h_ */ +#endif /* CI_LAB_VERSION_H */ /************************/ /* End of File Comment */