Skip to content

Commit

Permalink
Fix #206, updating sample_app to use new versioning system.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbaker committed Dec 26, 2023
1 parent 7ec0602 commit 1cb848e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
6 changes: 5 additions & 1 deletion fsw/src/sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ void SAMPLE_APP_Main(void)
int32 SAMPLE_APP_Init(void)
{
int32 status;
char VersionString[SAMPLE_APP_CFG_MAX_VERSION_STR_LEN];

/* Zero out the global data structure */
memset(&SAMPLE_APP_Data, 0, sizeof(SAMPLE_APP_Data));
Expand Down Expand Up @@ -191,8 +192,11 @@ int32 SAMPLE_APP_Init(void)
status = CFE_TBL_Load(SAMPLE_APP_Data.TblHandles[0], CFE_TBL_SRC_FILE, SAMPLE_APP_TABLE_FILE);
}

CFE_Config_GetVersionString(VersionString, SAMPLE_APP_CFG_MAX_VERSION_STR_LEN, "Sample App", SAMPLE_APP_BUILD_TYPE,
SAMPLE_APP_VERSION, SAMPLE_APP_BUILD_CODENAME, SAMPLE_APP_LAST_OFFICIAL);

CFE_EVS_SendEvent(SAMPLE_APP_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "Sample App Initialized.%s",
SAMPLE_APP_VERSION_STRING);
VersionString);
}

return status;
Expand Down
1 change: 1 addition & 0 deletions fsw/src/sample_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
** Required header files.
*/
#include "cfe.h"
#include "cfe_config.h"

#include "sample_app_mission_cfg.h"
#include "sample_app_platform_cfg.h"
Expand Down
27 changes: 17 additions & 10 deletions fsw/src/sample_app_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@

/* Development Build Macro Definitions */

#define SAMPLE_APP_BUILD_NUMBER 69 /*!< Development Build: Number of commits since baseline */
#define SAMPLE_APP_BUILD_BASELINE \
"v1.3.0-rc4" /*!< Development Build: git tag that is the base for the current development */
#define SAMPLE_APP_BUILD_NUMBER 69 /*!< Development Build: Number of commits since baseline */
#define SAMPLE_APP_BUILD_BASELINE "equuleus-rc1" /*!< Development Build: git tag that is the base for the current development */
#define SAMPLE_APP_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */
#define SAMPLE_APP_BUILD_TYPE "Development Build" /**< @brief: Development: Type of build (Development Build or Release) */
#define SAMPLE_APP_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */

/*
* Version Macros, see \ref cfsversions for definitions.
Expand All @@ -38,14 +40,19 @@
#define SAMPLE_APP_MINOR_VERSION 1 /*!< @brief Minor version number. */
#define SAMPLE_APP_REVISION 99 /*!< @brief Revision version number. Value of 99 indicates a development version.*/

/**
* @brief Last official release.
*/
#define SAMPLE_APP_LAST_OFFICIAL "v1.1.0"

/*!
* @brief Mission revision.
*
* Reserved for mission use to denote patches/customizations as needed.
* Values 1-254 are reserved for mission use to denote patches/customizations as needed. NOTE: Reserving 0 and 0xFF for
* cFS open-source development use (pending resolution of nasa/cFS#440)
*/
#define SAMPLE_APP_MISSION_REV 0xFF
#define SAMPLE_APP_MISSION_REV 0x00

#define SAMPLE_APP_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer macros */
#define SAMPLE_APP_STR(x) \
Expand All @@ -57,12 +64,12 @@
*/
#define SAMPLE_APP_VERSION SAMPLE_APP_BUILD_BASELINE "+dev" SAMPLE_APP_STR(SAMPLE_APP_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.
/**
* @brief Max Version String length.
*
* Maximum length that an OSAL version string can be.
*
*/
#define SAMPLE_APP_VERSION_STRING \
" Sample App DEVELOPMENT BUILD " SAMPLE_APP_VERSION \
", Last Official Release: v1.1.0" /* For full support please use this version */
#define SAMPLE_APP_CFG_MAX_VERSION_STR_LEN 256

#endif /* SAMPLE_APP_VERSION_H */

0 comments on commit 1cb848e

Please sign in to comment.