Skip to content

Commit 41c3dad

Browse files
committed
Add args to CmdSeqIn
1 parent 36e7a02 commit 41c3dad

15 files changed

Lines changed: 66 additions & 27 deletions

Svc/CmdSequencer/CmdSequencerImpl.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ void CmdSequencerComponentImpl::CS_RUN_cmdHandler(FwOpcodeType opCode,
100100
if (AUTO == this->m_stepMode) {
101101
this->m_runMode = RUNNING;
102102
if (this->isConnected_seqStartOut_OutputPort(0)) {
103-
this->seqStartOut_out(0, this->m_sequence->getStringFileName());
103+
// Create empty SeqArgs as placeholder
104+
// Use parameterized constructor to ensure m_size is initialized to 0
105+
Svc::SeqArgs emptyArgs(0, 0);
106+
this->seqStartOut_out(0, this->m_sequence->getStringFileName(), emptyArgs);
104107
}
105108
this->performCmd_Step();
106109
}
@@ -162,15 +165,19 @@ void CmdSequencerComponentImpl::doSequenceRun(const Fw::StringBase& filename) {
162165
if (AUTO == this->m_stepMode) {
163166
this->m_runMode = RUNNING;
164167
if (this->isConnected_seqStartOut_OutputPort(0)) {
165-
this->seqStartOut_out(0, this->m_sequence->getStringFileName());
168+
// Create empty SeqArgs as placeholder
169+
// Use parameterized constructor to ensure m_size is initialized to 0
170+
Svc::SeqArgs emptyArgs(0, 0);
171+
this->seqStartOut_out(0, this->m_sequence->getStringFileName(), emptyArgs);
166172
}
167173
this->performCmd_Step();
168174
}
169175

170176
this->log_ACTIVITY_HI_CS_PortSequenceStarted(this->m_sequence->getLogFileName());
171177
}
172178

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

@@ -322,7 +329,9 @@ void CmdSequencerComponentImpl ::CS_START_cmdHandler(FwOpcodeType opcode, U32 cm
322329
this->performCmd_Step();
323330
this->log_ACTIVITY_HI_CS_CmdStarted(this->m_sequence->getLogFileName());
324331
if (this->isConnected_seqStartOut_OutputPort(0)) {
325-
this->seqStartOut_out(0, this->m_sequence->getStringFileName());
332+
// Create empty SeqArgs as placeholder
333+
Svc::SeqArgs emptyArgs;
334+
this->seqStartOut_out(0, this->m_sequence->getStringFileName(), emptyArgs);
326335
}
327336
this->cmdResponse_out(opcode, cmdSeq, Fw::CmdResponse::OK);
328337
}

Svc/CmdSequencer/CmdSequencerImpl.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ class CmdSequencerComponentImpl final : public CmdSequencerComponentBase {
520520

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

526527
//! Handler implementation for seqDispatchIn

Svc/CmdSequencer/test/ut/CmdSequencerTester.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ void CmdSequencerTester ::parameterizedDataReadErrors(SequenceFiles::File& file)
271271
void CmdSequencerTester ::parameterizedNeverLoaded() {
272272
// Try to run a sequence
273273
Fw::String fArg("");
274-
this->invoke_to_seqRunIn(0, fArg);
274+
Svc::SeqArgs emptyArgs(0, 0);
275+
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
275276
this->clearAndDispatch();
276277
// Assert seqDone response
277278
ASSERT_from_seqDone_SIZE(1);
@@ -474,7 +475,8 @@ void CmdSequencerTester ::runSequence(const U32 cmdSeq, const char* const fileNa
474475
void CmdSequencerTester ::runSequenceByPortCall(const char* const fileName) {
475476
// Invoke the seqRun port
476477
Fw::String fArg(fileName);
477-
this->invoke_to_seqRunIn(0, fArg);
478+
Svc::SeqArgs emptyArgs(0, 0);
479+
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
478480
this->clearAndDispatch();
479481
// Assert no command response
480482
ASSERT_CMD_RESPONSE_SIZE(0);
@@ -500,7 +502,8 @@ void CmdSequencerTester ::runSequenceByFileDispatcherPortCall(const char* const
500502
void CmdSequencerTester ::runLoadedSequence() {
501503
// Invoke the port
502504
Fw::String fArg("");
503-
this->invoke_to_seqRunIn(0, fArg);
505+
Svc::SeqArgs emptyArgs(0, 0);
506+
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
504507
this->clearAndDispatch();
505508
// Assert no command response
506509
ASSERT_CMD_RESPONSE_SIZE(0);
@@ -530,7 +533,8 @@ void CmdSequencerTester ::startNewSequence(const char* const fileName) {
530533
ASSERT_EVENTS_CS_InvalidMode_SIZE(1);
531534
// Invoke sequence port
532535
Fw::String fArg(fileName);
533-
this->invoke_to_seqRunIn(0, fArg);
536+
Svc::SeqArgs emptyArgs(0, 0);
537+
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
534538
this->clearAndDispatch();
535539
// Assert response on seqDone
536540
ASSERT_from_seqDone_SIZE(1);

Svc/CmdSequencer/test/ut/ImmediateBase.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ void CmdSequencerTester ::parameterizedLoadRunRun(SequenceFiles::File& file, con
166166
this->parameterizedAutoByPort(file, numCommands, bound);
167167
// Try to run a loaded sequence
168168
Fw::String fArg("");
169-
this->invoke_to_seqRunIn(0, fArg);
169+
Svc::SeqArgs emptyArgs(0, 0);
170+
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
170171
this->clearAndDispatch();
171172
// Assert seqDone response
172173
ASSERT_from_seqDone_SIZE(1);

Svc/CmdSequencer/test/ut/InvalidFiles.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ void CmdSequencerTester ::MissingCRC() {
218218
ASSERT_TLM_CS_Errors(0, 2);
219219
// Run the sequence by port call
220220
Fw::String fArg(file.getName());
221-
this->invoke_to_seqRunIn(0, fArg);
221+
Svc::SeqArgs emptyArgs(0, 0);
222+
this->invoke_to_seqRunIn(0, fArg, emptyArgs);
222223
this->clearAndDispatch();
223224
// Assert seqDone response
224225
ASSERT_from_seqDone_SIZE(1);

Svc/FpySequencer/FpySequencer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ void FpySequencer::cmdResponseIn_handler(FwIndexType portNum, //!< T
391391
}
392392

393393
//! Handler for input port seqRunIn
394-
void FpySequencer::seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename) {
394+
void FpySequencer::seqRunIn_handler(FwIndexType portNum, const Fw::StringBase& filename, const Svc::SeqArgs& args) {
395+
(void)args; // Suppress unused parameter warning
395396
// can only run a seq while in idle
396397
if (sequencer_getState() != State::IDLE) {
397398
this->log_WARNING_HI_InvalidSeqRunCall(static_cast<I32>(sequencer_getState()));

Svc/FpySequencer/FpySequencer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class FpySequencer : public FpySequencerComponentBase {
481481
) override;
482482

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

486486
//! Handler for input port pingIn
487487
void pingIn_handler(FwIndexType portNum, //!< The port number

Svc/FpySequencer/FpySequencerStateMachine.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,10 @@ void FpySequencer::Svc_FpySequencer_SequencerStateMachine_action_report_seqStart
346346
) {
347347
if (this->isConnected_seqStartOut_OutputPort(0)) {
348348
// report that the sequence started to internal callers
349-
this->seqStartOut_out(0, this->m_sequenceFilePath);
349+
// Create empty SeqArgs as placeholder
350+
// Use parameterized constructor to ensure m_size is initialized to 0
351+
Svc::SeqArgs emptyArgs(0, 0);
352+
this->seqStartOut_out(0, this->m_sequenceFilePath, emptyArgs);
350353
}
351354
}
352355
// ----------------------------------------------------------------------

Svc/FpySequencer/test/ut/FpySequencerTestMain.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,7 +2134,7 @@ TEST_F(FpySequencerTester, cmd_RUN) {
21342134
ASSERT_EQ(tester_get_m_statementsDispatched(), 0);
21352135
dispatchUntilState(State::RUNNING_AWAITING_STATEMENT_RESPONSE);
21362136
ASSERT_from_seqStartOut_SIZE(1);
2137-
ASSERT_from_seqStartOut(0, Fw::String("test.bin"));
2137+
ASSERT_from_seqStartOut(0, Fw::String("test.bin"), Svc::SeqArgs(0, 0));
21382138
ASSERT_EQ(tester_get_m_sequencesStarted(), 1);
21392139
dispatchUntilState(State::IDLE);
21402140
ASSERT_EQ(tester_get_m_statementsDispatched(), 1);
@@ -2151,7 +2151,7 @@ TEST_F(FpySequencerTester, cmd_RUN) {
21512151
ASSERT_from_seqDoneOut_SIZE(0);
21522152
dispatchUntilState(State::VALIDATING);
21532153
ASSERT_from_seqStartOut_SIZE(1);
2154-
ASSERT_from_seqStartOut(0, Fw::String("test.bin"));
2154+
ASSERT_from_seqStartOut(0, Fw::String("test.bin"), Svc::SeqArgs(0, 0));
21552155
dispatchUntilState(State::RUNNING_AWAITING_STATEMENT_RESPONSE);
21562156
dispatchUntilState(State::IDLE);
21572157
ASSERT_CMD_RESPONSE_SIZE(1);
@@ -3277,22 +3277,23 @@ TEST_F(FpySequencerTester, seqRunIn) {
32773277
add_NO_OP();
32783278
writeToFile("test.bin");
32793279

3280-
invoke_to_seqRunIn(0, Fw::String("test.bin"));
3280+
Svc::SeqArgs emptyArgs;
3281+
invoke_to_seqRunIn(0, Fw::String("test.bin"), emptyArgs);
32813282
this->tester_doDispatch();
32823283
dispatchUntilState(State::VALIDATING);
32833284
dispatchUntilState(State::RUNNING_AWAITING_STATEMENT_RESPONSE);
32843285
dispatchUntilState(State::IDLE);
32853286

32863287
ASSERT_from_seqStartOut_SIZE(1);
3287-
ASSERT_from_seqStartOut(0, Fw::String("test.bin"));
3288+
ASSERT_from_seqStartOut(0, Fw::String("test.bin"), Svc::SeqArgs(0, 0));
32883289
ASSERT_from_seqDoneOut_SIZE(1);
32893290
ASSERT_from_seqDoneOut(0, 0, 0, Fw::CmdResponse::OK);
32903291

32913292
this->clearHistory();
32923293

32933294
// try running while already running
32943295
this->tester_setState(State::RUNNING_DISPATCH_STATEMENT);
3295-
invoke_to_seqRunIn(0, Fw::String("test.bin"));
3296+
invoke_to_seqRunIn(0, Fw::String("test.bin"), emptyArgs);
32963297
// dispatch cmd
32973298
this->tester_doDispatch();
32983299
ASSERT_EVENTS_InvalidSeqRunCall_SIZE(1);

Svc/Seq/Seq.fpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
module Svc {
2+
struct SeqArgs {
3+
$size: FwSizeType
4+
args: [SequenceArgumentsMaxSize] U8
5+
} default { $size = 0 }
26

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

813
@ Port to cancel a sequence

0 commit comments

Comments
 (0)