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

Resolve table services message initialization inconsistencies #986

Closed
skliper opened this issue Oct 30, 2020 · 0 comments · Fixed by #1120 or #1150
Closed

Resolve table services message initialization inconsistencies #986

skliper opened this issue Oct 30, 2020 · 0 comments · Fixed by #1120 or #1150
Labels
bug cFE-TBL Table services
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Oct 30, 2020

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

@skliper skliper added this to the 7.0.0 milestone Jan 22, 2021
skliper added a commit to skliper/cFE that referenced this issue Jan 22, 2021
skliper added a commit to skliper/cFE that referenced this issue Jan 22, 2021
skliper added a commit to skliper/cFE that referenced this issue Jan 27, 2021
@astrogeco astrogeco added cFE-TBL Table services bug and removed enhancement labels Feb 3, 2021
astrogeco added a commit that referenced this issue Feb 3, 2021
Fix #986, Remove unnecessary CFE_MSG_Init in TBL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cFE-TBL Table services
Projects
None yet
2 participants