Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #106, Use CFE_MSG_PTR conversion macro #107

Merged
merged 1 commit into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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