Fix #17, consolidate common logic in enable/disable commands#119
Fix #17, consolidate common logic in enable/disable commands#119thnkslprpt wants to merge 1 commit intonasa:mainfrom
Conversation
| /* */ | ||
| /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| void CS_DisableAppCmd(const CS_NoArgsCmd_t *CmdPtr) | ||
| static void CS_DoEnableDisableAppCmd(const CS_NoArgsCmd_t *CmdPtr, uint16 NewState, uint32 EventID) |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| /* */ | ||
| /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| void CS_DisableNameAppCmd(const CS_AppNameCmd_t *CmdPtr) | ||
| static void CS_DoEnableDisableNameAppCmd(const CS_AppNameCmd_t *CmdPtr, uint16 NewState, uint32 EventID, |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| strncpy(Name, CmdPtr->Payload.Name, sizeof(Name) - 1); | ||
| Name[sizeof(Name) - 1] = '\0'; | ||
|
|
||
| if (CS_GetAppResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression Warning
| Name); | ||
|
|
||
| CS_AppData.HkPacket.Payload.CmdCounter++; | ||
| if (CS_GetAppDefTblEntryByName(&DefinitionEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression Warning
| /* */ | ||
| /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| void CS_DisableCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr) | ||
| static void CS_DoEnableDisableCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr, uint16 NewState, uint32 EventID) |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| /* */ | ||
| /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| void CS_EnableEntryIDMemoryCmd(const CS_EntryCmd_t *CmdPtr) | ||
| static void CS_DoEnableDisableEntryIDMemoryCmd(const CS_EntryCmd_t *CmdPtr, uint16 NewState, uint32 EnableEventID, |
Check notice
Code scanning / CodeQL
Function too long Note
| /* */ | ||
| /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| void CS_DisableTablesCmd(const CS_NoArgsCmd_t *CmdPtr) | ||
| static void CS_DoEnableDisableTablesCmd(const CS_NoArgsCmd_t *CmdPtr, uint16 NewState, uint32 EventID) |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| /* */ | ||
| /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| void CS_DisableNameTablesCmd(const CS_TableNameCmd_t *CmdPtr) | ||
| static void CS_DoEnableDisableNameTablesCmd(const CS_TableNameCmd_t *CmdPtr, uint16 NewState, uint32 EventID, |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| strncpy(Name, CmdPtr->Payload.Name, sizeof(Name) - 1); | ||
| Name[sizeof(Name) - 1] = '\0'; | ||
|
|
||
| if (CS_GetTableResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression Warning
| } | ||
|
|
||
| CS_AppData.HkPacket.Payload.CmdCounter++; | ||
| if (CS_GetTableDefTblEntryByName(&DefinitionEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression Warning
Checklist
Describe the contribution
Testing performed
GitHub CI actions all passing successfully (incl. Build + Run, Unit/Functional Tests etc.).
100% test coverage is maintained.
Expected behavior changes
Behavior is unchanged - the same enable/disable functions exist but call helpers where all common logic is consolidated.
System(s) tested on
Debian 12 using the current main branch of cFS bundle.
Contributor Info
Avi Weiss @thnkslprpt