-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1527, Implement common command-handler return pattern across cFE #2302
base: main
Are you sure you want to change the base?
Fix #1527, Implement common command-handler return pattern across cFE #2302
Conversation
@@ -703,8 +694,11 @@ | |||
* See description in header file for argument/return detail | |||
* | |||
*-----------------------------------------------------------------*/ | |||
void CFE_TIME_SetDelayImpl(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, CFE_TIME_AdjustDirection_Enum_t Direction) | |||
CFE_Status_t CFE_TIME_SetDelayImpl(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -675,17 +675,17 @@ | |||
* See description in header file for argument/return detail | |||
* | |||
*-----------------------------------------------------------------*/ | |||
CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile(const char *DumpFilename, const char *TableName, const void *DumpDataAddr, | |||
size_t TblSizeInBytes) | |||
CFE_Status_t CFE_TBL_DumpToFile(const char *DumpFilename, const char *TableName, const void *DumpDataAddr, |
Check notice
Code scanning / CodeQL
Function too long Note
@@ -675,17 +675,17 @@ | |||
* See description in header file for argument/return detail | |||
* | |||
*-----------------------------------------------------------------*/ | |||
CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile(const char *DumpFilename, const char *TableName, const void *DumpDataAddr, | |||
size_t TblSizeInBytes) | |||
CFE_Status_t CFE_TBL_DumpToFile(const char *DumpFilename, const char *TableName, const void *DumpDataAddr, |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -964,8 +956,11 @@ | |||
* See description in header file for argument/return detail | |||
* | |||
*-----------------------------------------------------------------*/ | |||
void CFE_TIME_AdjustImpl(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, CFE_TIME_AdjustDirection_Enum_t Direction) | |||
CFE_Status_t CFE_TIME_AdjustImpl(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -1036,9 +1036,11 @@ | |||
* See description in header file for argument/return detail | |||
* | |||
*-----------------------------------------------------------------*/ | |||
void CFE_TIME_1HzAdjImpl(const CFE_TIME_OneHzAdjustmentCmd_Payload_t *CommandPtr, | |||
CFE_TIME_AdjustDirection_Enum_t Direction) | |||
CFE_Status_t CFE_TIME_1HzAdjImpl(const CFE_TIME_OneHzAdjustmentCmd_Payload_t *CommandPtr, |
Check notice
Code scanning / CodeQL
Long function without assertion Note
0466c81
to
312a1d0
Compare
312a1d0
to
7eab9a0
Compare
7eab9a0
to
b9557b4
Compare
b9557b4
to
0c41692
Compare
0c41692
to
3b8404a
Compare
@@ -68,8 +68,8 @@ | |||
uint8 Bytes[UT_TBL_LOAD_BUFFER_SIZE]; | |||
} UT_TBL_LoadBuffer; | |||
|
|||
void * Tbl1Ptr = NULL; | |||
void * Tbl2Ptr = NULL; | |||
void *Tbl1Ptr = NULL; |
Check notice
Code scanning / CodeQL
Global could be static Note
void * Tbl1Ptr = NULL; | ||
void * Tbl2Ptr = NULL; | ||
void *Tbl1Ptr = NULL; | ||
void *Tbl2Ptr = NULL; |
Check notice
Code scanning / CodeQL
Variable scope too large Note
Checklist
Describe the contribution
CommandCounter
's are incremented from 41 to 5, andErrorCounter
's from 71 to 11CFE_STATUS_COMMAND_FAILURE
macro which can be used by command functions to signal a general failure to execute their command. This macro can also be used by other cFS components and apps for command execution failures.Summary of module-specific changes:
ES
CFE_ES_TaskPipe()
CFE_ES_QueryAllCmd()
andCFE_ES_QueryAllTasksCmd()
) whereCFE_SUCCESS
was returned during a failure/error event after theErrorCounter
was incremented. These now returnCFE_STATUS_COMMAND_FAILURE
which improves the clarity of these functions.TIME
CFE_TIME_TaskPipe()
CFE_TIME_SetDelayImpl()
,CFE_TIME_AdjustImpl()
andCFE_TIME_1HzAdjImpl()
were changed fromvoid
return type toCFE_Status_t
in order to carry through the result of their respective add/subtract versions over toCFE_TIME_TaskPipe()
and increment the required countersSB
CFE_SB_ProcessCmdPipePkt()
CFE_SB_IncrCmdCtr()
helper function as it is no longer required with these changes - its functionality has been folded intoCFE_SB_ProcessCmdPipePkt()
TBL
CFE_TBL_MESSAGE_ERROR
(essentially replaced byCFE_STATUS_COMMAND_FAILURE)
CFE_TBL_CmdProcRet_t
enumerationCFE_TBL_INC_ERR_CTR,
which was previously mapped toCFE_TBL_MESSAGE_ERROR,
has now been replaced by the newCFE_STATUS_COMMAND_FAILURE
macro which was introduced in this PR.CFE_TBL_MESSAGE_ERROR
orCFE_TBL_CmdProcRet_t
- if this is required in this case, just let me know.CFE_TBL_NoopCmd()
erroneously noted a possible error return in doxygen comments - this has been removed as the function always returnsCFE_SUCCESS
.Note: #2264 which converts the remaining
int32
return types toCFE_Status_t
(along with most of the localstatus
/return
variables) is complementary to this PR.Testing performed
GitHub CI actions all passing successfully.
Local testing with full cFS suite confirms net coverage unchanged.
Prior to changes:
After changes:
Expected behavior changes
Behavior largely unchanged, other than the modifications listed above.
cFE command-handling code is now simpler, more consistent and easier to maintain.
System(s) tested on
Debian GNU/Linux 11 (bullseye)
Current main branch of cFS bundle.
Contributor Info
Avi Weiss @thnkslprpt