Skip to content

CF_UnionArgs_Payload_t elements dword and hword not used, union not necessary #288

@skliper

Description

@skliper

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I reviewed the CF README.md file to see if the feature is in the major future work.
  • I performed a cursory search to see if the feature request is relevant, not redundant, nor in conflict with other tickets.

Is your feature request related to a problem? Please describe.
dword and hword are not used in the CF_UnionArgs_Payload_t union, only byte:

CF/fsw/src/cf_msg.h

Lines 159 to 169 in 0774746

/* unionargs -
*
* A lot of commands have a single byte arg, and the old application had 3 spare bytes after that.
*
* So this structure gives the flexibility of a single byte arg, 2 halfwords, or a dword, all in one declaration. */
typedef union CF_UnionArgs_Payload
{
uint32 dword;
uint16 hword[2];
uint8 byte[4];
} CF_UnionArgs_Payload_t;

Describe the solution you'd like
Remove unnecessary union

Describe alternatives you've considered
CF_UnionArgsCmd_t is somewhat out of family in that it specifies unnecessary payload elements for some of the commands. The only common benefit seems to be byte 0 which is channel, supporting all channels generically with 255. Consider untangling all the layers of abstraction and go back to simple command processing.

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions