From dcdd0af11f70209e6e0c2344f95e18d2b4254161 Mon Sep 17 00:00:00 2001 From: Chris Knight Date: Fri, 26 Jun 2020 14:56:00 -0700 Subject: [PATCH 1/5] fix #47 - correct return type for TO_LAB_init() --- fsw/src/to_lab_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsw/src/to_lab_app.c b/fsw/src/to_lab_app.c index 1a5ec05..ca80b25 100644 --- a/fsw/src/to_lab_app.c +++ b/fsw/src/to_lab_app.c @@ -155,7 +155,7 @@ void TO_delete_callback(void) /* TO_init() -- TO initialization */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int TO_LAB_init(void) +int32 TO_LAB_init(void) { int32 status; char PipeName[16]; From ee44ea4cb9448764865a0310f12c7590b1722ac6 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 23 Jul 2020 09:28:28 -0400 Subject: [PATCH 2/5] Fix #50, Mark end of valid MsgId subscriptions --- CMakeLists.txt | 3 +++ fsw/src/to_lab_app.c | 9 ++++++++- fsw/tables/to_lab_sub.c | 6 +++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b83c57d..b73b656 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 2.6.4) project(CFS_TO_LAB C) +# Include source directory for table use +include_directories(fsw/src) + include_directories(fsw/mission_inc) include_directories(fsw/platform_inc) include_directories(${ci_lab_MISSION_DIR}/fsw/platform_inc) diff --git a/fsw/src/to_lab_app.c b/fsw/src/to_lab_app.c index 1a5ec05..c391837 100644 --- a/fsw/src/to_lab_app.c +++ b/fsw/src/to_lab_app.c @@ -227,9 +227,16 @@ int TO_LAB_init(void) /* Subscriptions for TLM pipe*/ for (i = 0; (i < (sizeof(TO_LAB_Subs->Subs) / sizeof(TO_LAB_Subs->Subs[0]))); i++) { - if (CFE_SB_IsValidMsgId(TO_LAB_Subs->Subs[i].Stream)) + if (CFE_SB_MsgIdToValue(TO_LAB_Subs->Subs[i].Stream) == TO_UNUSED) + { + /* Only process until MsgId TO_UNUSED is found*/ + break; + } + else if (CFE_SB_IsValidMsgId(TO_LAB_Subs->Subs[i].Stream)) + { status = CFE_SB_SubscribeEx(TO_LAB_Subs->Subs[i].Stream, TO_LAB_Global.Tlm_pipe, TO_LAB_Subs->Subs[i].Flags, TO_LAB_Subs->Subs[i].BufLimit); + } if (status != CFE_SUCCESS) CFE_EVS_SendEvent(TO_SUBSCRIBE_ERR_EID, CFE_EVS_EventType_ERROR, diff --git a/fsw/tables/to_lab_sub.c b/fsw/tables/to_lab_sub.c index 868ebd9..4b9b75f 100644 --- a/fsw/tables/to_lab_sub.c +++ b/fsw/tables/to_lab_sub.c @@ -30,6 +30,7 @@ #include "cfe_tbl_filedef.h" /* Required to obtain the CFE_TBL_FILEDEF macro definition */ #include "to_lab_sub_table.h" +#include "to_lab_app.h" /* ** Add the proper include file for the message IDs below @@ -86,7 +87,10 @@ TO_LAB_Subs_t TO_LAB_Subs = #endif {CFE_SB_MSGID_WRAP_VALUE(CFE_ES_APP_TLM_MID), {0, 0}, 4}, - {CFE_SB_MSGID_WRAP_VALUE(CFE_ES_MEMSTATS_TLM_MID), {0, 0}, 4} + {CFE_SB_MSGID_WRAP_VALUE(CFE_ES_MEMSTATS_TLM_MID), {0, 0}, 4}, + + /* TO_UNUSED entry to mark the end of valid MsgIds */ + {TO_UNUSED, {0, 0}, 0} } }; From 79981ffa5d49e1454e17ab06843b5acd327b38c8 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 29 Jul 2020 12:57:42 -0400 Subject: [PATCH 3/5] Fix #50, Use MsgId Equal API to compare --- fsw/src/to_lab_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsw/src/to_lab_app.c b/fsw/src/to_lab_app.c index c391837..0d25cec 100644 --- a/fsw/src/to_lab_app.c +++ b/fsw/src/to_lab_app.c @@ -227,7 +227,7 @@ int TO_LAB_init(void) /* Subscriptions for TLM pipe*/ for (i = 0; (i < (sizeof(TO_LAB_Subs->Subs) / sizeof(TO_LAB_Subs->Subs[0]))); i++) { - if (CFE_SB_MsgIdToValue(TO_LAB_Subs->Subs[i].Stream) == TO_UNUSED) + if (CFE_SB_MsgId_Equal(TO_LAB_Subs->Subs[i].Stream, TO_UNUSED)) { /* Only process until MsgId TO_UNUSED is found*/ break; From 3d71bcb55ab799373fe3526abd91f4de3db734bf Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Tue, 4 Aug 2020 14:29:29 -0400 Subject: [PATCH 4/5] Close #49, Add build number and baseline Reset version numbers to last release. Added build number and baseline macros. Added and using version string instead of number macros in reporting. --- fsw/src/to_lab_app.c | 3 +-- fsw/src/to_lab_version.h | 52 +++++++++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/fsw/src/to_lab_app.c b/fsw/src/to_lab_app.c index 21182ff..df30069 100644 --- a/fsw/src/to_lab_app.c +++ b/fsw/src/to_lab_app.c @@ -250,8 +250,7 @@ int32 TO_LAB_init(void) OS_TaskInstallDeleteHandler(&TO_delete_callback); CFE_EVS_SendEvent(TO_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, - "TO Lab Initialized. Version %d.%d.%d.%d Awaiting enable command.", TO_LAB_MAJOR_VERSION, - TO_LAB_MINOR_VERSION, TO_LAB_REVISION, TO_LAB_MISSION_REV); + "TO Lab Initialized.%s, Awaiting enable command.", TO_LAB_VERSION_STRING); return CFE_SUCCESS; } /* End of TO_LAB_init() */ diff --git a/fsw/src/to_lab_version.h b/fsw/src/to_lab_version.h index 55b9742..1ba322e 100644 --- a/fsw/src/to_lab_version.h +++ b/fsw/src/to_lab_version.h @@ -18,23 +18,47 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: to_lab_version.h -** -** Purpose: -** The TO Lab Application header file containing version number -** -** Notes: -** *************************************************************************/ -#ifndef _to_lab_version_h_ -#define _to_lab_version_h_ +#ifndef TO_LAB_VERSION_H +#define TO_LAB_VERSION_H + +/*! @file to_lab_version.h + * @brief Purpose: + * + * The TO Lab Application header file containing version information + * + */ + +/* Development Build Macro Definitions */ +#define TO_LAB_BUILD_NUMBER 43 /*!< Development Build: Number of commits since baseline */ +#define TO_LAB_BUILD_BASELINE "v2.3.0" /*!< Development Build: git tag that is the base for the current development */ + +/* Version Macro Definitions */ + +#define TO_LAB_MAJOR_VERSION 2 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */ +#define TO_LAB_MINOR_VERSION 3 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */ +#define TO_LAB_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. */ +#define TO_LAB_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */ + +#define TO_LAB_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer macros */ +#define TO_LAB_STR(x) TO_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 TO_LAB_VERSION TO_LAB_BUILD_BASELINE "+dev" TO_LAB_STR(TO_LAB_BUILD_NUMBER) -#define TO_LAB_MAJOR_VERSION 2 -#define TO_LAB_MINOR_VERSION 3 -#define TO_LAB_REVISION 7 -#define TO_LAB_MISSION_REV 0 +/*! @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 TO_LAB_VERSION_STRING \ + " TO Lab Development Build " \ + TO_LAB_VERSION \ + ", Last Official Release: v2.3.0" /* For full support please use this version */ -#endif /* _to_lab_version_h_ */ +#endif /* TO_LAB_VERSION_H */ /************************/ /* End of File Comment */ From a4d06c095f8ba45f5132d4c16f0cbad974190b23 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Wed, 5 Aug 2020 14:21:46 -0400 Subject: [PATCH 5/5] Increase version to v2.3.0+dev44 and update README Set "development build" part of version string to ALL CAPS for readability --- README.md | 7 +++++++ fsw/src/to_lab_version.h | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 53ed3cc..1b57a90 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,13 @@ To send telemtry to the "ground" or UDP/IP port, edit the subscription table in ## Version History +### Development Build: 2.3.0+dev45 + +- Fixes bug where an unset address values caused subscriptions to MsgId 0 over 200 times. Added a `TO_UNUSED` entry at the end of the subscription list and a break in the subscription loop when `TO_UNUSED` found. No more subscriptions on the unused table slots (no MsgId 0 subscriptions). +- Corrects return value of `TO_LAB_init()` to be `int32` instead of `int`. Declaration now matches definition, and app builds without errors. +- Add build number and baseline to version reporting. +- See + ### Development Build: 2.3.7 - Makes the `TO_LAB_Subs` table into a CFE_TBL-managed table. diff --git a/fsw/src/to_lab_version.h b/fsw/src/to_lab_version.h index 1ba322e..0831802 100644 --- a/fsw/src/to_lab_version.h +++ b/fsw/src/to_lab_version.h @@ -30,7 +30,7 @@ */ /* Development Build Macro Definitions */ -#define TO_LAB_BUILD_NUMBER 43 /*!< Development Build: Number of commits since baseline */ +#define TO_LAB_BUILD_NUMBER 44 /*!< Development Build: Number of commits since baseline */ #define TO_LAB_BUILD_BASELINE "v2.3.0" /*!< Development Build: git tag that is the base for the current development */ /* Version Macro Definitions */ @@ -54,7 +54,7 @@ * See @ref cfsversions for format differences between development and release versions. */ #define TO_LAB_VERSION_STRING \ - " TO Lab Development Build " \ + " TO Lab DEVELOPMENT BUILD " \ TO_LAB_VERSION \ ", Last Official Release: v2.3.0" /* For full support please use this version */