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 #95, Update command handler function message pointers and return #96

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thnkslprpt
Copy link
Contributor

@thnkslprpt thnkslprpt commented Apr 5, 2023

Checklist

Describe the contribution

  • Fixes Use CFE pattern for command handler functions #95
    • Updated the command handler functions to use their specific command message types (FM_NoopCmd_t, FM_ResetCountersCmd_t etc.) rather than the generic CFE_SB_Buffer_t.
    • Converted return types of the command handler functions and other relevant functions to CFE_Status_t (also changed their status/result variables to CFE_Status_t)
    • Added a general error return code FM_ERROR
    • Used some of the new, more specific, CFE error return types:
      • Converted the previous false returns from failures during FM_IsValidCmdPktLength() in the dispatch routines to the new CFE return code CFE_STATUS_VALIDATION_FAILURE
      • CFE_STATUS_INCORRECT_STATE and CFE_STATUS_RANGE_ERROR in suitable locations instead of just using FM_ERROR

Question: Does something need to be done in terms of deprecation due to the change to the API (the FM_SendHkCmd() BufPtr parameter type has changed)?

Testing performed
GitHub CI actions (incl. Build and Run, Unit Tests etc.) all passing successfully.

Expected behavior changes
Behavior largely unchanged.
Compiler error is now thrown if the command handler functions are invoked with any type other than their own specific command type.
Using a defined set of error return macros and the CFE_Status_t return type improves code clarity and makes FM more consistent with cFE and the other cFS apps.

Contributor Info
Avi Weiss @thnkslprpt

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@dzbaker dzbaker requested a review from dmknutsen April 6, 2023 18:58
@thnkslprpt thnkslprpt force-pushed the fix-95-update-command-handler-message-pointers-and-return-types branch from a0fcee1 to 9648f91 Compare May 19, 2023 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use CFE pattern for command handler functions
1 participant