From 4e2847ed3cef1990385e040bf53b07fd9980a567 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 27 Apr 2020 16:29:39 -0400 Subject: [PATCH 1/4] Fix #60, incorrect conversion specifier Corrects a format mismatch warning on some platforms. --- unit-test/coveragetest/coveragetest_sample_app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unit-test/coveragetest/coveragetest_sample_app.c b/unit-test/coveragetest/coveragetest_sample_app.c index b7a53a6..b97bad7 100644 --- a/unit-test/coveragetest/coveragetest_sample_app.c +++ b/unit-test/coveragetest/coveragetest_sample_app.c @@ -150,8 +150,8 @@ void Test_SAMPLE_AppMain(void) * log will show what the incorrect value was. */ UtAssert_True(SAMPLE_AppData.RunStatus == CFE_ES_RunStatus_APP_ERROR, - "SAMPLE_AppData.RunStatus (%d) == CFE_ES_RunStatus_APP_ERROR", - SAMPLE_AppData.RunStatus); + "SAMPLE_AppData.RunStatus (%lu) == CFE_ES_RunStatus_APP_ERROR", + (unsigned long)SAMPLE_AppData.RunStatus); /* From e69130422c872a2889ef0a52787820fb092e0277 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 8 Jan 2020 15:14:37 -0500 Subject: [PATCH 2/4] Fix #53, Opaque CFE_SB_MsgId_t values Do not assume CFE_SB_MsgId_t is implicitly integral in nature. When an integer value is required for printing or backward compatibility, use the explicit conversion routine to get this. --- fsw/src/sample_app.c | 4 ++-- unit-test/coveragetest/coveragetest_sample_app.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fsw/src/sample_app.c b/fsw/src/sample_app.c index 82e51e1..1686c5d 100644 --- a/fsw/src/sample_app.c +++ b/fsw/src/sample_app.c @@ -278,7 +278,7 @@ void SAMPLE_ProcessCommandPacket( CFE_SB_MsgPtr_t Msg ) CFE_EVS_SendEvent(SAMPLE_INVALID_MSGID_ERR_EID, CFE_EVS_EventType_ERROR, "SAMPLE: invalid command packet,MID = 0x%x", - MsgId); + (unsigned int)CFE_SB_MsgIdToValue(MsgId)); break; } @@ -488,7 +488,7 @@ bool SAMPLE_VerifyCmdLength( CFE_SB_MsgPtr_t Msg, uint16 ExpectedLength ) CFE_EVS_SendEvent(SAMPLE_LEN_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid Msg length: ID = 0x%X, CC = %d, Len = %d, Expected = %d", - MessageID, + (unsigned int)CFE_SB_MsgIdToValue(MessageID), CommandCode, ActualLength, ExpectedLength); diff --git a/unit-test/coveragetest/coveragetest_sample_app.c b/unit-test/coveragetest/coveragetest_sample_app.c index b7a53a6..7e094ab 100644 --- a/unit-test/coveragetest/coveragetest_sample_app.c +++ b/unit-test/coveragetest/coveragetest_sample_app.c @@ -275,7 +275,7 @@ void Test_SAMPLE_ProcessCommandPacket(void) SAMPLE_ProcessCommandPacket(&TestMsg.Base); /* invalid message id */ - TestMsgId = 0; + TestMsgId = CFE_SB_INVALID_MSG_ID; UT_SetDataBuffer(UT_KEY(CFE_SB_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); SAMPLE_ProcessCommandPacket(&TestMsg.Base); From 155a3e70596c59d09d334c63990dbdf930d588d8 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 11 May 2020 12:36:11 -0400 Subject: [PATCH 3/4] Fix #64, add CFE_SB_InitMsg() for housekeeping UT (HOTFIX) The FSW code relies on the message being pre-initalized which needs to be done explicitly in unit test code. --- unit-test/coveragetest/coveragetest_sample_app.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/unit-test/coveragetest/coveragetest_sample_app.c b/unit-test/coveragetest/coveragetest_sample_app.c index 46675e8..81cd5fc 100644 --- a/unit-test/coveragetest/coveragetest_sample_app.c +++ b/unit-test/coveragetest/coveragetest_sample_app.c @@ -375,6 +375,18 @@ void Test_SAMPLE_ReportHousekeeping(void) SAMPLE_AppData.CmdCounter = 22; SAMPLE_AppData.ErrCounter = 11; + /* + * CFE_SB_InitMsg() needs to be done to set the emulated MsgId and Length. + * + * The FSW code only does this once during init and relies on it + * remaining during the SAMPLE_ReportHousekeeping(). This does + * not happen during UT so it must be initialized again here. + */ + CFE_SB_InitMsg(&SAMPLE_AppData.HkBuf.MsgHdr, + SAMPLE_APP_HK_TLM_MID, + sizeof(SAMPLE_AppData.HkBuf), + true); + /* * Set up to "capture" the telemetry message */ From 6c3972be270efa336e3549ef3b444e33318d354c Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Wed, 13 May 2020 10:22:13 -0400 Subject: [PATCH 4/4] Increase version to 1.1.9. Update Readme and tidyup whitespace using Tidy-Markdown --- README.md | 62 ++++++++++++++++++++++-------------- fsw/src/sample_app_version.h | 2 +- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 4c9a568..30eefc8 100644 --- a/README.md +++ b/README.md @@ -2,56 +2,70 @@ This repository contains a sample application (sample_app), which is a framework component of the Core Flight System. -This sample application is a non-flight example application implementation for the cFS Bundle. It is intended to be located in the `apps/sample_app` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at https://github.com/nasa/cFS (which includes sample_app as a submodule), which includes build and execution instructions. +This sample application is a non-flight example application implementation for the cFS Bundle. It is intended to be located in the `apps/sample_app` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at (which includes sample_app as a submodule), which includes build and execution instructions. -sample_app is an example for how to build and link an application in cFS. See also the skeleton_app (https://github.com/nasa/skeleton_app) if you are looking for a bare-bones application to which to add your business logic. +sample_app is an example for how to build and link an application in cFS. See also the skeleton_app () if you are looking for a bare-bones application to which to add your business logic. ## Version History -#### Development Build: 1.1.8 +### Development Build: 1.1.9 + +- Applies the CFE_SB_MsgIdToValue() and CFE_SB_ValueToMsgId() routines where compatibility with an integer MsgId is necessary - syslog prints, events, compile-time MID #define values. +- No more format conversion error in RTEMS build +- See + +### Development Build: 1.1.8 + - Coverage data from make lcov includes the sample_app code -- See https://github.com/nasa/sample_app/pull/62 +- See + +### Development Build: 1.1.7 -#### Development Build: 1.1.7 - Fix bug where table is not released after being used -- Minor updates (see https://github.com/nasa/sample_app/pull/52) +- Minor updates (see ) + +### Development Build: 1.1.6 -#### Development Build: 1.1.6 -- Minor updates (see https://github.com/nasa/sample_app/pull/49) +- Minor updates (see ) + +### Development Build: 1.1.5 -#### Development Build: 1.1.5 - Fix to build on RASPBIAN OS -- Minor updates (see https://github.com/nasa/sample_app/pull/47) +- Minor updates (see ) + +### Development Build: 1.1.4 -#### Development Build: 1.1.4 - Fix for a clean build with OMIT_DEPRECATED -- Minor updates (see https://github.com/nasa/sample_app/pull/44) +- Minor updates (see ) + +### Development Build: 1.1.3 + +- Minor updates (see ) + +### Development Build: 1.1.2 -#### Development Build: 1.1.3 -- Minor updates (see https://github.com/nasa/sample_app/pull/34) +- Minor updates (see ) -#### Development Build: 1.1.2 -- Minor updates (see https://github.com/nasa/sample_app/pull/20) +### Development Build: 1.1.1 -#### Development Build: 1.1.1 -- Minor updates (see https://github.com/nasa/sample_app/pull/15) +- Minor updates (see ) -### ***OFFICIAL RELEASE: 1.1.0*** +### _**OFFICIAL RELEASE: 1.1.0**_ -- Minor updates (see https://github.com/nasa/sample_app/pull/11) +- Minor updates (see ) - Not backwards compatible with OSAL 4.2.1 - Released as part of cFE 6.7.0, Apache 2.0 -### ***OFFICIAL RELEASE: 1.0.0a*** +### _**OFFICIAL RELEASE: 1.0.0a**_ - Released as part of cFE 6.6.0a, Apache 2.0 ## Known issues -As a sample application, extensive testing is not performed prior to release and only minimal functionality is included. Note discrepancies likely exist between this application and the example detailed in the application developer guide. +As a sample application, extensive testing is not performed prior to release and only minimal functionality is included. Note discrepancies likely exist between this application and the example detailed in the application developer guide. ## Getting Help -For best results, submit issues:questions or issues:help wanted requests at https://github.com/nasa/cFS. +For best results, submit issues:questions or issues:help wanted requests at . -Official cFS page: http://cfs.gsfc.nasa.gov +Official cFS page: diff --git a/fsw/src/sample_app_version.h b/fsw/src/sample_app_version.h index 8f4ccc9..5fdc40f 100644 --- a/fsw/src/sample_app_version.h +++ b/fsw/src/sample_app_version.h @@ -33,7 +33,7 @@ #define SAMPLE_APP_MAJOR_VERSION 1 #define SAMPLE_APP_MINOR_VERSION 1 -#define SAMPLE_APP_REVISION 8 +#define SAMPLE_APP_REVISION 9 #define SAMPLE_APP_MISSION_REV 0