Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions Svc/CmdSequencer/CmdSequencerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ void CmdSequencerComponentImpl::CS_RUN_cmdHandler(FwOpcodeType opCode,
if (AUTO == this->m_stepMode) {
this->m_runMode = RUNNING;
if (this->isConnected_seqStartOut_OutputPort(0)) {
this->seqStartOut_out(0, this->m_sequence->getStringFileName());
// Create empty SeqArgs as placeholder
// Use parameterized constructor to ensure m_size is initialized to 0
Svc::SeqArgs emptyArgs(0, 0);
this->seqStartOut_out(0, this->m_sequence->getStringFileName(), emptyArgs);
}
this->performCmd_Step();
}
Expand Down Expand Up @@ -162,15 +165,19 @@ void CmdSequencerComponentImpl::doSequenceRun(const Fw::StringBase& filename) {
if (AUTO == this->m_stepMode) {
this->m_runMode = RUNNING;
if (this->isConnected_seqStartOut_OutputPort(0)) {
this->seqStartOut_out(0, this->m_sequence->getStringFileName());
// Create empty SeqArgs as placeholder
// Use parameterized constructor to ensure m_size is initialized to 0
Svc::SeqArgs emptyArgs(0, 0);
this->seqStartOut_out(0, this->m_sequence->getStringFileName(), emptyArgs);
}
this->performCmd_Step();
}

this->log_ACTIVITY_HI_CS_PortSequenceStarted(this->m_sequence->getLogFileName());
}

void CmdSequencerComponentImpl::seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename) {
void CmdSequencerComponentImpl::seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename, const Svc::SeqArgs& args) {
(void)args; // Suppress unused parameter warning
this->doSequenceRun(filename);
}

Expand Down Expand Up @@ -322,7 +329,9 @@ void CmdSequencerComponentImpl ::CS_START_cmdHandler(FwOpcodeType opcode, U32 cm
this->performCmd_Step();
this->log_ACTIVITY_HI_CS_CmdStarted(this->m_sequence->getLogFileName());
if (this->isConnected_seqStartOut_OutputPort(0)) {
this->seqStartOut_out(0, this->m_sequence->getStringFileName());
// Create empty SeqArgs as placeholder
Svc::SeqArgs emptyArgs;
this->seqStartOut_out(0, this->m_sequence->getStringFileName(), emptyArgs);
}
this->cmdResponse_out(opcode, cmdSeq, Fw::CmdResponse::OK);
}
Expand Down
3 changes: 2 additions & 1 deletion Svc/CmdSequencer/CmdSequencerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ class CmdSequencerComponentImpl final : public CmdSequencerComponentBase {

//! Handler for input port seqRunIn
void seqRunIn_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& filename //!< The sequence file
const Fw::StringBase& filename, //!< The sequence file
const Svc::SeqArgs& args //!< Sequence arguments (not currently used)
) override;

