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

Move cmd pipe processing into separate dispatch file #2262

Closed
jphickey opened this issue Mar 23, 2023 · 0 comments · Fixed by #2263
Closed

Move cmd pipe processing into separate dispatch file #2262

jphickey opened this issue Mar 23, 2023 · 0 comments · Fixed by #2263

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently the "TaskPipe" function is comprised of a couple big switch statements based on MsgId and FcnCode, along with length validation and potentially other structural checks. If/When migrating to EDS some of that logic can be handled by common code that check against constraints defined in EDS.

Describe the solution you'd like
The current "TaskPipe" function and the supporting logic around it should be moved to a separate "dispatch" source unit. This improves organization in general, but also makes for an easier switch to different logic in the future, should that come to be needed.

Describe alternatives you've considered
The alternative is to add #ifdef blocks if validation logic needs to be switched.

Additional context
The recommended solution of moving this logic to a separate source unit permits source-selection in CMake at configuration time rather than relying on preprocessor-based option selection. This is generally cleaner, and permits all options to be verified in a single unit test build, as opposed to only being able to test the selected option.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey changed the title Separate cmd pipe processing into separate dispatch file Move cmd pipe processing into separate dispatch file Mar 23, 2023
@jphickey jphickey self-assigned this Mar 23, 2023
jphickey added a commit to jphickey/cFE that referenced this issue Mar 23, 2023
Isolate the message verification and dispatch from the general message
processing.  Functions in the "task" source file now strictly handle the
command content, and do not get involved in general validation.

Also note: this is mostly a simple code move but does add a "const"
qualifier to the task pipe function where it was missing before.  All of
the handlers were already "const".
jphickey added a commit to jphickey/cFE that referenced this issue Mar 23, 2023
Isolate the message verification and dispatch from the general message
processing.  Functions in the "task" source file now strictly handle the
command content, and do not get involved in general validation.

Also note: this is mostly a simple code move but does add a "const"
qualifier to the task pipe function where it was missing before.  All of
the handlers were already "const".
dzbaker added a commit that referenced this issue Mar 30, 2023
Fix #2262, separate dispatcher for messages
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants