[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
When sending events and/or logging messages, the method used to "print" the identifier for an RTS or ATS is not consistent. Sometimes it is a number, sometimes it is a char (A/B), sometimes it uses 3 digits w/leading 0 (%03d format), and sometimes its just an int.
To Reproduce
N/A (code review)
Expected behavior
Should be represented consistently. If "lettering" (A/B) nomenclature is preferred for ATS's, then it should be used everywhere. Otherwise if "numbering" is preferred for RTS's, then use a consistent output format - leading zeros or no leading zeros, signed or unsigned, etc..
print RTS ID as unsigned int, using simple %u conversion (no leading zeros)
print ATS ID as char - and simply document that SC_NUMBER_OF_ATS must not be greater than 26 (which is very generous as this code has obviously never been run with this set to anything other than 2, given the A/B assumptions in the existing code).
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
Checklist (Please check before submitting)
Describe the bug When sending events and/or logging messages, the method used to "print" the identifier for an RTS or ATS is not consistent. Sometimes it is a number, sometimes it is a char (A/B), sometimes it uses 3 digits w/leading 0 (
%03d
format), and sometimes its just an int.To Reproduce N/A (code review)
Expected behavior Should be represented consistently. If "lettering" (A/B) nomenclature is preferred for ATS's, then it should be used everywhere. Otherwise if "numbering" is preferred for RTS's, then use a consistent output format - leading zeros or no leading zeros, signed or unsigned, etc..
Code snips One way ATS's are printed, which will incorrectly report every ATS beyond 1 as ATS B: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_atsrq.c#L79
Another way ATS's are printed, which will more properly report ATS beyond 1 as ATS C/D/E etc. but will NOT handle ATS beyond 26: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_atsrq.c#L678
A third way ATS's are printed, based on the number: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_cmds.c#L755-L756
With RTS, sometimes it has leading zero: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_rtsrq.c#L113
But sometimes not: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_rtsrq.c#L323
System observed on: Debian
Additional context Suggestion:
SC_NUMBER_OF_ATS
must not be greater than 26 (which is very generous as this code has obviously never been run with this set to anything other than 2, given the A/B assumptions in the existing code).Reporter Info Joseph Hickey, Vantage Systems, Inc.