-
Notifications
You must be signed in to change notification settings - Fork 47
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 #1, Update to dev guide, add table, add CRC output #14
Conversation
new updates, fixed dependency on ../src/tbl. Clean up code and tested.
|
Combine commit for review |
Test result:
|
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.
I think this is getting closer but still needs some modifications.
- The message handlers in sample_app do not follow the same pattern as CFE does. These should be modified to be in the same pattern as CFE. For instance, use
CFE_ES_TaskPipe()
orCFE_EVS_ProcessGroundCommand()
as a reference example for the current recommended pattern.
The main differences are:
- All identification, validation, and subsequent cast of the message pointer is done prior to invoking the message handler
- The message handler accepts a single pointer argument of the correct type, qualified as
const
.
For example, in CFE_ES_TaskPipe:
CommandCode = CFE_SB_GetCmdCode(Msg);
switch (CommandCode)
{
case CFE_ES_NOOP_CC:
if (CFE_ES_VerifyCmdLength(Msg, sizeof(CFE_ES_Noop_t)))
{
CFE_ES_NoopCmd((CFE_ES_Noop_t*)Msg);
}
break;
case CFE_ES_RESET_COUNTERS_CC:
if (CFE_ES_VerifyCmdLength(Msg, sizeof(CFE_ES_ResetCounters_t)))
{
CFE_ES_ResetCountersCmd((CFE_ES_ResetCounters_t*)Msg);
}
break;
And so on for each command type....
Specifically: the "outer" message processor is performing identification and validation duty, and once validated, actually casts it to the correct real message type. The "inner" message handler then just processes the message, knowing that it is already fully validated. It should not need to do any additional introspection or typecasting.
Why this is a better pattern: In a future CFE version it is intended that a message data dictionary of some sort (be it EDS or something else) will provide message identification and validation services. Keeping this consolidated in one function means an easy transition to future CFE versions.
-
Why was the
#ifndef
protector changed fromsample_app_...
tosample_lab_...
in a couple files? -
The commit log needs to be improved before it can be merged.
|
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.
Looks good now, approve for merge.
Describe the contribution
Updated to dev. guide, added sample table, added CRC output
Testing performed
Steps taken to test the contribution:
output from tblCRCTool:
Expected behavior changes
no impact to behavior
System(s) tested on:
Contributor Info
Anh Van, NASA Goddard
Community contributors
You must attach a signed CLA (required for acceptance) or reference one already submitted