Skip to content

Resolve table services message initialization inconsistencies #986

@skliper

Description

@skliper

Is your feature request related to a problem? Please describe.
Hk and Tbl RegPacket are initialized in both CFE_TBL_EarlyInit and CFE_TBL_InitData (called from CFE_TBL_TaskInit). The notify message packet is only initialized in CFE_TBL_SendNotificationMsg, and gets initialized every call.

/*
** Initialize housekeeping packet (clear user data area)...
*/
CFE_SB_InitMsg(&CFE_TBL_TaskData.HkPacket,
CFE_SB_ValueToMsgId(CFE_TBL_HK_TLM_MID),
sizeof(CFE_TBL_TaskData.HkPacket), true);
/*
** Initialize table registry report packet (clear user data area)...
*/
CFE_SB_InitMsg(&CFE_TBL_TaskData.TblRegPacket,
CFE_SB_ValueToMsgId(CFE_TBL_REG_TLM_MID),
sizeof(CFE_TBL_TaskData.TblRegPacket), true);

/*
** Initialize notification message packet (clear user data area)...
*/
CFE_SB_InitMsg(&CFE_TBL_TaskData.NotifyMsg,
RegRecPtr->NotificationMsgId,
sizeof(CFE_TBL_NotifyCmd_t), true);
/* Set the command code */
CFE_SB_SetCmdCode((CFE_SB_MsgPtr_t) &CFE_TBL_TaskData.NotifyMsg, RegRecPtr->NotificationCC);

/* Initialize Packet Headers */
CFE_SB_InitMsg(&CFE_TBL_TaskData.HkPacket,
CFE_SB_ValueToMsgId(CFE_TBL_HK_TLM_MID),
sizeof(CFE_TBL_TaskData.HkPacket),
true);
CFE_SB_InitMsg(&CFE_TBL_TaskData.TblRegPacket,
CFE_SB_ValueToMsgId(CFE_TBL_REG_TLM_MID),
sizeof(CFE_TBL_TaskData.TblRegPacket),
true);

The CFE_TBL_SendNotificationMsg could just be initialized once, then SetMsgId and SetFcnCode each time.

Describe the solution you'd like
These packets only need to be initialized once.

Describe alternatives you've considered
None.

Additional context
Observed when working on #777
Additional observation - the notification command gets timestamped, which fails for implementations where there is no time stamp in commands.

Requester Info
Jacob Hageman - NASA/GSFC

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions