Skip to content

Commit

Permalink
Fix nasa#79, updating tblCRCTool to use new versioning system.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbaker committed Dec 27, 2023
1 parent 0d2eda4 commit ab41166
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
8 changes: 7 additions & 1 deletion cfe_ts_crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

#include "cfe_ts_crc_version.h"

#include "cfe_version.h"

/* These headers are needed for CFE_FS_Header_t and CFE_TBL_File_Hdr_t, respectively.
* This uses the OSAL definition of fixed-width types, even thought this tool
* is not using OSAL itself.
Expand Down Expand Up @@ -108,11 +110,15 @@ int main(int argc, char **argv)
int fd;
char buffer[100];
off_t offsetReturn = 0;
char VersionString[CFE_TS_CRC_CFG_MAX_VERSION_STR_LEN];

/* check for valid input */
if ((argc != 2) || (strncmp(argv[1], "--help", 100) == 0))
{
printf("%s\n", CFE_TS_CRC_VERSION_STRING);
CFE_Config_GetVersionString(VersionString, CFE_TS_CRC_CFG_MAX_VERSION_STR_LEN, "tblCRCTool",
CFE_TS_CRC_BUILD_TYPE, CFE_TS_CRC_VERSION, CFE_TS_CRC_BUILD_CODENAME,
CFE_TS_CRC_LAST_OFFICIAL);
printf("%s\n", VersionString);
printf("\nUsage: cfe_ts_crc [filename]\n");
exit(EXIT_FAILURE);
}
Expand Down
29 changes: 17 additions & 12 deletions cfe_ts_crc_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
/*
* Development Build Macro Definitions
*/
#define CFE_TS_CRC_BUILD_NUMBER 28 /*!< @brief Number of commits since baseline */
#define CFE_TS_CRC_BUILD_BASELINE \
"v1.3.0-rc4+dev" /*!< @brief Development Build: git tag that is the base for the current */
#define CFE_TS_CRC_BUILD_NUMBER 28 /*!< @brief Number of commits since baseline */
#define CFE_TS_CRC_BUILD_BASELINE "equuleus-rc1" /*!< @brief Development Build: git tag that is the base for the current */
#define CFE_TS_CRC_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */
#define CFE_TS_CRC_BUILD_TYPE "Development Build" /**< @brief: Development: Type of build (Development Build or Release) */
#define CFE_TS_CRC_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */

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

/**
* @brief Last official release.
*/
#define CFE_TS_CRC_LAST_OFFICIAL "v3.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 CFE_TS_CRC_MISSION_REV 0xFF
#define CFE_TS_CRC_MISSION_REV 0x00

/*
* Tools to construct version string
Expand All @@ -62,14 +69,12 @@
*/
#define CFE_TS_CRC_VERSION CFE_TS_CRC_BUILD_BASELINE CFE_TS_CRC_STR(CFE_TS_CRC_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 a tblCRCTool version string can be.
*
*/
#define CFE_TS_CRC_VERSION_STRING \
" cFE TS CRC calculator (tblCRCtool) \n" \
" DEVELOPMENT BUILD \n" \
" " CFE_TS_CRC_VERSION " \n" \
" Last Official Release: tblCRCtool v3.1.0" /* For full support please use official release version */
#define CFE_TS_CRC_CFG_MAX_VERSION_STR_LEN 256

#endif /* CFE_TS_CRC_VERSION_H */

0 comments on commit ab41166

Please sign in to comment.