Skip to content

Commit

Permalink
Fix #689, Align all SB message definitions
Browse files Browse the repository at this point in the history
Replace uint8[] arrays which reserve space for the header
with an instance of the header struct as defined by SB.

Note this structure was the basis for the array size,
so it is the same size, but by actually using the structure
the resulting message will have the correct alignment.
  • Loading branch information
jphickey committed May 8, 2020
1 parent 7a608f0 commit d1da5f2
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 59 deletions.
38 changes: 19 additions & 19 deletions fsw/cfe-core/src/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@
*/
typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */

} CFE_ES_NoArgsCmd_t;

Expand Down Expand Up @@ -1148,7 +1148,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_RestartCmd_Payload_t Payload;
} CFE_ES_Restart_t;

Expand All @@ -1168,7 +1168,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_ShellCmd_Payload_t Payload;
} CFE_ES_Shell_t;

Expand All @@ -1188,7 +1188,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_FileNameCmd_Payload_t Payload;
} CFE_ES_FileNameCmd_t;

Expand Down Expand Up @@ -1216,7 +1216,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_OverWriteSysLogCmd_Payload_t Payload;
} CFE_ES_OverWriteSyslog_t;

Expand Down Expand Up @@ -1245,7 +1245,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_StartAppCmd_Payload_t Payload;
} CFE_ES_StartApp_t;

Expand All @@ -1262,7 +1262,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_AppNameCmd_Payload_t Payload;
} CFE_ES_AppNameCmd_t;

Expand Down Expand Up @@ -1290,7 +1290,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_AppReloadCmd_Payload_t Payload;
} CFE_ES_ReloadApp_t;

Expand All @@ -1308,7 +1308,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_SetMaxPRCountCmd_Payload_t Payload;
} CFE_ES_SetMaxPRCount_t;

Expand All @@ -1326,7 +1326,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_DeleteCDSCmd_Payload_t Payload;
} CFE_ES_DeleteCDS_t;

Expand All @@ -1343,7 +1343,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_StartPerfCmd_Payload_t Payload;
} CFE_ES_StartPerfData_t;

Expand All @@ -1361,7 +1361,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_StopPerfCmd_Payload_t Payload;
} CFE_ES_StopPerfData_t;

Expand All @@ -1381,7 +1381,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_SetPerfFilterMaskCmd_Payload_t Payload;
} CFE_ES_SetPerfFilterMask_t;

Expand All @@ -1400,7 +1400,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_SetPerfTrigMaskCmd_Payload_t Payload;
} CFE_ES_SetPerfTriggerMask_t;

Expand All @@ -1419,7 +1419,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_SendMemPoolStatsCmd_Payload_t Payload;
} CFE_ES_SendMemPoolStats_t;

Expand All @@ -1437,7 +1437,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_ES_DumpCDSRegistryCmd_Payload_t Payload;

} CFE_ES_DumpCDSRegistry_t;
Expand All @@ -1457,7 +1457,7 @@ typedef struct

typedef struct
{
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_ES_OneAppTlm_Payload_t Payload;
} CFE_ES_OneAppTlm_t;

Expand All @@ -1473,7 +1473,7 @@ typedef struct

typedef struct
{
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_ES_PoolStatsTlm_Payload_t Payload;
} CFE_ES_MemStatsTlm_t;

Expand Down Expand Up @@ -1570,7 +1570,7 @@ typedef struct

typedef struct
{
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_ES_HousekeepingTlm_Payload_t Payload;

} CFE_ES_HousekeepingTlm_t;
Expand Down
26 changes: 13 additions & 13 deletions fsw/cfe-core/src/inc/cfe_evs_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@
** \brief Command with no additional arguments
**/
typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
} CFE_EVS_NoArgsCmd_t;

