File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ int32 SAMPLE_AppInit( void )
174174 /*
175175 ** Initialize housekeeping packet (clear user data area).
176176 */
177- CFE_SB_InitMsg (& SAMPLE_AppData .HkBuf ,
177+ CFE_SB_InitMsg (& SAMPLE_AppData .HkBuf . MsgHdr ,
178178 SAMPLE_APP_HK_TLM_MID ,
179179 sizeof (SAMPLE_AppData .HkBuf ),
180180 true);
@@ -356,14 +356,14 @@ int32 SAMPLE_ReportHousekeeping( const CCSDS_CommandPacket_t *Msg )
356356 /*
357357 ** Get command execution counters...
358358 */
359- SAMPLE_AppData .HkBuf .Payload .CommandErrorCounter = SAMPLE_AppData .ErrCounter ;
360- SAMPLE_AppData .HkBuf .Payload .CommandCounter = SAMPLE_AppData .CmdCounter ;
359+ SAMPLE_AppData .HkBuf .HkTlm . Payload .CommandErrorCounter = SAMPLE_AppData .ErrCounter ;
360+ SAMPLE_AppData .HkBuf .HkTlm . Payload .CommandCounter = SAMPLE_AppData .CmdCounter ;
361361
362362 /*
363363 ** Send housekeeping telemetry packet...
364364 */
365- CFE_SB_TimeStampMsg (& SAMPLE_AppData .HkBuf );
366- CFE_SB_SendMsg (& SAMPLE_AppData .HkBuf );
365+ CFE_SB_TimeStampMsg (& SAMPLE_AppData .HkBuf . MsgHdr );
366+ CFE_SB_SendMsg (& SAMPLE_AppData .HkBuf . MsgHdr );
367367
368368 /*
369369 ** Manage any pending table loads, validations, etc.
Original file line number Diff line number Diff line change 5656/************************************************************************
5757** Type Definitions
5858*************************************************************************/
59+
60+ /*
61+ * Buffer to hold telemetry data prior to sending
62+ * Defined as a union to ensure proper alignment for a CFE_SB_Msg_t type
63+ */
64+ typedef union
65+ {
66+ CFE_SB_Msg_t MsgHdr ;
67+ SAMPLE_HkTlm_t HkTlm ;
68+ } SAMPLE_HkBuffer_t ;
69+
5970/*
6071** Global Data
6172*/
@@ -70,7 +81,7 @@ typedef struct
7081 /*
7182 ** Housekeeping telemetry packet...
7283 */
73- SAMPLE_HkTlm_t HkBuf ;
84+ SAMPLE_HkBuffer_t HkBuf ;
7485
7586 /*
7687 ** Run Status variable used in the main processing loop
You can’t perform that action at this time.
0 commit comments