-
Notifications
You must be signed in to change notification settings - Fork 33
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 #62, Apply message alignment pattern #63
Fix #62, Apply message alignment pattern #63
Conversation
CCB 2020-11-18 APPROVED
|
7ae5e4d
to
29c21e1
Compare
Push fixed typo in commit message and applied "*Cmd_t" pattern to all command types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor comment/suggestion
@@ -47,26 +47,19 @@ | |||
*/ | |||
typedef union | |||
{ | |||
CFE_MSG_Message_t MsgHdr; | |||
CFE_MSG_Message_t Msg; | |||
uint8 bytes[CI_LAB_MAX_INGEST]; | |||
uint16 hwords[2]; | |||
} CI_LAB_IngestBuffer_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "hwords" member here really should not be needed. AFAIK it served two purposes - to align the buffer to 16 bits (not needed if using CFE_MSG_Message_t) and in the event the message didn't validate it would actually report the value of the first two words in an error message. But that message is fundamentally flawed because if the length check doesn't work the values probably are undefined/uninitialized and thereby meaningless.
42b969b
to
05c1424
Compare
- Use CFE_SB_Buffer_t for receiving and casting to command types - Use CFE_MSG_CommandHeader_t and CFE_MSG_TelemetryHeader_t in command and telemetry type definitions - Use CFE_SB_TransmitMsg to copy the command and telemetry into a CFE_SB_Buffer_t and send it where needed - Avoids need to create send buffers within the app (or union the packet types with CFE_SB_Buffer_t) - Eliminates references to CFE_SB_CmdHdr_t and CFE_SB_TlmHdr_t that formerly enforced alignment since these had potential to change the actual packet sizes - No need to cast to CFE_MSG_Message_t anywhere since it's available in the CFE_SB_Buffer_t union
- Replaced CFE_SB_RcvMsg with CFE_SB_ReceiveBuffer - Replaced CFE_MSG_Size_t with size_t
05c1424
to
3ed636d
Compare
Minor updates to minimize future changes, and removed hwords. Left in report as a "clue". |
Describe the contribution
Fix #62 (updates related to nasa/cFE#1009, implementing a consistent message alignment pattern)
comamnd and telemetry type definitions
into a CFE_SB_Buffer_t and send it where needed
the packet types with CFE_SB_Buffer_t)
that formerly enforced alignment since these had potential
to change the actual packet sizes
available in the CFE_SB_Buffer_t union
Testing performed
Normal build, tested cmd/tlm interface and noops
Expected behavior changes
None.
System(s) tested on
Additional context
See nasa/cFE#1009
Third party code
None.
Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman - NASA/GSFC