Skip to content

Commit

Permalink
Fix #106, Use CFE_MSG_PTR conversion macro
Browse files Browse the repository at this point in the history
Updates conversions to CFE_Message_t to use the MSG macro
This also uses consistent naming - TelemetryHeader rather than TlmHeader
  • Loading branch information
jphickey committed Sep 30, 2021
1 parent 0c6d816 commit 13a60fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions fsw/src/to_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int32 TO_LAB_init(void)
/*
** Initialize housekeeping packet (clear user data area)...
*/
CFE_MSG_Init(&TO_LAB_Global.HkTlm.TlmHeader.Msg, CFE_SB_ValueToMsgId(TO_LAB_HK_TLM_MID),
CFE_MSG_Init(CFE_MSG_PTR(TO_LAB_Global.HkTlm.TelemetryHeader), CFE_SB_ValueToMsgId(TO_LAB_HK_TLM_MID),
sizeof(TO_LAB_Global.HkTlm));

status = CFE_TBL_Register(&TO_SubTblHandle, "TO_LAB_Subs", sizeof(*TO_LAB_Subs), CFE_TBL_OPT_DEFAULT, NULL);
Expand Down Expand Up @@ -396,10 +396,10 @@ int32 TO_LAB_SendDataTypes(const TO_LAB_SendDataTypesCmd_t *data)
char string_variable[10] = "ABCDEFGHIJ";

/* initialize data types packet */
CFE_MSG_Init(&TO_LAB_Global.DataTypesTlm.TlmHeader.Msg, CFE_SB_ValueToMsgId(TO_LAB_DATA_TYPES_MID),
CFE_MSG_Init(CFE_MSG_PTR(TO_LAB_Global.DataTypesTlm.TelemetryHeader), CFE_SB_ValueToMsgId(TO_LAB_DATA_TYPES_MID),
sizeof(TO_LAB_Global.DataTypesTlm));

CFE_SB_TimeStampMsg(&TO_LAB_Global.DataTypesTlm.TlmHeader.Msg);
CFE_SB_TimeStampMsg(CFE_MSG_PTR(TO_LAB_Global.DataTypesTlm.TelemetryHeader));

/* initialize the packet data */
TO_LAB_Global.DataTypesTlm.Payload.synch = 0x6969;
Expand Down Expand Up @@ -430,7 +430,7 @@ int32 TO_LAB_SendDataTypes(const TO_LAB_SendDataTypesCmd_t *data)
for (i = 0; i < 10; i++)
TO_LAB_Global.DataTypesTlm.Payload.str[i] = string_variable[i];

CFE_SB_TransmitMsg(&TO_LAB_Global.DataTypesTlm.TlmHeader.Msg, true);
CFE_SB_TransmitMsg(CFE_MSG_PTR(TO_LAB_Global.DataTypesTlm.TelemetryHeader), true);

++TO_LAB_Global.HkTlm.Payload.CommandCounter;
return CFE_SUCCESS;
Expand All @@ -443,8 +443,8 @@ int32 TO_LAB_SendDataTypes(const TO_LAB_SendDataTypesCmd_t *data)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 TO_LAB_SendHousekeeping(const CFE_MSG_CommandHeader_t *data)
{
CFE_SB_TimeStampMsg(&TO_LAB_Global.HkTlm.TlmHeader.Msg);
CFE_SB_TransmitMsg(&TO_LAB_Global.HkTlm.TlmHeader.Msg, true);
CFE_SB_TimeStampMsg(CFE_MSG_PTR(TO_LAB_Global.HkTlm.TelemetryHeader));
CFE_SB_TransmitMsg(CFE_MSG_PTR(TO_LAB_Global.HkTlm.TelemetryHeader), true);
return CFE_SUCCESS;
}

Expand Down
8 changes: 4 additions & 4 deletions fsw/src/to_lab_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ typedef struct

typedef struct
{
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */
TO_LAB_HkTlm_Payload_t Payload; /**< \brief Telemetry payload */
CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */
TO_LAB_HkTlm_Payload_t Payload; /**< \brief Telemetry payload */
} TO_LAB_HkTlm_t;

/******************************************************************************/
Expand Down Expand Up @@ -78,8 +78,8 @@ typedef struct

typedef struct
{
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */
TO_LAB_DataTypes_Payload_t Payload; /**< \brief Telemetry payload */
CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */
TO_LAB_DataTypes_Payload_t Payload; /**< \brief Telemetry payload */
} TO_LAB_DataTypesTlm_t;

/******************************************************************************/
Expand Down

0 comments on commit 13a60fa

Please sign in to comment.