diff --git a/fsw/src/sample_app.c b/fsw/src/sample_app.c index b8dd1ae..ce6bab1 100644 --- a/fsw/src/sample_app.c +++ b/fsw/src/sample_app.c @@ -174,7 +174,7 @@ int32 SAMPLE_AppInit( void ) /* ** Initialize housekeeping packet (clear user data area). */ - CFE_SB_InitMsg(&SAMPLE_AppData.HkBuf, + CFE_SB_InitMsg(&SAMPLE_AppData.HkBuf.MsgHdr, SAMPLE_APP_HK_TLM_MID, sizeof(SAMPLE_AppData.HkBuf), true); @@ -356,14 +356,14 @@ int32 SAMPLE_ReportHousekeeping( const CCSDS_CommandPacket_t *Msg ) /* ** Get command execution counters... */ - SAMPLE_AppData.HkBuf.Payload.CommandErrorCounter = SAMPLE_AppData.ErrCounter; - SAMPLE_AppData.HkBuf.Payload.CommandCounter = SAMPLE_AppData.CmdCounter; + SAMPLE_AppData.HkBuf.HkTlm.Payload.CommandErrorCounter = SAMPLE_AppData.ErrCounter; + SAMPLE_AppData.HkBuf.HkTlm.Payload.CommandCounter = SAMPLE_AppData.CmdCounter; /* ** Send housekeeping telemetry packet... */ - CFE_SB_TimeStampMsg(&SAMPLE_AppData.HkBuf); - CFE_SB_SendMsg(&SAMPLE_AppData.HkBuf); + CFE_SB_TimeStampMsg(&SAMPLE_AppData.HkBuf.MsgHdr); + CFE_SB_SendMsg(&SAMPLE_AppData.HkBuf.MsgHdr); /* ** Manage any pending table loads, validations, etc. diff --git a/fsw/src/sample_app.h b/fsw/src/sample_app.h index 18a0f56..a7c2c47 100644 --- a/fsw/src/sample_app.h +++ b/fsw/src/sample_app.h @@ -56,6 +56,17 @@ /************************************************************************ ** Type Definitions *************************************************************************/ + +/* + * Buffer to hold telemetry data prior to sending + * Defined as a union to ensure proper alignment for a CFE_SB_Msg_t type + */ +typedef union +{ + CFE_SB_Msg_t MsgHdr; + SAMPLE_HkTlm_t HkTlm; +} SAMPLE_HkBuffer_t; + /* ** Global Data */ @@ -70,7 +81,7 @@ typedef struct /* ** Housekeeping telemetry packet... */ - SAMPLE_HkTlm_t HkBuf; + SAMPLE_HkBuffer_t HkBuf; /* ** Run Status variable used in the main processing loop