nasa / FM

The Core Flight System (cFS) File Manager (FM) application.
Apache License 2.0
43 stars 25 forks source link

Standardization of Command Responses #118

Closed dmknutsen closed 1 month ago

dmknutsen commented 6 months ago

Checklist (Please check before submitting)

Is your feature request related to a problem? Please describe. cFS should have standardized command responses for commands that set a state/mode like enable/disable, on/off, true/false, start/stop/pause/resume, etc.

For those commands, the app should respond as describe below:

If the current setting is not in that commanded state,
    If the commanded state can be set successfully,
    a. Increment the command counter
    b. Send an INFO event that says command successfully executed
    otherwise,
    a. Increment the command error counter
    b. Send an ERROR event that says failed to execute the command

If the current setting is already in that commanded state,
    Increment the command counter, not command error counter
    Send an INFO event that says already in that state

The following command response does not align with the standard:

Successful commanding events are debug type:

FM_RESET_CMD_EID
FM_COPY_CMD_EID
FM_MOVE_CMD_EID
FM_RENAME_CMD_EID
FM_DELETE_CMD_EID
FM_DELETE_ALL_CMD_EID
FM_DECOM_CMD_EID
FM_GET_FILE_INFO_CMD_EID
FM_GET_OPEN_FILES_CMD_EID
FM_CREATE_DIR_CMD_EID
FM_DELETE_DIR_CMD_EID
FM_GET_DIR_FILE_CMD_EID
FM_GET_DIR_PKT_CMD_EID
FM_MONITOR_FILESYSTEM_SPACE_CMD_EID
FM_SET_PERM_CMD_EID

The following failure events are of info type:

FM_GET_DIR_FILE_WARNING_EID

Describe the solution you'd like Update logic to align with the standard.

Requester Info Dan Knutsen NASA Goddard

thnkslprpt commented 5 months ago

First list: all of those (except RESET) were fixed in https://github.com/nasa/FM/pull/115

Second list: Larger issue here of the ChildCmdWarnCounter (it's used in 8 places) to signal partial success of a command.

dmknutsen commented 5 months ago

Thanks for pointing that out! For the purpose of this issue I would just make FM_RESET_CMD_EID be informational/consistent with the rest of the commands. FM's use of a child task warning counter is a bit different than how some of the other apps work...but I think the implementation is straight forward enough/self explanatory that I don't think it is causing anyone any heartburn/issues.