//! Handler implementation for seqDispatchIn
Expand Down
12 changes: 8 additions & 4 deletions Svc/CmdSequencer/test/ut/CmdSequencerTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ void CmdSequencerTester ::parameterizedDataReadErrors(SequenceFiles::File& file)
void CmdSequencerTester ::parameterizedNeverLoaded() {
// Try to run a sequence
Fw::String fArg("");
this->invoke_to_seqRunIn(0, fArg);
Svc::SeqArgs emptyArgs(0, 0);
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
this->clearAndDispatch();
// Assert seqDone response
ASSERT_from_seqDone_SIZE(1);
Expand Down Expand Up @@ -474,7 +475,8 @@ void CmdSequencerTester ::runSequence(const U32 cmdSeq, const char* const fileNa
void CmdSequencerTester ::runSequenceByPortCall(const char* const fileName) {
// Invoke the seqRun port
Fw::String fArg(fileName);
this->invoke_to_seqRunIn(0, fArg);
Svc::SeqArgs emptyArgs(0, 0);
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
this->clearAndDispatch();
// Assert no command response
ASSERT_CMD_RESPONSE_SIZE(0);
Expand All @@ -500,7 +502,8 @@ void CmdSequencerTester ::runSequenceByFileDispatcherPortCall(const char* const
void CmdSequencerTester ::runLoadedSequence() {
// Invoke the port
Fw::String fArg("");
this->invoke_to_seqRunIn(0, fArg);
Svc::SeqArgs emptyArgs(0, 0);
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
this->clearAndDispatch();
// Assert no command response
ASSERT_CMD_RESPONSE_SIZE(0);
Expand Down Expand Up @@ -530,7 +533,8 @@ void CmdSequencerTester ::startNewSequence(const char* const fileName) {
ASSERT_EVENTS_CS_InvalidMode_SIZE(1);
// Invoke sequence port
Fw::String fArg(fileName);
this->invoke_to_seqRunIn(0, fArg);
Svc::SeqArgs emptyArgs(0, 0);
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
this->clearAndDispatch();
// Assert response on seqDone
ASSERT_from_seqDone_SIZE(1);
Expand Down
3 changes: 2 additions & 1 deletion Svc/CmdSequencer/test/ut/ImmediateBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ void CmdSequencerTester ::parameterizedLoadRunRun(SequenceFiles::File& file, con
this->parameterizedAutoByPort(file, numCommands, bound);
// Try to run a loaded sequence
Fw::String fArg("");
this->invoke_to_seqRunIn(0, fArg);
Svc::SeqArgs emptyArgs(0, 0);
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
this->clearAndDispatch();
// Assert seqDone response
ASSERT_from_seqDone_SIZE(1);
Expand Down
3 changes: 2 additions & 1 deletion Svc/CmdSequencer/test/ut/InvalidFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ void CmdSequencerTester ::MissingCRC() {
ASSERT_TLM_CS_Errors(0, 2);
// Run the sequence by port call
Fw::String fArg(file.getName());
this->invoke_to_seqRunIn(0, fArg);
Svc::SeqArgs emptyArgs(0, 0);
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
this->clearAndDispatch();
// Assert seqDone response
ASSERT_from_seqDone_SIZE(1);
Expand Down
3 changes: 2 additions & 1 deletion Svc/FpySequencer/FpySequencer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ void FpySequencer::cmdResponseIn_handler(FwIndexType portNum, //!< T
}

//! Handler for input port seqRunIn
void FpySequencer::seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename) {
void FpySequencer::seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename, const Svc::SeqArgs& args) {
(void)args; // Suppress unused parameter warning
// can only run a seq while in idle
if (sequencer_getState() != State::IDLE) {
this->log_WARNING_HI_InvalidSeqRunCall(static_cast<I32>(sequencer_getState()));
Expand Down
2 changes: 1 addition & 1 deletion Svc/FpySequencer/FpySequencer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ class FpySequencer : public FpySequencerComponentBase {
) override;

//! Handler for input port seqRunIn
void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename) override;
void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename, const Svc::SeqArgs& args) override;

//! Handler for input port pingIn
void pingIn_handler(FwIndexType portNum, //!< The port number
Expand Down
5 changes: 4 additions & 1 deletion Svc/FpySequencer/FpySequencerStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ void FpySequencer::Svc_FpySequencer_SequencerStateMachine_action_report_seqStart
) {
if (this->isConnected_seqStartOut_OutputPort(0)) {
// report that the sequence started to internal callers
this->seqStartOut_out(0, this->m_sequenceFilePath);
// Create empty SeqArgs as placeholder
// Use parameterized constructor to ensure m_size is initialized to 0
Svc::SeqArgs emptyArgs(0, 0);
this->seqStartOut_out(0, this->m_sequenceFilePath, emptyArgs);
}
}
// ----------------------------------------------------------------------
Expand Down
11 changes: 6 additions & 5 deletions Svc/FpySequencer/test/ut/FpySequencerTestMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,7 @@ TEST_F(FpySequencerTester, cmd_RUN) {
ASSERT_EQ(tester_get_m_statementsDispatched(), 0);
dispatchUntilState(State::RUNNING_AWAITING_STATEMENT_RESPONSE);
ASSERT_from_seqStartOut_SIZE(1);
ASSERT_from_seqStartOut(0, Fw::String("test.bin"));
ASSERT_from_seqStartOut(0, Fw::String("test.bin"), Svc::SeqArgs(0, 0));
ASSERT_EQ(tester_get_m_sequencesStarted(), 1);
dispatchUntilState(State::IDLE);
ASSERT_EQ(tester_get_m_statementsDispatched(), 1);
Expand All @@ -2086,7 +2086,7 @@ TEST_F(FpySequencerTester, cmd_RUN) {
ASSERT_from_seqDoneOut_SIZE(0);
dispatchUntilState(State::VALIDATING);
ASSERT_from_seqStartOut_SIZE(1);
ASSERT_from_seqStartOut(0, Fw::String("test.bin"));
ASSERT_from_seqStartOut(0, Fw::String("test.bin"), Svc::SeqArgs(0, 0));
dispatchUntilState(State::RUNNING_AWAITING_STATEMENT_RESPONSE);
dispatchUntilState(State::IDLE);
ASSERT_CMD_RESPONSE_SIZE(1);
Expand Down Expand Up @@ -3169,22 +3169,23 @@ TEST_F(FpySequencerTester, seqRunIn) {
add_NO_OP();
writeToFile("test.bin");

invoke_to_seqRunIn(0, Fw::String("test.bin"));
Svc::SeqArgs emptyArgs;
invoke_to_seqRunIn(0, Fw::String("test.bin"), emptyArgs);
this->tester_doDispatch();
dispatchUntilState(State::VALIDATING);
dispatchUntilState(State::RUNNING_AWAITING_STATEMENT_RESPONSE);
dispatchUntilState(State::IDLE);

ASSERT_from_seqStartOut_SIZE(1);
ASSERT_from_seqStartOut(0, Fw::String("test.bin"));
ASSERT_from_seqStartOut(0, Fw::String("test.bin"), Svc::SeqArgs(0, 0));
ASSERT_from_seqDoneOut_SIZE(1);
ASSERT_from_seqDoneOut(0, 0, 0, Fw::CmdResponse::OK);

this->clearHistory();

// try running while already running
this->tester_setState(State::RUNNING_DISPATCH_STATEMENT);
invoke_to_seqRunIn(0, Fw::String("test.bin"));
invoke_to_seqRunIn(0, Fw::String("test.bin"), emptyArgs);
// dispatch cmd
this->tester_doDispatch();
ASSERT_EVENTS_InvalidSeqRunCall_SIZE(1);
Expand Down
5 changes: 5 additions & 0 deletions Svc/Seq/Seq.fpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
module Svc {
struct SeqArgs {
$size: FwSizeType
args: [SequenceArgumentsMaxSize] U8
} default { $size = 0 }

@ Port to request a sequence be run
port CmdSeqIn(
filename: string size 240 @< The sequence file
args: SeqArgs @< Sequence arguments (placeholder - not currently processed)
)

@ Port to cancel a sequence
Expand Down
13 changes: 10 additions & 3 deletions Svc/SeqDispatcher/SeqDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ void SeqDispatcher::runSequence(FwIndexType sequencerIdx, const Fw::ConstStringB

this->m_dispatchedCount++;
this->tlmWrite_dispatchedCount(this->m_dispatchedCount);
this->seqRunOut_out(sequencerIdx, this->m_entryTable[sequencerIdx].sequenceRunning);

// Create empty SeqArgs (no arguments for command-initiated sequences)
// Use parameterized constructor to ensure m_size is initialized to 0
Svc::SeqArgs emptyArgs(0, 0);
this->seqRunOut_out(sequencerIdx, this->m_entryTable[sequencerIdx].sequenceRunning, emptyArgs);
}

void SeqDispatcher::seqStartIn_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& fileName //!< The sequence file name
const Fw::StringBase& fileName, //!< The sequence file name
const Svc::SeqArgs& args //!< Sequence arguments (not currently used)
) {
(void)args; // Suppress unused parameter warning
FW_ASSERT(portNum >= 0 && portNum < SeqDispatcherSequencerPorts, static_cast<FwAssertArgType>(portNum));
if (this->m_entryTable[portNum].state == SeqDispatcher_CmdSequencerState::RUNNING_SEQUENCE_BLOCK ||
this->m_entryTable[portNum].state == SeqDispatcher_CmdSequencerState::RUNNING_SEQUENCE_NO_BLOCK) {
Expand Down Expand Up @@ -121,7 +127,8 @@ void SeqDispatcher::seqDoneIn_handler(FwIndexType portNum, //!< The
}

//! Handler for input port seqRunIn
void SeqDispatcher::seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& fileName) {
void SeqDispatcher::seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& fileName, const Svc::SeqArgs& args) {
(void)args; // Suppress unused parameter warning
FwIndexType idx = this->getNextAvailableSequencerIdx();
// no available sequencers
if (idx == -1) {
Expand Down
6 changes: 4 additions & 2 deletions Svc/SeqDispatcher/SeqDispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ class SeqDispatcher final : public SeqDispatcherComponentBase {

//! Handler for input port seqStartIn
void seqStartIn_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& fileName //!< The sequence file
const Fw::StringBase& fileName, //!< The sequence file
const Svc::SeqArgs& args //!< Optional sequence arguments
);

//! Handler for input port seqRunIn
void seqRunIn_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& fileName //!< The sequence file
const Fw::StringBase& fileName, //!< The sequence file
const Svc::SeqArgs& args //!< Optional sequence arguments
);

private:
Expand Down
5 changes: 3 additions & 2 deletions Svc/SeqDispatcher/test/ut/SeqDispatcherTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ void SeqDispatcherTester::testLogStatus() {
}

void SeqDispatcherTester::seqRunOut_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& filename //!< The sequence file
const Fw::StringBase& filename, //!< The sequence file
const Svc::SeqArgs& args //!< Sequence arguments
) {
this->pushFromPortEntry_seqRunOut(filename);
this->pushFromPortEntry_seqRunOut(filename, args);
}

} // namespace Svc
3 changes: 2 additions & 1 deletion Svc/SeqDispatcher/test/ut/SeqDispatcherTester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class SeqDispatcherTester : public SeqDispatcherGTestBase {
// ----------------------------------------------------------------------

void seqRunOut_handler(FwIndexType portNum, //!< The port number
const Fw::StringBase& filename //!< The sequence file
const Fw::StringBase& filename, //!< The sequence file
const Svc::SeqArgs& args //!< Sequence arguments
);

private:
Expand Down
2 changes: 2 additions & 0 deletions default/config/AcConstants.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ constant FwAssertTextSize = 256
@ the constants FW_ASSERT_TEXT_SIZE and FW_LOG_STRING_MAX_SIZE, set
@ in FpConfig.h.
constant AssertFatalAdapterEventFileSize = FileNameStringSize

constant SequenceArgumentsMaxSize = 512