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 #42, Use CFE_SB_CmdHdr_t for cmd sizing #43

Closed
wants to merge 1 commit into from

Conversation

skliper
Copy link
Contributor

@skliper skliper commented Jun 9, 2020

Describe the contribution
Eliminates unnecessary union and uses CFE_SB_CmdHdr_t for zero parameter command sizing
Fix #42

Testing performed
Steps taken to test the contribution:

  1. Nominal build, confirmed HK's were sent

Expected behavior changes
None, but allows for updates in nasa/cFE#726

System(s) tested on

  • Hardware: cFS Dev Server
  • OS: Ubuntu 18.04
  • Versions: Bundle + this commit

Additional context
None

Third party code
None

Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman - NASA/GSFC

@skliper skliper added enhancement New feature or request CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Jun 9, 2020
@skliper skliper added this to the 2.4.0 milestone Jun 9, 2020
Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing what the actual problem was here -- the sizeof(SCH_LAB_MessageBuffer_t) union type would have been OK, correct? Is there something that works here that didn't work before? Is there some objection to having another layer of buffer type?

While the extra union might have been made unnecessary (strictly speaking) when CFE_SB_CmdHdr_t was changed to a union, I still don't see how it hurts anything to have it at this level too.

Main objection is unnecessary casting - prefer to use the union member, not cast. It's more type safe.

@@ -128,7 +122,7 @@ void SCH_Lab_AppMain(void)
if (LocalStateEntry->Counter >= LocalStateEntry->PacketRate)
{
LocalStateEntry->Counter = 0;
CFE_SB_SendMsg(&LocalStateEntry->MsgBuf.MsgHdr);
CFE_SB_SendMsg((CFE_SB_Msg_t *)&LocalStateEntry->MsgBuf);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to cast here, just use &LocalStateEntry->MsgBuf.BaseMsg (or equivalent).

@skliper
Copy link
Contributor Author

skliper commented Jun 9, 2020

Retracting change after fixing some things related to nasa/cFE#726.

@skliper skliper closed this Jun 9, 2020
@skliper skliper deleted the fix42-cmd-msg-size branch June 9, 2020 21:03
@skliper skliper added invalid This doesn't seem right and removed enhancement New feature or request CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Jun 9, 2020
@skliper skliper removed this from the 2.4.0 milestone Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Packet sizing dependence on generic CFE_SB_Msg_t
2 participants