/*
Expand All @@ -942,7 +942,7 @@ typedef struct {
} CFE_EVS_LogFileCmd_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_LogFileCmd_Payload_t Payload;
} CFE_EVS_WriteLogDataFile_t;

Expand All @@ -958,7 +958,7 @@ typedef struct {
} CFE_EVS_AppDataCmd_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_AppDataCmd_Payload_t Payload;
} CFE_EVS_WriteAppDataFile_t;

Expand All @@ -974,7 +974,7 @@ typedef struct {
} CFE_EVS_SetLogMode_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_SetLogMode_Payload_t Payload;
} CFE_EVS_SetLogMode_t;

Expand All @@ -990,7 +990,7 @@ typedef struct {
} CFE_EVS_SetEventFormatMode_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_SetEventFormatMode_Payload_t Payload;
} CFE_EVS_SetEventFormatMode_t;

Expand All @@ -1007,7 +1007,7 @@ typedef struct {
} CFE_EVS_BitMaskCmd_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_BitMaskCmd_Payload_t Payload;
} CFE_EVS_BitMaskCmd_t;

Expand All @@ -1033,7 +1033,7 @@ typedef struct {
} CFE_EVS_AppNameCmd_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_AppNameCmd_Payload_t Payload;
} CFE_EVS_AppNameCmd_t;

Expand All @@ -1059,7 +1059,7 @@ typedef struct {
} CFE_EVS_AppNameEventIDCmd_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_AppNameEventIDCmd_Payload_t Payload;
} CFE_EVS_AppNameEventIDCmd_t;

Expand All @@ -1084,7 +1084,7 @@ typedef struct {
} CFE_EVS_AppNameBitMaskCmd_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_AppNameBitMaskCmd_Payload_t Payload;
} CFE_EVS_AppNameBitMaskCmd_t;

Expand All @@ -1110,7 +1110,7 @@ typedef struct {
} CFE_EVS_AppNameEventIDMaskCmd_Payload_t;

typedef struct {
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;
CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload;
} CFE_EVS_AppNameEventIDMaskCmd_t;

Expand Down Expand Up @@ -1181,7 +1181,7 @@ typedef struct {
} CFE_EVS_HousekeepingTlm_Payload_t;

typedef struct {
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE];
CFE_SB_TlmHdr_t TlmHeader;
CFE_EVS_HousekeepingTlm_Payload_t Payload;
} CFE_EVS_HousekeepingTlm_t;

Expand Down Expand Up @@ -1224,13 +1224,13 @@ typedef struct {
} CFE_EVS_ShortEventTlm_Payload_t;

typedef struct {
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE];
CFE_SB_TlmHdr_t TlmHeader;
CFE_EVS_LongEventTlm_Payload_t Payload;

} CFE_EVS_LongEventTlm_t;

typedef struct {
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE];
CFE_SB_TlmHdr_t TlmHeader;
CFE_EVS_ShortEventTlm_Payload_t Payload;

} CFE_EVS_ShortEventTlm_t;
Expand Down
24 changes: 12 additions & 12 deletions fsw/cfe-core/src/inc/cfe_tbl_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
*/
typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */

} CFE_TBL_NoArgsCmd_t;

Expand All @@ -519,7 +519,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_LoadCmd_Payload_t Payload;
} CFE_TBL_Load_t;

Expand All @@ -546,7 +546,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_DumpCmd_Payload_t Payload;
} CFE_TBL_Dump_t;

Expand All @@ -570,7 +570,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_ValidateCmd_Payload_t Payload;
} CFE_TBL_Validate_t;

Expand All @@ -588,7 +588,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_ActivateCmd_Payload_t Payload;
} CFE_TBL_Activate_t;

Expand All @@ -607,7 +607,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_DumpRegistryCmd_Payload_t Payload;
} CFE_TBL_DumpRegistry_t;

Expand All @@ -627,7 +627,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_SendRegistryCmd_Payload_t Payload;
} CFE_TBL_SendRegistry_t;

Expand All @@ -647,7 +647,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_DelCDSCmd_Payload_t Payload;
} CFE_TBL_DeleteCDS_t;

Expand All @@ -665,7 +665,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_AbortLoadCmd_Payload_t Payload;
} CFE_TBL_AbortLoad_t;

Expand All @@ -690,7 +690,7 @@ typedef struct

typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */
CFE_SB_CmdHdr_t CmdHeader; /**< \brief cFE Software Bus Command Message Header */
CFE_TBL_NotifyCmd_Payload_t Payload;
} CFE_TBL_NotifyCmd_t;

Expand Down Expand Up @@ -762,7 +762,7 @@ typedef struct

typedef struct
{
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_TBL_HousekeepingTlm_Payload_t Payload;
} CFE_TBL_HousekeepingTlm_t;

Expand Down Expand Up @@ -810,7 +810,7 @@ typedef struct

typedef struct
{
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_TBL_TblRegPacket_Payload_t Payload;
} CFE_TBL_TableRegistryTlm_t;

Expand Down
Loading

0 comments on commit d1da5f2

Please sign in to comment.