CF icon indicating copy to clipboard operation
CF copied to clipboard

Some minor out-of-family naming/consistency issues in CF could be updated

Open thnkslprpt opened this issue 2 years ago • 0 comments

Checklist

  • [x] I reviewed the Contributing Guide.
  • [x] I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug CF is the only app to still use CFE_MSG_SetMsgTime() to timestamp the HK packet, rather than CFE_SB_TimeStampMsg(): https://github.com/nasa/CF/blob/0f18ae4b8f800afefdf60c97809c737289f46942/fsw/src/cf_app.c#L47-L51

No memset to zero-out the global data structure upon initialization.

CF checks the return value of the call to CFE_EVS_SendEvent() at the end of a successful initialization - not incorrect but unnecessary. Returns from CFE_EVS_SendEvent() are only checked a handful of times across cFS out of several thousand instances. Also, CF does not check returns from this function anywhere else in the source code. https://github.com/nasa/CF/blob/0f18ae4b8f800afefdf60c97809c737289f46942/fsw/src/cf_app.c#L251-L257

In CF_AppMain(), there is a check for CFE_SUCCESS and for a null pointer of the buffer passed in to CFE_SB_ReceiveBuffer() - this is guaranteed by CFE_SB_ReceiveBuffer() to not be possible and is therefore unnecessary. cFE and almost all other apps do not do this. https://github.com/nasa/CF/blob/0f18ae4b8f800afefdf60c97809c737289f46942/fsw/src/cf_app.c#L336-L343

Some other naming inconsistencies that could be updated to match standard cFS patterns such as common variables and function/command names also exist.

Expected behavior Align with cFS where appropriate - consistency makes maintenance easier, and improves usability for consumers of cFS and the open-source apps.

Reporter Info Avi Weiss @thnkslprpt

thnkslprpt avatar Jun 06 '23 04:06 thnkslprpt