-
Notifications
You must be signed in to change notification settings - Fork 1.4k
FpySequencer flag system #4259
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
base: devel
Are you sure you want to change the base?
FpySequencer flag system #4259
Conversation
@LeStarch this is ready for review |
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR); | ||
return; | ||
} | ||
|
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR); | ||
return; | ||
} | ||
|
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
this->m_runtime.flags[flag.e] = value; | ||
|
||
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | ||
} |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
this->paramGet_FLAG_DEFAULT_EXIT_ON_CMD_FAIL(valid); | ||
FW_ASSERT(valid != Fw::ParamValid::INVALID && valid != Fw::ParamValid::UNINIT, | ||
static_cast<FwAssertArgType>(valid.e)); | ||
} |
Check warning
Code scanning / CodeQL
Unchecked return value Warning
paramGet_FLAG_DEFAULT_EXIT_ON_CMD_FAIL
this->push<U8>(flagVal); | ||
return Signal::stmtResponse_success; | ||
} | ||
} // namespace Svc |
Check warning
Code scanning / CodeQL
Unchecked return value Warning
operator=
break; | ||
} | ||
case Fpy::DirectiveId::SET_FLAG: { | ||
new (&deserializedDirective.setFlag) FpySequencer_SetFlagDirective(); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
break; | ||
} | ||
case Fpy::DirectiveId::GET_FLAG: { | ||
new (&deserializedDirective.getFlag) FpySequencer_GetFlagDirective(); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
return; | ||
} | ||
case Fpy::DirectiveId::SET_FLAG: { | ||
this->directive_setFlag_internalInterfaceInvoke(directive.setFlag); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
return; | ||
} | ||
case Fpy::DirectiveId::GET_FLAG: { | ||
this->directive_getFlag_internalInterfaceInvoke(directive.getFlag); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
void FpySequencer::SET_FLAG_cmdHandler(FwOpcodeType opCode, //!< The opcode | ||
U32 cmdSeq, //!< The command sequence number | ||
Svc::Fpy::FlagId flag, | ||
bool value) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
if (directive.get_flagIdx() >= Fpy::FLAG_COUNT) { | ||
error = DirectiveError::FLAG_IDX_OUT_OF_BOUNDS; | ||
return Signal::stmtResponse_failure; | ||
} |
Check notice
Code scanning / CodeQL
Long function without assertion Note
if (directive.get_flagIdx() >= Fpy::FLAG_COUNT) { | ||
error = DirectiveError::FLAG_IDX_OUT_OF_BOUNDS; | ||
return Signal::stmtResponse_failure; | ||
} |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@zimri-leisher merge of the last PR created conflicts here. Would you take a look? They aren't trivial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally some comments to answer.
// this is a sanity check, we shouldn't even get here if this isn't true | ||
// because the enum should check for validity and raise a format err if not valid. | ||
// actually what this really catches is an incorrect FLAG_COUNT value | ||
FW_ASSERT(static_cast<I32>(flag.e) < Fpy::FLAG_COUNT, static_cast<FwAssertArgType>(flag.e)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use an I32 here, I see 8-bits below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the args to < will be converted to 32 bit types implicitly, this just makes it explicit.
@LeStarch feedback responded to |
//! Internal interface handler for directive_setFlag | ||
void FpySequencer::directive_setFlag_internalInterfaceHandler(const Svc::FpySequencer_SetFlagDirective& directive) { | ||
DirectiveError error = DirectiveError::NO_ERROR; | ||
this->sendSignal(this->setFlag_directiveHandler(directive, error)); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
//! Internal interface handler for directive_getFlag | ||
void FpySequencer::directive_getFlag_internalInterfaceHandler(const Svc::FpySequencer_GetFlagDirective& directive) { | ||
DirectiveError error = DirectiveError::NO_ERROR; | ||
this->sendSignal(this->getFlag_directiveHandler(directive, error)); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
Change Description