From 1b5ed8a64a7f4a5325cc47e824d7a9bd18342975 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 30 Nov 2020 08:57:50 -0500 Subject: [PATCH 1/2] Fix #56, Apply message alignment pattern - Use CFE_MSG_CommandHeader_t and CFE_MSG_TelemetryHeader_t in command and telemetry type definitions - Use CFE_SB_TransmitMsg to copy the command and telemetry into a CFE_SB_Buffer_t and send it where needed - Avoids need to create send buffers within the app (or union the packet types with CFE_SB_Buffer_t) - Eliminates references to CFE_SB_CmdHdr_t and CFE_SB_TlmHdr_t that formerly enforced alignment since these had potential to change the actual packet sizes --- fsw/src/sch_lab_app.c | 18 ++++++++---------- fsw/src/sch_lab_version.h | 3 ++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/fsw/src/sch_lab_app.c b/fsw/src/sch_lab_app.c index adf005d..ea311a4 100644 --- a/fsw/src/sch_lab_app.c +++ b/fsw/src/sch_lab_app.c @@ -51,19 +51,16 @@ */ typedef struct { - CFE_SB_CmdHdr_t CmdBuf; - uint32 PacketRate; - uint32 Counter; + CFE_MSG_CommandHeader_t CmdHeader; + uint32 PacketRate; + uint32 Counter; } SCH_LAB_StateEntry_t; typedef struct { SCH_LAB_StateEntry_t State[SCH_LAB_MAX_SCHEDULE_ENTRIES]; CFE_TBL_Handle_t TblHandle; - - CFE_MSG_Message_t *CmdPipePktPtr; - CFE_SB_PipeId_t CmdPipe; - + CFE_SB_PipeId_t CmdPipe; } SCH_LAB_GlobalData_t; /* @@ -86,6 +83,7 @@ void SCH_Lab_AppMain(void) uint32 Status = CFE_SUCCESS; uint32 RunStatus = CFE_ES_RunStatus_APP_RUN; SCH_LAB_StateEntry_t *LocalStateEntry; + CFE_SB_Buffer_t * SBBufPtr; CFE_ES_PerfLogEntry(SCH_MAIN_TASK_PERF_ID); @@ -103,7 +101,7 @@ void SCH_Lab_AppMain(void) CFE_ES_PerfLogExit(SCH_MAIN_TASK_PERF_ID); /* Pend on receipt of 1Hz packet */ - Status = CFE_SB_RcvMsg(&SCH_LAB_Global.CmdPipePktPtr, SCH_LAB_Global.CmdPipe, CFE_SB_PEND_FOREVER); + Status = CFE_SB_ReceiveBuffer(&SBBufPtr, SCH_LAB_Global.CmdPipe, CFE_SB_PEND_FOREVER); CFE_ES_PerfLogEntry(SCH_MAIN_TASK_PERF_ID); @@ -122,7 +120,7 @@ void SCH_Lab_AppMain(void) if (LocalStateEntry->Counter >= LocalStateEntry->PacketRate) { LocalStateEntry->Counter = 0; - CFE_SB_SendMsg(&LocalStateEntry->CmdBuf.BaseMsg); + CFE_SB_TransmitMsg(&LocalStateEntry->CmdHeader.Msg, false); } } ++LocalStateEntry; @@ -198,7 +196,7 @@ int32 SCH_LAB_AppInit(void) { if (ConfigEntry->PacketRate != 0) { - CFE_MSG_Init(&LocalStateEntry->CmdBuf.BaseMsg, ConfigEntry->MessageID, sizeof(LocalStateEntry->CmdBuf)); + CFE_MSG_Init(&LocalStateEntry->CmdHeader.Msg, ConfigEntry->MessageID, sizeof(LocalStateEntry->CmdHeader)); LocalStateEntry->PacketRate = ConfigEntry->PacketRate; } ++ConfigEntry; diff --git a/fsw/src/sch_lab_version.h b/fsw/src/sch_lab_version.h index 42e2ef0..4b7db82 100644 --- a/fsw/src/sch_lab_version.h +++ b/fsw/src/sch_lab_version.h @@ -31,7 +31,8 @@ /* Development Build Macro Definitions */ #define SCH_LAB_BUILD_NUMBER 9 /*!< Development Build: Number of commits since baseline */ -#define SCH_LAB_BUILD_BASELINE "v2.4.0-rc1" /*!< Development Build: git tag that is the base for the current development */ +#define SCH_LAB_BUILD_BASELINE \ + "v2.4.0-rc1" /*!< Development Build: git tag that is the base for the current development */ /* Version Macro Definitions */ From 268336817445dd9b96d773db0a245f519db1509a Mon Sep 17 00:00:00 2001 From: astrogeco <59618057+astrogeco@users.noreply.github.com> Date: Wed, 9 Dec 2020 15:41:46 -0500 Subject: [PATCH 2/2] Bump to v2.4.0-rc1+dev12 --- README.md | 6 ++++++ fsw/src/sch_lab_version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 765bb71..7433d10 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ To change the list of packets that sch_lab sends out, edit the schedule table lo ## Version History + +### Development Build: 2.4.0-rc1+dev12 + +- Aligns messages according to changes in cFE . Uses the "raw" message cmd/tlm types in definition +- See + ### Development Build: 2.4.0-rc1+dev9 - Update to use MSG module. Replaces deprecated SB APIs with MSG diff --git a/fsw/src/sch_lab_version.h b/fsw/src/sch_lab_version.h index 4b7db82..ce2b808 100644 --- a/fsw/src/sch_lab_version.h +++ b/fsw/src/sch_lab_version.h @@ -30,7 +30,7 @@ */ /* Development Build Macro Definitions */ -#define SCH_LAB_BUILD_NUMBER 9 /*!< Development Build: Number of commits since baseline */ +#define SCH_LAB_BUILD_NUMBER 12 /*!< Development Build: Number of commits since baseline */ #define SCH_LAB_BUILD_BASELINE \ "v2.4.0-rc1" /*!< Development Build: git tag that is the base for the current development */