F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
WasmSequencerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title WasmSequencerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for WasmSequencer component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace {
17 
18  // Constant definitions for the state machine signal buffer
19  namespace SmSignalBuffer {
20 
21  // Union for computing the max size of a signal type
22  union SignalTypeUnion {
23  BYTE size_of_I16[sizeof(I16)];
24  BYTE size_of_I32[sizeof(I32)];
25  BYTE size_of_Svc_WasmSequencer_CommandRequest[Svc::WasmSequencer_CommandRequest::SERIALIZED_SIZE];
26  BYTE size_of_Svc_WasmSequencer_HostFunction[Svc::WasmSequencer_HostFunction::SERIALIZED_SIZE];
27  BYTE size_of_Svc_WasmSequencer_InvokeRequest[Svc::WasmSequencer_InvokeRequest::SERIALIZED_SIZE];
28  BYTE size_of_Svc_WasmSequencer_LoadRequest[Svc::WasmSequencer_LoadRequest::SERIALIZED_SIZE];
29  BYTE size_of_Svc_WasmSequencer_RequestContext[Svc::WasmSequencer_RequestContext::SERIALIZED_SIZE];
30  BYTE size_of_Svc_WasmSequencer_TrapReason[Svc::WasmSequencer_TrapReason::SERIALIZED_SIZE];
31  };
32 
33  // The serialized size
34  static constexpr FwSizeType SERIALIZED_SIZE =
35  2 * sizeof(FwEnumStoreType) +
36  sizeof(SignalTypeUnion);
37 
38  }
39 
40  enum MsgTypeEnum {
41  WASMSEQUENCER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
42  CHECKTIMERS_SCHED,
43  CMDRESPONSEIN_CMDRESPONSE,
44  SEQRUNIN_CMDSEQIN,
45  WRITETELEMETRY_SCHED,
46  CMD_RUN,
47  CMD_LOAD,
48  CMD_INVOKE,
49  CMD_WAIT,
50  CMD_PAUSE,
51  CMD_CONTINUE,
52  CMD_GLOBAL_SET_I32,
53  CMD_GLOBAL_SET_I64,
54  CMD_GLOBAL_SET_F32,
55  CMD_GLOBAL_SET_F64,
56  CMD_GLOBAL_GET,
57  INTERNAL_STATE_MACHINE_SIGNAL,
58  };
59 
60  // Get the max size by constructing a union of the async input, command, and
61  // internal port serialization sizes
62  union BuffUnion {
63  BYTE checkTimersPortSize[Svc::SchedPortBuffer::CAPACITY];
64  BYTE cmdResponseInPortSize[Fw::CmdResponsePortBuffer::CAPACITY];
65  BYTE seqRunInPortSize[Svc::CmdSeqInPortBuffer::CAPACITY];
66  BYTE writeTelemetryPortSize[Svc::SchedPortBuffer::CAPACITY];
68  // Size of buffer for internal state machine signals
69  // The internal SmSignalBuffer stores the state machine id, the
70  // signal id, and the signal data
71  BYTE internalSmBufferSize[SmSignalBuffer::SERIALIZED_SIZE];
72  };
73 
74  // Define a message buffer class large enough to handle all the
75  // asynchronous inputs to the component
76  class ComponentIpcSerializableBuffer :
78  {
79 
80  public:
81 
82  enum {
83  // Offset into data in buffer: Size of message ID and port number
84  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
85  // Max data size
86  MAX_DATA_SIZE = sizeof(BuffUnion),
87  // Max message size: Size of message id + size of port + max data size
88  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
89  };
90 
91  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
92 
93  }
94 
95  private:
96  // Should be the max of all the input ports serialized sizes...
97  U8 m_buff[SERIALIZATION_SIZE];
98 
99  };
100  }
101 
102  // ----------------------------------------------------------------------
103  // Types for internal state machines
104  // ----------------------------------------------------------------------
105 
108  m_component(component)
109  {
110 
111  }
112 
115  {
116  this->initBase(static_cast<FwEnumStoreType>(smId));
117  }
118 
120  getId() const
121  {
122  return static_cast<WasmSequencerComponentBase::SmId>(this->m_id);
123  }
124 
125  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
126  action_processInvoke(
127  Signal signal,
129  )
130  {
131  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_processInvoke(this->getId(), signal, value);
132  }
133 
134  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
135  action_setCancelRequested(Signal signal)
136  {
137  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_setCancelRequested(this->getId(), signal);
138  }
139 
140  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
141  action_clearCancelRequested(Signal signal)
142  {
143  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_clearCancelRequested(this->getId(), signal);
144  }
145 
146  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
147  action_cancelPendingRequest(
148  Signal signal,
150  )
151  {
152  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_cancelPendingRequest(this->getId(), signal, value);
153  }
154 
155  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
156  action_respond_noblock_OK(
157  Signal signal,
159  )
160  {
161  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_respond_noblock_OK(this->getId(), signal, value);
162  }
163 
164  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
165  action_respond_ERROR(
166  Signal signal,
168  )
169  {
170  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_respond_ERROR(this->getId(), signal, value);
171  }
172 
173  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
174  action_incrementSequenceFailure(Signal signal)
175  {
176  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_incrementSequenceFailure(this->getId(), signal);
177  }
178 
179  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
180  action_respondInvoke_BUSY(
181  Signal signal,
183  )
184  {
185  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_respondInvoke_BUSY(this->getId(), signal, value);
186  }
187 
188  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
189  action_respondInvoke_ERROR(
190  Signal signal,
192  )
193  {
194  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_respondInvoke_ERROR(this->getId(), signal, value);
195  }
196 
197  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
198  action_respondLoad_BUSY(
199  Signal signal,
200  const Svc::WasmSequencer_LoadRequest& value
201  )
202  {
203  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_respondLoad_BUSY(this->getId(), signal, value);
204  }
205 
206  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
207  action_respond_block_OK(
208  Signal signal,
210  )
211  {
212  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_respond_block_OK(this->getId(), signal, value);
213  }
214 
215  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
216  action_respond_block_ERROR(
217  Signal signal,
219  )
220  {
221  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_respond_block_ERROR(this->getId(), signal, value);
222  }
223 
224  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
225  action_load(
226  Signal signal,
227  const Svc::WasmSequencer_LoadRequest& value
228  )
229  {
230  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_load(this->getId(), signal, value);
231  }
232 
233  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
234  action_invokeStart(
235  Signal signal,
237  )
238  {
239  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_invokeStart(this->getId(), signal, value);
240  }
241 
242  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
243  action_invokeMain(
244  Signal signal,
246  )
247  {
248  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_invokeMain(this->getId(), signal, value);
249  }
250 
251  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
252  action_reportModuleInvalidMain(
253  Signal signal,
255  )
256  {
257  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_reportModuleInvalidMain(this->getId(), signal, value);
258  }
259 
260  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
261  action_reportModuleMainInvokeFailed(
262  Signal signal,
264  )
265  {
266  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_reportModuleMainInvokeFailed(this->getId(), signal, value);
267  }
268 
269  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
270  action_reportModuleStartInvokeFailed(
271  Signal signal,
273  )
274  {
275  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_reportModuleStartInvokeFailed(this->getId(), signal, value);
276  }
277 
278  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
279  action_reportModuleStarted(
280  Signal signal,
282  )
283  {
284  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_reportModuleStarted(this->getId(), signal, value);
285  }
286 
287  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
288  action_reportModuleSucceeded(
289  Signal signal,
291  )
292  {
293  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_reportModuleSucceeded(this->getId(), signal, value);
294  }
295 
296  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
297  action_reportModuleStartFailed(
298  Signal signal,
300  )
301  {
302  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_reportModuleStartFailed(this->getId(), signal, value);
303  }
304 
305  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
306  action_reportModuleMainFailed(
307  Signal signal,
309  )
310  {
311  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_reportModuleMainFailed(this->getId(), signal, value);
312  }
313 
314  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
315  action_resetStore(Signal signal)
316  {
317  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_resetStore(this->getId(), signal);
318  }
319 
320  void WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
321  action_runEngine(
322  Signal signal,
324  )
325  {
326  this->m_component.Svc_WasmSequencer_ControllerStateMachine_action_runEngine(this->getId(), signal, value);
327  }
328 
329  bool WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
330  guard_cancelRequested(Signal signal) const
331  {
332  return this->m_component.Svc_WasmSequencer_ControllerStateMachine_guard_cancelRequested(this->getId(), signal);
333  }
334 
335  bool WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
336  guard_moduleHasStart(
337  Signal signal,
339  ) const
340  {
341  return this->m_component.Svc_WasmSequencer_ControllerStateMachine_guard_moduleHasStart(this->getId(), signal, value);
342  }
343 
344  bool WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
345  guard_moduleHasValidMain(
346  Signal signal,
348  ) const
349  {
350  return this->m_component.Svc_WasmSequencer_ControllerStateMachine_guard_moduleHasValidMain(this->getId(), signal, value);
351  }
352 
353  bool WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
354  guard_invokeSucceeded(
355  Signal signal,
357  ) const
358  {
359  return this->m_component.Svc_WasmSequencer_ControllerStateMachine_guard_invokeSucceeded(this->getId(), signal, value);
360  }
361 
362  bool WasmSequencerComponentBase::Svc_WasmSequencer_ControllerStateMachine ::
363  guard_interpreterSucceeded(Signal signal) const
364  {
365  return this->m_component.Svc_WasmSequencer_ControllerStateMachine_guard_interpreterSucceeded(this->getId(), signal);
366  }
367 
370  m_component(component)
371  {
372 
373  }
374 
377  {
378  this->initBase(static_cast<FwEnumStoreType>(smId));
379  }
380 
382  getId() const
383  {
384  return static_cast<WasmSequencerComponentBase::SmId>(this->m_id);
385  }
386 
387  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
388  action_cmdReplyOK(
389  Signal signal,
391  )
392  {
393  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_cmdReplyOK(this->getId(), signal, value);
394  }
395 
396  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
397  action_signalEntered(Signal signal)
398  {
399  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_signalEntered(this->getId(), signal);
400  }
401 
402  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
403  action_spin(Signal signal)
404  {
405  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_spin(this->getId(), signal);
406  }
407 
408  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
409  action_reset(Signal signal)
410  {
411  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_reset(this->getId(), signal);
412  }
413 
414  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
415  action_clearExitStatus(Signal signal)
416  {
417  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_clearExitStatus(this->getId(), signal);
418  }
419 
420  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
421  action_setExitReason_INTERPRETER_FINISHED(Signal signal)
422  {
423  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setExitReason_INTERPRETER_FINISHED(this->getId(), signal);
424  }
425 
426  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
427  action_setExitReason_INTERPRETER_TRAP(Signal signal)
428  {
429  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setExitReason_INTERPRETER_TRAP(this->getId(), signal);
430  }
431 
432  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
433  action_setExitReason_REPLY_TIMEOUT(Signal signal)
434  {
435  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setExitReason_REPLY_TIMEOUT(this->getId(), signal);
436  }
437 
438  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
439  action_setExitReason_HOST_FAILURE(Signal signal)
440  {
441  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setExitReason_HOST_FAILURE(this->getId(), signal);
442  }
443 
444  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
445  action_setExitReason_TIMER_INCOMPARABLE(Signal signal)
446  {
447  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setExitReason_TIMER_INCOMPARABLE(this->getId(), signal);
448  }
449 
450  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
451  action_setExitReason_UNEXPECTED_REPLY(Signal signal)
452  {
453  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setExitReason_UNEXPECTED_REPLY(this->getId(), signal);
454  }
455 
456  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
457  action_setExitReason_CANCEL(Signal signal)
458  {
459  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setExitReason_CANCEL(this->getId(), signal);
460  }
461 
462  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
463  action_setExitCode(
464  Signal signal,
465  I32 value
466  )
467  {
468  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setExitCode(this->getId(), signal, value);
469  }
470 
471  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
472  action_setTrapReason(
473  Signal signal,
474  const Svc::WasmSequencer_TrapReason& value
475  )
476  {
477  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setTrapReason(this->getId(), signal, value);
478  }
479 
480  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
481  action_setLastHostFunction(Signal signal)
482  {
483  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setLastHostFunction(this->getId(), signal);
484  }
485 
486  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
487  action_finish(Signal signal)
488  {
489  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_finish(this->getId(), signal);
490  }
491 
492  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
493  action_reportPaused(Signal signal)
494  {
495  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_reportPaused(this->getId(), signal);
496  }
497 
498  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
499  action_clearPause(Signal signal)
500  {
501  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_clearPause(this->getId(), signal);
502  }
503 
504  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
505  action_dispatchPendingHostFunction(Signal signal)
506  {
507  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_dispatchPendingHostFunction(this->getId(), signal);
508  }
509 
510  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
511  action_clearPendingHostFunction(Signal signal)
512  {
513  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_clearPendingHostFunction(this->getId(), signal);
514  }
515 
516  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
517  action_setContext(
518  Signal signal,
520  )
521  {
522  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_setContext(this->getId(), signal, value);
523  }
524 
525  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
526  action_clearContext(Signal signal)
527  {
528  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_clearContext(this->getId(), signal);
529  }
530 
531  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
532  action_resume(Signal signal)
533  {
534  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_resume(this->getId(), signal);
535  }
536 
537  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
538  action_resumeI32(
539  Signal signal,
540  I32 value
541  )
542  {
543  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_resumeI32(this->getId(), signal, value);
544  }
545 
546  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
547  action_checkSleepTimers(Signal signal)
548  {
549  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_checkSleepTimers(this->getId(), signal);
550  }
551 
552  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
553  action_checkTimeout(Signal signal)
554  {
555  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_checkTimeout(this->getId(), signal);
556  }
557 
558  void WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
559  action_dequeueSerialAndResume(
560  Signal signal,
561  const FwIndexType& value
562  )
563  {
564  this->m_component.Svc_WasmSequencer_InterpreterStateMachine_action_dequeueSerialAndResume(this->getId(), signal, value);
565  }
566 
567  bool WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
568  guard_pendingPause(Signal signal) const
569  {
570  return this->m_component.Svc_WasmSequencer_InterpreterStateMachine_guard_pendingPause(this->getId(), signal);
571  }
572 
573  bool WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
574  guard_pendingHostFunction(Signal signal) const
575  {
576  return this->m_component.Svc_WasmSequencer_InterpreterStateMachine_guard_pendingHostFunction(this->getId(), signal);
577  }
578 
579  bool WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
580  guard_pendingHostFunctionIsSleep(Signal signal) const
581  {
582  return this->m_component.Svc_WasmSequencer_InterpreterStateMachine_guard_pendingHostFunctionIsSleep(this->getId(), signal);
583  }
584 
585  bool WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
586  guard_blockingSerialIn(
587  Signal signal,
588  const FwIndexType& value
589  ) const
590  {
591  return this->m_component.Svc_WasmSequencer_InterpreterStateMachine_guard_blockingSerialIn(this->getId(), signal, value);
592  }
593 
594  bool WasmSequencerComponentBase::Svc_WasmSequencer_InterpreterStateMachine ::
595  guard_dequeueSucceeded(Signal signal) const
596  {
597  return this->m_component.Svc_WasmSequencer_InterpreterStateMachine_guard_dequeueSucceeded(this->getId(), signal);
598  }
599 
600  // ----------------------------------------------------------------------
601  // Component initialization
602  // ----------------------------------------------------------------------
603 
606  FwSizeType queueDepth,
607  FwEnumStoreType instance
608  )
609  {
610  // Initialize base class
612 
613  // Initialize state machine instances
614  this->m_stateMachine_controller.init(SmId::controller);
615  this->m_stateMachine_interpreter.init(SmId::interpreter);
616 
617 #if !FW_DIRECT_PORT_CALLS
618  // Connect input port cmdIn
619  for (
620  FwIndexType port = 0;
621  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
622  port++
623  ) {
624  this->m_cmdIn_InputPort[port].init();
625  this->m_cmdIn_InputPort[port].addCallComp(
626  this,
627  m_p_cmdIn_in
628  );
629  this->m_cmdIn_InputPort[port].setPortNum(port);
630 
631 #if FW_OBJECT_NAMES == 1
632  Fw::ObjectName portName;
633  portName.format(
634  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
635  this->m_objName.toChar(),
636  port
637  );
638  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
639 #endif
640  }
641 #endif
642 
643 #if !FW_DIRECT_PORT_CALLS
644  // Connect input port checkTimers
645  for (
646  FwIndexType port = 0;
647  port < static_cast<FwIndexType>(this->getNum_checkTimers_InputPorts());
648  port++
649  ) {
650  this->m_checkTimers_InputPort[port].init();
651  this->m_checkTimers_InputPort[port].addCallComp(
652  this,
653  m_p_checkTimers_in
654  );
655  this->m_checkTimers_InputPort[port].setPortNum(port);
656 
657 #if FW_OBJECT_NAMES == 1
658  Fw::ObjectName portName;
659  portName.format(
660  "%s_checkTimers_InputPort[%" PRI_FwIndexType "]",
661  this->m_objName.toChar(),
662  port
663  );
664  this->m_checkTimers_InputPort[port].setObjName(portName.toChar());
665 #endif
666  }
667 #endif
668 
669 #if !FW_DIRECT_PORT_CALLS
670  // Connect input port cmdResponseIn
671  for (
672  FwIndexType port = 0;
673  port < static_cast<FwIndexType>(this->getNum_cmdResponseIn_InputPorts());
674  port++
675  ) {
676  this->m_cmdResponseIn_InputPort[port].init();
677  this->m_cmdResponseIn_InputPort[port].addCallComp(
678  this,
679  m_p_cmdResponseIn_in
680  );
681  this->m_cmdResponseIn_InputPort[port].setPortNum(port);
682 
683 #if FW_OBJECT_NAMES == 1
684  Fw::ObjectName portName;
685  portName.format(
686  "%s_cmdResponseIn_InputPort[%" PRI_FwIndexType "]",
687  this->m_objName.toChar(),
688  port
689  );
690  this->m_cmdResponseIn_InputPort[port].setObjName(portName.toChar());
691 #endif
692  }
693 #endif
694 
695 #if !FW_DIRECT_PORT_CALLS
696  // Connect input port seqCancelIn
697  for (
698  FwIndexType port = 0;
699  port < static_cast<FwIndexType>(this->getNum_seqCancelIn_InputPorts());
700  port++
701  ) {
702  this->m_seqCancelIn_InputPort[port].init();
703  this->m_seqCancelIn_InputPort[port].addCallComp(
704  this,
705  m_p_seqCancelIn_in
706  );
707  this->m_seqCancelIn_InputPort[port].setPortNum(port);
708 
709 #if FW_OBJECT_NAMES == 1
710  Fw::ObjectName portName;
711  portName.format(
712  "%s_seqCancelIn_InputPort[%" PRI_FwIndexType "]",
713  this->m_objName.toChar(),
714  port
715  );
716  this->m_seqCancelIn_InputPort[port].setObjName(portName.toChar());
717 #endif
718  }
719 #endif
720 
721 #if !FW_DIRECT_PORT_CALLS
722  // Connect input port seqRunIn
723  for (
724  FwIndexType port = 0;
725  port < static_cast<FwIndexType>(this->getNum_seqRunIn_InputPorts());
726  port++
727  ) {
728  this->m_seqRunIn_InputPort[port].init();
729  this->m_seqRunIn_InputPort[port].addCallComp(
730  this,
731  m_p_seqRunIn_in
732  );
733  this->m_seqRunIn_InputPort[port].setPortNum(port);
734 
735 #if FW_OBJECT_NAMES == 1
736  Fw::ObjectName portName;
737  portName.format(
738  "%s_seqRunIn_InputPort[%" PRI_FwIndexType "]",
739  this->m_objName.toChar(),
740  port
741  );
742  this->m_seqRunIn_InputPort[port].setObjName(portName.toChar());
743 #endif
744  }
745 #endif
746 
747 #if !FW_DIRECT_PORT_CALLS
748  // Connect input port writeTelemetry
749  for (
750  FwIndexType port = 0;
751  port < static_cast<FwIndexType>(this->getNum_writeTelemetry_InputPorts());
752  port++
753  ) {
754  this->m_writeTelemetry_InputPort[port].init();
755  this->m_writeTelemetry_InputPort[port].addCallComp(
756  this,
757  m_p_writeTelemetry_in
758  );
759  this->m_writeTelemetry_InputPort[port].setPortNum(port);
760 
761 #if FW_OBJECT_NAMES == 1
762  Fw::ObjectName portName;
763  portName.format(
764  "%s_writeTelemetry_InputPort[%" PRI_FwIndexType "]",
765  this->m_objName.toChar(),
766  port
767  );
768  this->m_writeTelemetry_InputPort[port].setObjName(portName.toChar());
769 #endif
770  }
771 #endif
772 
773 #if !FW_DIRECT_PORT_CALLS
774  // Connect input port serialIn
775  for (
776  FwIndexType port = 0;
777  port < static_cast<FwIndexType>(this->getNum_serialIn_InputPorts());
778  port++
779  ) {
780  this->m_serialIn_InputPort[port].init();
781  this->m_serialIn_InputPort[port].addCallComp(
782  this,
783  m_p_serialIn_in
784  );
785  this->m_serialIn_InputPort[port].setPortNum(port);
786 
787 #if FW_OBJECT_NAMES == 1
788  Fw::ObjectName portName;
789  portName.format(
790  "%s_serialIn_InputPort[%" PRI_FwIndexType "]",
791  this->m_objName.toChar(),
792  port
793  );
794  this->m_serialIn_InputPort[port].setObjName(portName.toChar());
795 #endif
796  }
797 #endif
798 
799 #if !FW_DIRECT_PORT_CALLS
800  // Connect output port cmdRegOut
801  for (
802  FwIndexType port = 0;
803  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
804  port++
805  ) {
806  this->m_cmdRegOut_OutputPort[port].init();
807 
808 #if FW_OBJECT_NAMES == 1
809  Fw::ObjectName portName;
810  portName.format(
811  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
812  this->m_objName.toChar(),
813  port
814  );
815  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
816 #endif
817  }
818 #endif
819 
820 #if !FW_DIRECT_PORT_CALLS
821  // Connect output port cmdResponseOut
822  for (
823  FwIndexType port = 0;
824  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
825  port++
826  ) {
827  this->m_cmdResponseOut_OutputPort[port].init();
828 
829 #if FW_OBJECT_NAMES == 1
830  Fw::ObjectName portName;
831  portName.format(
832  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
833  this->m_objName.toChar(),
834  port
835  );
836  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
837 #endif
838  }
839 #endif
840 
841 #if !FW_DIRECT_PORT_CALLS
842  // Connect output port logOut
843  for (
844  FwIndexType port = 0;
845  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
846  port++
847  ) {
848  this->m_logOut_OutputPort[port].init();
849 
850 #if FW_OBJECT_NAMES == 1
851  Fw::ObjectName portName;
852  portName.format(
853  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
854  this->m_objName.toChar(),
855  port
856  );
857  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
858 #endif
859  }
860 #endif
861 
862 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
863  // Connect output port logTextOut
864  for (
865  FwIndexType port = 0;
866  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
867  port++
868  ) {
869  this->m_logTextOut_OutputPort[port].init();
870 
871 #if FW_OBJECT_NAMES == 1
872  Fw::ObjectName portName;
873  portName.format(
874  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
875  this->m_objName.toChar(),
876  port
877  );
878  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
879 #endif
880  }
881 #endif
882 
883 #if !FW_DIRECT_PORT_CALLS
884  // Connect output port prmGet
885  for (
886  FwIndexType port = 0;
887  port < static_cast<FwIndexType>(this->getNum_prmGet_OutputPorts());
888  port++
889  ) {
890  this->m_prmGet_OutputPort[port].init();
891 
892 #if FW_OBJECT_NAMES == 1
893  Fw::ObjectName portName;
894  portName.format(
895  "%s_prmGet_OutputPort[%" PRI_FwIndexType "]",
896  this->m_objName.toChar(),
897  port
898  );
899  this->m_prmGet_OutputPort[port].setObjName(portName.toChar());
900 #endif
901  }
902 #endif
903 
904 #if !FW_DIRECT_PORT_CALLS
905  // Connect output port prmSet
906  for (
907  FwIndexType port = 0;
908  port < static_cast<FwIndexType>(this->getNum_prmSet_OutputPorts());
909  port++
910  ) {
911  this->m_prmSet_OutputPort[port].init();
912 
913 #if FW_OBJECT_NAMES == 1
914  Fw::ObjectName portName;
915  portName.format(
916  "%s_prmSet_OutputPort[%" PRI_FwIndexType "]",
917  this->m_objName.toChar(),
918  port
919  );
920  this->m_prmSet_OutputPort[port].setObjName(portName.toChar());
921 #endif
922  }
923 #endif
924 
925 #if !FW_DIRECT_PORT_CALLS
926  // Connect output port timeCaller
927  for (
928  FwIndexType port = 0;
929  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
930  port++
931  ) {
932  this->m_timeCaller_OutputPort[port].init();
933 
934 #if FW_OBJECT_NAMES == 1
935  Fw::ObjectName portName;
936  portName.format(
937  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
938  this->m_objName.toChar(),
939  port
940  );
941  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
942 #endif
943  }
944 #endif
945 
946 #if !FW_DIRECT_PORT_CALLS
947  // Connect output port tlmOut
948  for (
949  FwIndexType port = 0;
950  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
951  port++
952  ) {
953  this->m_tlmOut_OutputPort[port].init();
954 
955 #if FW_OBJECT_NAMES == 1
956  Fw::ObjectName portName;
957  portName.format(
958  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
959  this->m_objName.toChar(),
960  port
961  );
962  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
963 #endif
964  }
965 #endif
966 
967 #if !FW_DIRECT_PORT_CALLS
968  // Connect output port cmdOut
969  for (
970  FwIndexType port = 0;
971  port < static_cast<FwIndexType>(this->getNum_cmdOut_OutputPorts());
972  port++
973  ) {
974  this->m_cmdOut_OutputPort[port].init();
975 
976 #if FW_OBJECT_NAMES == 1
977  Fw::ObjectName portName;
978  portName.format(
979  "%s_cmdOut_OutputPort[%" PRI_FwIndexType "]",
980  this->m_objName.toChar(),
981  port
982  );
983  this->m_cmdOut_OutputPort[port].setObjName(portName.toChar());
984 #endif
985  }
986 #endif
987 
988 #if !FW_DIRECT_PORT_CALLS
989  // Connect output port getParam
990  for (
991  FwIndexType port = 0;
992  port < static_cast<FwIndexType>(this->getNum_getParam_OutputPorts());
993  port++
994  ) {
995  this->m_getParam_OutputPort[port].init();
996 
997 #if FW_OBJECT_NAMES == 1
998  Fw::ObjectName portName;
999  portName.format(
1000  "%s_getParam_OutputPort[%" PRI_FwIndexType "]",
1001  this->m_objName.toChar(),
1002  port
1003  );
1004  this->m_getParam_OutputPort[port].setObjName(portName.toChar());
1005 #endif
1006  }
1007 #endif
1008 
1009 #if !FW_DIRECT_PORT_CALLS
1010  // Connect output port getTlmChan
1011  for (
1012  FwIndexType port = 0;
1013  port < static_cast<FwIndexType>(this->getNum_getTlmChan_OutputPorts());
1014  port++
1015  ) {
1016  this->m_getTlmChan_OutputPort[port].init();
1017 
1018 #if FW_OBJECT_NAMES == 1
1019  Fw::ObjectName portName;
1020  portName.format(
1021  "%s_getTlmChan_OutputPort[%" PRI_FwIndexType "]",
1022  this->m_objName.toChar(),
1023  port
1024  );
1025  this->m_getTlmChan_OutputPort[port].setObjName(portName.toChar());
1026 #endif
1027  }
1028 #endif
1029 
1030 #if !FW_DIRECT_PORT_CALLS
1031  // Connect output port seqDoneOut
1032  for (
1033  FwIndexType port = 0;
1034  port < static_cast<FwIndexType>(this->getNum_seqDoneOut_OutputPorts());
1035  port++
1036  ) {
1037  this->m_seqDoneOut_OutputPort[port].init();
1038 
1039 #if FW_OBJECT_NAMES == 1
1040  Fw::ObjectName portName;
1041  portName.format(
1042  "%s_seqDoneOut_OutputPort[%" PRI_FwIndexType "]",
1043  this->m_objName.toChar(),
1044  port
1045  );
1046  this->m_seqDoneOut_OutputPort[port].setObjName(portName.toChar());
1047 #endif
1048  }
1049 #endif
1050 
1051 #if !FW_DIRECT_PORT_CALLS
1052  // Connect output port seqStartOut
1053  for (
1054  FwIndexType port = 0;
1055  port < static_cast<FwIndexType>(this->getNum_seqStartOut_OutputPorts());
1056  port++
1057  ) {
1058  this->m_seqStartOut_OutputPort[port].init();
1059 
1060 #if FW_OBJECT_NAMES == 1
1061  Fw::ObjectName portName;
1062  portName.format(
1063  "%s_seqStartOut_OutputPort[%" PRI_FwIndexType "]",
1064  this->m_objName.toChar(),
1065  port
1066  );
1067  this->m_seqStartOut_OutputPort[port].setObjName(portName.toChar());
1068 #endif
1069  }
1070 #endif
1071 
1072 #if !FW_DIRECT_PORT_CALLS
1073  // Connect output port serialOut
1074  for (
1075  FwIndexType port = 0;
1076  port < static_cast<FwIndexType>(this->getNum_serialOut_OutputPorts());
1077  port++
1078  ) {
1079  this->m_serialOut_OutputPort[port].init();
1080 
1081 #if FW_OBJECT_NAMES == 1
1082  Fw::ObjectName portName;
1083  portName.format(
1084  "%s_serialOut_OutputPort[%" PRI_FwIndexType "]",
1085  this->m_objName.toChar(),
1086  port
1087  );
1088  this->m_serialOut_OutputPort[port].setObjName(portName.toChar());
1089 #endif
1090  }
1091 #endif
1092 
1093  // Create the queue
1094  Os::Queue::Status qStat = this->createQueue(
1095  queueDepth,
1096  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
1097  );
1098  FW_ASSERT(
1099  Os::Queue::Status::OP_OK == qStat,
1100  static_cast<FwAssertArgType>(qStat)
1101  );
1102  }
1103 
1104 #if !FW_DIRECT_PORT_CALLS
1105 
1106  // ----------------------------------------------------------------------
1107  // Getters for special input ports
1108  // ----------------------------------------------------------------------
1109 
1112  {
1113  FW_ASSERT(
1114  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
1115  static_cast<FwAssertArgType>(portNum)
1116  );
1117 
1118  return &this->m_cmdIn_InputPort[portNum];
1119  }
1120 
1121 #endif
1122 
1123 #if !FW_DIRECT_PORT_CALLS
1124 
1125  // ----------------------------------------------------------------------
1126  // Getters for typed input ports
1127  // ----------------------------------------------------------------------
1128 
1131  {
1132  FW_ASSERT(
1133  (0 <= portNum) && (portNum < this->getNum_checkTimers_InputPorts()),
1134  static_cast<FwAssertArgType>(portNum)
1135  );
1136 
1137  return &this->m_checkTimers_InputPort[portNum];
1138  }
1139 
1142  {
1143  FW_ASSERT(
1144  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
1145  static_cast<FwAssertArgType>(portNum)
1146  );
1147 
1148  return &this->m_cmdResponseIn_InputPort[portNum];
1149  }
1150 
1153  {
1154  FW_ASSERT(
1155  (0 <= portNum) && (portNum < this->getNum_seqCancelIn_InputPorts()),
1156  static_cast<FwAssertArgType>(portNum)
1157  );
1158 
1159  return &this->m_seqCancelIn_InputPort[portNum];
1160  }
1161 
1164  {
1165  FW_ASSERT(
1166  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
1167  static_cast<FwAssertArgType>(portNum)
1168  );
1169 
1170  return &this->m_seqRunIn_InputPort[portNum];
1171  }
1172 
1175  {
1176  FW_ASSERT(
1177  (0 <= portNum) && (portNum < this->getNum_writeTelemetry_InputPorts()),
1178  static_cast<FwAssertArgType>(portNum)
1179  );
1180 
1181  return &this->m_writeTelemetry_InputPort[portNum];
1182  }
1183 
1184 #endif
1185 
1186 #if !FW_DIRECT_PORT_CALLS
1187 
1188  // ----------------------------------------------------------------------
1189  // Getters for serial input ports
1190  // ----------------------------------------------------------------------
1191 
1192  Fw::InputSerializePort* WasmSequencerComponentBase ::
1194  {
1195  FW_ASSERT(
1196  (0 <= portNum) && (portNum < this->getNum_serialIn_InputPorts()),
1197  static_cast<FwAssertArgType>(portNum)
1198  );
1199 
1200  return &this->m_serialIn_InputPort[portNum];
1201  }
1202 
1203 #endif
1204 
1205 #if !FW_DIRECT_PORT_CALLS
1206 
1207  // ----------------------------------------------------------------------
1208  // Connect input ports to special output ports
1209  // ----------------------------------------------------------------------
1210 
1213  FwIndexType portNum,
1214  Fw::InputCmdRegPort* port
1215  )
1216  {
1217  FW_ASSERT(
1218  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1219  static_cast<FwAssertArgType>(portNum)
1220  );
1221 
1222  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
1223  }
1224 
1227  FwIndexType portNum,
1229  )
1230  {
1231  FW_ASSERT(
1232  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1233  static_cast<FwAssertArgType>(portNum)
1234  );
1235 
1236  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
1237  }
1238 
1241  FwIndexType portNum,
1242  Fw::InputLogPort* port
1243  )
1244  {
1245  FW_ASSERT(
1246  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1247  static_cast<FwAssertArgType>(portNum)
1248  );
1249 
1250  this->m_logOut_OutputPort[portNum].addCallPort(port);
1251  }
1252 
1253 #if FW_ENABLE_TEXT_LOGGING == 1
1254 
1255  void WasmSequencerComponentBase ::
1256  set_logTextOut_OutputPort(
1257  FwIndexType portNum,
1258  Fw::InputLogTextPort* port
1259  )
1260  {
1261  FW_ASSERT(
1262  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1263  static_cast<FwAssertArgType>(portNum)
1264  );
1265 
1266  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
1267  }
1268 
1269 #endif
1270 
1273  FwIndexType portNum,
1274  Fw::InputPrmGetPort* port
1275  )
1276  {
1277  FW_ASSERT(
1278  (0 <= portNum) && (portNum < this->getNum_prmGet_OutputPorts()),
1279  static_cast<FwAssertArgType>(portNum)
1280  );
1281 
1282  this->m_prmGet_OutputPort[portNum].addCallPort(port);
1283  }
1284 
1287  FwIndexType portNum,
1288  Fw::InputPrmSetPort* port
1289  )
1290  {
1291  FW_ASSERT(
1292  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
1293  static_cast<FwAssertArgType>(portNum)
1294  );
1295 
1296  this->m_prmSet_OutputPort[portNum].addCallPort(port);
1297  }
1298 
1301  FwIndexType portNum,
1302  Fw::InputTimePort* port
1303  )
1304  {
1305  FW_ASSERT(
1306  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1307  static_cast<FwAssertArgType>(portNum)
1308  );
1309 
1310  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
1311  }
1312 
1315  FwIndexType portNum,
1316  Fw::InputTlmPort* port
1317  )
1318  {
1319  FW_ASSERT(
1320  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1321  static_cast<FwAssertArgType>(portNum)
1322  );
1323 
1324  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
1325  }
1326 
1327 #endif
1328 
1329 #if !FW_DIRECT_PORT_CALLS
1330 
1331  // ----------------------------------------------------------------------
1332  // Connect typed input ports to typed output ports
1333  // ----------------------------------------------------------------------
1334 
1337  FwIndexType portNum,
1338  Fw::InputComPort* port
1339  )
1340  {
1341  FW_ASSERT(
1342  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
1343  static_cast<FwAssertArgType>(portNum)
1344  );
1345 
1346  this->m_cmdOut_OutputPort[portNum].addCallPort(port);
1347  }
1348 
1351  FwIndexType portNum,
1352  Fw::InputPrmGetPort* port
1353  )
1354  {
1355  FW_ASSERT(
1356  (0 <= portNum) && (portNum < this->getNum_getParam_OutputPorts()),
1357  static_cast<FwAssertArgType>(portNum)
1358  );
1359 
1360  this->m_getParam_OutputPort[portNum].addCallPort(port);
1361  }
1362 
1365  FwIndexType portNum,
1366  Fw::InputTlmGetPort* port
1367  )
1368  {
1369  FW_ASSERT(
1370  (0 <= portNum) && (portNum < this->getNum_getTlmChan_OutputPorts()),
1371  static_cast<FwAssertArgType>(portNum)
1372  );
1373 
1374  this->m_getTlmChan_OutputPort[portNum].addCallPort(port);
1375  }
1376 
1379  FwIndexType portNum,
1381  )
1382  {
1383  FW_ASSERT(
1384  (0 <= portNum) && (portNum < this->getNum_seqDoneOut_OutputPorts()),
1385  static_cast<FwAssertArgType>(portNum)
1386  );
1387 
1388  this->m_seqDoneOut_OutputPort[portNum].addCallPort(port);
1389  }
1390 
1393  FwIndexType portNum,
1395  )
1396  {
1397  FW_ASSERT(
1398  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1399  static_cast<FwAssertArgType>(portNum)
1400  );
1401 
1402  this->m_seqStartOut_OutputPort[portNum].addCallPort(port);
1403  }
1404 
1405 #endif
1406 
1407 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
1408 
1409  // ----------------------------------------------------------------------
1410  // Connect serial input ports to special output ports
1411  // ----------------------------------------------------------------------
1412 
1415  FwIndexType portNum,
1416  Fw::InputSerializePort* port
1417  )
1418  {
1419  FW_ASSERT(
1420  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1421  static_cast<FwAssertArgType>(portNum)
1422  );
1423 
1424  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
1425  }
1426 
1429  FwIndexType portNum,
1430  Fw::InputSerializePort* port
1431  )
1432  {
1433  FW_ASSERT(
1434  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1435  static_cast<FwAssertArgType>(portNum)
1436  );
1437 
1438  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
1439  }
1440 
1443  FwIndexType portNum,
1444  Fw::InputSerializePort* port
1445  )
1446  {
1447  FW_ASSERT(
1448  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1449  static_cast<FwAssertArgType>(portNum)
1450  );
1451 
1452  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
1453  }
1454 
1455 #if FW_ENABLE_TEXT_LOGGING == 1
1456 
1457  void WasmSequencerComponentBase ::
1458  set_logTextOut_OutputPort(
1459  FwIndexType portNum,
1460  Fw::InputSerializePort* port
1461  )
1462  {
1463  FW_ASSERT(
1464  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1465  static_cast<FwAssertArgType>(portNum)
1466  );
1467 
1468  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
1469  }
1470 
1471 #endif
1472 
1475  FwIndexType portNum,
1476  Fw::InputSerializePort* port
1477  )
1478  {
1479  FW_ASSERT(
1480  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
1481  static_cast<FwAssertArgType>(portNum)
1482  );
1483 
1484  this->m_prmSet_OutputPort[portNum].registerSerialPort(port);
1485  }
1486 
1489  FwIndexType portNum,
1490  Fw::InputSerializePort* port
1491  )
1492  {
1493  FW_ASSERT(
1494  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1495  static_cast<FwAssertArgType>(portNum)
1496  );
1497 
1498  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
1499  }
1500 
1503  FwIndexType portNum,
1504  Fw::InputSerializePort* port
1505  )
1506  {
1507  FW_ASSERT(
1508  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1509  static_cast<FwAssertArgType>(portNum)
1510  );
1511 
1512  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
1513  }
1514 
1515 #endif
1516 
1517 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
1518 
1519  // ----------------------------------------------------------------------
1520  // Connect serial input ports to typed output ports
1521  // ----------------------------------------------------------------------
1522 
1525  FwIndexType portNum,
1526  Fw::InputSerializePort* port
1527  )
1528  {
1529  FW_ASSERT(
1530  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
1531  static_cast<FwAssertArgType>(portNum)
1532  );
1533 
1534  this->m_cmdOut_OutputPort[portNum].registerSerialPort(port);
1535  }
1536 
1539  FwIndexType portNum,
1540  Fw::InputSerializePort* port
1541  )
1542  {
1543  FW_ASSERT(
1544  (0 <= portNum) && (portNum < this->getNum_seqDoneOut_OutputPorts()),
1545  static_cast<FwAssertArgType>(portNum)
1546  );
1547 
1548  this->m_seqDoneOut_OutputPort[portNum].registerSerialPort(port);
1549  }
1550 
1553  FwIndexType portNum,
1554  Fw::InputSerializePort* port
1555  )
1556  {
1557  FW_ASSERT(
1558  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1559  static_cast<FwAssertArgType>(portNum)
1560  );
1561 
1562  this->m_seqStartOut_OutputPort[portNum].registerSerialPort(port);
1563  }
1564 
1565 #endif
1566 
1567 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
1568 
1569  // ----------------------------------------------------------------------
1570  // Connect typed and serial input ports to serial output ports
1571  // ----------------------------------------------------------------------
1572 
1573  void WasmSequencerComponentBase ::
1574  set_serialOut_OutputPort(
1575  FwIndexType portNum,
1576  Fw::InputPortBase* port
1577  )
1578  {
1579  FW_ASSERT(
1580  (0 <= portNum) && (portNum < this->getNum_serialOut_OutputPorts()),
1581  static_cast<FwAssertArgType>(portNum)
1582  );
1583 
1584  this->m_serialOut_OutputPort[portNum].registerSerialPort(port);
1585  }
1586 
1587 #endif
1588 
1589  // ----------------------------------------------------------------------
1590  // Command registration
1591  // ----------------------------------------------------------------------
1592 
1595  {
1597 
1598  this->cmdRegOut_out(
1599  0,
1600  this->getIdBase() + OPCODE_RUN
1601  );
1602 
1603  this->cmdRegOut_out(
1604  0,
1605  this->getIdBase() + OPCODE_LOAD
1606  );
1607 
1608  this->cmdRegOut_out(
1609  0,
1610  this->getIdBase() + OPCODE_INVOKE
1611  );
1612 
1613  this->cmdRegOut_out(
1614  0,
1615  this->getIdBase() + OPCODE_WAIT
1616  );
1617 
1618  this->cmdRegOut_out(
1619  0,
1620  this->getIdBase() + OPCODE_CANCEL
1621  );
1622 
1623  this->cmdRegOut_out(
1624  0,
1625  this->getIdBase() + OPCODE_PAUSE
1626  );
1627 
1628  this->cmdRegOut_out(
1629  0,
1630  this->getIdBase() + OPCODE_CONTINUE
1631  );
1632 
1633  this->cmdRegOut_out(
1634  0,
1636  );
1637 
1638  this->cmdRegOut_out(
1639  0,
1641  );
1642 
1643  this->cmdRegOut_out(
1644  0,
1646  );
1647 
1648  this->cmdRegOut_out(
1649  0,
1651  );
1652 
1653  this->cmdRegOut_out(
1654  0,
1655  this->getIdBase() + OPCODE_GLOBAL_GET
1656  );
1657 
1658  this->cmdRegOut_out(
1659  0,
1661  );
1662 
1663  this->cmdRegOut_out(
1664  0,
1666  );
1667 
1668  this->cmdRegOut_out(
1669  0,
1671  );
1672 
1673  this->cmdRegOut_out(
1674  0,
1676  );
1677 
1678  this->cmdRegOut_out(
1679  0,
1681  );
1682 
1683  this->cmdRegOut_out(
1684  0,
1686  );
1687  }
1688 
1689  // ----------------------------------------------------------------------
1690  // Parameter loading
1691  // ----------------------------------------------------------------------
1692 
1695  {
1697  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
1699 
1700  FwPrmIdType _id{};
1701  Fw::ParamBuffer _paramBuffer;
1702 
1703  _id = _baseId + PARAMID_HOST_FUNCTION_TIMEOUT_SECS;
1704 
1705  // Get serialized parameter HOST_FUNCTION_TIMEOUT_SECS
1706  this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid = this->prmGet_out(
1707  0,
1708  _id,
1709  _paramBuffer
1710  );
1711 
1712  this->m_paramLock.lock();
1713 
1714  // Deserialize parameter or use default value
1715  if (this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid == Fw::ParamValid::VALID) {
1716  _stat = _paramBuffer.deserializeTo(this->m_HOST_FUNCTION_TIMEOUT_SECS);
1717  if (_stat != Fw::FW_SERIALIZE_OK) {
1718  this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid = Fw::ParamValid::DEFAULT;
1719  }
1720  }
1721  else {
1722  this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid = Fw::ParamValid::DEFAULT;
1723  }
1724  if (this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid == Fw::ParamValid::DEFAULT) {
1725  this->m_HOST_FUNCTION_TIMEOUT_SECS = 60.0f;
1726  }
1727 
1728  this->m_paramLock.unlock();
1729 
1730  _id = _baseId + PARAMID_INSTRUCTION_FUEL;
1731 
1732  // Get serialized parameter INSTRUCTION_FUEL
1733  this->m_param_INSTRUCTION_FUEL_valid = this->prmGet_out(
1734  0,
1735  _id,
1736  _paramBuffer
1737  );
1738 
1739  this->m_paramLock.lock();
1740 
1741  // Deserialize parameter or use default value
1742  if (this->m_param_INSTRUCTION_FUEL_valid == Fw::ParamValid::VALID) {
1743  _stat = _paramBuffer.deserializeTo(this->m_INSTRUCTION_FUEL);
1744  if (_stat != Fw::FW_SERIALIZE_OK) {
1745  this->m_param_INSTRUCTION_FUEL_valid = Fw::ParamValid::DEFAULT;
1746  }
1747  }
1748  else {
1749  this->m_param_INSTRUCTION_FUEL_valid = Fw::ParamValid::DEFAULT;
1750  }
1751  if (this->m_param_INSTRUCTION_FUEL_valid == Fw::ParamValid::DEFAULT) {
1752  this->m_INSTRUCTION_FUEL = 1000;
1753  }
1754 
1755  this->m_paramLock.unlock();
1756 
1757  _id = _baseId + PARAMID_SEQ_BASE_DIR;
1758 
1759  // Get serialized parameter SEQ_BASE_DIR
1760  this->m_param_SEQ_BASE_DIR_valid = this->prmGet_out(
1761  0,
1762  _id,
1763  _paramBuffer
1764  );
1765 
1766  this->m_paramLock.lock();
1767 
1768  // Deserialize parameter or use default value
1769  if (this->m_param_SEQ_BASE_DIR_valid == Fw::ParamValid::VALID) {
1770  _stat = _paramBuffer.deserializeTo(this->m_SEQ_BASE_DIR);
1771  if (_stat != Fw::FW_SERIALIZE_OK) {
1772  this->m_param_SEQ_BASE_DIR_valid = Fw::ParamValid::DEFAULT;
1773  }
1774  }
1775  else {
1776  this->m_param_SEQ_BASE_DIR_valid = Fw::ParamValid::DEFAULT;
1777  }
1778  if (this->m_param_SEQ_BASE_DIR_valid == Fw::ParamValid::DEFAULT) {
1779  this->m_SEQ_BASE_DIR = Fw::String("");
1780  }
1781 
1782  this->m_paramLock.unlock();
1783 
1784  // Call notifier
1785  this->parametersLoaded();
1786  }
1787 
1788  // ----------------------------------------------------------------------
1789  // Component construction and destruction
1790  // ----------------------------------------------------------------------
1791 
1793  WasmSequencerComponentBase(const char* compName) :
1794  Fw::ActiveComponentBase(compName),
1795  m_stateMachine_controller(*this),
1796  m_stateMachine_interpreter(*this)
1797  {
1798 
1799  }
1800 
1803  {
1804 
1805  }
1806 
1807 #if !FW_DIRECT_PORT_CALLS
1808 
1809  // ----------------------------------------------------------------------
1810  // Connection status queries for special output ports
1811  // ----------------------------------------------------------------------
1812 
1815  {
1816  FW_ASSERT(
1817  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1818  static_cast<FwAssertArgType>(portNum)
1819  );
1820 
1821  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1822  }
1823 
1826  {
1827  FW_ASSERT(
1828  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1829  static_cast<FwAssertArgType>(portNum)
1830  );
1831 
1832  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1833  }
1834 
1837  {
1838  FW_ASSERT(
1839  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1840  static_cast<FwAssertArgType>(portNum)
1841  );
1842 
1843  return this->m_logOut_OutputPort[portNum].isConnected();
1844  }
1845 
1846 #if FW_ENABLE_TEXT_LOGGING == 1
1847 
1848  bool WasmSequencerComponentBase ::
1849  isConnected_logTextOut_OutputPort(FwIndexType portNum) const
1850  {
1851  FW_ASSERT(
1852  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1853  static_cast<FwAssertArgType>(portNum)
1854  );
1855 
1856  return this->m_logTextOut_OutputPort[portNum].isConnected();
1857  }
1858 
1859 #endif
1860 
1863  {
1864  FW_ASSERT(
1865  (0 <= portNum) && (portNum < this->getNum_prmGet_OutputPorts()),
1866  static_cast<FwAssertArgType>(portNum)
1867  );
1868 
1869  return this->m_prmGet_OutputPort[portNum].isConnected();
1870  }
1871 
1874  {
1875  FW_ASSERT(
1876  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
1877  static_cast<FwAssertArgType>(portNum)
1878  );
1879 
1880  return this->m_prmSet_OutputPort[portNum].isConnected();
1881  }
1882 
1885  {
1886  FW_ASSERT(
1887  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1888  static_cast<FwAssertArgType>(portNum)
1889  );
1890 
1891  return this->m_timeCaller_OutputPort[portNum].isConnected();
1892  }
1893 
1896  {
1897  FW_ASSERT(
1898  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1899  static_cast<FwAssertArgType>(portNum)
1900  );
1901 
1902  return this->m_tlmOut_OutputPort[portNum].isConnected();
1903  }
1904 
1905 #endif
1906 
1907 #if !FW_DIRECT_PORT_CALLS
1908 
1909  // ----------------------------------------------------------------------
1910  // Connection status queries for typed output ports
1911  // ----------------------------------------------------------------------
1912 
1915  {
1916  FW_ASSERT(
1917  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
1918  static_cast<FwAssertArgType>(portNum)
1919  );
1920 
1921  return this->m_cmdOut_OutputPort[portNum].isConnected();
1922  }
1923 
1926  {
1927  FW_ASSERT(
1928  (0 <= portNum) && (portNum < this->getNum_getParam_OutputPorts()),
1929  static_cast<FwAssertArgType>(portNum)
1930  );
1931 
1932  return this->m_getParam_OutputPort[portNum].isConnected();
1933  }
1934 
1937  {
1938  FW_ASSERT(
1939  (0 <= portNum) && (portNum < this->getNum_getTlmChan_OutputPorts()),
1940  static_cast<FwAssertArgType>(portNum)
1941  );
1942 
1943  return this->m_getTlmChan_OutputPort[portNum].isConnected();
1944  }
1945 
1948  {
1949  FW_ASSERT(
1950  (0 <= portNum) && (portNum < this->getNum_seqDoneOut_OutputPorts()),
1951  static_cast<FwAssertArgType>(portNum)
1952  );
1953 
1954  return this->m_seqDoneOut_OutputPort[portNum].isConnected();
1955  }
1956 
1959  {
1960  FW_ASSERT(
1961  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1962  static_cast<FwAssertArgType>(portNum)
1963  );
1964 
1965  return this->m_seqStartOut_OutputPort[portNum].isConnected();
1966  }
1967 
1968 #endif
1969 
1970 #if !FW_DIRECT_PORT_CALLS
1971 
1972  // ----------------------------------------------------------------------
1973  // Connection status queries for serial output ports
1974  // ----------------------------------------------------------------------
1975 
1978  {
1979  FW_ASSERT(
1980  (0 <= portNum) && (portNum < this->getNum_serialOut_OutputPorts()),
1981  static_cast<FwAssertArgType>(portNum)
1982  );
1983 
1984  return this->m_serialOut_OutputPort[portNum].isConnected();
1985  }
1986 
1987 #endif
1988 
1989  // ----------------------------------------------------------------------
1990  // Port handler base-class functions for special input ports
1991  //
1992  // Call these functions directly to bypass the corresponding ports
1993  // ----------------------------------------------------------------------
1994 
1997  FwIndexType portNum,
1998  FwOpcodeType opCode,
1999  U32 cmdSeq,
2000  Fw::CmdArgBuffer& args
2001  )
2002  {
2003 
2004  const U32 idBase = this->getIdBase();
2005  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
2006 
2007  // Select base class function based on opcode
2008  switch (opCode - idBase) {
2009  case OPCODE_RUN: {
2010  this->RUN_cmdHandlerBase(
2011  opCode,
2012  cmdSeq,
2013  args
2014  );
2015  break;
2016  }
2017 
2018  case OPCODE_LOAD: {
2019  this->LOAD_cmdHandlerBase(
2020  opCode,
2021  cmdSeq,
2022  args
2023  );
2024  break;
2025  }
2026 
2027  case OPCODE_INVOKE: {
2028  this->INVOKE_cmdHandlerBase(
2029  opCode,
2030  cmdSeq,
2031  args
2032  );
2033  break;
2034  }
2035 
2036  case OPCODE_WAIT: {
2037  this->WAIT_cmdHandlerBase(
2038  opCode,
2039  cmdSeq,
2040  args
2041  );
2042  break;
2043  }
2044 
2045  case OPCODE_CANCEL: {
2046  this->CANCEL_cmdHandlerBase(
2047  opCode,
2048  cmdSeq,
2049  args
2050  );
2051  break;
2052  }
2053 
2054  case OPCODE_PAUSE: {
2055  this->PAUSE_cmdHandlerBase(
2056  opCode,
2057  cmdSeq,
2058  args
2059  );
2060  break;
2061  }
2062 
2063  case OPCODE_CONTINUE: {
2065  opCode,
2066  cmdSeq,
2067  args
2068  );
2069  break;
2070  }
2071 
2072  case OPCODE_GLOBAL_SET_I32: {
2074  opCode,
2075  cmdSeq,
2076  args
2077  );
2078  break;
2079  }
2080 
2081  case OPCODE_GLOBAL_SET_I64: {
2083  opCode,
2084  cmdSeq,
2085  args
2086  );
2087  break;
2088  }
2089 
2090  case OPCODE_GLOBAL_SET_F32: {
2092  opCode,
2093  cmdSeq,
2094  args
2095  );
2096  break;
2097  }
2098 
2099  case OPCODE_GLOBAL_SET_F64: {
2101  opCode,
2102  cmdSeq,
2103  args
2104  );
2105  break;
2106  }
2107 
2108  case OPCODE_GLOBAL_GET: {
2110  opCode,
2111  cmdSeq,
2112  args
2113  );
2114  break;
2115  }
2116 
2118  Fw::CmdResponse _cstat = this->paramSet_HOST_FUNCTION_TIMEOUT_SECS(args);
2119  this->cmdResponse_out(
2120  opCode,
2121  cmdSeq,
2122  _cstat
2123  );
2124  break;
2125  }
2126 
2128  Fw::CmdResponse _cstat = this->paramSave_HOST_FUNCTION_TIMEOUT_SECS();
2129  this->cmdResponse_out(
2130  opCode,
2131  cmdSeq,
2132  _cstat
2133  );
2134  break;
2135  }
2136 
2138  Fw::CmdResponse _cstat = this->paramSet_INSTRUCTION_FUEL(args);
2139  this->cmdResponse_out(
2140  opCode,
2141  cmdSeq,
2142  _cstat
2143  );
2144  break;
2145  }
2146 
2148  Fw::CmdResponse _cstat = this->paramSave_INSTRUCTION_FUEL();
2149  this->cmdResponse_out(
2150  opCode,
2151  cmdSeq,
2152  _cstat
2153  );
2154  break;
2155  }
2156 
2157  case OPCODE_SEQ_BASE_DIR_SET: {
2158  Fw::CmdResponse _cstat = this->paramSet_SEQ_BASE_DIR(args);
2159  this->cmdResponse_out(
2160  opCode,
2161  cmdSeq,
2162  _cstat
2163  );
2164  break;
2165  }
2166 
2167  case OPCODE_SEQ_BASE_DIR_SAVE: {
2168  Fw::CmdResponse _cstat = this->paramSave_SEQ_BASE_DIR();
2169  this->cmdResponse_out(
2170  opCode,
2171  cmdSeq,
2172  _cstat
2173  );
2174  break;
2175  }
2176  default:
2177  // Unknown opcode: ignore it
2178  break;
2179  }
2180  }
2181 
2182  // ----------------------------------------------------------------------
2183  // Port handler base-class functions for typed input ports
2184  //
2185  // Call these functions directly to bypass the corresponding ports
2186  // ----------------------------------------------------------------------
2187 
2190  FwIndexType portNum,
2191  U32 context
2192  )
2193  {
2194  // Make sure port number is valid
2195  FW_ASSERT(
2196  (0 <= portNum) && (portNum < this->getNum_checkTimers_InputPorts()),
2197  static_cast<FwAssertArgType>(portNum)
2198  );
2199 
2200  // Call pre-message hook
2202  portNum,
2203  context
2204  );
2205  ComponentIpcSerializableBuffer msg;
2207 
2208  // Serialize message ID
2209  _status = msg.serializeFrom(
2210  static_cast<FwEnumStoreType>(CHECKTIMERS_SCHED)
2211  );
2212  FW_ASSERT(
2213  _status == Fw::FW_SERIALIZE_OK,
2214  static_cast<FwAssertArgType>(_status)
2215  );
2216 
2217  // Serialize port number
2218  _status = msg.serializeFrom(portNum);
2219  FW_ASSERT(
2220  _status == Fw::FW_SERIALIZE_OK,
2221  static_cast<FwAssertArgType>(_status)
2222  );
2223 
2224  // Serialize argument context
2225  _status = msg.serializeFrom(context);
2226  FW_ASSERT(
2227  _status == Fw::FW_SERIALIZE_OK,
2228  static_cast<FwAssertArgType>(_status)
2229  );
2230 
2231  // Send message
2233  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2234 
2235  FW_ASSERT(
2236  qStatus == Os::Queue::OP_OK,
2237  static_cast<FwAssertArgType>(qStatus)
2238  );
2239  }
2240 
2243  FwIndexType portNum,
2244  FwOpcodeType opCode,
2245  U32 cmdSeq,
2246  const Fw::CmdResponse& response
2247  )
2248  {
2249  // Make sure port number is valid
2250  FW_ASSERT(
2251  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
2252  static_cast<FwAssertArgType>(portNum)
2253  );
2254 
2255  // Call pre-message hook
2257  portNum,
2258  opCode,
2259  cmdSeq,
2260  response
2261  );
2262  ComponentIpcSerializableBuffer msg;
2264 
2265  // Serialize message ID
2266  _status = msg.serializeFrom(
2267  static_cast<FwEnumStoreType>(CMDRESPONSEIN_CMDRESPONSE)
2268  );
2269  FW_ASSERT(
2270  _status == Fw::FW_SERIALIZE_OK,
2271  static_cast<FwAssertArgType>(_status)
2272  );
2273 
2274  // Serialize port number
2275  _status = msg.serializeFrom(portNum);
2276  FW_ASSERT(
2277  _status == Fw::FW_SERIALIZE_OK,
2278  static_cast<FwAssertArgType>(_status)
2279  );
2280 
2281  // Serialize argument opCode
2282  _status = msg.serializeFrom(opCode);
2283  FW_ASSERT(
2284  _status == Fw::FW_SERIALIZE_OK,
2285  static_cast<FwAssertArgType>(_status)
2286  );
2287 
2288  // Serialize argument cmdSeq
2289  _status = msg.serializeFrom(cmdSeq);
2290  FW_ASSERT(
2291  _status == Fw::FW_SERIALIZE_OK,
2292  static_cast<FwAssertArgType>(_status)
2293  );
2294 
2295  // Serialize argument response
2296  _status = msg.serializeFrom(response);
2297  FW_ASSERT(
2298  _status == Fw::FW_SERIALIZE_OK,
2299  static_cast<FwAssertArgType>(_status)
2300  );
2301 
2302  // Send message
2304  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2305 
2306  FW_ASSERT(
2307  qStatus == Os::Queue::OP_OK,
2308  static_cast<FwAssertArgType>(qStatus)
2309  );
2310  }
2311 
2314  {
2315  // Make sure port number is valid
2316  FW_ASSERT(
2317  (0 <= portNum) && (portNum < this->getNum_seqCancelIn_InputPorts()),
2318  static_cast<FwAssertArgType>(portNum)
2319  );
2320 
2321  // Call handler function
2322  this->seqCancelIn_handler(portNum);
2323  }
2324 
2327  FwIndexType portNum,
2328  const Fw::StringBase& filename,
2329  const Svc::SeqArgs& args
2330  )
2331  {
2332  // Make sure port number is valid
2333  FW_ASSERT(
2334  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
2335  static_cast<FwAssertArgType>(portNum)
2336  );
2337 
2338  // Call pre-message hook
2340  portNum,
2341  filename,
2342  args
2343  );
2344  ComponentIpcSerializableBuffer msg;
2346 
2347  // Serialize message ID
2348  _status = msg.serializeFrom(
2349  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
2350  );
2351  FW_ASSERT(
2352  _status == Fw::FW_SERIALIZE_OK,
2353  static_cast<FwAssertArgType>(_status)
2354  );
2355 
2356  // Serialize port number
2357  _status = msg.serializeFrom(portNum);
2358  FW_ASSERT(
2359  _status == Fw::FW_SERIALIZE_OK,
2360  static_cast<FwAssertArgType>(_status)
2361  );
2362 
2363  // Serialize argument filename
2364  _status = filename.serializeTo(msg, 240);
2365  FW_ASSERT(
2366  _status == Fw::FW_SERIALIZE_OK,
2367  static_cast<FwAssertArgType>(_status)
2368  );
2369 
2370  // Serialize argument args
2371  _status = msg.serializeFrom(args);
2372  FW_ASSERT(
2373  _status == Fw::FW_SERIALIZE_OK,
2374  static_cast<FwAssertArgType>(_status)
2375  );
2376 
2377  // Send message
2379  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2380 
2381  FW_ASSERT(
2382  qStatus == Os::Queue::OP_OK,
2383  static_cast<FwAssertArgType>(qStatus)
2384  );
2385  }
2386 
2389  FwIndexType portNum,
2390  U32 context
2391  )
2392  {
2393  // Make sure port number is valid
2394  FW_ASSERT(
2395  (0 <= portNum) && (portNum < this->getNum_writeTelemetry_InputPorts()),
2396  static_cast<FwAssertArgType>(portNum)
2397  );
2398 
2399  // Call pre-message hook
2401  portNum,
2402  context
2403  );
2404  ComponentIpcSerializableBuffer msg;
2406 
2407  // Serialize message ID
2408  _status = msg.serializeFrom(
2409  static_cast<FwEnumStoreType>(WRITETELEMETRY_SCHED)
2410  );
2411  FW_ASSERT(
2412  _status == Fw::FW_SERIALIZE_OK,
2413  static_cast<FwAssertArgType>(_status)
2414  );
2415 
2416  // Serialize port number
2417  _status = msg.serializeFrom(portNum);
2418  FW_ASSERT(
2419  _status == Fw::FW_SERIALIZE_OK,
2420  static_cast<FwAssertArgType>(_status)
2421  );
2422 
2423  // Serialize argument context
2424  _status = msg.serializeFrom(context);
2425  FW_ASSERT(
2426  _status == Fw::FW_SERIALIZE_OK,
2427  static_cast<FwAssertArgType>(_status)
2428  );
2429 
2430  // Send message
2432  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2433 
2434  if (qStatus == Os::Queue::Status::FULL) {
2435  this->incNumMsgDropped();
2436  return;
2437  }
2438 
2439  FW_ASSERT(
2440  qStatus == Os::Queue::OP_OK,
2441  static_cast<FwAssertArgType>(qStatus)
2442  );
2443  }
2444 
2445  // ----------------------------------------------------------------------
2446  // Port handler base-class functions for serial input ports
2447  //
2448  // Call these functions directly to bypass the corresponding ports
2449  // ----------------------------------------------------------------------
2450 
2453  FwIndexType portNum,
2454  Fw::LinearBufferBase& buffer
2455  )
2456  {
2457  // Make sure port number is valid
2458  FW_ASSERT(
2459  (0 <= portNum) && (portNum < this->getNum_serialIn_InputPorts()),
2460  static_cast<FwAssertArgType>(portNum)
2461  );
2462 
2463  // Lock guard mutex before calling
2464  this->lock();
2465 
2466  // Call handler function
2467  this->serialIn_handler(
2468  portNum,
2469  buffer
2470  );
2471 
2472  // Unlock guard mutex
2473  this->unLock();
2474  }
2475 
2476  // ----------------------------------------------------------------------
2477  // Pre-message hooks for typed async input ports
2478  //
2479  // Each of these functions is invoked just before processing a message
2480  // on the corresponding port. By default, they do nothing. You can
2481  // override them to provide specific pre-message behavior.
2482  // ----------------------------------------------------------------------
2483 
2486  FwIndexType portNum,
2487  U32 context
2488  )
2489  {
2490  // Default: no-op
2491  }
2492 
2495  FwIndexType portNum,
2496  FwOpcodeType opCode,
2497  U32 cmdSeq,
2498  const Fw::CmdResponse& response
2499  )
2500  {
2501  // Default: no-op
2502  }
2503 
2506  FwIndexType portNum,
2507  const Fw::StringBase& filename,
2508  const Svc::SeqArgs& args
2509  )
2510  {
2511  // Default: no-op
2512  }
2513 
2516  FwIndexType portNum,
2517  U32 context
2518  )
2519  {
2520  // Default: no-op
2521  }
2522 
2523 #if !FW_DIRECT_PORT_CALLS
2524 
2525  // ----------------------------------------------------------------------
2526  // Invocation functions for typed output ports
2527  // ----------------------------------------------------------------------
2528 
2531  FwIndexType portNum,
2532  Fw::ComBuffer& data,
2533  U32 context
2534  ) const
2535  {
2536  FW_ASSERT(
2537  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
2538  static_cast<FwAssertArgType>(portNum)
2539  );
2540 
2541  FW_ASSERT(
2542  this->m_cmdOut_OutputPort[portNum].isConnected(),
2543  static_cast<FwAssertArgType>(portNum)
2544  );
2545  this->m_cmdOut_OutputPort[portNum].invoke(
2546  data,
2547  context
2548  );
2549  }
2550 
2553  FwIndexType portNum,
2554  FwPrmIdType id,
2555  Fw::ParamBuffer& val
2556  ) const
2557  {
2558  FW_ASSERT(
2559  (0 <= portNum) && (portNum < this->getNum_getParam_OutputPorts()),
2560  static_cast<FwAssertArgType>(portNum)
2561  );
2562 
2563  FW_ASSERT(
2564  this->m_getParam_OutputPort[portNum].isConnected(),
2565  static_cast<FwAssertArgType>(portNum)
2566  );
2567  return this->m_getParam_OutputPort[portNum].invoke(
2568  id,
2569  val
2570  );
2571  }
2572 
2575  FwIndexType portNum,
2576  FwChanIdType id,
2577  Fw::Time& timeTag,
2578  Fw::TlmBuffer& val
2579  ) const
2580  {
2581  FW_ASSERT(
2582  (0 <= portNum) && (portNum < this->getNum_getTlmChan_OutputPorts()),
2583  static_cast<FwAssertArgType>(portNum)
2584  );
2585 
2586  FW_ASSERT(
2587  this->m_getTlmChan_OutputPort[portNum].isConnected(),
2588  static_cast<FwAssertArgType>(portNum)
2589  );
2590  return this->m_getTlmChan_OutputPort[portNum].invoke(
2591  id,
2592  timeTag,
2593  val
2594  );
2595  }
2596 
2599  FwIndexType portNum,
2600  FwOpcodeType opCode,
2601  U32 cmdSeq,
2602  const Fw::CmdResponse& response
2603  ) const
2604  {
2605  FW_ASSERT(
2606  (0 <= portNum) && (portNum < this->getNum_seqDoneOut_OutputPorts()),
2607  static_cast<FwAssertArgType>(portNum)
2608  );
2609 
2610  FW_ASSERT(
2611  this->m_seqDoneOut_OutputPort[portNum].isConnected(),
2612  static_cast<FwAssertArgType>(portNum)
2613  );
2614  this->m_seqDoneOut_OutputPort[portNum].invoke(
2615  opCode,
2616  cmdSeq,
2617  response
2618  );
2619  }
2620 
2623  FwIndexType portNum,
2624  const Fw::StringBase& filename,
2625  const Svc::SeqArgs& args
2626  ) const
2627  {
2628  FW_ASSERT(
2629  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
2630  static_cast<FwAssertArgType>(portNum)
2631  );
2632 
2633  FW_ASSERT(
2634  this->m_seqStartOut_OutputPort[portNum].isConnected(),
2635  static_cast<FwAssertArgType>(portNum)
2636  );
2637  this->m_seqStartOut_OutputPort[portNum].invoke(
2638  filename,
2639  args
2640  );
2641  }
2642 
2643 #endif
2644 
2645 #if !FW_DIRECT_PORT_CALLS
2646 
2647  // ----------------------------------------------------------------------
2648  // Invocation functions for serial output ports
2649  // ----------------------------------------------------------------------
2650 
2653  FwIndexType portNum,
2654  Fw::LinearBufferBase& buffer
2655  )
2656  {
2657  FW_ASSERT(
2658  (0 <= portNum) && (portNum < this->getNum_serialOut_OutputPorts()),
2659  static_cast<FwAssertArgType>(portNum)
2660  );
2661 
2662  FW_ASSERT(
2663  this->m_serialOut_OutputPort[portNum].isConnected(),
2664  static_cast<FwAssertArgType>(portNum)
2665  );
2666  return this->m_serialOut_OutputPort[portNum].invokeSerial(
2667  buffer
2668  );
2669  }
2670 
2671 #endif
2672 
2673  // ----------------------------------------------------------------------
2674  // State getter functions
2675  // ----------------------------------------------------------------------
2676 
2679  {
2680  return this->m_stateMachine_controller.getState();
2681  }
2682 
2685  {
2686  return this->m_stateMachine_interpreter.getState();
2687  }
2688 
2689  // ----------------------------------------------------------------------
2690  // Signal send functions
2691  // ----------------------------------------------------------------------
2692 
2695  {
2696  ComponentIpcSerializableBuffer buffer;
2697  // Serialize the message type, port number, state ID, and signal
2698  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::run), buffer);
2699  // Serialize the signal data
2700  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2701  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2702  // Send the message and handle overflow
2703  this->controller_sendSignalFinish(buffer);
2704  }
2705 
2708  {
2709  ComponentIpcSerializableBuffer buffer;
2710  // Serialize the message type, port number, state ID, and signal
2711  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::load), buffer);
2712  // Serialize the signal data
2713  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2714  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2715  // Send the message and handle overflow
2716  this->controller_sendSignalFinish(buffer);
2717  }
2718 
2721  {
2722  ComponentIpcSerializableBuffer buffer;
2723  // Serialize the message type, port number, state ID, and signal
2724  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::invoke), buffer);
2725  // Serialize the signal data
2726  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2727  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2728  // Send the message and handle overflow
2729  this->controller_sendSignalFinish(buffer);
2730  }
2731 
2734  {
2735  ComponentIpcSerializableBuffer buffer;
2736  // Serialize the message type, port number, state ID, and signal
2737  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::invoked), buffer);
2738  // Serialize the signal data
2739  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2740  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2741  // Send the message and handle overflow
2742  this->controller_sendSignalFinish(buffer);
2743  }
2744 
2747  {
2748  ComponentIpcSerializableBuffer buffer;
2749  // Serialize the message type, port number, state ID, and signal
2750  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::invokeFailed), buffer);
2751  // Serialize the signal data
2752  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2753  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2754  // Send the message and handle overflow
2755  this->controller_sendSignalFinish(buffer);
2756  }
2757 
2760  {
2761  ComponentIpcSerializableBuffer buffer;
2762  // Serialize the message type, port number, state ID, and signal
2763  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::cancel), buffer);
2764  // Send the message and handle overflow
2765  this->controller_sendSignalFinish(buffer);
2766  }
2767 
2770  {
2771  ComponentIpcSerializableBuffer buffer;
2772  // Serialize the message type, port number, state ID, and signal
2773  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::loadSucceeded), buffer);
2774  // Serialize the signal data
2775  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2776  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2777  // Send the message and handle overflow
2778  this->controller_sendSignalFinish(buffer);
2779  }
2780 
2783  {
2784  ComponentIpcSerializableBuffer buffer;
2785  // Serialize the message type, port number, state ID, and signal
2786  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::loadFailed), buffer);
2787  // Serialize the signal data
2788  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2789  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2790  // Send the message and handle overflow
2791  this->controller_sendSignalFinish(buffer);
2792  }
2793 
2796  {
2797  ComponentIpcSerializableBuffer buffer;
2798  // Serialize the message type, port number, state ID, and signal
2799  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::engineFinished), buffer);
2800  // Serialize the signal data
2801  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2802  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2803  // Send the message and handle overflow
2804  this->controller_sendSignalFinish(buffer);
2805  }
2806 
2809  {
2810  ComponentIpcSerializableBuffer buffer;
2811  // Serialize the message type, port number, state ID, and signal
2812  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::cmd_CONTINUE), buffer);
2813  // Send the message and handle overflow
2814  this->interpreter_sendSignalFinish(buffer);
2815  }
2816 
2819  {
2820  ComponentIpcSerializableBuffer buffer;
2821  // Serialize the message type, port number, state ID, and signal
2822  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::cmdCancel), buffer);
2823  // Serialize the signal data
2824  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2825  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2826  // Send the message and handle overflow
2827  this->interpreter_sendSignalFinish(buffer);
2828  }
2829 
2832  {
2833  ComponentIpcSerializableBuffer buffer;
2834  // Serialize the message type, port number, state ID, and signal
2835  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::cancel), buffer);
2836  // Send the message and handle overflow
2837  this->interpreter_sendSignalFinish(buffer);
2838  }
2839 
2842  {
2843  ComponentIpcSerializableBuffer buffer;
2844  // Serialize the message type, port number, state ID, and signal
2845  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::entered), buffer);
2846  // Send the message and handle overflow
2847  this->interpreter_sendSignalFinish(buffer);
2848  }
2849 
2852  {
2853  ComponentIpcSerializableBuffer buffer;
2854  // Serialize the message type, port number, state ID, and signal
2855  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::run), buffer);
2856  // Serialize the signal data
2857  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2858  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2859  // Send the message and handle overflow
2860  this->interpreter_sendSignalFinish(buffer);
2861  }
2862 
2865  {
2866  ComponentIpcSerializableBuffer buffer;
2867  // Serialize the message type, port number, state ID, and signal
2868  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::checkTimers), buffer);
2869  // Send the message and handle overflow
2870  this->interpreter_sendSignalFinish(buffer);
2871  }
2872 
2875  {
2876  ComponentIpcSerializableBuffer buffer;
2877  // Serialize the message type, port number, state ID, and signal
2878  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResume), buffer);
2879  // Send the message and handle overflow
2880  this->interpreter_sendSignalFinish(buffer);
2881  }
2882 
2885  {
2886  ComponentIpcSerializableBuffer buffer;
2887  // Serialize the message type, port number, state ID, and signal
2888  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResumeI32), buffer);
2889  // Serialize the signal data
2890  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2891  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2892  // Send the message and handle overflow
2893  this->interpreter_sendSignalFinish(buffer);
2894  }
2895 
2898  {
2899  ComponentIpcSerializableBuffer buffer;
2900  // Serialize the message type, port number, state ID, and signal
2901  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResponseFailure), buffer);
2902  // Send the message and handle overflow
2903  this->interpreter_sendSignalFinish(buffer);
2904  }
2905 
2908  {
2909  ComponentIpcSerializableBuffer buffer;
2910  // Serialize the message type, port number, state ID, and signal
2911  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResponseUnexpected), buffer);
2912  // Serialize the signal data
2913  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2914  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2915  // Send the message and handle overflow
2916  this->interpreter_sendSignalFinish(buffer);
2917  }
2918 
2921  {
2922  ComponentIpcSerializableBuffer buffer;
2923  // Serialize the message type, port number, state ID, and signal
2924  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResponseTimeIncomparable), buffer);
2925  // Send the message and handle overflow
2926  this->interpreter_sendSignalFinish(buffer);
2927  }
2928 
2931  {
2932  ComponentIpcSerializableBuffer buffer;
2933  // Serialize the message type, port number, state ID, and signal
2934  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResponseTimeout), buffer);
2935  // Send the message and handle overflow
2936  this->interpreter_sendSignalFinish(buffer);
2937  }
2938 
2941  {
2942  ComponentIpcSerializableBuffer buffer;
2943  // Serialize the message type, port number, state ID, and signal
2944  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::serialInMessage), buffer);
2945  // Serialize the signal data
2946  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2947  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2948  // Send the message and handle overflow
2949  this->interpreter_sendSignalFinish(buffer);
2950  }
2951 
2954  {
2955  ComponentIpcSerializableBuffer buffer;
2956  // Serialize the message type, port number, state ID, and signal
2957  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::interpreterFinished), buffer);
2958  // Serialize the signal data
2959  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2960  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2961  // Send the message and handle overflow
2962  this->interpreter_sendSignalFinish(buffer);
2963  }
2964 
2967  {
2968  ComponentIpcSerializableBuffer buffer;
2969  // Serialize the message type, port number, state ID, and signal
2970  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::interpreterTrap), buffer);
2971  // Serialize the signal data
2972  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2973  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2974  // Send the message and handle overflow
2975  this->interpreter_sendSignalFinish(buffer);
2976  }
2977 
2980  {
2981  ComponentIpcSerializableBuffer buffer;
2982  // Serialize the message type, port number, state ID, and signal
2983  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::interpreterOutOfFuel), buffer);
2984  // Send the message and handle overflow
2985  this->interpreter_sendSignalFinish(buffer);
2986  }
2987 
2990  {
2991  ComponentIpcSerializableBuffer buffer;
2992  // Serialize the message type, port number, state ID, and signal
2993  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::interpreterHostFunctionNeedsPause), buffer);
2994  // Send the message and handle overflow
2995  this->interpreter_sendSignalFinish(buffer);
2996  }
2997 
2998  // ----------------------------------------------------------------------
2999  // Command response
3000  // ----------------------------------------------------------------------
3001 
3004  FwOpcodeType opCode,
3005  U32 cmdSeq,
3006  Fw::CmdResponse response
3007  )
3008  {
3010  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
3011  }
3012 
3013  // ----------------------------------------------------------------------
3014  // Command handler base-class functions
3015  //
3016  // Call these functions directly to bypass the command input port
3017  // ----------------------------------------------------------------------
3018 
3021  FwOpcodeType opCode,
3022  U32 cmdSeq,
3023  Fw::CmdArgBuffer& args
3024  )
3025  {
3026  // Call pre-message hook
3027  this->RUN_preMsgHook(opCode,cmdSeq);
3028 
3029  // Defer deserializing arguments to the message dispatcher
3030  // to avoid deserializing and reserializing just for IPC
3031  ComponentIpcSerializableBuffer msg;
3033 
3034  // Serialize for IPC
3035  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_RUN));
3036  FW_ASSERT (
3037  _status == Fw::FW_SERIALIZE_OK,
3038  static_cast<FwAssertArgType>(_status)
3039  );
3040 
3041  // Fake port number to make message dequeue work
3042  FwIndexType port = 0;
3043 
3044  _status = msg.serializeFrom(port);
3045  FW_ASSERT (
3046  _status == Fw::FW_SERIALIZE_OK,
3047  static_cast<FwAssertArgType>(_status)
3048  );
3049 
3050  _status = msg.serializeFrom(opCode);
3051  FW_ASSERT (
3052  _status == Fw::FW_SERIALIZE_OK,
3053  static_cast<FwAssertArgType>(_status)
3054  );
3055 
3056  _status = msg.serializeFrom(cmdSeq);
3057  FW_ASSERT (
3058  _status == Fw::FW_SERIALIZE_OK,
3059  static_cast<FwAssertArgType>(_status)
3060  );
3061 
3062  _status = msg.serializeFrom(args);
3063  FW_ASSERT (
3064  _status == Fw::FW_SERIALIZE_OK,
3065  static_cast<FwAssertArgType>(_status)
3066  );
3067 
3068  // Send message
3070  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3071 
3072  FW_ASSERT(
3073  qStatus == Os::Queue::OP_OK,
3074  static_cast<FwAssertArgType>(qStatus)
3075  );
3076  }
3077 
3080  FwOpcodeType opCode,
3081  U32 cmdSeq,
3082  Fw::CmdArgBuffer& args
3083  )
3084  {
3085  // Call pre-message hook
3086  this->LOAD_preMsgHook(opCode,cmdSeq);
3087 
3088  // Defer deserializing arguments to the message dispatcher
3089  // to avoid deserializing and reserializing just for IPC
3090  ComponentIpcSerializableBuffer msg;
3092 
3093  // Serialize for IPC
3094  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_LOAD));
3095  FW_ASSERT (
3096  _status == Fw::FW_SERIALIZE_OK,
3097  static_cast<FwAssertArgType>(_status)
3098  );
3099 
3100  // Fake port number to make message dequeue work
3101  FwIndexType port = 0;
3102 
3103  _status = msg.serializeFrom(port);
3104  FW_ASSERT (
3105  _status == Fw::FW_SERIALIZE_OK,
3106  static_cast<FwAssertArgType>(_status)
3107  );
3108 
3109  _status = msg.serializeFrom(opCode);
3110  FW_ASSERT (
3111  _status == Fw::FW_SERIALIZE_OK,
3112  static_cast<FwAssertArgType>(_status)
3113  );
3114 
3115  _status = msg.serializeFrom(cmdSeq);
3116  FW_ASSERT (
3117  _status == Fw::FW_SERIALIZE_OK,
3118  static_cast<FwAssertArgType>(_status)
3119  );
3120 
3121  _status = msg.serializeFrom(args);
3122  FW_ASSERT (
3123  _status == Fw::FW_SERIALIZE_OK,
3124  static_cast<FwAssertArgType>(_status)
3125  );
3126 
3127  // Send message
3129  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3130 
3131  FW_ASSERT(
3132  qStatus == Os::Queue::OP_OK,
3133  static_cast<FwAssertArgType>(qStatus)
3134  );
3135  }
3136 
3139  FwOpcodeType opCode,
3140  U32 cmdSeq,
3141  Fw::CmdArgBuffer& args
3142  )
3143  {
3144  // Call pre-message hook
3145  this->INVOKE_preMsgHook(opCode,cmdSeq);
3146 
3147  // Defer deserializing arguments to the message dispatcher
3148  // to avoid deserializing and reserializing just for IPC
3149  ComponentIpcSerializableBuffer msg;
3151 
3152  // Serialize for IPC
3153  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_INVOKE));
3154  FW_ASSERT (
3155  _status == Fw::FW_SERIALIZE_OK,
3156  static_cast<FwAssertArgType>(_status)
3157  );
3158 
3159  // Fake port number to make message dequeue work
3160  FwIndexType port = 0;
3161 
3162  _status = msg.serializeFrom(port);
3163  FW_ASSERT (
3164  _status == Fw::FW_SERIALIZE_OK,
3165  static_cast<FwAssertArgType>(_status)
3166  );
3167 
3168  _status = msg.serializeFrom(opCode);
3169  FW_ASSERT (
3170  _status == Fw::FW_SERIALIZE_OK,
3171  static_cast<FwAssertArgType>(_status)
3172  );
3173 
3174  _status = msg.serializeFrom(cmdSeq);
3175  FW_ASSERT (
3176  _status == Fw::FW_SERIALIZE_OK,
3177  static_cast<FwAssertArgType>(_status)
3178  );
3179 
3180  _status = msg.serializeFrom(args);
3181  FW_ASSERT (
3182  _status == Fw::FW_SERIALIZE_OK,
3183  static_cast<FwAssertArgType>(_status)
3184  );
3185 
3186  // Send message
3188  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3189 
3190  FW_ASSERT(
3191  qStatus == Os::Queue::OP_OK,
3192  static_cast<FwAssertArgType>(qStatus)
3193  );
3194  }
3195 
3198  FwOpcodeType opCode,
3199  U32 cmdSeq,
3200  Fw::CmdArgBuffer& args
3201  )
3202  {
3203  // Call pre-message hook
3204  this->WAIT_preMsgHook(opCode,cmdSeq);
3205 
3206  // Defer deserializing arguments to the message dispatcher
3207  // to avoid deserializing and reserializing just for IPC
3208  ComponentIpcSerializableBuffer msg;
3210 
3211  // Serialize for IPC
3212  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_WAIT));
3213  FW_ASSERT (
3214  _status == Fw::FW_SERIALIZE_OK,
3215  static_cast<FwAssertArgType>(_status)
3216  );
3217 
3218  // Fake port number to make message dequeue work
3219  FwIndexType port = 0;
3220 
3221  _status = msg.serializeFrom(port);
3222  FW_ASSERT (
3223  _status == Fw::FW_SERIALIZE_OK,
3224  static_cast<FwAssertArgType>(_status)
3225  );
3226 
3227  _status = msg.serializeFrom(opCode);
3228  FW_ASSERT (
3229  _status == Fw::FW_SERIALIZE_OK,
3230  static_cast<FwAssertArgType>(_status)
3231  );
3232 
3233  _status = msg.serializeFrom(cmdSeq);
3234  FW_ASSERT (
3235  _status == Fw::FW_SERIALIZE_OK,
3236  static_cast<FwAssertArgType>(_status)
3237  );
3238 
3239  _status = msg.serializeFrom(args);
3240  FW_ASSERT (
3241  _status == Fw::FW_SERIALIZE_OK,
3242  static_cast<FwAssertArgType>(_status)
3243  );
3244 
3245  // Send message
3247  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3248 
3249  FW_ASSERT(
3250  qStatus == Os::Queue::OP_OK,
3251  static_cast<FwAssertArgType>(qStatus)
3252  );
3253  }
3254 
3257  FwOpcodeType opCode,
3258  U32 cmdSeq,
3259  Fw::CmdArgBuffer& args
3260  )
3261  {
3262 #if FW_CMD_CHECK_RESIDUAL
3263  // Make sure there was no data left over.
3264  // That means the argument buffer size was incorrect.
3265  if (args.getDeserializeSizeLeft() != 0) {
3267  this->cmdResponseOut_out(
3268  0,
3269  opCode,
3270  cmdSeq,
3272  );
3273  }
3274  return;
3275  }
3276 #endif
3277 
3278  this->CANCEL_cmdHandler(opCode, cmdSeq);
3279  }
3280 
3283  FwOpcodeType opCode,
3284  U32 cmdSeq,
3285  Fw::CmdArgBuffer& args
3286  )
3287  {
3288  // Call pre-message hook
3289  this->PAUSE_preMsgHook(opCode,cmdSeq);
3290 
3291  // Defer deserializing arguments to the message dispatcher
3292  // to avoid deserializing and reserializing just for IPC
3293  ComponentIpcSerializableBuffer msg;
3295 
3296  // Serialize for IPC
3297  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_PAUSE));
3298  FW_ASSERT (
3299  _status == Fw::FW_SERIALIZE_OK,
3300  static_cast<FwAssertArgType>(_status)
3301  );
3302 
3303  // Fake port number to make message dequeue work
3304  FwIndexType port = 0;
3305 
3306  _status = msg.serializeFrom(port);
3307  FW_ASSERT (
3308  _status == Fw::FW_SERIALIZE_OK,
3309  static_cast<FwAssertArgType>(_status)
3310  );
3311 
3312  _status = msg.serializeFrom(opCode);
3313  FW_ASSERT (
3314  _status == Fw::FW_SERIALIZE_OK,
3315  static_cast<FwAssertArgType>(_status)
3316  );
3317 
3318  _status = msg.serializeFrom(cmdSeq);
3319  FW_ASSERT (
3320  _status == Fw::FW_SERIALIZE_OK,
3321  static_cast<FwAssertArgType>(_status)
3322  );
3323 
3324  _status = msg.serializeFrom(args);
3325  FW_ASSERT (
3326  _status == Fw::FW_SERIALIZE_OK,
3327  static_cast<FwAssertArgType>(_status)
3328  );
3329 
3330  // Send message
3332  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3333 
3334  FW_ASSERT(
3335  qStatus == Os::Queue::OP_OK,
3336  static_cast<FwAssertArgType>(qStatus)
3337  );
3338  }
3339 
3342  FwOpcodeType opCode,
3343  U32 cmdSeq,
3344  Fw::CmdArgBuffer& args
3345  )
3346  {
3347  // Call pre-message hook
3348  this->CONTINUE_preMsgHook(opCode,cmdSeq);
3349 
3350  // Defer deserializing arguments to the message dispatcher
3351  // to avoid deserializing and reserializing just for IPC
3352  ComponentIpcSerializableBuffer msg;
3354 
3355  // Serialize for IPC
3356  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CONTINUE));
3357  FW_ASSERT (
3358  _status == Fw::FW_SERIALIZE_OK,
3359  static_cast<FwAssertArgType>(_status)
3360  );
3361 
3362  // Fake port number to make message dequeue work
3363  FwIndexType port = 0;
3364 
3365  _status = msg.serializeFrom(port);
3366  FW_ASSERT (
3367  _status == Fw::FW_SERIALIZE_OK,
3368  static_cast<FwAssertArgType>(_status)
3369  );
3370 
3371  _status = msg.serializeFrom(opCode);
3372  FW_ASSERT (
3373  _status == Fw::FW_SERIALIZE_OK,
3374  static_cast<FwAssertArgType>(_status)
3375  );
3376 
3377  _status = msg.serializeFrom(cmdSeq);
3378  FW_ASSERT (
3379  _status == Fw::FW_SERIALIZE_OK,
3380  static_cast<FwAssertArgType>(_status)
3381  );
3382 
3383  _status = msg.serializeFrom(args);
3384  FW_ASSERT (
3385  _status == Fw::FW_SERIALIZE_OK,
3386  static_cast<FwAssertArgType>(_status)
3387  );
3388 
3389  // Send message
3391  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3392 
3393  FW_ASSERT(
3394  qStatus == Os::Queue::OP_OK,
3395  static_cast<FwAssertArgType>(qStatus)
3396  );
3397  }
3398 
3401  FwOpcodeType opCode,
3402  U32 cmdSeq,
3403  Fw::CmdArgBuffer& args
3404  )
3405  {
3406  // Call pre-message hook
3407  this->GLOBAL_SET_I32_preMsgHook(opCode,cmdSeq);
3408 
3409  // Defer deserializing arguments to the message dispatcher
3410  // to avoid deserializing and reserializing just for IPC
3411  ComponentIpcSerializableBuffer msg;
3413 
3414  // Serialize for IPC
3415  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_SET_I32));
3416  FW_ASSERT (
3417  _status == Fw::FW_SERIALIZE_OK,
3418  static_cast<FwAssertArgType>(_status)
3419  );
3420 
3421  // Fake port number to make message dequeue work
3422  FwIndexType port = 0;
3423 
3424  _status = msg.serializeFrom(port);
3425  FW_ASSERT (
3426  _status == Fw::FW_SERIALIZE_OK,
3427  static_cast<FwAssertArgType>(_status)
3428  );
3429 
3430  _status = msg.serializeFrom(opCode);
3431  FW_ASSERT (
3432  _status == Fw::FW_SERIALIZE_OK,
3433  static_cast<FwAssertArgType>(_status)
3434  );
3435 
3436  _status = msg.serializeFrom(cmdSeq);
3437  FW_ASSERT (
3438  _status == Fw::FW_SERIALIZE_OK,
3439  static_cast<FwAssertArgType>(_status)
3440  );
3441 
3442  _status = msg.serializeFrom(args);
3443  FW_ASSERT (
3444  _status == Fw::FW_SERIALIZE_OK,
3445  static_cast<FwAssertArgType>(_status)
3446  );
3447 
3448  // Send message
3450  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3451 
3452  FW_ASSERT(
3453  qStatus == Os::Queue::OP_OK,
3454  static_cast<FwAssertArgType>(qStatus)
3455  );
3456  }
3457 
3460  FwOpcodeType opCode,
3461  U32 cmdSeq,
3462  Fw::CmdArgBuffer& args
3463  )
3464  {
3465  // Call pre-message hook
3466  this->GLOBAL_SET_I64_preMsgHook(opCode,cmdSeq);
3467 
3468  // Defer deserializing arguments to the message dispatcher
3469  // to avoid deserializing and reserializing just for IPC
3470  ComponentIpcSerializableBuffer msg;
3472 
3473  // Serialize for IPC
3474  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_SET_I64));
3475  FW_ASSERT (
3476  _status == Fw::FW_SERIALIZE_OK,
3477  static_cast<FwAssertArgType>(_status)
3478  );
3479 
3480  // Fake port number to make message dequeue work
3481  FwIndexType port = 0;
3482 
3483  _status = msg.serializeFrom(port);
3484  FW_ASSERT (
3485  _status == Fw::FW_SERIALIZE_OK,
3486  static_cast<FwAssertArgType>(_status)
3487  );
3488 
3489  _status = msg.serializeFrom(opCode);
3490  FW_ASSERT (
3491  _status == Fw::FW_SERIALIZE_OK,
3492  static_cast<FwAssertArgType>(_status)
3493  );
3494 
3495  _status = msg.serializeFrom(cmdSeq);
3496  FW_ASSERT (
3497  _status == Fw::FW_SERIALIZE_OK,
3498  static_cast<FwAssertArgType>(_status)
3499  );
3500 
3501  _status = msg.serializeFrom(args);
3502  FW_ASSERT (
3503  _status == Fw::FW_SERIALIZE_OK,
3504  static_cast<FwAssertArgType>(_status)
3505  );
3506 
3507  // Send message
3509  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3510 
3511  FW_ASSERT(
3512  qStatus == Os::Queue::OP_OK,
3513  static_cast<FwAssertArgType>(qStatus)
3514  );
3515  }
3516 
3519  FwOpcodeType opCode,
3520  U32 cmdSeq,
3521  Fw::CmdArgBuffer& args
3522  )
3523  {
3524  // Call pre-message hook
3525  this->GLOBAL_SET_F32_preMsgHook(opCode,cmdSeq);
3526 
3527  // Defer deserializing arguments to the message dispatcher
3528  // to avoid deserializing and reserializing just for IPC
3529  ComponentIpcSerializableBuffer msg;
3531 
3532  // Serialize for IPC
3533  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_SET_F32));
3534  FW_ASSERT (
3535  _status == Fw::FW_SERIALIZE_OK,
3536  static_cast<FwAssertArgType>(_status)
3537  );
3538 
3539  // Fake port number to make message dequeue work
3540  FwIndexType port = 0;
3541 
3542  _status = msg.serializeFrom(port);
3543  FW_ASSERT (
3544  _status == Fw::FW_SERIALIZE_OK,
3545  static_cast<FwAssertArgType>(_status)
3546  );
3547 
3548  _status = msg.serializeFrom(opCode);
3549  FW_ASSERT (
3550  _status == Fw::FW_SERIALIZE_OK,
3551  static_cast<FwAssertArgType>(_status)
3552  );
3553 
3554  _status = msg.serializeFrom(cmdSeq);
3555  FW_ASSERT (
3556  _status == Fw::FW_SERIALIZE_OK,
3557  static_cast<FwAssertArgType>(_status)
3558  );
3559 
3560  _status = msg.serializeFrom(args);
3561  FW_ASSERT (
3562  _status == Fw::FW_SERIALIZE_OK,
3563  static_cast<FwAssertArgType>(_status)
3564  );
3565 
3566  // Send message
3568  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3569 
3570  FW_ASSERT(
3571  qStatus == Os::Queue::OP_OK,
3572  static_cast<FwAssertArgType>(qStatus)
3573  );
3574  }
3575 
3578  FwOpcodeType opCode,
3579  U32 cmdSeq,
3580  Fw::CmdArgBuffer& args
3581  )
3582  {
3583  // Call pre-message hook
3584  this->GLOBAL_SET_F64_preMsgHook(opCode,cmdSeq);
3585 
3586  // Defer deserializing arguments to the message dispatcher
3587  // to avoid deserializing and reserializing just for IPC
3588  ComponentIpcSerializableBuffer msg;
3590 
3591  // Serialize for IPC
3592  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_SET_F64));
3593  FW_ASSERT (
3594  _status == Fw::FW_SERIALIZE_OK,
3595  static_cast<FwAssertArgType>(_status)
3596  );
3597 
3598  // Fake port number to make message dequeue work
3599  FwIndexType port = 0;
3600 
3601  _status = msg.serializeFrom(port);
3602  FW_ASSERT (
3603  _status == Fw::FW_SERIALIZE_OK,
3604  static_cast<FwAssertArgType>(_status)
3605  );
3606 
3607  _status = msg.serializeFrom(opCode);
3608  FW_ASSERT (
3609  _status == Fw::FW_SERIALIZE_OK,
3610  static_cast<FwAssertArgType>(_status)
3611  );
3612 
3613  _status = msg.serializeFrom(cmdSeq);
3614  FW_ASSERT (
3615  _status == Fw::FW_SERIALIZE_OK,
3616  static_cast<FwAssertArgType>(_status)
3617  );
3618 
3619  _status = msg.serializeFrom(args);
3620  FW_ASSERT (
3621  _status == Fw::FW_SERIALIZE_OK,
3622  static_cast<FwAssertArgType>(_status)
3623  );
3624 
3625  // Send message
3627  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3628 
3629  FW_ASSERT(
3630  qStatus == Os::Queue::OP_OK,
3631  static_cast<FwAssertArgType>(qStatus)
3632  );
3633  }
3634 
3637  FwOpcodeType opCode,
3638  U32 cmdSeq,
3639  Fw::CmdArgBuffer& args
3640  )
3641  {
3642  // Call pre-message hook
3643  this->GLOBAL_GET_preMsgHook(opCode,cmdSeq);
3644 
3645  // Defer deserializing arguments to the message dispatcher
3646  // to avoid deserializing and reserializing just for IPC
3647  ComponentIpcSerializableBuffer msg;
3649 
3650  // Serialize for IPC
3651  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_GET));
3652  FW_ASSERT (
3653  _status == Fw::FW_SERIALIZE_OK,
3654  static_cast<FwAssertArgType>(_status)
3655  );
3656 
3657  // Fake port number to make message dequeue work
3658  FwIndexType port = 0;
3659 
3660  _status = msg.serializeFrom(port);
3661  FW_ASSERT (
3662  _status == Fw::FW_SERIALIZE_OK,
3663  static_cast<FwAssertArgType>(_status)
3664  );
3665 
3666  _status = msg.serializeFrom(opCode);
3667  FW_ASSERT (
3668  _status == Fw::FW_SERIALIZE_OK,
3669  static_cast<FwAssertArgType>(_status)
3670  );
3671 
3672  _status = msg.serializeFrom(cmdSeq);
3673  FW_ASSERT (
3674  _status == Fw::FW_SERIALIZE_OK,
3675  static_cast<FwAssertArgType>(_status)
3676  );
3677 
3678  _status = msg.serializeFrom(args);
3679  FW_ASSERT (
3680  _status == Fw::FW_SERIALIZE_OK,
3681  static_cast<FwAssertArgType>(_status)
3682  );
3683 
3684  // Send message
3686  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3687 
3688  FW_ASSERT(
3689  qStatus == Os::Queue::OP_OK,
3690  static_cast<FwAssertArgType>(qStatus)
3691  );
3692  }
3693 
3694  // ----------------------------------------------------------------------
3695  // Pre-message hooks for async commands
3696  //
3697  // Each of these functions is invoked just before processing the
3698  // corresponding command. By default they do nothing. You can
3699  // override them to provide specific pre-command behavior.
3700  // ----------------------------------------------------------------------
3701 
3704  FwOpcodeType opCode,
3705  U32 cmdSeq
3706  )
3707  {
3708  // Defaults to no-op; can be overridden
3709  (void) opCode;
3710  (void) cmdSeq;
3711  }
3712 
3715  FwOpcodeType opCode,
3716  U32 cmdSeq
3717  )
3718  {
3719  // Defaults to no-op; can be overridden
3720  (void) opCode;
3721  (void) cmdSeq;
3722  }
3723 
3726  FwOpcodeType opCode,
3727  U32 cmdSeq
3728  )
3729  {
3730  // Defaults to no-op; can be overridden
3731  (void) opCode;
3732  (void) cmdSeq;
3733  }
3734 
3737  FwOpcodeType opCode,
3738  U32 cmdSeq
3739  )
3740  {
3741  // Defaults to no-op; can be overridden
3742  (void) opCode;
3743  (void) cmdSeq;
3744  }
3745 
3748  FwOpcodeType opCode,
3749  U32 cmdSeq
3750  )
3751  {
3752  // Defaults to no-op; can be overridden
3753  (void) opCode;
3754  (void) cmdSeq;
3755  }
3756 
3759  FwOpcodeType opCode,
3760  U32 cmdSeq
3761  )
3762  {
3763  // Defaults to no-op; can be overridden
3764  (void) opCode;
3765  (void) cmdSeq;
3766  }
3767 
3770  FwOpcodeType opCode,
3771  U32 cmdSeq
3772  )
3773  {
3774  // Defaults to no-op; can be overridden
3775  (void) opCode;
3776  (void) cmdSeq;
3777  }
3778 
3781  FwOpcodeType opCode,
3782  U32 cmdSeq
3783  )
3784  {
3785  // Defaults to no-op; can be overridden
3786  (void) opCode;
3787  (void) cmdSeq;
3788  }
3789 
3792  FwOpcodeType opCode,
3793  U32 cmdSeq
3794  )
3795  {
3796  // Defaults to no-op; can be overridden
3797  (void) opCode;
3798  (void) cmdSeq;
3799  }
3800 
3803  FwOpcodeType opCode,
3804  U32 cmdSeq
3805  )
3806  {
3807  // Defaults to no-op; can be overridden
3808  (void) opCode;
3809  (void) cmdSeq;
3810  }
3811 
3814  FwOpcodeType opCode,
3815  U32 cmdSeq
3816  )
3817  {
3818  // Defaults to no-op; can be overridden
3819  (void) opCode;
3820  (void) cmdSeq;
3821  }
3822 
3823  // ----------------------------------------------------------------------
3824  // Event logging functions
3825  // ----------------------------------------------------------------------
3826 
3829  {
3830  // Get the time
3831  Fw::Time _logTime;
3832  if (this->isConnected_timeCaller_OutputPort(0)) {
3833  this->timeCaller_out(0, _logTime);
3834  }
3835 
3837 
3838  // Emit the event on the log port
3839  if (this->isConnected_logOut_OutputPort(0)) {
3840  Fw::LogBuffer _logBuff;
3842 
3843 #if FW_AMPCS_COMPATIBLE
3844  // Serialize the number of arguments
3845  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3846  FW_ASSERT(
3847  _status == Fw::FW_SERIALIZE_OK,
3848  static_cast<FwAssertArgType>(_status)
3849  );
3850 #endif
3851 
3852 #if FW_AMPCS_COMPATIBLE
3853  // Serialize the argument size
3854  _status = _logBuff.serializeFrom(
3855  static_cast<U8>(sizeof(U16))
3856  );
3857  FW_ASSERT(
3858  _status == Fw::FW_SERIALIZE_OK,
3859  static_cast<FwAssertArgType>(_status)
3860  );
3861 #endif
3862  _status = _logBuff.serializeFrom(moduleCount);
3863  FW_ASSERT(
3864  _status == Fw::FW_SERIALIZE_OK,
3865  static_cast<FwAssertArgType>(_status)
3866  );
3867 
3868  this->logOut_out(
3869  0,
3870  _id,
3871  _logTime,
3873  _logBuff
3874  );
3875  }
3876 
3877  // Emit the event on the text log port
3878 #if FW_ENABLE_TEXT_LOGGING
3879  if (this->isConnected_logTextOut_OutputPort(0)) {
3880 #if FW_OBJECT_NAMES == 1
3881  const char* _formatString =
3882  "(%s) %s: Successfully allocated store with %" PRIu16 " modules";
3883 #else
3884  const char* _formatString =
3885  "%s: Successfully allocated store with %" PRIu16 " modules";
3886 #endif
3887 
3888  Fw::TextLogString _logString;
3889  (void) _logString.format(
3890  _formatString,
3891 #if FW_OBJECT_NAMES == 1
3892  this->m_objName.toChar(),
3893 #endif
3894  "StoreAllocationSucceeded ",
3895  moduleCount
3896  );
3897 
3898  this->logTextOut_out(
3899  0,
3900  _id,
3901  _logTime,
3903  _logString
3904  );
3905  }
3906 #endif
3907  }
3908 
3911  {
3912  // Get the time
3913  Fw::Time _logTime;
3914  if (this->isConnected_timeCaller_OutputPort(0)) {
3915  this->timeCaller_out(0, _logTime);
3916  }
3917 
3919 
3920  // Emit the event on the log port
3921  if (this->isConnected_logOut_OutputPort(0)) {
3922  Fw::LogBuffer _logBuff;
3923 
3924 #if FW_AMPCS_COMPATIBLE
3926  // Serialize the number of arguments
3927  _status = _logBuff.serializeFrom(static_cast<U8>(0));
3928  FW_ASSERT(
3929  _status == Fw::FW_SERIALIZE_OK,
3930  static_cast<FwAssertArgType>(_status)
3931  );
3932 #endif
3933 
3934  this->logOut_out(
3935  0,
3936  _id,
3937  _logTime,
3939  _logBuff
3940  );
3941  }
3942 
3943  // Emit the event on the text log port
3944 #if FW_ENABLE_TEXT_LOGGING
3945  if (this->isConnected_logTextOut_OutputPort(0)) {
3946 #if FW_OBJECT_NAMES == 1
3947  const char* _formatString =
3948  "(%s) %s: Cannot invoke a module when no module is loaded";
3949 #else
3950  const char* _formatString =
3951  "%s: Cannot invoke a module when no module is loaded";
3952 #endif
3953 
3954  Fw::TextLogString _logString;
3955  (void) _logString.format(
3956  _formatString,
3957 #if FW_OBJECT_NAMES == 1
3958  this->m_objName.toChar(),
3959 #endif
3960  "ControllerCannotInvoke "
3961  );
3962 
3963  this->logTextOut_out(
3964  0,
3965  _id,
3966  _logTime,
3968  _logString
3969  );
3970  }
3971 #endif
3972  }
3973 
3976  const Svc::WasmSequencer_SignalSource& signalSource,
3978  ) const
3979  {
3980  // Get the time
3981  Fw::Time _logTime;
3982  if (this->isConnected_timeCaller_OutputPort(0)) {
3983  this->timeCaller_out(0, _logTime);
3984  }
3985 
3986  const FwEventIdType _id = this->getIdBase() + EVENTID_CONTROLLERBUSY;
3987 
3988  // Emit the event on the log port
3989  if (this->isConnected_logOut_OutputPort(0)) {
3990  Fw::LogBuffer _logBuff;
3992 
3993 #if FW_AMPCS_COMPATIBLE
3994  // Serialize the number of arguments
3995  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3996  FW_ASSERT(
3997  _status == Fw::FW_SERIALIZE_OK,
3998  static_cast<FwAssertArgType>(_status)
3999  );
4000 #endif
4001 
4002 #if FW_AMPCS_COMPATIBLE
4003  // Serialize the argument size
4004  _status = _logBuff.serializeFrom(
4006  );
4007  FW_ASSERT(
4008  _status == Fw::FW_SERIALIZE_OK,
4009  static_cast<FwAssertArgType>(_status)
4010  );
4011 #endif
4012  _status = _logBuff.serializeFrom(signalSource);
4013  FW_ASSERT(
4014  _status == Fw::FW_SERIALIZE_OK,
4015  static_cast<FwAssertArgType>(_status)
4016  );
4017 
4018 #if FW_AMPCS_COMPATIBLE
4019  // Serialize the argument size
4020  _status = _logBuff.serializeFrom(
4022  );
4023  FW_ASSERT(
4024  _status == Fw::FW_SERIALIZE_OK,
4025  static_cast<FwAssertArgType>(_status)
4026  );
4027 #endif
4028  _status = _logBuff.serializeFrom(state);
4029  FW_ASSERT(
4030  _status == Fw::FW_SERIALIZE_OK,
4031  static_cast<FwAssertArgType>(_status)
4032  );
4033 
4034  this->logOut_out(
4035  0,
4036  _id,
4037  _logTime,
4039  _logBuff
4040  );
4041  }
4042 
4043  // Emit the event on the text log port
4044 #if FW_ENABLE_TEXT_LOGGING
4045  if (this->isConnected_logTextOut_OutputPort(0)) {
4046 #if FW_OBJECT_NAMES == 1
4047  const char* _formatString =
4048  "(%s) %s: Controller cannot process signal %s in state %s";
4049 #else
4050  const char* _formatString =
4051  "%s: Controller cannot process signal %s in state %s";
4052 #endif
4053 
4054  Fw::String signalSourceStr;
4055  signalSource.toString(signalSourceStr);
4056  Fw::String stateStr;
4057  state.toString(stateStr);
4058 
4059  Fw::TextLogString _logString;
4060  (void) _logString.format(
4061  _formatString,
4062 #if FW_OBJECT_NAMES == 1
4063  this->m_objName.toChar(),
4064 #endif
4065  "ControllerBusy ",
4066  signalSourceStr.toChar(),
4067  stateStr.toChar()
4068  );
4069 
4070  this->logTextOut_out(
4071  0,
4072  _id,
4073  _logTime,
4075  _logString
4076  );
4077  }
4078 #endif
4079  }
4080 
4083  {
4084  // Get the time
4085  Fw::Time _logTime;
4086  if (this->isConnected_timeCaller_OutputPort(0)) {
4087  this->timeCaller_out(0, _logTime);
4088  }
4089 
4090  const FwEventIdType _id = this->getIdBase() + EVENTID_MODULENOTFOUND;
4091 
4092  // Emit the event on the log port
4093  if (this->isConnected_logOut_OutputPort(0)) {
4094  Fw::LogBuffer _logBuff;
4096 
4097 #if FW_AMPCS_COMPATIBLE
4098  // Serialize the number of arguments
4099  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4100  FW_ASSERT(
4101  _status == Fw::FW_SERIALIZE_OK,
4102  static_cast<FwAssertArgType>(_status)
4103  );
4104 #endif
4105 
4106  _status = module_name.serializeTo(
4107  _logBuff,
4108  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4109  );
4110  FW_ASSERT(
4111  _status == Fw::FW_SERIALIZE_OK,
4112  static_cast<FwAssertArgType>(_status)
4113  );
4114 
4115  this->logOut_out(
4116  0,
4117  _id,
4118  _logTime,
4120  _logBuff
4121  );
4122  }
4123 
4124  // Emit the event on the text log port
4125 #if FW_ENABLE_TEXT_LOGGING
4126  if (this->isConnected_logTextOut_OutputPort(0)) {
4127 #if FW_OBJECT_NAMES == 1
4128  const char* _formatString =
4129  "(%s) %s: Module with name %s is not loaded into the store";
4130 #else
4131  const char* _formatString =
4132  "%s: Module with name %s is not loaded into the store";
4133 #endif
4134 
4135  Fw::TextLogString _logString;
4136  (void) _logString.format(
4137  _formatString,
4138 #if FW_OBJECT_NAMES == 1
4139  this->m_objName.toChar(),
4140 #endif
4141  "ModuleNotFound ",
4142  module_name.toChar()
4143  );
4144 
4145  this->logTextOut_out(
4146  0,
4147  _id,
4148  _logTime,
4150  _logString
4151  );
4152  }
4153 #endif
4154  }
4155 
4159  U64 requestedSize
4160  ) const
4161  {
4162  // Get the time
4163  Fw::Time _logTime;
4164  if (this->isConnected_timeCaller_OutputPort(0)) {
4165  this->timeCaller_out(0, _logTime);
4166  }
4167 
4168  const FwEventIdType _id = this->getIdBase() + EVENTID_MEMORYGROWREJECTED;
4169 
4170  // Emit the event on the log port
4171  if (this->isConnected_logOut_OutputPort(0)) {
4172  Fw::LogBuffer _logBuff;
4174 
4175 #if FW_AMPCS_COMPATIBLE
4176  // Serialize the number of arguments
4177  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4178  FW_ASSERT(
4179  _status == Fw::FW_SERIALIZE_OK,
4180  static_cast<FwAssertArgType>(_status)
4181  );
4182 #endif
4183 
4184 #if FW_AMPCS_COMPATIBLE
4185  // Serialize the argument size
4186  _status = _logBuff.serializeFrom(
4188  );
4189  FW_ASSERT(
4190  _status == Fw::FW_SERIALIZE_OK,
4191  static_cast<FwAssertArgType>(_status)
4192  );
4193 #endif
4194  _status = _logBuff.serializeFrom(reason);
4195  FW_ASSERT(
4196  _status == Fw::FW_SERIALIZE_OK,
4197  static_cast<FwAssertArgType>(_status)
4198  );
4199 
4200 #if FW_AMPCS_COMPATIBLE
4201  // Serialize the argument size
4202  _status = _logBuff.serializeFrom(
4203  static_cast<U8>(sizeof(U64))
4204  );
4205  FW_ASSERT(
4206  _status == Fw::FW_SERIALIZE_OK,
4207  static_cast<FwAssertArgType>(_status)
4208  );
4209 #endif
4210  _status = _logBuff.serializeFrom(requestedSize);
4211  FW_ASSERT(
4212  _status == Fw::FW_SERIALIZE_OK,
4213  static_cast<FwAssertArgType>(_status)
4214  );
4215 
4216  this->logOut_out(
4217  0,
4218  _id,
4219  _logTime,
4221  _logBuff
4222  );
4223  }
4224 
4225  // Emit the event on the text log port
4226 #if FW_ENABLE_TEXT_LOGGING
4227  if (this->isConnected_logTextOut_OutputPort(0)) {
4228 #if FW_OBJECT_NAMES == 1
4229  const char* _formatString =
4230  "(%s) %s: Guest memory.grow rejected: %s (requested %" PRIu64 " bytes)";
4231 #else
4232  const char* _formatString =
4233  "%s: Guest memory.grow rejected: %s (requested %" PRIu64 " bytes)";
4234 #endif
4235 
4236  Fw::String reasonStr;
4237  reason.toString(reasonStr);
4238 
4239  Fw::TextLogString _logString;
4240  (void) _logString.format(
4241  _formatString,
4242 #if FW_OBJECT_NAMES == 1
4243  this->m_objName.toChar(),
4244 #endif
4245  "MemoryGrowRejected ",
4246  reasonStr.toChar(),
4247  requestedSize
4248  );
4249 
4250  this->logTextOut_out(
4251  0,
4252  _id,
4253  _logTime,
4255  _logString
4256  );
4257  }
4258 #endif
4259  }
4260 
4263  const Fw::StringBase& module_name,
4264  const Fw::StringBase& globalName,
4265  const Svc::WasmSequencer_Status& reason
4266  ) const
4267  {
4268  // Get the time
4269  Fw::Time _logTime;
4270  if (this->isConnected_timeCaller_OutputPort(0)) {
4271  this->timeCaller_out(0, _logTime);
4272  }
4273 
4274  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALSETFAILED;
4275 
4276  // Emit the event on the log port
4277  if (this->isConnected_logOut_OutputPort(0)) {
4278  Fw::LogBuffer _logBuff;
4280 
4281 #if FW_AMPCS_COMPATIBLE
4282  // Serialize the number of arguments
4283  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4284  FW_ASSERT(
4285  _status == Fw::FW_SERIALIZE_OK,
4286  static_cast<FwAssertArgType>(_status)
4287  );
4288 #endif
4289 
4290  _status = module_name.serializeTo(
4291  _logBuff,
4292  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4293  );
4294  FW_ASSERT(
4295  _status == Fw::FW_SERIALIZE_OK,
4296  static_cast<FwAssertArgType>(_status)
4297  );
4298 
4299  _status = globalName.serializeTo(
4300  _logBuff,
4301  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4302  );
4303  FW_ASSERT(
4304  _status == Fw::FW_SERIALIZE_OK,
4305  static_cast<FwAssertArgType>(_status)
4306  );
4307 
4308 #if FW_AMPCS_COMPATIBLE
4309  // Serialize the argument size
4310  _status = _logBuff.serializeFrom(
4312  );
4313  FW_ASSERT(
4314  _status == Fw::FW_SERIALIZE_OK,
4315  static_cast<FwAssertArgType>(_status)
4316  );
4317 #endif
4318  _status = _logBuff.serializeFrom(reason);
4319  FW_ASSERT(
4320  _status == Fw::FW_SERIALIZE_OK,
4321  static_cast<FwAssertArgType>(_status)
4322  );
4323 
4324  this->logOut_out(
4325  0,
4326  _id,
4327  _logTime,
4329  _logBuff
4330  );
4331  }
4332 
4333  // Emit the event on the text log port
4334 #if FW_ENABLE_TEXT_LOGGING
4335  if (this->isConnected_logTextOut_OutputPort(0)) {
4336 #if FW_OBJECT_NAMES == 1
4337  const char* _formatString =
4338  "(%s) %s: Failed to set global value for module %s global name %s: %s";
4339 #else
4340  const char* _formatString =
4341  "%s: Failed to set global value for module %s global name %s: %s";
4342 #endif
4343 
4344  Fw::String reasonStr;
4345  reason.toString(reasonStr);
4346 
4347  Fw::TextLogString _logString;
4348  (void) _logString.format(
4349  _formatString,
4350 #if FW_OBJECT_NAMES == 1
4351  this->m_objName.toChar(),
4352 #endif
4353  "GlobalSetFailed ",
4354  module_name.toChar(),
4355  globalName.toChar(),
4356  reasonStr.toChar()
4357  );
4358 
4359  this->logTextOut_out(
4360  0,
4361  _id,
4362  _logTime,
4364  _logString
4365  );
4366  }
4367 #endif
4368  }
4369 
4372  const Fw::StringBase& module_name,
4373  const Fw::StringBase& globalName,
4374  const Svc::WasmSequencer_Status& reason
4375  ) const
4376  {
4377  // Get the time
4378  Fw::Time _logTime;
4379  if (this->isConnected_timeCaller_OutputPort(0)) {
4380  this->timeCaller_out(0, _logTime);
4381  }
4382 
4383  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALGETFAILED;
4384 
4385  // Emit the event on the log port
4386  if (this->isConnected_logOut_OutputPort(0)) {
4387  Fw::LogBuffer _logBuff;
4389 
4390 #if FW_AMPCS_COMPATIBLE
4391  // Serialize the number of arguments
4392  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4393  FW_ASSERT(
4394  _status == Fw::FW_SERIALIZE_OK,
4395  static_cast<FwAssertArgType>(_status)
4396  );
4397 #endif
4398 
4399  _status = module_name.serializeTo(
4400  _logBuff,
4401  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4402  );
4403  FW_ASSERT(
4404  _status == Fw::FW_SERIALIZE_OK,
4405  static_cast<FwAssertArgType>(_status)
4406  );
4407 
4408  _status = globalName.serializeTo(
4409  _logBuff,
4410  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4411  );
4412  FW_ASSERT(
4413  _status == Fw::FW_SERIALIZE_OK,
4414  static_cast<FwAssertArgType>(_status)
4415  );
4416 
4417 #if FW_AMPCS_COMPATIBLE
4418  // Serialize the argument size
4419  _status = _logBuff.serializeFrom(
4421  );
4422  FW_ASSERT(
4423  _status == Fw::FW_SERIALIZE_OK,
4424  static_cast<FwAssertArgType>(_status)
4425  );
4426 #endif
4427  _status = _logBuff.serializeFrom(reason);
4428  FW_ASSERT(
4429  _status == Fw::FW_SERIALIZE_OK,
4430  static_cast<FwAssertArgType>(_status)
4431  );
4432 
4433  this->logOut_out(
4434  0,
4435  _id,
4436  _logTime,
4438  _logBuff
4439  );
4440  }
4441 
4442  // Emit the event on the text log port
4443 #if FW_ENABLE_TEXT_LOGGING
4444  if (this->isConnected_logTextOut_OutputPort(0)) {
4445 #if FW_OBJECT_NAMES == 1
4446  const char* _formatString =
4447  "(%s) %s: Failed to get global value for module %s global name %s: %s";
4448 #else
4449  const char* _formatString =
4450  "%s: Failed to get global value for module %s global name %s: %s";
4451 #endif
4452 
4453  Fw::String reasonStr;
4454  reason.toString(reasonStr);
4455 
4456  Fw::TextLogString _logString;
4457  (void) _logString.format(
4458  _formatString,
4459 #if FW_OBJECT_NAMES == 1
4460  this->m_objName.toChar(),
4461 #endif
4462  "GlobalGetFailed ",
4463  module_name.toChar(),
4464  globalName.toChar(),
4465  reasonStr.toChar()
4466  );
4467 
4468  this->logTextOut_out(
4469  0,
4470  _id,
4471  _logTime,
4473  _logString
4474  );
4475  }
4476 #endif
4477  }
4478 
4481  const Fw::StringBase& module_name,
4482  const Fw::StringBase& globalName,
4483  I32 value
4484  ) const
4485  {
4486  // Get the time
4487  Fw::Time _logTime;
4488  if (this->isConnected_timeCaller_OutputPort(0)) {
4489  this->timeCaller_out(0, _logTime);
4490  }
4491 
4492  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALVALUEI32;
4493 
4494  // Emit the event on the log port
4495  if (this->isConnected_logOut_OutputPort(0)) {
4496  Fw::LogBuffer _logBuff;
4498 
4499 #if FW_AMPCS_COMPATIBLE
4500  // Serialize the number of arguments
4501  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4502  FW_ASSERT(
4503  _status == Fw::FW_SERIALIZE_OK,
4504  static_cast<FwAssertArgType>(_status)
4505  );
4506 #endif
4507 
4508  _status = module_name.serializeTo(
4509  _logBuff,
4510  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4511  );
4512  FW_ASSERT(
4513  _status == Fw::FW_SERIALIZE_OK,
4514  static_cast<FwAssertArgType>(_status)
4515  );
4516 
4517  _status = globalName.serializeTo(
4518  _logBuff,
4519  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4520  );
4521  FW_ASSERT(
4522  _status == Fw::FW_SERIALIZE_OK,
4523  static_cast<FwAssertArgType>(_status)
4524  );
4525 
4526 #if FW_AMPCS_COMPATIBLE
4527  // Serialize the argument size
4528  _status = _logBuff.serializeFrom(
4529  static_cast<U8>(sizeof(I32))
4530  );
4531  FW_ASSERT(
4532  _status == Fw::FW_SERIALIZE_OK,
4533  static_cast<FwAssertArgType>(_status)
4534  );
4535 #endif
4536  _status = _logBuff.serializeFrom(value);
4537  FW_ASSERT(
4538  _status == Fw::FW_SERIALIZE_OK,
4539  static_cast<FwAssertArgType>(_status)
4540  );
4541 
4542  this->logOut_out(
4543  0,
4544  _id,
4545  _logTime,
4547  _logBuff
4548  );
4549  }
4550 
4551  // Emit the event on the text log port
4552 #if FW_ENABLE_TEXT_LOGGING
4553  if (this->isConnected_logTextOut_OutputPort(0)) {
4554 #if FW_OBJECT_NAMES == 1
4555  const char* _formatString =
4556  "(%s) %s: Global value module=%s name=%s value=%" PRIi32 "";
4557 #else
4558  const char* _formatString =
4559  "%s: Global value module=%s name=%s value=%" PRIi32 "";
4560 #endif
4561 
4562  Fw::TextLogString _logString;
4563  (void) _logString.format(
4564  _formatString,
4565 #if FW_OBJECT_NAMES == 1
4566  this->m_objName.toChar(),
4567 #endif
4568  "GlobalValueI32 ",
4569  module_name.toChar(),
4570  globalName.toChar(),
4571  value
4572  );
4573 
4574  this->logTextOut_out(
4575  0,
4576  _id,
4577  _logTime,
4579  _logString
4580  );
4581  }
4582 #endif
4583  }
4584 
4587  const Fw::StringBase& module_name,
4588  const Fw::StringBase& globalName,
4589  I64 value
4590  ) const
4591  {
4592  // Get the time
4593  Fw::Time _logTime;
4594  if (this->isConnected_timeCaller_OutputPort(0)) {
4595  this->timeCaller_out(0, _logTime);
4596  }
4597 
4598  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALVALUEI64;
4599 
4600  // Emit the event on the log port
4601  if (this->isConnected_logOut_OutputPort(0)) {
4602  Fw::LogBuffer _logBuff;
4604 
4605 #if FW_AMPCS_COMPATIBLE
4606  // Serialize the number of arguments
4607  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4608  FW_ASSERT(
4609  _status == Fw::FW_SERIALIZE_OK,
4610  static_cast<FwAssertArgType>(_status)
4611  );
4612 #endif
4613 
4614  _status = module_name.serializeTo(
4615  _logBuff,
4616  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4617  );
4618  FW_ASSERT(
4619  _status == Fw::FW_SERIALIZE_OK,
4620  static_cast<FwAssertArgType>(_status)
4621  );
4622 
4623  _status = globalName.serializeTo(
4624  _logBuff,
4625  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4626  );
4627  FW_ASSERT(
4628  _status == Fw::FW_SERIALIZE_OK,
4629  static_cast<FwAssertArgType>(_status)
4630  );
4631 
4632 #if FW_AMPCS_COMPATIBLE
4633  // Serialize the argument size
4634  _status = _logBuff.serializeFrom(
4635  static_cast<U8>(sizeof(I64))
4636  );
4637  FW_ASSERT(
4638  _status == Fw::FW_SERIALIZE_OK,
4639  static_cast<FwAssertArgType>(_status)
4640  );
4641 #endif
4642  _status = _logBuff.serializeFrom(value);
4643  FW_ASSERT(
4644  _status == Fw::FW_SERIALIZE_OK,
4645  static_cast<FwAssertArgType>(_status)
4646  );
4647 
4648  this->logOut_out(
4649  0,
4650  _id,
4651  _logTime,
4653  _logBuff
4654  );
4655  }
4656 
4657  // Emit the event on the text log port
4658 #if FW_ENABLE_TEXT_LOGGING
4659  if (this->isConnected_logTextOut_OutputPort(0)) {
4660 #if FW_OBJECT_NAMES == 1
4661  const char* _formatString =
4662  "(%s) %s: Global value module=%s name=%s value=%" PRIi64 "";
4663 #else
4664  const char* _formatString =
4665  "%s: Global value module=%s name=%s value=%" PRIi64 "";
4666 #endif
4667 
4668  Fw::TextLogString _logString;
4669  (void) _logString.format(
4670  _formatString,
4671 #if FW_OBJECT_NAMES == 1
4672  this->m_objName.toChar(),
4673 #endif
4674  "GlobalValueI64 ",
4675  module_name.toChar(),
4676  globalName.toChar(),
4677  value
4678  );
4679 
4680  this->logTextOut_out(
4681  0,
4682  _id,
4683  _logTime,
4685  _logString
4686  );
4687  }
4688 #endif
4689  }
4690 
4693  const Fw::StringBase& module_name,
4694  const Fw::StringBase& globalName,
4695  F32 value
4696  ) const
4697  {
4698  // Get the time
4699  Fw::Time _logTime;
4700  if (this->isConnected_timeCaller_OutputPort(0)) {
4701  this->timeCaller_out(0, _logTime);
4702  }
4703 
4704  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALVALUEF32;
4705 
4706  // Emit the event on the log port
4707  if (this->isConnected_logOut_OutputPort(0)) {
4708  Fw::LogBuffer _logBuff;
4710 
4711 #if FW_AMPCS_COMPATIBLE
4712  // Serialize the number of arguments
4713  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4714  FW_ASSERT(
4715  _status == Fw::FW_SERIALIZE_OK,
4716  static_cast<FwAssertArgType>(_status)
4717  );
4718 #endif
4719 
4720  _status = module_name.serializeTo(
4721  _logBuff,
4722  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4723  );
4724  FW_ASSERT(
4725  _status == Fw::FW_SERIALIZE_OK,
4726  static_cast<FwAssertArgType>(_status)
4727  );
4728 
4729  _status = globalName.serializeTo(
4730  _logBuff,
4731  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4732  );
4733  FW_ASSERT(
4734  _status == Fw::FW_SERIALIZE_OK,
4735  static_cast<FwAssertArgType>(_status)
4736  );
4737 
4738 #if FW_AMPCS_COMPATIBLE
4739  // Serialize the argument size
4740  _status = _logBuff.serializeFrom(
4741  static_cast<U8>(sizeof(F32))
4742  );
4743  FW_ASSERT(
4744  _status == Fw::FW_SERIALIZE_OK,
4745  static_cast<FwAssertArgType>(_status)
4746  );
4747 #endif
4748  _status = _logBuff.serializeFrom(value);
4749  FW_ASSERT(
4750  _status == Fw::FW_SERIALIZE_OK,
4751  static_cast<FwAssertArgType>(_status)
4752  );
4753 
4754  this->logOut_out(
4755  0,
4756  _id,
4757  _logTime,
4759  _logBuff
4760  );
4761  }
4762 
4763  // Emit the event on the text log port
4764 #if FW_ENABLE_TEXT_LOGGING
4765  if (this->isConnected_logTextOut_OutputPort(0)) {
4766 #if FW_OBJECT_NAMES == 1
4767  const char* _formatString =
4768  "(%s) %s: Global value module=%s name=%s value=%f";
4769 #else
4770  const char* _formatString =
4771  "%s: Global value module=%s name=%s value=%f";
4772 #endif
4773 
4774  Fw::TextLogString _logString;
4775  (void) _logString.format(
4776  _formatString,
4777 #if FW_OBJECT_NAMES == 1
4778  this->m_objName.toChar(),
4779 #endif
4780  "GlobalValueF32 ",
4781  module_name.toChar(),
4782  globalName.toChar(),
4783  static_cast<F64>(value)
4784  );
4785 
4786  this->logTextOut_out(
4787  0,
4788  _id,
4789  _logTime,
4791  _logString
4792  );
4793  }
4794 #endif
4795  }
4796 
4799  const Fw::StringBase& module_name,
4800  const Fw::StringBase& globalName,
4801  F64 value
4802  ) const
4803  {
4804  // Get the time
4805  Fw::Time _logTime;
4806  if (this->isConnected_timeCaller_OutputPort(0)) {
4807  this->timeCaller_out(0, _logTime);
4808  }
4809 
4810  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALVALUEF64;
4811 
4812  // Emit the event on the log port
4813  if (this->isConnected_logOut_OutputPort(0)) {
4814  Fw::LogBuffer _logBuff;
4816 
4817 #if FW_AMPCS_COMPATIBLE
4818  // Serialize the number of arguments
4819  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4820  FW_ASSERT(
4821  _status == Fw::FW_SERIALIZE_OK,
4822  static_cast<FwAssertArgType>(_status)
4823  );
4824 #endif
4825 
4826  _status = module_name.serializeTo(
4827  _logBuff,
4828  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4829  );
4830  FW_ASSERT(
4831  _status == Fw::FW_SERIALIZE_OK,
4832  static_cast<FwAssertArgType>(_status)
4833  );
4834 
4835  _status = globalName.serializeTo(
4836  _logBuff,
4837  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4838  );
4839  FW_ASSERT(
4840  _status == Fw::FW_SERIALIZE_OK,
4841  static_cast<FwAssertArgType>(_status)
4842  );
4843 
4844 #if FW_AMPCS_COMPATIBLE
4845  // Serialize the argument size
4846  _status = _logBuff.serializeFrom(
4847  static_cast<U8>(sizeof(F64))
4848  );
4849  FW_ASSERT(
4850  _status == Fw::FW_SERIALIZE_OK,
4851  static_cast<FwAssertArgType>(_status)
4852  );
4853 #endif
4854  _status = _logBuff.serializeFrom(value);
4855  FW_ASSERT(
4856  _status == Fw::FW_SERIALIZE_OK,
4857  static_cast<FwAssertArgType>(_status)
4858  );
4859 
4860  this->logOut_out(
4861  0,
4862  _id,
4863  _logTime,
4865  _logBuff
4866  );
4867  }
4868 
4869  // Emit the event on the text log port
4870 #if FW_ENABLE_TEXT_LOGGING
4871  if (this->isConnected_logTextOut_OutputPort(0)) {
4872 #if FW_OBJECT_NAMES == 1
4873  const char* _formatString =
4874  "(%s) %s: Global value module=%s name=%s value=%f";
4875 #else
4876  const char* _formatString =
4877  "%s: Global value module=%s name=%s value=%f";
4878 #endif
4879 
4880  Fw::TextLogString _logString;
4881  (void) _logString.format(
4882  _formatString,
4883 #if FW_OBJECT_NAMES == 1
4884  this->m_objName.toChar(),
4885 #endif
4886  "GlobalValueF64 ",
4887  module_name.toChar(),
4888  globalName.toChar(),
4889  value
4890  );
4891 
4892  this->logTextOut_out(
4893  0,
4894  _id,
4895  _logTime,
4897  _logString
4898  );
4899  }
4900 #endif
4901  }
4902 
4905  const Fw::StringBase& fileName,
4906  I32 status
4907  ) const
4908  {
4909  // Get the time
4910  Fw::Time _logTime;
4911  if (this->isConnected_timeCaller_OutputPort(0)) {
4912  this->timeCaller_out(0, _logTime);
4913  }
4914 
4915  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEOPENERROR;
4916 
4917  // Emit the event on the log port
4918  if (this->isConnected_logOut_OutputPort(0)) {
4919  Fw::LogBuffer _logBuff;
4921 
4922 #if FW_AMPCS_COMPATIBLE
4923  // Serialize the number of arguments
4924  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4925  FW_ASSERT(
4926  _status == Fw::FW_SERIALIZE_OK,
4927  static_cast<FwAssertArgType>(_status)
4928  );
4929 #endif
4930 
4931  _status = fileName.serializeTo(
4932  _logBuff,
4933  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4934  );
4935  FW_ASSERT(
4936  _status == Fw::FW_SERIALIZE_OK,
4937  static_cast<FwAssertArgType>(_status)
4938  );
4939 
4940 #if FW_AMPCS_COMPATIBLE
4941  // Serialize the argument size
4942  _status = _logBuff.serializeFrom(
4943  static_cast<U8>(sizeof(I32))
4944  );
4945  FW_ASSERT(
4946  _status == Fw::FW_SERIALIZE_OK,
4947  static_cast<FwAssertArgType>(_status)
4948  );
4949 #endif
4950  _status = _logBuff.serializeFrom(status);
4951  FW_ASSERT(
4952  _status == Fw::FW_SERIALIZE_OK,
4953  static_cast<FwAssertArgType>(_status)
4954  );
4955 
4956  this->logOut_out(
4957  0,
4958  _id,
4959  _logTime,
4961  _logBuff
4962  );
4963  }
4964 
4965  // Emit the event on the text log port
4966 #if FW_ENABLE_TEXT_LOGGING
4967  if (this->isConnected_logTextOut_OutputPort(0)) {
4968 #if FW_OBJECT_NAMES == 1
4969  const char* _formatString =
4970  "(%s) %s: Failed to open Wasm module file %s: status %" PRIi32 "";
4971 #else
4972  const char* _formatString =
4973  "%s: Failed to open Wasm module file %s: status %" PRIi32 "";
4974 #endif
4975 
4976  Fw::TextLogString _logString;
4977  (void) _logString.format(
4978  _formatString,
4979 #if FW_OBJECT_NAMES == 1
4980  this->m_objName.toChar(),
4981 #endif
4982  "FileOpenError ",
4983  fileName.toChar(),
4984  status
4985  );
4986 
4987  this->logTextOut_out(
4988  0,
4989  _id,
4990  _logTime,
4992  _logString
4993  );
4994  }
4995 #endif
4996  }
4997 
5000  const Fw::StringBase& baseDir,
5001  const Fw::StringBase& fileName
5002  ) const
5003  {
5004  // Get the time
5005  Fw::Time _logTime;
5006  if (this->isConnected_timeCaller_OutputPort(0)) {
5007  this->timeCaller_out(0, _logTime);
5008  }
5009 
5011 
5012  // Emit the event on the log port
5013  if (this->isConnected_logOut_OutputPort(0)) {
5014  Fw::LogBuffer _logBuff;
5016 
5017 #if FW_AMPCS_COMPATIBLE
5018  // Serialize the number of arguments
5019  _status = _logBuff.serializeFrom(static_cast<U8>(2));
5020  FW_ASSERT(
5021  _status == Fw::FW_SERIALIZE_OK,
5022  static_cast<FwAssertArgType>(_status)
5023  );
5024 #endif
5025 
5026  _status = baseDir.serializeTo(
5027  _logBuff,
5028  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
5029  );
5030  FW_ASSERT(
5031  _status == Fw::FW_SERIALIZE_OK,
5032  static_cast<FwAssertArgType>(_status)
5033  );
5034 
5035  _status = fileName.serializeTo(
5036  _logBuff,
5037  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
5038  );
5039  FW_ASSERT(
5040  _status == Fw::FW_SERIALIZE_OK,
5041  static_cast<FwAssertArgType>(_status)
5042  );
5043 
5044  this->logOut_out(
5045  0,
5046  _id,
5047  _logTime,
5049  _logBuff
5050  );
5051  }
5052 
5053  // Emit the event on the text log port
5054 #if FW_ENABLE_TEXT_LOGGING
5055  if (this->isConnected_logTextOut_OutputPort(0)) {
5056 #if FW_OBJECT_NAMES == 1
5057  const char* _formatString =
5058  "(%s) %s: Sequence file path too long: base dir %s + file %s";
5059 #else
5060  const char* _formatString =
5061  "%s: Sequence file path too long: base dir %s + file %s";
5062 #endif
5063 
5064  Fw::TextLogString _logString;
5065  (void) _logString.format(
5066  _formatString,
5067 #if FW_OBJECT_NAMES == 1
5068  this->m_objName.toChar(),
5069 #endif
5070  "SequenceFilePathTooLong ",
5071  baseDir.toChar(),
5072  fileName.toChar()
5073  );
5074 
5075  this->logTextOut_out(
5076  0,
5077  _id,
5078  _logTime,
5080  _logString
5081  );
5082  }
5083 #endif
5084  }
5085 
5088  const Fw::StringBase& baseDir,
5089  const Fw::StringBase& fileName
5090  ) const
5091  {
5092  // Get the time
5093  Fw::Time _logTime;
5094  if (this->isConnected_timeCaller_OutputPort(0)) {
5095  this->timeCaller_out(0, _logTime);
5096  }
5097 
5099 
5100  // Emit the event on the log port
5101  if (this->isConnected_logOut_OutputPort(0)) {
5102  Fw::LogBuffer _logBuff;
5104 
5105 #if FW_AMPCS_COMPATIBLE
5106  // Serialize the number of arguments
5107  _status = _logBuff.serializeFrom(static_cast<U8>(2));
5108  FW_ASSERT(
5109  _status == Fw::FW_SERIALIZE_OK,
5110  static_cast<FwAssertArgType>(_status)
5111  );
5112 #endif
5113 
5114  _status = baseDir.serializeTo(
5115  _logBuff,
5116  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
5117  );
5118  FW_ASSERT(
5119  _status == Fw::FW_SERIALIZE_OK,
5120  static_cast<FwAssertArgType>(_status)
5121  );
5122 
5123  _status = fileName.serializeTo(
5124  _logBuff,
5125  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
5126  );
5127  FW_ASSERT(
5128  _status == Fw::FW_SERIALIZE_OK,
5129  static_cast<FwAssertArgType>(_status)
5130  );
5131 
5132  this->logOut_out(
5133  0,
5134  _id,
5135  _logTime,
5137  _logBuff
5138  );
5139  }
5140 
5141  // Emit the event on the text log port
5142 #if FW_ENABLE_TEXT_LOGGING
5143  if (this->isConnected_logTextOut_OutputPort(0)) {
5144 #if FW_OBJECT_NAMES == 1
5145  const char* _formatString =
5146  "(%s) %s: Sequence file %s is not contained within base dir %s (path traversal rejected)";
5147 #else
5148  const char* _formatString =
5149  "%s: Sequence file %s is not contained within base dir %s (path traversal rejected)";
5150 #endif
5151 
5152  Fw::TextLogString _logString;
5153  (void) _logString.format(
5154  _formatString,
5155 #if FW_OBJECT_NAMES == 1
5156  this->m_objName.toChar(),
5157 #endif
5158  "SequenceFilePathNotContained ",
5159  baseDir.toChar(),
5160  fileName.toChar()
5161  );
5162 
5163  this->logTextOut_out(
5164  0,
5165  _id,
5166  _logTime,
5168  _logString
5169  );
5170  }
5171 #endif
5172  }
5173 
5176  {
5177  // Get the time
5178  Fw::Time _logTime;
5179  if (this->isConnected_timeCaller_OutputPort(0)) {
5180  this->timeCaller_out(0, _logTime);
5181  }
5182 
5183  const FwEventIdType _id = this->getIdBase() + EVENTID_MODULELOADFAILED;
5184 
5185  // Emit the event on the log port
5186  if (this->isConnected_logOut_OutputPort(0)) {
5187  Fw::LogBuffer _logBuff;
5189 
5190 #if FW_AMPCS_COMPATIBLE
5191  // Serialize the number of arguments
5192  _status = _logBuff.serializeFrom(static_cast<U8>(1));
5193  FW_ASSERT(
5194  _status == Fw::FW_SERIALIZE_OK,
5195  static_cast<FwAssertArgType>(_status)
5196  );
5197 #endif
5198 
5199 #if FW_AMPCS_COMPATIBLE
5200  // Serialize the argument size
5201  _status = _logBuff.serializeFrom(
5203  );
5204  FW_ASSERT(
5205  _status == Fw::FW_SERIALIZE_OK,
5206  static_cast<FwAssertArgType>(_status)
5207  );
5208 #endif
5209  _status = _logBuff.serializeFrom(status);
5210  FW_ASSERT(
5211  _status == Fw::FW_SERIALIZE_OK,
5212  static_cast<FwAssertArgType>(_status)
5213  );
5214 
5215  this->logOut_out(
5216  0,
5217  _id,
5218  _logTime,
5220  _logBuff
5221  );
5222  }
5223 
5224  // Emit the event on the text log port
5225 #if FW_ENABLE_TEXT_LOGGING
5226  if (this->isConnected_logTextOut_OutputPort(0)) {
5227 #if FW_OBJECT_NAMES == 1
5228  const char* _formatString =
5229  "(%s) %s: Module load failed: %s";
5230 #else
5231  const char* _formatString =
5232  "%s: Module load failed: %s";
5233 #endif
5234 
5235  Fw::String statusStr;
5236  status.toString(statusStr);
5237 
5238  Fw::TextLogString _logString;
5239  (void) _logString.format(
5240  _formatString,
5241 #if FW_OBJECT_NAMES == 1
5242  this->m_objName.toChar(),
5243 #endif
5244  "ModuleLoadFailed ",
5245  statusStr.toChar()
5246  );
5247 
5248  this->logTextOut_out(
5249  0,
5250  _id,
5251  _logTime,
5253  _logString
5254  );
5255  }
5256 #endif
5257  }
5258 
5261  {
5262  // Get the time
5263  Fw::Time _logTime;
5264  if (this->isConnected_timeCaller_OutputPort(0)) {
5265  this->timeCaller_out(0, _logTime);
5266  }
5267 
5269 
5270  // Emit the event on the log port
5271  if (this->isConnected_logOut_OutputPort(0)) {
5272  Fw::LogBuffer _logBuff;
5274 
5275 #if FW_AMPCS_COMPATIBLE
5276  // Serialize the number of arguments
5277  _status = _logBuff.serializeFrom(static_cast<U8>(1));
5278  FW_ASSERT(
5279  _status == Fw::FW_SERIALIZE_OK,
5280  static_cast<FwAssertArgType>(_status)
5281  );
5282 #endif
5283 
5284 #if FW_AMPCS_COMPATIBLE
5285  // Serialize the argument size
5286  _status = _logBuff.serializeFrom(
5288  );
5289  FW_ASSERT(
5290  _status == Fw::FW_SERIALIZE_OK,
5291  static_cast<FwAssertArgType>(_status)
5292  );
5293 #endif
5294  _status = _logBuff.serializeFrom(status);
5295  FW_ASSERT(
5296  _status == Fw::FW_SERIALIZE_OK,
5297  static_cast<FwAssertArgType>(_status)
5298  );
5299 
5300  this->logOut_out(
5301  0,
5302  _id,
5303  _logTime,
5305  _logBuff
5306  );
5307  }
5308 
5309  // Emit the event on the text log port
5310 #if FW_ENABLE_TEXT_LOGGING
5311  if (this->isConnected_logTextOut_OutputPort(0)) {
5312 #if FW_OBJECT_NAMES == 1
5313  const char* _formatString =
5314  "(%s) %s: Module main invoke failed: %s";
5315 #else
5316  const char* _formatString =
5317  "%s: Module main invoke failed: %s";
5318 #endif
5319 
5320  Fw::String statusStr;
5321  status.toString(statusStr);
5322 
5323  Fw::TextLogString _logString;
5324  (void) _logString.format(
5325  _formatString,
5326 #if FW_OBJECT_NAMES == 1
5327  this->m_objName.toChar(),
5328 #endif
5329  "ModuleMainInvokeFailed ",
5330  statusStr.toChar()
5331  );
5332 
5333  this->logTextOut_out(
5334  0,
5335  _id,
5336  _logTime,
5338  _logString
5339  );
5340  }
5341 #endif
5342  }
5343 
5346  {
5347  // Get the time
5348  Fw::Time _logTime;
5349  if (this->isConnected_timeCaller_OutputPort(0)) {
5350  this->timeCaller_out(0, _logTime);
5351  }
5352 
5354 
5355  // Emit the event on the log port
5356  if (this->isConnected_logOut_OutputPort(0)) {
5357  Fw::LogBuffer _logBuff;
5359 
5360 #if FW_AMPCS_COMPATIBLE
5361  // Serialize the number of arguments
5362  _status = _logBuff.serializeFrom(static_cast<U8>(1));
5363  FW_ASSERT(
5364  _status == Fw::FW_SERIALIZE_OK,
5365  static_cast<FwAssertArgType>(_status)
5366  );
5367 #endif
5368 
5369 #if FW_AMPCS_COMPATIBLE
5370  // Serialize the argument size
5371  _status = _logBuff.serializeFrom(
5373  );
5374  FW_ASSERT(
5375  _status == Fw::FW_SERIALIZE_OK,
5376  static_cast<FwAssertArgType>(_status)
5377  );
5378 #endif
5379  _status = _logBuff.serializeFrom(status);
5380  FW_ASSERT(
5381  _status == Fw::FW_SERIALIZE_OK,
5382  static_cast<FwAssertArgType>(_status)
5383  );
5384 
5385  this->logOut_out(
5386  0,
5387  _id,
5388  _logTime,
5390  _logBuff
5391  );
5392  }
5393 
5394  // Emit the event on the text log port
5395 #if FW_ENABLE_TEXT_LOGGING
5396  if (this->isConnected_logTextOut_OutputPort(0)) {
5397 #if FW_OBJECT_NAMES == 1
5398  const char* _formatString =
5399  "(%s) %s: Module start invoke failed: %s";
5400 #else
5401  const char* _formatString =
5402  "%s: Module start invoke failed: %s";
5403 #endif
5404 
5405  Fw::String statusStr;
5406  status.toString(statusStr);
5407 
5408  Fw::TextLogString _logString;
5409  (void) _logString.format(
5410  _formatString,
5411 #if FW_OBJECT_NAMES == 1
5412  this->m_objName.toChar(),
5413 #endif
5414  "ModuleStartInvokeFailed ",
5415  statusStr.toChar()
5416  );
5417 
5418  this->logTextOut_out(
5419  0,
5420  _id,
5421  _logTime,
5423  _logString
5424  );
5425  }
5426 #endif
5427  }
5428 
5431  {
5432  // Get the time
5433  Fw::Time _logTime;
5434  if (this->isConnected_timeCaller_OutputPort(0)) {
5435  this->timeCaller_out(0, _logTime);
5436  }
5437 
5439 
5440  // Emit the event on the log port
5441  if (this->isConnected_logOut_OutputPort(0)) {
5442  Fw::LogBuffer _logBuff;
5443 
5444 #if FW_AMPCS_COMPATIBLE
5446  // Serialize the number of arguments
5447  _status = _logBuff.serializeFrom(static_cast<U8>(0));
5448  FW_ASSERT(
5449  _status == Fw::FW_SERIALIZE_OK,
5450  static_cast<FwAssertArgType>(_status)
5451  );
5452 #endif
5453 
5454  this->logOut_out(
5455  0,
5456  _id,
5457  _logTime,
5459  _logBuff
5460  );
5461  }
5462 
5463  // Emit the event on the text log port
5464 #if FW_ENABLE_TEXT_LOGGING
5465  if (this->isConnected_logTextOut_OutputPort(0)) {
5466 #if FW_OBJECT_NAMES == 1
5467  const char* _formatString =
5468  "(%s) %s: Too many commands blocking on sequencer finish";
5469 #else
5470  const char* _formatString =
5471  "%s: Too many commands blocking on sequencer finish";
5472 #endif
5473 
5474  Fw::TextLogString _logString;
5475  (void) _logString.format(
5476  _formatString,
5477 #if FW_OBJECT_NAMES == 1
5478  this->m_objName.toChar(),
5479 #endif
5480  "TooManyBlockingCommands "
5481  );
5482 
5483  this->logTextOut_out(
5484  0,
5485  _id,
5486  _logTime,
5488  _logString
5489  );
5490  }
5491 #endif
5492  }
5493 
5496  const Svc::WasmSequencer_HostFunction& host_function,
5497  U32 size,
5498  U32 maxSize
5499  ) const
5500  {
5501  // Get the time
5502  Fw::Time _logTime;
5503  if (this->isConnected_timeCaller_OutputPort(0)) {
5504  this->timeCaller_out(0, _logTime);
5505  }
5506 
5507  const FwEventIdType _id = this->getIdBase() + EVENTID_BUFFERTOOLARGE;
5508 
5509  // Emit the event on the log port
5510  if (this->isConnected_logOut_OutputPort(0)) {
5511  Fw::LogBuffer _logBuff;
5513 
5514 #if FW_AMPCS_COMPATIBLE
5515  // Serialize the number of arguments
5516  _status = _logBuff.serializeFrom(static_cast<U8>(3));
5517  FW_ASSERT(
5518  _status == Fw::FW_SERIALIZE_OK,
5519  static_cast<FwAssertArgType>(_status)
5520  );
5521 #endif
5522 
5523 #if FW_AMPCS_COMPATIBLE
5524  // Serialize the argument size
5525  _status = _logBuff.serializeFrom(
5527  );
5528  FW_ASSERT(
5529  _status == Fw::FW_SERIALIZE_OK,
5530  static_cast<FwAssertArgType>(_status)
5531  );
5532 #endif
5533  _status = _logBuff.serializeFrom(host_function);
5534  FW_ASSERT(
5535  _status == Fw::FW_SERIALIZE_OK,
5536  static_cast<FwAssertArgType>(_status)
5537  );
5538 
5539 #if FW_AMPCS_COMPATIBLE
5540  // Serialize the argument size
5541  _status = _logBuff.serializeFrom(
5542  static_cast<U8>(sizeof(U32))
5543  );
5544  FW_ASSERT(
5545  _status == Fw::FW_SERIALIZE_OK,
5546  static_cast<FwAssertArgType>(_status)
5547  );
5548 #endif
5549  _status = _logBuff.serializeFrom(size);
5550  FW_ASSERT(
5551  _status == Fw::FW_SERIALIZE_OK,
5552  static_cast<FwAssertArgType>(_status)
5553  );
5554 
5555 #if FW_AMPCS_COMPATIBLE
5556  // Serialize the argument size
5557  _status = _logBuff.serializeFrom(
5558  static_cast<U8>(sizeof(U32))
5559  );
5560  FW_ASSERT(
5561  _status == Fw::FW_SERIALIZE_OK,
5562  static_cast<FwAssertArgType>(_status)
5563  );
5564 #endif
5565  _status = _logBuff.serializeFrom(maxSize);
5566  FW_ASSERT(
5567  _status == Fw::FW_SERIALIZE_OK,
5568  static_cast<FwAssertArgType>(_status)
5569  );
5570 
5571  this->logOut_out(
5572  0,
5573  _id,
5574  _logTime,
5576  _logBuff
5577  );
5578  }
5579 
5580  // Emit the event on the text log port
5581 #if FW_ENABLE_TEXT_LOGGING
5582  if (this->isConnected_logTextOut_OutputPort(0)) {
5583 #if FW_OBJECT_NAMES == 1
5584  const char* _formatString =
5585  "(%s) %s: Host function %s buffer payload size %" PRIu32 " larger than host maximum size %" PRIu32 "";
5586 #else
5587  const char* _formatString =
5588  "%s: Host function %s buffer payload size %" PRIu32 " larger than host maximum size %" PRIu32 "";
5589 #endif
5590 
5591  Fw::String host_functionStr;
5592  host_function.toString(host_functionStr);
5593 
5594  Fw::TextLogString _logString;
5595  (void) _logString.format(
5596  _formatString,
5597 #if FW_OBJECT_NAMES == 1
5598  this->m_objName.toChar(),
5599 #endif
5600  "BufferTooLarge ",
5601  host_functionStr.toChar(),
5602  size,
5603  maxSize
5604  );
5605 
5606  this->logTextOut_out(
5607  0,
5608  _id,
5609  _logTime,
5611  _logString
5612  );
5613  }
5614 #endif
5615  }
5616 
5619  const Svc::WasmSequencer_HostFunction& host_function,
5620  U32 size,
5621  U32 valueSize
5622  ) const
5623  {
5624  // Get the time
5625  Fw::Time _logTime;
5626  if (this->isConnected_timeCaller_OutputPort(0)) {
5627  this->timeCaller_out(0, _logTime);
5628  }
5629 
5630  const FwEventIdType _id = this->getIdBase() + EVENTID_BUFFERTOOSMALL;
5631 
5632  // Emit the event on the log port
5633  if (this->isConnected_logOut_OutputPort(0)) {
5634  Fw::LogBuffer _logBuff;
5636 
5637 #if FW_AMPCS_COMPATIBLE
5638  // Serialize the number of arguments
5639  _status = _logBuff.serializeFrom(static_cast<U8>(3));
5640  FW_ASSERT(
5641  _status == Fw::FW_SERIALIZE_OK,
5642  static_cast<FwAssertArgType>(_status)
5643  );
5644 #endif
5645 
5646 #if FW_AMPCS_COMPATIBLE
5647  // Serialize the argument size
5648  _status = _logBuff.serializeFrom(
5650  );
5651  FW_ASSERT(
5652  _status == Fw::FW_SERIALIZE_OK,
5653  static_cast<FwAssertArgType>(_status)
5654  );
5655 #endif
5656  _status = _logBuff.serializeFrom(host_function);
5657  FW_ASSERT(
5658  _status == Fw::FW_SERIALIZE_OK,
5659  static_cast<FwAssertArgType>(_status)
5660  );
5661 
5662 #if FW_AMPCS_COMPATIBLE
5663  // Serialize the argument size
5664  _status = _logBuff.serializeFrom(
5665  static_cast<U8>(sizeof(U32))
5666  );
5667  FW_ASSERT(
5668  _status == Fw::FW_SERIALIZE_OK,
5669  static_cast<FwAssertArgType>(_status)
5670  );
5671 #endif
5672  _status = _logBuff.serializeFrom(size);
5673  FW_ASSERT(
5674  _status == Fw::FW_SERIALIZE_OK,
5675  static_cast<FwAssertArgType>(_status)
5676  );
5677 
5678 #if FW_AMPCS_COMPATIBLE
5679  // Serialize the argument size
5680  _status = _logBuff.serializeFrom(
5681  static_cast<U8>(sizeof(U32))
5682  );
5683  FW_ASSERT(
5684  _status == Fw::FW_SERIALIZE_OK,
5685  static_cast<FwAssertArgType>(_status)
5686  );
5687 #endif
5688  _status = _logBuff.serializeFrom(valueSize);
5689  FW_ASSERT(
5690  _status == Fw::FW_SERIALIZE_OK,
5691  static_cast<FwAssertArgType>(_status)
5692  );
5693 
5694  this->logOut_out(
5695  0,
5696  _id,
5697  _logTime,
5699  _logBuff
5700  );
5701  }
5702 
5703  // Emit the event on the text log port
5704 #if FW_ENABLE_TEXT_LOGGING
5705  if (this->isConnected_logTextOut_OutputPort(0)) {
5706 #if FW_OBJECT_NAMES == 1
5707  const char* _formatString =
5708  "(%s) %s: Host function %s buffer payload size %" PRIu32 " smaller than host value size %" PRIu32 "";
5709 #else
5710  const char* _formatString =
5711  "%s: Host function %s buffer payload size %" PRIu32 " smaller than host value size %" PRIu32 "";
5712 #endif
5713 
5714  Fw::String host_functionStr;
5715  host_function.toString(host_functionStr);
5716 
5717  Fw::TextLogString _logString;
5718  (void) _logString.format(
5719  _formatString,
5720 #if FW_OBJECT_NAMES == 1
5721  this->m_objName.toChar(),
5722 #endif
5723  "BufferTooSmall ",
5724  host_functionStr.toChar(),
5725  size,
5726  valueSize
5727  );
5728 
5729  this->logTextOut_out(
5730  0,
5731  _id,
5732  _logTime,
5734  _logString
5735  );
5736  }
5737 #endif
5738  }
5739 
5742  const Svc::WasmSequencer_HostFunction& host_function,
5743  const Svc::WasmSequencer_Status& code
5744  ) const
5745  {
5746  // Get the time
5747  Fw::Time _logTime;
5748  if (this->isConnected_timeCaller_OutputPort(0)) {
5749  this->timeCaller_out(0, _logTime);
5750  }
5751 
5753 
5754  // Emit the event on the log port
5755  if (this->isConnected_logOut_OutputPort(0)) {
5756  Fw::LogBuffer _logBuff;
5758 
5759 #if FW_AMPCS_COMPATIBLE
5760  // Serialize the number of arguments
5761  _status = _logBuff.serializeFrom(static_cast<U8>(2));
5762  FW_ASSERT(
5763  _status == Fw::FW_SERIALIZE_OK,
5764  static_cast<FwAssertArgType>(_status)
5765  );
5766 #endif
5767 
5768 #if FW_AMPCS_COMPATIBLE
5769  // Serialize the argument size
5770  _status = _logBuff.serializeFrom(
5772  );
5773  FW_ASSERT(
5774  _status == Fw::FW_SERIALIZE_OK,
5775  static_cast<FwAssertArgType>(_status)
5776  );
5777 #endif
5778  _status = _logBuff.serializeFrom(host_function);
5779  FW_ASSERT(
5780  _status == Fw::FW_SERIALIZE_OK,
5781  static_cast<FwAssertArgType>(_status)
5782  );
5783 
5784 #if FW_AMPCS_COMPATIBLE
5785  // Serialize the argument size
5786  _status = _logBuff.serializeFrom(
5788  );
5789  FW_ASSERT(
5790  _status == Fw::FW_SERIALIZE_OK,
5791  static_cast<FwAssertArgType>(_status)
5792  );
5793 #endif
5794  _status = _logBuff.serializeFrom(code);
5795  FW_ASSERT(
5796  _status == Fw::FW_SERIALIZE_OK,
5797  static_cast<FwAssertArgType>(_status)
5798  );
5799 
5800  this->logOut_out(
5801  0,
5802  _id,
5803  _logTime,
5805  _logBuff
5806  );
5807  }
5808 
5809  // Emit the event on the text log port
5810 #if FW_ENABLE_TEXT_LOGGING
5811  if (this->isConnected_logTextOut_OutputPort(0)) {
5812 #if FW_OBJECT_NAMES == 1
5813  const char* _formatString =
5814  "(%s) %s: Failed to read guest pointer in host function %s: %s";
5815 #else
5816  const char* _formatString =
5817  "%s: Failed to read guest pointer in host function %s: %s";
5818 #endif
5819 
5820  Fw::String host_functionStr;
5821  host_function.toString(host_functionStr);
5822  Fw::String codeStr;
5823  code.toString(codeStr);
5824 
5825  Fw::TextLogString _logString;
5826  (void) _logString.format(
5827  _formatString,
5828 #if FW_OBJECT_NAMES == 1
5829  this->m_objName.toChar(),
5830 #endif
5831  "HostFunctionInvalidPointer ",
5832  host_functionStr.toChar(),
5833  codeStr.toChar()
5834  );
5835 
5836  this->logTextOut_out(
5837  0,
5838  _id,
5839  _logTime,
5841  _logString
5842  );
5843  }
5844 #endif
5845  }
5846 
5849  {
5850  // Get the time
5851  Fw::Time _logTime;
5852  if (this->isConnected_timeCaller_OutputPort(0)) {
5853  this->timeCaller_out(0, _logTime);
5854  }
5855 
5857 
5858  // Emit the event on the log port
5859  if (this->isConnected_logOut_OutputPort(0)) {
5860  Fw::LogBuffer _logBuff;
5862 
5863 #if FW_AMPCS_COMPATIBLE
5864  // Serialize the number of arguments
5865  _status = _logBuff.serializeFrom(static_cast<U8>(1));
5866  FW_ASSERT(
5867  _status == Fw::FW_SERIALIZE_OK,
5868  static_cast<FwAssertArgType>(_status)
5869  );
5870 #endif
5871 
5872 #if FW_AMPCS_COMPATIBLE
5873  // Serialize the argument size
5874  _status = _logBuff.serializeFrom(
5875  static_cast<U8>(sizeof(I32))
5876  );
5877  FW_ASSERT(
5878  _status == Fw::FW_SERIALIZE_OK,
5879  static_cast<FwAssertArgType>(_status)
5880  );
5881 #endif
5882  _status = _logBuff.serializeFrom(invalidValue);
5883  FW_ASSERT(
5884  _status == Fw::FW_SERIALIZE_OK,
5885  static_cast<FwAssertArgType>(_status)
5886  );
5887 
5888  this->logOut_out(
5889  0,
5890  _id,
5891  _logTime,
5893  _logBuff
5894  );
5895  }
5896 
5897  // Emit the event on the text log port
5898 #if FW_ENABLE_TEXT_LOGGING
5899  if (this->isConnected_logTextOut_OutputPort(0)) {
5900 #if FW_OBJECT_NAMES == 1
5901  const char* _formatString =
5902  "(%s) %s: Invalid blocking type value passed to serial_recv: %" PRIi32 "";
5903 #else
5904  const char* _formatString =
5905  "%s: Invalid blocking type value passed to serial_recv: %" PRIi32 "";
5906 #endif
5907 
5908  Fw::TextLogString _logString;
5909  (void) _logString.format(
5910  _formatString,
5911 #if FW_OBJECT_NAMES == 1
5912  this->m_objName.toChar(),
5913 #endif
5914  "InvalidBlockingTypeValue ",
5915  invalidValue
5916  );
5917 
5918  this->logTextOut_out(
5919  0,
5920  _id,
5921  _logTime,
5923  _logString
5924  );
5925  }
5926 #endif
5927  }
5928 
5931  const Svc::WasmSequencer_HostFunction& host_function,
5932  I32 index,
5933  U32 numPorts
5934  ) const
5935  {
5936  // Get the time
5937  Fw::Time _logTime;
5938  if (this->isConnected_timeCaller_OutputPort(0)) {
5939  this->timeCaller_out(0, _logTime);
5940  }
5941 
5943 
5944  // Emit the event on the log port
5945  if (this->isConnected_logOut_OutputPort(0)) {
5946  Fw::LogBuffer _logBuff;
5948 
5949 #if FW_AMPCS_COMPATIBLE
5950  // Serialize the number of arguments
5951  _status = _logBuff.serializeFrom(static_cast<U8>(3));
5952  FW_ASSERT(
5953  _status == Fw::FW_SERIALIZE_OK,
5954  static_cast<FwAssertArgType>(_status)
5955  );
5956 #endif
5957 
5958 #if FW_AMPCS_COMPATIBLE
5959  // Serialize the argument size
5960  _status = _logBuff.serializeFrom(
5962  );
5963  FW_ASSERT(
5964  _status == Fw::FW_SERIALIZE_OK,
5965  static_cast<FwAssertArgType>(_status)
5966  );
5967 #endif
5968  _status = _logBuff.serializeFrom(host_function);
5969  FW_ASSERT(
5970  _status == Fw::FW_SERIALIZE_OK,
5971  static_cast<FwAssertArgType>(_status)
5972  );
5973 
5974 #if FW_AMPCS_COMPATIBLE
5975  // Serialize the argument size
5976  _status = _logBuff.serializeFrom(
5977  static_cast<U8>(sizeof(I32))
5978  );
5979  FW_ASSERT(
5980  _status == Fw::FW_SERIALIZE_OK,
5981  static_cast<FwAssertArgType>(_status)
5982  );
5983 #endif
5984  _status = _logBuff.serializeFrom(index);
5985  FW_ASSERT(
5986  _status == Fw::FW_SERIALIZE_OK,
5987  static_cast<FwAssertArgType>(_status)
5988  );
5989 
5990 #if FW_AMPCS_COMPATIBLE
5991  // Serialize the argument size
5992  _status = _logBuff.serializeFrom(
5993  static_cast<U8>(sizeof(U32))
5994  );
5995  FW_ASSERT(
5996  _status == Fw::FW_SERIALIZE_OK,
5997  static_cast<FwAssertArgType>(_status)
5998  );
5999 #endif
6000  _status = _logBuff.serializeFrom(numPorts);
6001  FW_ASSERT(
6002  _status == Fw::FW_SERIALIZE_OK,
6003  static_cast<FwAssertArgType>(_status)
6004  );
6005 
6006  this->logOut_out(
6007  0,
6008  _id,
6009  _logTime,
6011  _logBuff
6012  );
6013  }
6014 
6015  // Emit the event on the text log port
6016 #if FW_ENABLE_TEXT_LOGGING
6017  if (this->isConnected_logTextOut_OutputPort(0)) {
6018 #if FW_OBJECT_NAMES == 1
6019  const char* _formatString =
6020  "(%s) %s: Host function %s requested invalid serial port index %" PRIi32 " (have %" PRIu32 " ports)";
6021 #else
6022  const char* _formatString =
6023  "%s: Host function %s requested invalid serial port index %" PRIi32 " (have %" PRIu32 " ports)";
6024 #endif
6025 
6026  Fw::String host_functionStr;
6027  host_function.toString(host_functionStr);
6028 
6029  Fw::TextLogString _logString;
6030  (void) _logString.format(
6031  _formatString,
6032 #if FW_OBJECT_NAMES == 1
6033  this->m_objName.toChar(),
6034 #endif
6035  "HostFunctionInvalidPort ",
6036  host_functionStr.toChar(),
6037  index,
6038  numPorts
6039  );
6040 
6041  this->logTextOut_out(
6042  0,
6043  _id,
6044  _logTime,
6046  _logString
6047  );
6048  }
6049 #endif
6050  }
6051 
6054  const Svc::WasmSequencer_HostFunction& host_function,
6055  I32 status
6056  ) const
6057  {
6058  // Get the time
6059  Fw::Time _logTime;
6060  if (this->isConnected_timeCaller_OutputPort(0)) {
6061  this->timeCaller_out(0, _logTime);
6062  }
6063 
6065 
6066  // Emit the event on the log port
6067  if (this->isConnected_logOut_OutputPort(0)) {
6068  Fw::LogBuffer _logBuff;
6070 
6071 #if FW_AMPCS_COMPATIBLE
6072  // Serialize the number of arguments
6073  _status = _logBuff.serializeFrom(static_cast<U8>(2));
6074  FW_ASSERT(
6075  _status == Fw::FW_SERIALIZE_OK,
6076  static_cast<FwAssertArgType>(_status)
6077  );
6078 #endif
6079 
6080 #if FW_AMPCS_COMPATIBLE
6081  // Serialize the argument size
6082  _status = _logBuff.serializeFrom(
6084  );
6085  FW_ASSERT(
6086  _status == Fw::FW_SERIALIZE_OK,
6087  static_cast<FwAssertArgType>(_status)
6088  );
6089 #endif
6090  _status = _logBuff.serializeFrom(host_function);
6091  FW_ASSERT(
6092  _status == Fw::FW_SERIALIZE_OK,
6093  static_cast<FwAssertArgType>(_status)
6094  );
6095 
6096 #if FW_AMPCS_COMPATIBLE
6097  // Serialize the argument size
6098  _status = _logBuff.serializeFrom(
6099  static_cast<U8>(sizeof(I32))
6100  );
6101  FW_ASSERT(
6102  _status == Fw::FW_SERIALIZE_OK,
6103  static_cast<FwAssertArgType>(_status)
6104  );
6105 #endif
6106  _status = _logBuff.serializeFrom(status);
6107  FW_ASSERT(
6108  _status == Fw::FW_SERIALIZE_OK,
6109  static_cast<FwAssertArgType>(_status)
6110  );
6111 
6112  this->logOut_out(
6113  0,
6114  _id,
6115  _logTime,
6117  _logBuff
6118  );
6119  }
6120 
6121  // Emit the event on the text log port
6122 #if FW_ENABLE_TEXT_LOGGING
6123  if (this->isConnected_logTextOut_OutputPort(0)) {
6124 #if FW_OBJECT_NAMES == 1
6125  const char* _formatString =
6126  "(%s) %s: Host function %s failed to send on serial port: serialize status %" PRIi32 "";
6127 #else
6128  const char* _formatString =
6129  "%s: Host function %s failed to send on serial port: serialize status %" PRIi32 "";
6130 #endif
6131 
6132  Fw::String host_functionStr;
6133  host_function.toString(host_functionStr);
6134 
6135  Fw::TextLogString _logString;
6136  (void) _logString.format(
6137  _formatString,
6138 #if FW_OBJECT_NAMES == 1
6139  this->m_objName.toChar(),
6140 #endif
6141  "SerialPortSendFailed ",
6142  host_functionStr.toChar(),
6143  status
6144  );
6145 
6146  this->logTextOut_out(
6147  0,
6148  _id,
6149  _logTime,
6151  _logString
6152  );
6153  }
6154 #endif
6155  }
6156 
6159  U32 portIndex,
6160  U32 size,
6161  U32 maxSize
6162  ) const
6163  {
6164  // Get the time
6165  Fw::Time _logTime;
6166  if (this->isConnected_timeCaller_OutputPort(0)) {
6167  this->timeCaller_out(0, _logTime);
6168  }
6169 
6171 
6172  // Emit the event on the log port
6173  if (this->isConnected_logOut_OutputPort(0)) {
6174  Fw::LogBuffer _logBuff;
6176 
6177 #if FW_AMPCS_COMPATIBLE
6178  // Serialize the number of arguments
6179  _status = _logBuff.serializeFrom(static_cast<U8>(3));
6180  FW_ASSERT(
6181  _status == Fw::FW_SERIALIZE_OK,
6182  static_cast<FwAssertArgType>(_status)
6183  );
6184 #endif
6185 
6186 #if FW_AMPCS_COMPATIBLE
6187  // Serialize the argument size
6188  _status = _logBuff.serializeFrom(
6189  static_cast<U8>(sizeof(U32))
6190  );
6191  FW_ASSERT(
6192  _status == Fw::FW_SERIALIZE_OK,
6193  static_cast<FwAssertArgType>(_status)
6194  );
6195 #endif
6196  _status = _logBuff.serializeFrom(portIndex);
6197  FW_ASSERT(
6198  _status == Fw::FW_SERIALIZE_OK,
6199  static_cast<FwAssertArgType>(_status)
6200  );
6201 
6202 #if FW_AMPCS_COMPATIBLE
6203  // Serialize the argument size
6204  _status = _logBuff.serializeFrom(
6205  static_cast<U8>(sizeof(U32))
6206  );
6207  FW_ASSERT(
6208  _status == Fw::FW_SERIALIZE_OK,
6209  static_cast<FwAssertArgType>(_status)
6210  );
6211 #endif
6212  _status = _logBuff.serializeFrom(size);
6213  FW_ASSERT(
6214  _status == Fw::FW_SERIALIZE_OK,
6215  static_cast<FwAssertArgType>(_status)
6216  );
6217 
6218 #if FW_AMPCS_COMPATIBLE
6219  // Serialize the argument size
6220  _status = _logBuff.serializeFrom(
6221  static_cast<U8>(sizeof(U32))
6222  );
6223  FW_ASSERT(
6224  _status == Fw::FW_SERIALIZE_OK,
6225  static_cast<FwAssertArgType>(_status)
6226  );
6227 #endif
6228  _status = _logBuff.serializeFrom(maxSize);
6229  FW_ASSERT(
6230  _status == Fw::FW_SERIALIZE_OK,
6231  static_cast<FwAssertArgType>(_status)
6232  );
6233 
6234  this->logOut_out(
6235  0,
6236  _id,
6237  _logTime,
6239  _logBuff
6240  );
6241  }
6242 
6243  // Emit the event on the text log port
6244 #if FW_ENABLE_TEXT_LOGGING
6245  if (this->isConnected_logTextOut_OutputPort(0)) {
6246 #if FW_OBJECT_NAMES == 1
6247  const char* _formatString =
6248  "(%s) %s: Serial input port %" PRIu32 " dropped oversized frame of %" PRIu32 " bytes (queue max %" PRIu32 ")";
6249 #else
6250  const char* _formatString =
6251  "%s: Serial input port %" PRIu32 " dropped oversized frame of %" PRIu32 " bytes (queue max %" PRIu32 ")";
6252 #endif
6253 
6254  Fw::TextLogString _logString;
6255  (void) _logString.format(
6256  _formatString,
6257 #if FW_OBJECT_NAMES == 1
6258  this->m_objName.toChar(),
6259 #endif
6260  "SerialInFrameTooLarge ",
6261  portIndex,
6262  size,
6263  maxSize
6264  );
6265 
6266  this->logTextOut_out(
6267  0,
6268  _id,
6269  _logTime,
6271  _logString
6272  );
6273  }
6274 #endif
6275  }
6276 
6279  I32 raw,
6280  const Fw::StringBase& msg
6281  ) const
6282  {
6283  // Get the time
6284  Fw::Time _logTime;
6285  if (this->isConnected_timeCaller_OutputPort(0)) {
6286  this->timeCaller_out(0, _logTime);
6287  }
6288 
6290 
6291  // Emit the event on the log port
6292  if (this->isConnected_logOut_OutputPort(0)) {
6293  Fw::LogBuffer _logBuff;
6295 
6296 #if FW_AMPCS_COMPATIBLE
6297  // Serialize the number of arguments
6298  _status = _logBuff.serializeFrom(static_cast<U8>(2));
6299  FW_ASSERT(
6300  _status == Fw::FW_SERIALIZE_OK,
6301  static_cast<FwAssertArgType>(_status)
6302  );
6303 #endif
6304 
6305 #if FW_AMPCS_COMPATIBLE
6306  // Serialize the argument size
6307  _status = _logBuff.serializeFrom(
6308  static_cast<U8>(sizeof(I32))
6309  );
6310  FW_ASSERT(
6311  _status == Fw::FW_SERIALIZE_OK,
6312  static_cast<FwAssertArgType>(_status)
6313  );
6314 #endif
6315  _status = _logBuff.serializeFrom(raw);
6316  FW_ASSERT(
6317  _status == Fw::FW_SERIALIZE_OK,
6318  static_cast<FwAssertArgType>(_status)
6319  );
6320 
6321  _status = msg.serializeTo(
6322  _logBuff,
6323  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
6324  );
6325  FW_ASSERT(
6326  _status == Fw::FW_SERIALIZE_OK,
6327  static_cast<FwAssertArgType>(_status)
6328  );
6329 
6330  this->logOut_out(
6331  0,
6332  _id,
6333  _logTime,
6335  _logBuff
6336  );
6337  }
6338 
6339  // Emit the event on the text log port
6340 #if FW_ENABLE_TEXT_LOGGING
6341  if (this->isConnected_logTextOut_OutputPort(0)) {
6342 #if FW_OBJECT_NAMES == 1
6343  const char* _formatString =
6344  "(%s) %s: Guest event at invalid/forbidden severity '%" PRIi32 "': %s";
6345 #else
6346  const char* _formatString =
6347  "%s: Guest event at invalid/forbidden severity '%" PRIi32 "': %s";
6348 #endif
6349 
6350  Fw::TextLogString _logString;
6351  (void) _logString.format(
6352  _formatString,
6353 #if FW_OBJECT_NAMES == 1
6354  this->m_objName.toChar(),
6355 #endif
6356  "HostFunctionInvalidSeverity ",
6357  raw,
6358  msg.toChar()
6359  );
6360 
6361  this->logTextOut_out(
6362  0,
6363  _id,
6364  _logTime,
6366  _logString
6367  );
6368  }
6369 #endif
6370  }
6371 
6374  {
6375  // Get the time
6376  Fw::Time _logTime;
6377  if (this->isConnected_timeCaller_OutputPort(0)) {
6378  this->timeCaller_out(0, _logTime);
6379  }
6380 
6381  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCESTARTING;
6382 
6383  // Emit the event on the log port
6384  if (this->isConnected_logOut_OutputPort(0)) {
6385  Fw::LogBuffer _logBuff;
6387 
6388 #if FW_AMPCS_COMPATIBLE
6389  // Serialize the number of arguments
6390  _status = _logBuff.serializeFrom(static_cast<U8>(1));
6391  FW_ASSERT(
6392  _status == Fw::FW_SERIALIZE_OK,
6393  static_cast<FwAssertArgType>(_status)
6394  );
6395 #endif
6396 
6397 #if FW_AMPCS_COMPATIBLE
6398  // Serialize the argument size
6399  _status = _logBuff.serializeFrom(
6400  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6401  );
6402  FW_ASSERT(
6403  _status == Fw::FW_SERIALIZE_OK,
6404  static_cast<FwAssertArgType>(_status)
6405  );
6406 #endif
6407  _status = _logBuff.serializeFrom(index);
6408  FW_ASSERT(
6409  _status == Fw::FW_SERIALIZE_OK,
6410  static_cast<FwAssertArgType>(_status)
6411  );
6412 
6413  this->logOut_out(
6414  0,
6415  _id,
6416  _logTime,
6418  _logBuff
6419  );
6420  }
6421 
6422  // Emit the event on the text log port
6423 #if FW_ENABLE_TEXT_LOGGING
6424  if (this->isConnected_logTextOut_OutputPort(0)) {
6425 #if FW_OBJECT_NAMES == 1
6426  const char* _formatString =
6427  "(%s) %s: Sequence at index %" PRIu8 " finished starting";
6428 #else
6429  const char* _formatString =
6430  "%s: Sequence at index %" PRIu8 " finished starting";
6431 #endif
6432 
6433  Fw::TextLogString _logString;
6434  (void) _logString.format(
6435  _formatString,
6436 #if FW_OBJECT_NAMES == 1
6437  this->m_objName.toChar(),
6438 #endif
6439  "SequenceStarting ",
6440  index
6441  );
6442 
6443  this->logTextOut_out(
6444  0,
6445  _id,
6446  _logTime,
6448  _logString
6449  );
6450  }
6451 #endif
6452  }
6453 
6456  {
6457  // Get the time
6458  Fw::Time _logTime;
6459  if (this->isConnected_timeCaller_OutputPort(0)) {
6460  this->timeCaller_out(0, _logTime);
6461  }
6462 
6463  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCESUCCEEDED;
6464 
6465  // Emit the event on the log port
6466  if (this->isConnected_logOut_OutputPort(0)) {
6467  Fw::LogBuffer _logBuff;
6469 
6470 #if FW_AMPCS_COMPATIBLE
6471  // Serialize the number of arguments
6472  _status = _logBuff.serializeFrom(static_cast<U8>(1));
6473  FW_ASSERT(
6474  _status == Fw::FW_SERIALIZE_OK,
6475  static_cast<FwAssertArgType>(_status)
6476  );
6477 #endif
6478 
6479 #if FW_AMPCS_COMPATIBLE
6480  // Serialize the argument size
6481  _status = _logBuff.serializeFrom(
6482  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6483  );
6484  FW_ASSERT(
6485  _status == Fw::FW_SERIALIZE_OK,
6486  static_cast<FwAssertArgType>(_status)
6487  );
6488 #endif
6489  _status = _logBuff.serializeFrom(index);
6490  FW_ASSERT(
6491  _status == Fw::FW_SERIALIZE_OK,
6492  static_cast<FwAssertArgType>(_status)
6493  );
6494 
6495  this->logOut_out(
6496  0,
6497  _id,
6498  _logTime,
6500  _logBuff
6501  );
6502  }
6503 
6504  // Emit the event on the text log port
6505 #if FW_ENABLE_TEXT_LOGGING
6506  if (this->isConnected_logTextOut_OutputPort(0)) {
6507 #if FW_OBJECT_NAMES == 1
6508  const char* _formatString =
6509  "(%s) %s: Sequence at index %" PRIu8 " finished successfully";
6510 #else
6511  const char* _formatString =
6512  "%s: Sequence at index %" PRIu8 " finished successfully";
6513 #endif
6514 
6515  Fw::TextLogString _logString;
6516  (void) _logString.format(
6517  _formatString,
6518 #if FW_OBJECT_NAMES == 1
6519  this->m_objName.toChar(),
6520 #endif
6521  "SequenceSucceeded ",
6522  index
6523  );
6524 
6525  this->logTextOut_out(
6526  0,
6527  _id,
6528  _logTime,
6530  _logString
6531  );
6532  }
6533 #endif
6534  }
6535 
6540  ) const
6541  {
6542  // Get the time
6543  Fw::Time _logTime;
6544  if (this->isConnected_timeCaller_OutputPort(0)) {
6545  this->timeCaller_out(0, _logTime);
6546  }
6547 
6548  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCECANCELLED;
6549 
6550  // Emit the event on the log port
6551  if (this->isConnected_logOut_OutputPort(0)) {
6552  Fw::LogBuffer _logBuff;
6554 
6555 #if FW_AMPCS_COMPATIBLE
6556  // Serialize the number of arguments
6557  _status = _logBuff.serializeFrom(static_cast<U8>(2));
6558  FW_ASSERT(
6559  _status == Fw::FW_SERIALIZE_OK,
6560  static_cast<FwAssertArgType>(_status)
6561  );
6562 #endif
6563 
6564 #if FW_AMPCS_COMPATIBLE
6565  // Serialize the argument size
6566  _status = _logBuff.serializeFrom(
6567  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6568  );
6569  FW_ASSERT(
6570  _status == Fw::FW_SERIALIZE_OK,
6571  static_cast<FwAssertArgType>(_status)
6572  );
6573 #endif
6574  _status = _logBuff.serializeFrom(index);
6575  FW_ASSERT(
6576  _status == Fw::FW_SERIALIZE_OK,
6577  static_cast<FwAssertArgType>(_status)
6578  );
6579 
6580 #if FW_AMPCS_COMPATIBLE
6581  // Serialize the argument size
6582  _status = _logBuff.serializeFrom(
6584  );
6585  FW_ASSERT(
6586  _status == Fw::FW_SERIALIZE_OK,
6587  static_cast<FwAssertArgType>(_status)
6588  );
6589 #endif
6590  _status = _logBuff.serializeFrom(phase);
6591  FW_ASSERT(
6592  _status == Fw::FW_SERIALIZE_OK,
6593  static_cast<FwAssertArgType>(_status)
6594  );
6595 
6596  this->logOut_out(
6597  0,
6598  _id,
6599  _logTime,
6601  _logBuff
6602  );
6603  }
6604 
6605  // Emit the event on the text log port
6606 #if FW_ENABLE_TEXT_LOGGING
6607  if (this->isConnected_logTextOut_OutputPort(0)) {
6608 #if FW_OBJECT_NAMES == 1
6609  const char* _formatString =
6610  "(%s) %s: Sequence at index %" PRIu8 " was cancelled during %s";
6611 #else
6612  const char* _formatString =
6613  "%s: Sequence at index %" PRIu8 " was cancelled during %s";
6614 #endif
6615 
6616  Fw::String phaseStr;
6617  phase.toString(phaseStr);
6618 
6619  Fw::TextLogString _logString;
6620  (void) _logString.format(
6621  _formatString,
6622 #if FW_OBJECT_NAMES == 1
6623  this->m_objName.toChar(),
6624 #endif
6625  "SequenceCancelled ",
6626  index,
6627  phaseStr.toChar()
6628  );
6629 
6630  this->logTextOut_out(
6631  0,
6632  _id,
6633  _logTime,
6635  _logString
6636  );
6637  }
6638 #endif
6639  }
6640 
6644  const Svc::WasmSequencer_SequencePhase& phase,
6645  I32 code
6646  ) const
6647  {
6648  // Get the time
6649  Fw::Time _logTime;
6650  if (this->isConnected_timeCaller_OutputPort(0)) {
6651  this->timeCaller_out(0, _logTime);
6652  }
6653 
6654  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCEEXITED;
6655 
6656  // Emit the event on the log port
6657  if (this->isConnected_logOut_OutputPort(0)) {
6658  Fw::LogBuffer _logBuff;
6660 
6661 #if FW_AMPCS_COMPATIBLE
6662  // Serialize the number of arguments
6663  _status = _logBuff.serializeFrom(static_cast<U8>(3));
6664  FW_ASSERT(
6665  _status == Fw::FW_SERIALIZE_OK,
6666  static_cast<FwAssertArgType>(_status)
6667  );
6668 #endif
6669 
6670 #if FW_AMPCS_COMPATIBLE
6671  // Serialize the argument size
6672  _status = _logBuff.serializeFrom(
6673  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6674  );
6675  FW_ASSERT(
6676  _status == Fw::FW_SERIALIZE_OK,
6677  static_cast<FwAssertArgType>(_status)
6678  );
6679 #endif
6680  _status = _logBuff.serializeFrom(index);
6681  FW_ASSERT(
6682  _status == Fw::FW_SERIALIZE_OK,
6683  static_cast<FwAssertArgType>(_status)
6684  );
6685 
6686 #if FW_AMPCS_COMPATIBLE
6687  // Serialize the argument size
6688  _status = _logBuff.serializeFrom(
6690  );
6691  FW_ASSERT(
6692  _status == Fw::FW_SERIALIZE_OK,
6693  static_cast<FwAssertArgType>(_status)
6694  );
6695 #endif
6696  _status = _logBuff.serializeFrom(phase);
6697  FW_ASSERT(
6698  _status == Fw::FW_SERIALIZE_OK,
6699  static_cast<FwAssertArgType>(_status)
6700  );
6701 
6702 #if FW_AMPCS_COMPATIBLE
6703  // Serialize the argument size
6704  _status = _logBuff.serializeFrom(
6705  static_cast<U8>(sizeof(I32))
6706  );
6707  FW_ASSERT(
6708  _status == Fw::FW_SERIALIZE_OK,
6709  static_cast<FwAssertArgType>(_status)
6710  );
6711 #endif
6712  _status = _logBuff.serializeFrom(code);
6713  FW_ASSERT(
6714  _status == Fw::FW_SERIALIZE_OK,
6715  static_cast<FwAssertArgType>(_status)
6716  );
6717 
6718  this->logOut_out(
6719  0,
6720  _id,
6721  _logTime,
6723  _logBuff
6724  );
6725  }
6726 
6727  // Emit the event on the text log port
6728 #if FW_ENABLE_TEXT_LOGGING
6729  if (this->isConnected_logTextOut_OutputPort(0)) {
6730 #if FW_OBJECT_NAMES == 1
6731  const char* _formatString =
6732  "(%s) %s: Sequence at index %" PRIu8 " exited during %s with non-zero code %" PRIi32 "";
6733 #else
6734  const char* _formatString =
6735  "%s: Sequence at index %" PRIu8 " exited during %s with non-zero code %" PRIi32 "";
6736 #endif
6737 
6738  Fw::String phaseStr;
6739  phase.toString(phaseStr);
6740 
6741  Fw::TextLogString _logString;
6742  (void) _logString.format(
6743  _formatString,
6744 #if FW_OBJECT_NAMES == 1
6745  this->m_objName.toChar(),
6746 #endif
6747  "SequenceExited ",
6748  index,
6749  phaseStr.toChar(),
6750  code
6751  );
6752 
6753  this->logTextOut_out(
6754  0,
6755  _id,
6756  _logTime,
6758  _logString
6759  );
6760  }
6761 #endif
6762  }
6763 
6767  const Svc::WasmSequencer_SequencePhase& phase,
6768  I32 code
6769  ) const
6770  {
6771  // Get the time
6772  Fw::Time _logTime;
6773  if (this->isConnected_timeCaller_OutputPort(0)) {
6774  this->timeCaller_out(0, _logTime);
6775  }
6776 
6777  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCEPANIC;
6778 
6779  // Emit the event on the log port
6780  if (this->isConnected_logOut_OutputPort(0)) {
6781  Fw::LogBuffer _logBuff;
6783 
6784 #if FW_AMPCS_COMPATIBLE
6785  // Serialize the number of arguments
6786  _status = _logBuff.serializeFrom(static_cast<U8>(3));
6787  FW_ASSERT(
6788  _status == Fw::FW_SERIALIZE_OK,
6789  static_cast<FwAssertArgType>(_status)
6790  );
6791 #endif
6792 
6793 #if FW_AMPCS_COMPATIBLE
6794  // Serialize the argument size
6795  _status = _logBuff.serializeFrom(
6796  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6797  );
6798  FW_ASSERT(
6799  _status == Fw::FW_SERIALIZE_OK,
6800  static_cast<FwAssertArgType>(_status)
6801  );
6802 #endif
6803  _status = _logBuff.serializeFrom(index);
6804  FW_ASSERT(
6805  _status == Fw::FW_SERIALIZE_OK,
6806  static_cast<FwAssertArgType>(_status)
6807  );
6808 
6809 #if FW_AMPCS_COMPATIBLE
6810  // Serialize the argument size
6811  _status = _logBuff.serializeFrom(
6813  );
6814  FW_ASSERT(
6815  _status == Fw::FW_SERIALIZE_OK,
6816  static_cast<FwAssertArgType>(_status)
6817  );
6818 #endif
6819  _status = _logBuff.serializeFrom(phase);
6820  FW_ASSERT(
6821  _status == Fw::FW_SERIALIZE_OK,
6822  static_cast<FwAssertArgType>(_status)
6823  );
6824 
6825 #if FW_AMPCS_COMPATIBLE
6826  // Serialize the argument size
6827  _status = _logBuff.serializeFrom(
6828  static_cast<U8>(sizeof(I32))
6829  );
6830  FW_ASSERT(
6831  _status == Fw::FW_SERIALIZE_OK,
6832  static_cast<FwAssertArgType>(_status)
6833  );
6834 #endif
6835  _status = _logBuff.serializeFrom(code);
6836  FW_ASSERT(
6837  _status == Fw::FW_SERIALIZE_OK,
6838  static_cast<FwAssertArgType>(_status)
6839  );
6840 
6841  this->logOut_out(
6842  0,
6843  _id,
6844  _logTime,
6846  _logBuff
6847  );
6848  }
6849 
6850  // Emit the event on the text log port
6851 #if FW_ENABLE_TEXT_LOGGING
6852  if (this->isConnected_logTextOut_OutputPort(0)) {
6853 #if FW_OBJECT_NAMES == 1
6854  const char* _formatString =
6855  "(%s) %s: Sequence at index %" PRIu8 " panicked during %s with code %" PRIi32 "";
6856 #else
6857  const char* _formatString =
6858  "%s: Sequence at index %" PRIu8 " panicked during %s with code %" PRIi32 "";
6859 #endif
6860 
6861  Fw::String phaseStr;
6862  phase.toString(phaseStr);
6863 
6864  Fw::TextLogString _logString;
6865  (void) _logString.format(
6866  _formatString,
6867 #if FW_OBJECT_NAMES == 1
6868  this->m_objName.toChar(),
6869 #endif
6870  "SequencePanic ",
6871  index,
6872  phaseStr.toChar(),
6873  code
6874  );
6875 
6876  this->logTextOut_out(
6877  0,
6878  _id,
6879  _logTime,
6881  _logString
6882  );
6883  }
6884 #endif
6885  }
6886 
6890  const Svc::WasmSequencer_SequencePhase& phase,
6891  const Svc::WasmSequencer_TrapReason& reason
6892  ) const
6893  {
6894  // Get the time
6895  Fw::Time _logTime;
6896  if (this->isConnected_timeCaller_OutputPort(0)) {
6897  this->timeCaller_out(0, _logTime);
6898  }
6899 
6900  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCETRAPPED;
6901 
6902  // Emit the event on the log port
6903  if (this->isConnected_logOut_OutputPort(0)) {
6904  Fw::LogBuffer _logBuff;
6906 
6907 #if FW_AMPCS_COMPATIBLE
6908  // Serialize the number of arguments
6909  _status = _logBuff.serializeFrom(static_cast<U8>(3));
6910  FW_ASSERT(
6911  _status == Fw::FW_SERIALIZE_OK,
6912  static_cast<FwAssertArgType>(_status)
6913  );
6914 #endif
6915 
6916 #if FW_AMPCS_COMPATIBLE
6917  // Serialize the argument size
6918  _status = _logBuff.serializeFrom(
6919  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6920  );
6921  FW_ASSERT(
6922  _status == Fw::FW_SERIALIZE_OK,
6923  static_cast<FwAssertArgType>(_status)
6924  );
6925 #endif
6926  _status = _logBuff.serializeFrom(index);
6927  FW_ASSERT(
6928  _status == Fw::FW_SERIALIZE_OK,
6929  static_cast<FwAssertArgType>(_status)
6930  );
6931 
6932 #if FW_AMPCS_COMPATIBLE
6933  // Serialize the argument size
6934  _status = _logBuff.serializeFrom(
6936  );
6937  FW_ASSERT(
6938  _status == Fw::FW_SERIALIZE_OK,
6939  static_cast<FwAssertArgType>(_status)
6940  );
6941 #endif
6942  _status = _logBuff.serializeFrom(phase);
6943  FW_ASSERT(
6944  _status == Fw::FW_SERIALIZE_OK,
6945  static_cast<FwAssertArgType>(_status)
6946  );
6947 
6948 #if FW_AMPCS_COMPATIBLE
6949  // Serialize the argument size
6950  _status = _logBuff.serializeFrom(
6952  );
6953  FW_ASSERT(
6954  _status == Fw::FW_SERIALIZE_OK,
6955  static_cast<FwAssertArgType>(_status)
6956  );
6957 #endif
6958  _status = _logBuff.serializeFrom(reason);
6959  FW_ASSERT(
6960  _status == Fw::FW_SERIALIZE_OK,
6961  static_cast<FwAssertArgType>(_status)
6962  );
6963 
6964  this->logOut_out(
6965  0,
6966  _id,
6967  _logTime,
6969  _logBuff
6970  );
6971  }
6972 
6973  // Emit the event on the text log port
6974 #if FW_ENABLE_TEXT_LOGGING
6975  if (this->isConnected_logTextOut_OutputPort(0)) {
6976 #if FW_OBJECT_NAMES == 1
6977  const char* _formatString =
6978  "(%s) %s: Sequence at index %" PRIu8 " trapped during %s: %s";
6979 #else
6980  const char* _formatString =
6981  "%s: Sequence at index %" PRIu8 " trapped during %s: %s";
6982 #endif
6983 
6984  Fw::String phaseStr;
6985  phase.toString(phaseStr);
6986  Fw::String reasonStr;
6987  reason.toString(reasonStr);
6988 
6989  Fw::TextLogString _logString;
6990  (void) _logString.format(
6991  _formatString,
6992 #if FW_OBJECT_NAMES == 1
6993  this->m_objName.toChar(),
6994 #endif
6995  "SequenceTrapped ",
6996  index,
6997  phaseStr.toChar(),
6998  reasonStr.toChar()
6999  );
7000 
7001  this->logTextOut_out(
7002  0,
7003  _id,
7004  _logTime,
7006  _logString
7007  );
7008  }
7009 #endif
7010  }
7011 
7015  const Svc::WasmSequencer_SequencePhase& phase,
7016  const Svc::WasmSequencer_ExitReason& reason,
7017  const Svc::WasmSequencer_HostFunction& hostFunction
7018  ) const
7019  {
7020  // Get the time
7021  Fw::Time _logTime;
7022  if (this->isConnected_timeCaller_OutputPort(0)) {
7023  this->timeCaller_out(0, _logTime);
7024  }
7025 
7026  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCEHOSTFAILURE;
7027 
7028  // Emit the event on the log port
7029  if (this->isConnected_logOut_OutputPort(0)) {
7030  Fw::LogBuffer _logBuff;
7032 
7033 #if FW_AMPCS_COMPATIBLE
7034  // Serialize the number of arguments
7035  _status = _logBuff.serializeFrom(static_cast<U8>(4));
7036  FW_ASSERT(
7037  _status == Fw::FW_SERIALIZE_OK,
7038  static_cast<FwAssertArgType>(_status)
7039  );
7040 #endif
7041 
7042 #if FW_AMPCS_COMPATIBLE
7043  // Serialize the argument size
7044  _status = _logBuff.serializeFrom(
7045  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
7046  );
7047  FW_ASSERT(
7048  _status == Fw::FW_SERIALIZE_OK,
7049  static_cast<FwAssertArgType>(_status)
7050  );
7051 #endif
7052  _status = _logBuff.serializeFrom(index);
7053  FW_ASSERT(
7054  _status == Fw::FW_SERIALIZE_OK,
7055  static_cast<FwAssertArgType>(_status)
7056  );
7057 
7058 #if FW_AMPCS_COMPATIBLE
7059  // Serialize the argument size
7060  _status = _logBuff.serializeFrom(
7062  );
7063  FW_ASSERT(
7064  _status == Fw::FW_SERIALIZE_OK,
7065  static_cast<FwAssertArgType>(_status)
7066  );
7067 #endif
7068  _status = _logBuff.serializeFrom(phase);
7069  FW_ASSERT(
7070  _status == Fw::FW_SERIALIZE_OK,
7071  static_cast<FwAssertArgType>(_status)
7072  );
7073 
7074 #if FW_AMPCS_COMPATIBLE
7075  // Serialize the argument size
7076  _status = _logBuff.serializeFrom(
7078  );
7079  FW_ASSERT(
7080  _status == Fw::FW_SERIALIZE_OK,
7081  static_cast<FwAssertArgType>(_status)
7082  );
7083 #endif
7084  _status = _logBuff.serializeFrom(reason);
7085  FW_ASSERT(
7086  _status == Fw::FW_SERIALIZE_OK,
7087  static_cast<FwAssertArgType>(_status)
7088  );
7089 
7090 #if FW_AMPCS_COMPATIBLE
7091  // Serialize the argument size
7092  _status = _logBuff.serializeFrom(
7094  );
7095  FW_ASSERT(
7096  _status == Fw::FW_SERIALIZE_OK,
7097  static_cast<FwAssertArgType>(_status)
7098  );
7099 #endif
7100  _status = _logBuff.serializeFrom(hostFunction);
7101  FW_ASSERT(
7102  _status == Fw::FW_SERIALIZE_OK,
7103  static_cast<FwAssertArgType>(_status)
7104  );
7105 
7106  this->logOut_out(
7107  0,
7108  _id,
7109  _logTime,
7111  _logBuff
7112  );
7113  }
7114 
7115  // Emit the event on the text log port
7116 #if FW_ENABLE_TEXT_LOGGING
7117  if (this->isConnected_logTextOut_OutputPort(0)) {
7118 #if FW_OBJECT_NAMES == 1
7119  const char* _formatString =
7120  "(%s) %s: Sequence at index %" PRIu8 " failed during %s awaiting host function %s (reason %s)";
7121 #else
7122  const char* _formatString =
7123  "%s: Sequence at index %" PRIu8 " failed during %s awaiting host function %s (reason %s)";
7124 #endif
7125 
7126  Fw::String phaseStr;
7127  phase.toString(phaseStr);
7128  Fw::String reasonStr;
7129  reason.toString(reasonStr);
7130  Fw::String hostFunctionStr;
7131  hostFunction.toString(hostFunctionStr);
7132 
7133  Fw::TextLogString _logString;
7134  (void) _logString.format(
7135  _formatString,
7136 #if FW_OBJECT_NAMES == 1
7137  this->m_objName.toChar(),
7138 #endif
7139  "SequenceHostFailure ",
7140  index,
7141  phaseStr.toChar(),
7142  reasonStr.toChar(),
7143  hostFunctionStr.toChar()
7144  );
7145 
7146  this->logTextOut_out(
7147  0,
7148  _id,
7149  _logTime,
7151  _logString
7152  );
7153  }
7154 #endif
7155  }
7156 
7159  {
7160  // Get the time
7161  Fw::Time _logTime;
7162  if (this->isConnected_timeCaller_OutputPort(0)) {
7163  this->timeCaller_out(0, _logTime);
7164  }
7165 
7166  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCEPAUSED;
7167 
7168  // Emit the event on the log port
7169  if (this->isConnected_logOut_OutputPort(0)) {
7170  Fw::LogBuffer _logBuff;
7171 
7172 #if FW_AMPCS_COMPATIBLE
7174  // Serialize the number of arguments
7175  _status = _logBuff.serializeFrom(static_cast<U8>(0));
7176  FW_ASSERT(
7177  _status == Fw::FW_SERIALIZE_OK,
7178  static_cast<FwAssertArgType>(_status)
7179  );
7180 #endif
7181 
7182  this->logOut_out(
7183  0,
7184  _id,
7185  _logTime,
7187  _logBuff
7188  );
7189  }
7190 
7191  // Emit the event on the text log port
7192 #if FW_ENABLE_TEXT_LOGGING
7193  if (this->isConnected_logTextOut_OutputPort(0)) {
7194 #if FW_OBJECT_NAMES == 1
7195  const char* _formatString =
7196  "(%s) %s: Sequence execution paused";
7197 #else
7198  const char* _formatString =
7199  "%s: Sequence execution paused";
7200 #endif
7201 
7202  Fw::TextLogString _logString;
7203  (void) _logString.format(
7204  _formatString,
7205 #if FW_OBJECT_NAMES == 1
7206  this->m_objName.toChar(),
7207 #endif
7208  "SequencePaused "
7209  );
7210 
7211  this->logTextOut_out(
7212  0,
7213  _id,
7214  _logTime,
7216  _logString
7217  );
7218  }
7219 #endif
7220  }
7221 
7224  {
7225  // Get the time
7226  Fw::Time _logTime;
7227  if (this->isConnected_timeCaller_OutputPort(0)) {
7228  this->timeCaller_out(0, _logTime);
7229  }
7230 
7231  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCENOTRUNNING;
7232 
7233  // Emit the event on the log port
7234  if (this->isConnected_logOut_OutputPort(0)) {
7235  Fw::LogBuffer _logBuff;
7236 
7237 #if FW_AMPCS_COMPATIBLE
7239  // Serialize the number of arguments
7240  _status = _logBuff.serializeFrom(static_cast<U8>(0));
7241  FW_ASSERT(
7242  _status == Fw::FW_SERIALIZE_OK,
7243  static_cast<FwAssertArgType>(_status)
7244  );
7245 #endif
7246 
7247  this->logOut_out(
7248  0,
7249  _id,
7250  _logTime,
7252  _logBuff
7253  );
7254  }
7255 
7256  // Emit the event on the text log port
7257 #if FW_ENABLE_TEXT_LOGGING
7258  if (this->isConnected_logTextOut_OutputPort(0)) {
7259 #if FW_OBJECT_NAMES == 1
7260  const char* _formatString =
7261  "(%s) %s: Sequence cannot continue when interpreter is not running";
7262 #else
7263  const char* _formatString =
7264  "%s: Sequence cannot continue when interpreter is not running";
7265 #endif
7266 
7267  Fw::TextLogString _logString;
7268  (void) _logString.format(
7269  _formatString,
7270 #if FW_OBJECT_NAMES == 1
7271  this->m_objName.toChar(),
7272 #endif
7273  "SequenceNotRunning "
7274  );
7275 
7276  this->logTextOut_out(
7277  0,
7278  _id,
7279  _logTime,
7281  _logString
7282  );
7283  }
7284 #endif
7285  }
7286 
7289  const Svc::WasmSequencer_HostFunction& host_function,
7290  U64 micros
7291  ) const
7292  {
7293  // Get the time
7294  Fw::Time _logTime;
7295  if (this->isConnected_timeCaller_OutputPort(0)) {
7296  this->timeCaller_out(0, _logTime);
7297  }
7298 
7300 
7301  // Emit the event on the log port
7302  if (this->isConnected_logOut_OutputPort(0)) {
7303  Fw::LogBuffer _logBuff;
7305 
7306 #if FW_AMPCS_COMPATIBLE
7307  // Serialize the number of arguments
7308  _status = _logBuff.serializeFrom(static_cast<U8>(2));
7309  FW_ASSERT(
7310  _status == Fw::FW_SERIALIZE_OK,
7311  static_cast<FwAssertArgType>(_status)
7312  );
7313 #endif
7314 
7315 #if FW_AMPCS_COMPATIBLE
7316  // Serialize the argument size
7317  _status = _logBuff.serializeFrom(
7319  );
7320  FW_ASSERT(
7321  _status == Fw::FW_SERIALIZE_OK,
7322  static_cast<FwAssertArgType>(_status)
7323  );
7324 #endif
7325  _status = _logBuff.serializeFrom(host_function);
7326  FW_ASSERT(
7327  _status == Fw::FW_SERIALIZE_OK,
7328  static_cast<FwAssertArgType>(_status)
7329  );
7330 
7331 #if FW_AMPCS_COMPATIBLE
7332  // Serialize the argument size
7333  _status = _logBuff.serializeFrom(
7334  static_cast<U8>(sizeof(U64))
7335  );
7336  FW_ASSERT(
7337  _status == Fw::FW_SERIALIZE_OK,
7338  static_cast<FwAssertArgType>(_status)
7339  );
7340 #endif
7341  _status = _logBuff.serializeFrom(micros);
7342  FW_ASSERT(
7343  _status == Fw::FW_SERIALIZE_OK,
7344  static_cast<FwAssertArgType>(_status)
7345  );
7346 
7347  this->logOut_out(
7348  0,
7349  _id,
7350  _logTime,
7352  _logBuff
7353  );
7354  }
7355 
7356  // Emit the event on the text log port
7357 #if FW_ENABLE_TEXT_LOGGING
7358  if (this->isConnected_logTextOut_OutputPort(0)) {
7359 #if FW_OBJECT_NAMES == 1
7360  const char* _formatString =
7361  "(%s) %s: Host function %s requested a sleep of %" PRIu64 " us that overflows the host timer";
7362 #else
7363  const char* _formatString =
7364  "%s: Host function %s requested a sleep of %" PRIu64 " us that overflows the host timer";
7365 #endif
7366 
7367  Fw::String host_functionStr;
7368  host_function.toString(host_functionStr);
7369 
7370  Fw::TextLogString _logString;
7371  (void) _logString.format(
7372  _formatString,
7373 #if FW_OBJECT_NAMES == 1
7374  this->m_objName.toChar(),
7375 #endif
7376  "SleepDurationTooLarge ",
7377  host_functionStr.toChar(),
7378  micros
7379  );
7380 
7381  this->logTextOut_out(
7382  0,
7383  _id,
7384  _logTime,
7386  _logString
7387  );
7388  }
7389 #endif
7390  }
7391 
7394  const Svc::WasmSequencer_HostFunction& host_function,
7395  I64 id
7396  ) const
7397  {
7398  // Get the time
7399  Fw::Time _logTime;
7400  if (this->isConnected_timeCaller_OutputPort(0)) {
7401  this->timeCaller_out(0, _logTime);
7402  }
7403 
7405 
7406  // Emit the event on the log port
7407  if (this->isConnected_logOut_OutputPort(0)) {
7408  Fw::LogBuffer _logBuff;
7410 
7411 #if FW_AMPCS_COMPATIBLE
7412  // Serialize the number of arguments
7413  _status = _logBuff.serializeFrom(static_cast<U8>(2));
7414  FW_ASSERT(
7415  _status == Fw::FW_SERIALIZE_OK,
7416  static_cast<FwAssertArgType>(_status)
7417  );
7418 #endif
7419 
7420 #if FW_AMPCS_COMPATIBLE
7421  // Serialize the argument size
7422  _status = _logBuff.serializeFrom(
7424  );
7425  FW_ASSERT(
7426  _status == Fw::FW_SERIALIZE_OK,
7427  static_cast<FwAssertArgType>(_status)
7428  );
7429 #endif
7430  _status = _logBuff.serializeFrom(host_function);
7431  FW_ASSERT(
7432  _status == Fw::FW_SERIALIZE_OK,
7433  static_cast<FwAssertArgType>(_status)
7434  );
7435 
7436 #if FW_AMPCS_COMPATIBLE
7437  // Serialize the argument size
7438  _status = _logBuff.serializeFrom(
7439  static_cast<U8>(sizeof(I64))
7440  );
7441  FW_ASSERT(
7442  _status == Fw::FW_SERIALIZE_OK,
7443  static_cast<FwAssertArgType>(_status)
7444  );
7445 #endif
7446  _status = _logBuff.serializeFrom(id);
7447  FW_ASSERT(
7448  _status == Fw::FW_SERIALIZE_OK,
7449  static_cast<FwAssertArgType>(_status)
7450  );
7451 
7452  this->logOut_out(
7453  0,
7454  _id,
7455  _logTime,
7457  _logBuff
7458  );
7459  }
7460 
7461  // Emit the event on the text log port
7462 #if FW_ENABLE_TEXT_LOGGING
7463  if (this->isConnected_logTextOut_OutputPort(0)) {
7464 #if FW_OBJECT_NAMES == 1
7465  const char* _formatString =
7466  "(%s) %s: Host function %s requested id %" PRIi64 " outside representable id range";
7467 #else
7468  const char* _formatString =
7469  "%s: Host function %s requested id %" PRIi64 " outside representable id range";
7470 #endif
7471 
7472  Fw::String host_functionStr;
7473  host_function.toString(host_functionStr);
7474 
7475  Fw::TextLogString _logString;
7476  (void) _logString.format(
7477  _formatString,
7478 #if FW_OBJECT_NAMES == 1
7479  this->m_objName.toChar(),
7480 #endif
7481  "HostFunctionInvalidId ",
7482  host_functionStr.toChar(),
7483  id
7484  );
7485 
7486  this->logTextOut_out(
7487  0,
7488  _id,
7489  _logTime,
7491  _logString
7492  );
7493  }
7494 #endif
7495  }
7496 
7499  FwOpcodeType opcode,
7500  const Fw::CmdResponse& response,
7501  U16 oldSequenceIdx,
7502  U16 currentSequenceIdx
7503  ) const
7504  {
7505  // Get the time
7506  Fw::Time _logTime;
7507  if (this->isConnected_timeCaller_OutputPort(0)) {
7508  this->timeCaller_out(0, _logTime);
7509  }
7510 
7512 
7513  // Emit the event on the log port
7514  if (this->isConnected_logOut_OutputPort(0)) {
7515  Fw::LogBuffer _logBuff;
7517 
7518 #if FW_AMPCS_COMPATIBLE
7519  // Serialize the number of arguments
7520  _status = _logBuff.serializeFrom(static_cast<U8>(4));
7521  FW_ASSERT(
7522  _status == Fw::FW_SERIALIZE_OK,
7523  static_cast<FwAssertArgType>(_status)
7524  );
7525 #endif
7526 
7527 #if FW_AMPCS_COMPATIBLE
7528  // Serialize the argument size
7529  _status = _logBuff.serializeFrom(
7530  static_cast<U8>(sizeof(FwOpcodeType))
7531  );
7532  FW_ASSERT(
7533  _status == Fw::FW_SERIALIZE_OK,
7534  static_cast<FwAssertArgType>(_status)
7535  );
7536 #endif
7537  _status = _logBuff.serializeFrom(opcode);
7538  FW_ASSERT(
7539  _status == Fw::FW_SERIALIZE_OK,
7540  static_cast<FwAssertArgType>(_status)
7541  );
7542 
7543 #if FW_AMPCS_COMPATIBLE
7544  // Serialize the argument size
7545  _status = _logBuff.serializeFrom(
7546  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
7547  );
7548  FW_ASSERT(
7549  _status == Fw::FW_SERIALIZE_OK,
7550  static_cast<FwAssertArgType>(_status)
7551  );
7552 #endif
7553  _status = _logBuff.serializeFrom(response);
7554  FW_ASSERT(
7555  _status == Fw::FW_SERIALIZE_OK,
7556  static_cast<FwAssertArgType>(_status)
7557  );
7558 
7559 #if FW_AMPCS_COMPATIBLE
7560  // Serialize the argument size
7561  _status = _logBuff.serializeFrom(
7562  static_cast<U8>(sizeof(U16))
7563  );
7564  FW_ASSERT(
7565  _status == Fw::FW_SERIALIZE_OK,
7566  static_cast<FwAssertArgType>(_status)
7567  );
7568 #endif
7569  _status = _logBuff.serializeFrom(oldSequenceIdx);
7570  FW_ASSERT(
7571  _status == Fw::FW_SERIALIZE_OK,
7572  static_cast<FwAssertArgType>(_status)
7573  );
7574 
7575 #if FW_AMPCS_COMPATIBLE
7576  // Serialize the argument size
7577  _status = _logBuff.serializeFrom(
7578  static_cast<U8>(sizeof(U16))
7579  );
7580  FW_ASSERT(
7581  _status == Fw::FW_SERIALIZE_OK,
7582  static_cast<FwAssertArgType>(_status)
7583  );
7584 #endif
7585  _status = _logBuff.serializeFrom(currentSequenceIdx);
7586  FW_ASSERT(
7587  _status == Fw::FW_SERIALIZE_OK,
7588  static_cast<FwAssertArgType>(_status)
7589  );
7590 
7591  this->logOut_out(
7592  0,
7593  _id,
7594  _logTime,
7596  _logBuff
7597  );
7598  }
7599 
7600  // Emit the event on the text log port
7601 #if FW_ENABLE_TEXT_LOGGING
7602  if (this->isConnected_logTextOut_OutputPort(0)) {
7603 #if FW_OBJECT_NAMES == 1
7604  const char* _formatString =
7605  "(%s) %s: Command response (opcode %" PRIu32 ", response %s) was from a previous sequence (old idx %" PRIu16 ", current idx %" PRIu16 ")";
7606 #else
7607  const char* _formatString =
7608  "%s: Command response (opcode %" PRIu32 ", response %s) was from a previous sequence (old idx %" PRIu16 ", current idx %" PRIu16 ")";
7609 #endif
7610 
7611  Fw::String responseStr;
7612  response.toString(responseStr);
7613 
7614  Fw::TextLogString _logString;
7615  (void) _logString.format(
7616  _formatString,
7617 #if FW_OBJECT_NAMES == 1
7618  this->m_objName.toChar(),
7619 #endif
7620  "CmdResponseFromOldSequence ",
7621  opcode,
7622  responseStr.toChar(),
7623  oldSequenceIdx,
7624  currentSequenceIdx
7625  );
7626 
7627  this->logTextOut_out(
7628  0,
7629  _id,
7630  _logTime,
7632  _logString
7633  );
7634  }
7635 #endif
7636  }
7637 
7640  FwOpcodeType opcode,
7641  const Fw::CmdResponse& response,
7642  U16 actualCmdIdx,
7643  U16 expectedCmdIdx
7644  ) const
7645  {
7646  // Get the time
7647  Fw::Time _logTime;
7648  if (this->isConnected_timeCaller_OutputPort(0)) {
7649  this->timeCaller_out(0, _logTime);
7650  }
7651 
7653 
7654  // Emit the event on the log port
7655  if (this->isConnected_logOut_OutputPort(0)) {
7656  Fw::LogBuffer _logBuff;
7658 
7659 #if FW_AMPCS_COMPATIBLE
7660  // Serialize the number of arguments
7661  _status = _logBuff.serializeFrom(static_cast<U8>(4));
7662  FW_ASSERT(
7663  _status == Fw::FW_SERIALIZE_OK,
7664  static_cast<FwAssertArgType>(_status)
7665  );
7666 #endif
7667 
7668 #if FW_AMPCS_COMPATIBLE
7669  // Serialize the argument size
7670  _status = _logBuff.serializeFrom(
7671  static_cast<U8>(sizeof(FwOpcodeType))
7672  );
7673  FW_ASSERT(
7674  _status == Fw::FW_SERIALIZE_OK,
7675  static_cast<FwAssertArgType>(_status)
7676  );
7677 #endif
7678  _status = _logBuff.serializeFrom(opcode);
7679  FW_ASSERT(
7680  _status == Fw::FW_SERIALIZE_OK,
7681  static_cast<FwAssertArgType>(_status)
7682  );
7683 
7684 #if FW_AMPCS_COMPATIBLE
7685  // Serialize the argument size
7686  _status = _logBuff.serializeFrom(
7687  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
7688  );
7689  FW_ASSERT(
7690  _status == Fw::FW_SERIALIZE_OK,
7691  static_cast<FwAssertArgType>(_status)
7692  );
7693 #endif
7694  _status = _logBuff.serializeFrom(response);
7695  FW_ASSERT(
7696  _status == Fw::FW_SERIALIZE_OK,
7697  static_cast<FwAssertArgType>(_status)
7698  );
7699 
7700 #if FW_AMPCS_COMPATIBLE
7701  // Serialize the argument size
7702  _status = _logBuff.serializeFrom(
7703  static_cast<U8>(sizeof(U16))
7704  );
7705  FW_ASSERT(
7706  _status == Fw::FW_SERIALIZE_OK,
7707  static_cast<FwAssertArgType>(_status)
7708  );
7709 #endif
7710  _status = _logBuff.serializeFrom(actualCmdIdx);
7711  FW_ASSERT(
7712  _status == Fw::FW_SERIALIZE_OK,
7713  static_cast<FwAssertArgType>(_status)
7714  );
7715 
7716 #if FW_AMPCS_COMPATIBLE
7717  // Serialize the argument size
7718  _status = _logBuff.serializeFrom(
7719  static_cast<U8>(sizeof(U16))
7720  );
7721  FW_ASSERT(
7722  _status == Fw::FW_SERIALIZE_OK,
7723  static_cast<FwAssertArgType>(_status)
7724  );
7725 #endif
7726  _status = _logBuff.serializeFrom(expectedCmdIdx);
7727  FW_ASSERT(
7728  _status == Fw::FW_SERIALIZE_OK,
7729  static_cast<FwAssertArgType>(_status)
7730  );
7731 
7732  this->logOut_out(
7733  0,
7734  _id,
7735  _logTime,
7737  _logBuff
7738  );
7739  }
7740 
7741  // Emit the event on the text log port
7742 #if FW_ENABLE_TEXT_LOGGING
7743  if (this->isConnected_logTextOut_OutputPort(0)) {
7744 #if FW_OBJECT_NAMES == 1
7745  const char* _formatString =
7746  "(%s) %s: Command response (opcode %" PRIu32 ", response %s) was for a different command instance (actual idx %" PRIu16 ", expected %" PRIu16 ")";
7747 #else
7748  const char* _formatString =
7749  "%s: Command response (opcode %" PRIu32 ", response %s) was for a different command instance (actual idx %" PRIu16 ", expected %" PRIu16 ")";
7750 #endif
7751 
7752  Fw::String responseStr;
7753  response.toString(responseStr);
7754 
7755  Fw::TextLogString _logString;
7756  (void) _logString.format(
7757  _formatString,
7758 #if FW_OBJECT_NAMES == 1
7759  this->m_objName.toChar(),
7760 #endif
7761  "WrongCmdResponseIndex ",
7762  opcode,
7763  responseStr.toChar(),
7764  actualCmdIdx,
7765  expectedCmdIdx
7766  );
7767 
7768  this->logTextOut_out(
7769  0,
7770  _id,
7771  _logTime,
7773  _logString
7774  );
7775  }
7776 #endif
7777  }
7778 
7781  Svc::WasmSequencer_ModuleIdx moduleIdx,
7782  const Svc::WasmSequencer_Status& status
7783  ) const
7784  {
7785  // Get the time
7786  Fw::Time _logTime;
7787  if (this->isConnected_timeCaller_OutputPort(0)) {
7788  this->timeCaller_out(0, _logTime);
7789  }
7790 
7792 
7793  // Emit the event on the log port
7794  if (this->isConnected_logOut_OutputPort(0)) {
7795  Fw::LogBuffer _logBuff;
7797 
7798 #if FW_AMPCS_COMPATIBLE
7799  // Serialize the number of arguments
7800  _status = _logBuff.serializeFrom(static_cast<U8>(2));
7801  FW_ASSERT(
7802  _status == Fw::FW_SERIALIZE_OK,
7803  static_cast<FwAssertArgType>(_status)
7804  );
7805 #endif
7806 
7807 #if FW_AMPCS_COMPATIBLE
7808  // Serialize the argument size
7809  _status = _logBuff.serializeFrom(
7810  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
7811  );
7812  FW_ASSERT(
7813  _status == Fw::FW_SERIALIZE_OK,
7814  static_cast<FwAssertArgType>(_status)
7815  );
7816 #endif
7817  _status = _logBuff.serializeFrom(moduleIdx);
7818  FW_ASSERT(
7819  _status == Fw::FW_SERIALIZE_OK,
7820  static_cast<FwAssertArgType>(_status)
7821  );
7822 
7823 #if FW_AMPCS_COMPATIBLE
7824  // Serialize the argument size
7825  _status = _logBuff.serializeFrom(
7827  );
7828  FW_ASSERT(
7829  _status == Fw::FW_SERIALIZE_OK,
7830  static_cast<FwAssertArgType>(_status)
7831  );
7832 #endif
7833  _status = _logBuff.serializeFrom(status);
7834  FW_ASSERT(
7835  _status == Fw::FW_SERIALIZE_OK,
7836  static_cast<FwAssertArgType>(_status)
7837  );
7838 
7839  this->logOut_out(
7840  0,
7841  _id,
7842  _logTime,
7844  _logBuff
7845  );
7846  }
7847 
7848  // Emit the event on the text log port
7849 #if FW_ENABLE_TEXT_LOGGING
7850  if (this->isConnected_logTextOut_OutputPort(0)) {
7851 #if FW_OBJECT_NAMES == 1
7852  const char* _formatString =
7853  "(%s) %s: Module at index %" PRIu8 " does not have a valid 'main' entrypoint: %s";
7854 #else
7855  const char* _formatString =
7856  "%s: Module at index %" PRIu8 " does not have a valid 'main' entrypoint: %s";
7857 #endif
7858 
7859  Fw::String statusStr;
7860  status.toString(statusStr);
7861 
7862  Fw::TextLogString _logString;
7863  (void) _logString.format(
7864  _formatString,
7865 #if FW_OBJECT_NAMES == 1
7866  this->m_objName.toChar(),
7867 #endif
7868  "InvalidModuleEntrypoint ",
7869  moduleIdx,
7870  statusStr.toChar()
7871  );
7872 
7873  this->logTextOut_out(
7874  0,
7875  _id,
7876  _logTime,
7878  _logString
7879  );
7880  }
7881 #endif
7882  }
7883 
7886  {
7887  // Get the time
7888  Fw::Time _logTime;
7889  if (this->isConnected_timeCaller_OutputPort(0)) {
7890  this->timeCaller_out(0, _logTime);
7891  }
7892 
7893  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGWARNINGHI;
7894 
7895  // Emit the event on the log port
7896  if (this->isConnected_logOut_OutputPort(0)) {
7897  Fw::LogBuffer _logBuff;
7899 
7900 #if FW_AMPCS_COMPATIBLE
7901  // Serialize the number of arguments
7902  _status = _logBuff.serializeFrom(static_cast<U8>(1));
7903  FW_ASSERT(
7904  _status == Fw::FW_SERIALIZE_OK,
7905  static_cast<FwAssertArgType>(_status)
7906  );
7907 #endif
7908 
7909  _status = msg.serializeTo(
7910  _logBuff,
7911  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
7912  );
7913  FW_ASSERT(
7914  _status == Fw::FW_SERIALIZE_OK,
7915  static_cast<FwAssertArgType>(_status)
7916  );
7917 
7918  this->logOut_out(
7919  0,
7920  _id,
7921  _logTime,
7923  _logBuff
7924  );
7925  }
7926 
7927  // Emit the event on the text log port
7928 #if FW_ENABLE_TEXT_LOGGING
7929  if (this->isConnected_logTextOut_OutputPort(0)) {
7930 #if FW_OBJECT_NAMES == 1
7931  const char* _formatString =
7932  "(%s) %s: %s";
7933 #else
7934  const char* _formatString =
7935  "%s: %s";
7936 #endif
7937 
7938  Fw::TextLogString _logString;
7939  (void) _logString.format(
7940  _formatString,
7941 #if FW_OBJECT_NAMES == 1
7942  this->m_objName.toChar(),
7943 #endif
7944  "LogWarningHi ",
7945  msg.toChar()
7946  );
7947 
7948  this->logTextOut_out(
7949  0,
7950  _id,
7951  _logTime,
7953  _logString
7954  );
7955  }
7956 #endif
7957  }
7958 
7961  {
7962  // Get the time
7963  Fw::Time _logTime;
7964  if (this->isConnected_timeCaller_OutputPort(0)) {
7965  this->timeCaller_out(0, _logTime);
7966  }
7967 
7968  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGWARNINGLO;
7969 
7970  // Emit the event on the log port
7971  if (this->isConnected_logOut_OutputPort(0)) {
7972  Fw::LogBuffer _logBuff;
7974 
7975 #if FW_AMPCS_COMPATIBLE
7976  // Serialize the number of arguments
7977  _status = _logBuff.serializeFrom(static_cast<U8>(1));
7978  FW_ASSERT(
7979  _status == Fw::FW_SERIALIZE_OK,
7980  static_cast<FwAssertArgType>(_status)
7981  );
7982 #endif
7983 
7984  _status = msg.serializeTo(
7985  _logBuff,
7986  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
7987  );
7988  FW_ASSERT(
7989  _status == Fw::FW_SERIALIZE_OK,
7990  static_cast<FwAssertArgType>(_status)
7991  );
7992 
7993  this->logOut_out(
7994  0,
7995  _id,
7996  _logTime,
7998  _logBuff
7999  );
8000  }
8001 
8002  // Emit the event on the text log port
8003 #if FW_ENABLE_TEXT_LOGGING
8004  if (this->isConnected_logTextOut_OutputPort(0)) {
8005 #if FW_OBJECT_NAMES == 1
8006  const char* _formatString =
8007  "(%s) %s: %s";
8008 #else
8009  const char* _formatString =
8010  "%s: %s";
8011 #endif
8012 
8013  Fw::TextLogString _logString;
8014  (void) _logString.format(
8015  _formatString,
8016 #if FW_OBJECT_NAMES == 1
8017  this->m_objName.toChar(),
8018 #endif
8019  "LogWarningLo ",
8020  msg.toChar()
8021  );
8022 
8023  this->logTextOut_out(
8024  0,
8025  _id,
8026  _logTime,
8028  _logString
8029  );
8030  }
8031 #endif
8032  }
8033 
8036  {
8037  // Get the time
8038  Fw::Time _logTime;
8039  if (this->isConnected_timeCaller_OutputPort(0)) {
8040  this->timeCaller_out(0, _logTime);
8041  }
8042 
8043  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGACTIVITYHI;
8044 
8045  // Emit the event on the log port
8046  if (this->isConnected_logOut_OutputPort(0)) {
8047  Fw::LogBuffer _logBuff;
8049 
8050 #if FW_AMPCS_COMPATIBLE
8051  // Serialize the number of arguments
8052  _status = _logBuff.serializeFrom(static_cast<U8>(1));
8053  FW_ASSERT(
8054  _status == Fw::FW_SERIALIZE_OK,
8055  static_cast<FwAssertArgType>(_status)
8056  );
8057 #endif
8058 
8059  _status = msg.serializeTo(
8060  _logBuff,
8061  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
8062  );
8063  FW_ASSERT(
8064  _status == Fw::FW_SERIALIZE_OK,
8065  static_cast<FwAssertArgType>(_status)
8066  );
8067 
8068  this->logOut_out(
8069  0,
8070  _id,
8071  _logTime,
8073  _logBuff
8074  );
8075  }
8076 
8077  // Emit the event on the text log port
8078 #if FW_ENABLE_TEXT_LOGGING
8079  if (this->isConnected_logTextOut_OutputPort(0)) {
8080 #if FW_OBJECT_NAMES == 1
8081  const char* _formatString =
8082  "(%s) %s: %s";
8083 #else
8084  const char* _formatString =
8085  "%s: %s";
8086 #endif
8087 
8088  Fw::TextLogString _logString;
8089  (void) _logString.format(
8090  _formatString,
8091 #if FW_OBJECT_NAMES == 1
8092  this->m_objName.toChar(),
8093 #endif
8094  "LogActivityHi ",
8095  msg.toChar()
8096  );
8097 
8098  this->logTextOut_out(
8099  0,
8100  _id,
8101  _logTime,
8103  _logString
8104  );
8105  }
8106 #endif
8107  }
8108 
8111  {
8112  // Get the time
8113  Fw::Time _logTime;
8114  if (this->isConnected_timeCaller_OutputPort(0)) {
8115  this->timeCaller_out(0, _logTime);
8116  }
8117 
8118  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGACTIVITYLO;
8119 
8120  // Emit the event on the log port
8121  if (this->isConnected_logOut_OutputPort(0)) {
8122  Fw::LogBuffer _logBuff;
8124 
8125 #if FW_AMPCS_COMPATIBLE
8126  // Serialize the number of arguments
8127  _status = _logBuff.serializeFrom(static_cast<U8>(1));
8128  FW_ASSERT(
8129  _status == Fw::FW_SERIALIZE_OK,
8130  static_cast<FwAssertArgType>(_status)
8131  );
8132 #endif
8133 
8134  _status = msg.serializeTo(
8135  _logBuff,
8136  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
8137  );
8138  FW_ASSERT(
8139  _status == Fw::FW_SERIALIZE_OK,
8140  static_cast<FwAssertArgType>(_status)
8141  );
8142 
8143  this->logOut_out(
8144  0,
8145  _id,
8146  _logTime,
8148  _logBuff
8149  );
8150  }
8151 
8152  // Emit the event on the text log port
8153 #if FW_ENABLE_TEXT_LOGGING
8154  if (this->isConnected_logTextOut_OutputPort(0)) {
8155 #if FW_OBJECT_NAMES == 1
8156  const char* _formatString =
8157  "(%s) %s: %s";
8158 #else
8159  const char* _formatString =
8160  "%s: %s";
8161 #endif
8162 
8163  Fw::TextLogString _logString;
8164  (void) _logString.format(
8165  _formatString,
8166 #if FW_OBJECT_NAMES == 1
8167  this->m_objName.toChar(),
8168 #endif
8169  "LogActivityLo ",
8170  msg.toChar()
8171  );
8172 
8173  this->logTextOut_out(
8174  0,
8175  _id,
8176  _logTime,
8178  _logString
8179  );
8180  }
8181 #endif
8182  }
8183 
8186  {
8187  // Get the time
8188  Fw::Time _logTime;
8189  if (this->isConnected_timeCaller_OutputPort(0)) {
8190  this->timeCaller_out(0, _logTime);
8191  }
8192 
8193  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGDIAGNOSTIC;
8194 
8195  // Emit the event on the log port
8196  if (this->isConnected_logOut_OutputPort(0)) {
8197  Fw::LogBuffer _logBuff;
8199 
8200 #if FW_AMPCS_COMPATIBLE
8201  // Serialize the number of arguments
8202  _status = _logBuff.serializeFrom(static_cast<U8>(1));
8203  FW_ASSERT(
8204  _status == Fw::FW_SERIALIZE_OK,
8205  static_cast<FwAssertArgType>(_status)
8206  );
8207 #endif
8208 
8209  _status = msg.serializeTo(
8210  _logBuff,
8211  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
8212  );
8213  FW_ASSERT(
8214  _status == Fw::FW_SERIALIZE_OK,
8215  static_cast<FwAssertArgType>(_status)
8216  );
8217 
8218  this->logOut_out(
8219  0,
8220  _id,
8221  _logTime,
8223  _logBuff
8224  );
8225  }
8226 
8227  // Emit the event on the text log port
8228 #if FW_ENABLE_TEXT_LOGGING
8229  if (this->isConnected_logTextOut_OutputPort(0)) {
8230 #if FW_OBJECT_NAMES == 1
8231  const char* _formatString =
8232  "(%s) %s: %s";
8233 #else
8234  const char* _formatString =
8235  "%s: %s";
8236 #endif
8237 
8238  Fw::TextLogString _logString;
8239  (void) _logString.format(
8240  _formatString,
8241 #if FW_OBJECT_NAMES == 1
8242  this->m_objName.toChar(),
8243 #endif
8244  "LogDiagnostic ",
8245  msg.toChar()
8246  );
8247 
8248  this->logTextOut_out(
8249  0,
8250  _id,
8251  _logTime,
8253  _logString
8254  );
8255  }
8256 #endif
8257  }
8258 
8259  // ----------------------------------------------------------------------
8260  // Telemetry serialized write
8261  // ----------------------------------------------------------------------
8262 
8265  FwChanIdType id,
8266  Fw::TlmBuffer& _tlmBuff,
8267  Fw::Time _tlmTime
8268  ) const
8269  {
8270  if (this->isConnected_tlmOut_OutputPort(0)) {
8271  if (
8273  (_tlmTime == Fw::ZERO_TIME)
8274  ) {
8275  this->timeCaller_out(0, _tlmTime);
8276  }
8277 
8278  FwChanIdType _id;
8279  _id = this->getIdBase() + id;
8280 
8281  this->tlmOut_out(
8282  0,
8283  _id,
8284  _tlmTime,
8285  _tlmBuff
8286  );
8287  }
8288  }
8289 
8290  // ----------------------------------------------------------------------
8291  // Telemetry write functions
8292  // ----------------------------------------------------------------------
8293 
8297  Fw::Time _tlmTime
8298  )
8299  {
8300  // Check to see if it is the first time
8301  if (not this->m_first_update_ControllerState) {
8302  // Check to see if value has changed. If not, don't write it.
8303  if (arg == this->m_last_ControllerState) {
8304  return;
8305  }
8306  else {
8307  this->m_last_ControllerState = arg;
8308  }
8309  }
8310  else {
8311  this->m_first_update_ControllerState = false;
8312  this->m_last_ControllerState = arg;
8313  }
8314 
8315  if (this->isConnected_tlmOut_OutputPort(0)) {
8316  Fw::TlmBuffer _tlmBuff;
8317  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8318  FW_ASSERT(
8319  _stat == Fw::FW_SERIALIZE_OK,
8320  static_cast<FwAssertArgType>(_stat)
8321  );
8322 
8323  this->tlmWrite(
8325  _tlmBuff,
8326  _tlmTime
8327  );
8328  }
8329  }
8330 
8334  Fw::Time _tlmTime
8335  )
8336  {
8337  // Check to see if it is the first time
8338  if (not this->m_first_update_InterpreterState) {
8339  // Check to see if value has changed. If not, don't write it.
8340  if (arg == this->m_last_InterpreterState) {
8341  return;
8342  }
8343  else {
8344  this->m_last_InterpreterState = arg;
8345  }
8346  }
8347  else {
8348  this->m_first_update_InterpreterState = false;
8349  this->m_last_InterpreterState = arg;
8350  }
8351 
8352  if (this->isConnected_tlmOut_OutputPort(0)) {
8353  Fw::TlmBuffer _tlmBuff;
8354  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8355  FW_ASSERT(
8356  _stat == Fw::FW_SERIALIZE_OK,
8357  static_cast<FwAssertArgType>(_stat)
8358  );
8359 
8360  this->tlmWrite(
8362  _tlmBuff,
8363  _tlmTime
8364  );
8365  }
8366  }
8367 
8370  U64 arg,
8371  Fw::Time _tlmTime
8372  )
8373  {
8374  // Check to see if it is the first time
8375  if (not this->m_first_update_SequencesSucceeded) {
8376  // Check to see if value has changed. If not, don't write it.
8377  if (arg == this->m_last_SequencesSucceeded) {
8378  return;
8379  }
8380  else {
8381  this->m_last_SequencesSucceeded = arg;
8382  }
8383  }
8384  else {
8385  this->m_first_update_SequencesSucceeded = false;
8386  this->m_last_SequencesSucceeded = arg;
8387  }
8388 
8389  if (this->isConnected_tlmOut_OutputPort(0)) {
8390  Fw::TlmBuffer _tlmBuff;
8391  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8392  FW_ASSERT(
8393  _stat == Fw::FW_SERIALIZE_OK,
8394  static_cast<FwAssertArgType>(_stat)
8395  );
8396 
8397  this->tlmWrite(
8399  _tlmBuff,
8400  _tlmTime
8401  );
8402  }
8403  }
8404 
8407  U64 arg,
8408  Fw::Time _tlmTime
8409  )
8410  {
8411  // Check to see if it is the first time
8412  if (not this->m_first_update_SequencesFailed) {
8413  // Check to see if value has changed. If not, don't write it.
8414  if (arg == this->m_last_SequencesFailed) {
8415  return;
8416  }
8417  else {
8418  this->m_last_SequencesFailed = arg;
8419  }
8420  }
8421  else {
8422  this->m_first_update_SequencesFailed = false;
8423  this->m_last_SequencesFailed = arg;
8424  }
8425 
8426  if (this->isConnected_tlmOut_OutputPort(0)) {
8427  Fw::TlmBuffer _tlmBuff;
8428  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8429  FW_ASSERT(
8430  _stat == Fw::FW_SERIALIZE_OK,
8431  static_cast<FwAssertArgType>(_stat)
8432  );
8433 
8434  this->tlmWrite(
8436  _tlmBuff,
8437  _tlmTime
8438  );
8439  }
8440  }
8441 
8444  U64 arg,
8445  Fw::Time _tlmTime
8446  )
8447  {
8448  // Check to see if it is the first time
8449  if (not this->m_first_update_SequencesCancelled) {
8450  // Check to see if value has changed. If not, don't write it.
8451  if (arg == this->m_last_SequencesCancelled) {
8452  return;
8453  }
8454  else {
8455  this->m_last_SequencesCancelled = arg;
8456  }
8457  }
8458  else {
8459  this->m_first_update_SequencesCancelled = false;
8460  this->m_last_SequencesCancelled = arg;
8461  }
8462 
8463  if (this->isConnected_tlmOut_OutputPort(0)) {
8464  Fw::TlmBuffer _tlmBuff;
8465  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8466  FW_ASSERT(
8467  _stat == Fw::FW_SERIALIZE_OK,
8468  static_cast<FwAssertArgType>(_stat)
8469  );
8470 
8471  this->tlmWrite(
8473  _tlmBuff,
8474  _tlmTime
8475  );
8476  }
8477  }
8478 
8481  U64 arg,
8482  Fw::Time _tlmTime
8483  )
8484  {
8485  // Check to see if it is the first time
8486  if (not this->m_first_update_CommandsDispatched) {
8487  // Check to see if value has changed. If not, don't write it.
8488  if (arg == this->m_last_CommandsDispatched) {
8489  return;
8490  }
8491  else {
8492  this->m_last_CommandsDispatched = arg;
8493  }
8494  }
8495  else {
8496  this->m_first_update_CommandsDispatched = false;
8497  this->m_last_CommandsDispatched = arg;
8498  }
8499 
8500  if (this->isConnected_tlmOut_OutputPort(0)) {
8501  Fw::TlmBuffer _tlmBuff;
8502  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8503  FW_ASSERT(
8504  _stat == Fw::FW_SERIALIZE_OK,
8505  static_cast<FwAssertArgType>(_stat)
8506  );
8507 
8508  this->tlmWrite(
8510  _tlmBuff,
8511  _tlmTime
8512  );
8513  }
8514  }
8515 
8518  U64 arg,
8519  Fw::Time _tlmTime
8520  )
8521  {
8522  // Check to see if it is the first time
8523  if (not this->m_first_update_CommandsFailed) {
8524  // Check to see if value has changed. If not, don't write it.
8525  if (arg == this->m_last_CommandsFailed) {
8526  return;
8527  }
8528  else {
8529  this->m_last_CommandsFailed = arg;
8530  }
8531  }
8532  else {
8533  this->m_first_update_CommandsFailed = false;
8534  this->m_last_CommandsFailed = arg;
8535  }
8536 
8537  if (this->isConnected_tlmOut_OutputPort(0)) {
8538  Fw::TlmBuffer _tlmBuff;
8539  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8540  FW_ASSERT(
8541  _stat == Fw::FW_SERIALIZE_OK,
8542  static_cast<FwAssertArgType>(_stat)
8543  );
8544 
8545  this->tlmWrite(
8547  _tlmBuff,
8548  _tlmTime
8549  );
8550  }
8551  }
8552 
8555  const Svc::WasmSequencer_TrapReason& arg,
8556  Fw::Time _tlmTime
8557  )
8558  {
8559  // Check to see if it is the first time
8560  if (not this->m_first_update_LastTrapReason) {
8561  // Check to see if value has changed. If not, don't write it.
8562  if (arg == this->m_last_LastTrapReason) {
8563  return;
8564  }
8565  else {
8566  this->m_last_LastTrapReason = arg;
8567  }
8568  }
8569  else {
8570  this->m_first_update_LastTrapReason = false;
8571  this->m_last_LastTrapReason = arg;
8572  }
8573 
8574  if (this->isConnected_tlmOut_OutputPort(0)) {
8575  Fw::TlmBuffer _tlmBuff;
8576  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8577  FW_ASSERT(
8578  _stat == Fw::FW_SERIALIZE_OK,
8579  static_cast<FwAssertArgType>(_stat)
8580  );
8581 
8582  this->tlmWrite(
8584  _tlmBuff,
8585  _tlmTime
8586  );
8587  }
8588  }
8589 
8592  const Fw::StringBase& arg,
8593  Fw::Time _tlmTime
8594  )
8595  {
8596  // Check to see if it is the first time
8597  if (not this->m_first_update_SeqName) {
8598  // Check to see if value has changed. If not, don't write it.
8599  if (arg == this->m_last_SeqName) {
8600  return;
8601  }
8602  else {
8603  this->m_last_SeqName = arg;
8604  }
8605  }
8606  else {
8607  this->m_first_update_SeqName = false;
8608  this->m_last_SeqName = arg;
8609  }
8610 
8611  if (this->isConnected_tlmOut_OutputPort(0)) {
8612  Fw::TlmBuffer _tlmBuff;
8613  Fw::SerializeStatus _stat = arg.serializeTo(
8614  _tlmBuff,
8615  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 240)
8616  );
8617  FW_ASSERT(
8618  _stat == Fw::FW_SERIALIZE_OK,
8619  static_cast<FwAssertArgType>(_stat)
8620  );
8621 
8622  this->tlmWrite(
8624  _tlmBuff,
8625  _tlmTime
8626  );
8627  }
8628  }
8629 
8630  // ----------------------------------------------------------------------
8631  // Parameter hook functions
8632  // ----------------------------------------------------------------------
8633 
8636  {
8637  // Do nothing by default
8638  }
8639 
8642  {
8643  // Do nothing by default
8644  }
8645 
8646  // ----------------------------------------------------------------------
8647  // Parameter get functions
8648  // ----------------------------------------------------------------------
8649 
8652  {
8653  F32 _local{};
8654  this->m_paramLock.lock();
8655  valid = this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid;
8656  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
8657  _local = this->m_HOST_FUNCTION_TIMEOUT_SECS;
8658  }
8659  this->m_paramLock.unlock();
8660  return _local;
8661  }
8662 
8665  {
8666  FwSizeType _local{};
8667  this->m_paramLock.lock();
8668  valid = this->m_param_INSTRUCTION_FUEL_valid;
8669  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
8670  _local = this->m_INSTRUCTION_FUEL;
8671  }
8672  this->m_paramLock.unlock();
8673  return _local;
8674  }
8675 
8678  {
8679  Fw::ParamString _local{};
8680  this->m_paramLock.lock();
8681  valid = this->m_param_SEQ_BASE_DIR_valid;
8682  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
8683  _local = this->m_SEQ_BASE_DIR;
8684  }
8685  this->m_paramLock.unlock();
8686  return _local;
8687  }
8688 
8689  // ----------------------------------------------------------------------
8690  // Time
8691  // ----------------------------------------------------------------------
8692 
8694  getTime() const
8695  {
8696  if (this->isConnected_timeCaller_OutputPort(0)) {
8697  Fw::Time _time;
8698  this->timeCaller_out(0, _time);
8699  return _time;
8700  }
8701  else {
8702  return Fw::Time(TimeBase::TB_NONE, 0, 0);
8703  }
8704  }
8705 
8706  // ----------------------------------------------------------------------
8707  // Mutex operations for guarded ports
8708  //
8709  // You can override these operations to provide more sophisticated
8710  // synchronization
8711  // ----------------------------------------------------------------------
8712 
8715  {
8716  this->m_guardedPortMutex.lock();
8717  }
8718 
8721  {
8722  this->m_guardedPortMutex.unLock();
8723  }
8724 
8725  // ----------------------------------------------------------------------
8726  // Message dispatch functions
8727  // ----------------------------------------------------------------------
8728 
8729  Fw::QueuedComponentBase::MsgDispatchStatus WasmSequencerComponentBase ::
8730  doDispatch()
8731  {
8732  ComponentIpcSerializableBuffer _msg;
8733  FwQueuePriorityType _priority = 0;
8734 
8735  Os::Queue::Status _msgStatus = this->m_queue.receive(
8736  _msg,
8738  _priority
8739  );
8740  FW_ASSERT(
8741  _msgStatus == Os::Queue::OP_OK,
8742  static_cast<FwAssertArgType>(_msgStatus)
8743  );
8744 
8745  // Reset to beginning of buffer
8746  _msg.resetDeser();
8747 
8748  FwEnumStoreType _desMsg = 0;
8749  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
8750  FW_ASSERT(
8751  _deserStatus == Fw::FW_SERIALIZE_OK,
8752  static_cast<FwAssertArgType>(_deserStatus)
8753  );
8754 
8755  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
8756 
8757  if (_msgType == WASMSEQUENCER_COMPONENT_EXIT) {
8758  return MSG_DISPATCH_EXIT;
8759  }
8760 
8761  FwIndexType portNum = 0;
8762  _deserStatus = _msg.deserializeTo(portNum);
8763  FW_ASSERT(
8764  _deserStatus == Fw::FW_SERIALIZE_OK,
8765  static_cast<FwAssertArgType>(_deserStatus)
8766  );
8767 
8768  switch (_msgType) {
8769  // Handle async input port checkTimers
8770  case CHECKTIMERS_SCHED: {
8771  // Deserialize argument context
8772  U32 context;
8773  _deserStatus = _msg.deserializeTo(context);
8774  FW_ASSERT(
8775  _deserStatus == Fw::FW_SERIALIZE_OK,
8776  static_cast<FwAssertArgType>(_deserStatus)
8777  );
8778  // Call handler function
8779  this->checkTimers_handler(
8780  portNum,
8781  context
8782  );
8783 
8784  break;
8785  }
8786 
8787  // Handle async input port cmdResponseIn
8788  case CMDRESPONSEIN_CMDRESPONSE: {
8789  // Deserialize argument opCode
8790  FwOpcodeType opCode;
8791  _deserStatus = _msg.deserializeTo(opCode);
8792  FW_ASSERT(
8793  _deserStatus == Fw::FW_SERIALIZE_OK,
8794  static_cast<FwAssertArgType>(_deserStatus)
8795  );
8796 
8797  // Deserialize argument cmdSeq
8798  U32 cmdSeq;
8799  _deserStatus = _msg.deserializeTo(cmdSeq);
8800  FW_ASSERT(
8801  _deserStatus == Fw::FW_SERIALIZE_OK,
8802  static_cast<FwAssertArgType>(_deserStatus)
8803  );
8804 
8805  // Deserialize argument response
8806  Fw::CmdResponse response;
8807  _deserStatus = _msg.deserializeTo(response);
8808  FW_ASSERT(
8809  _deserStatus == Fw::FW_SERIALIZE_OK,
8810  static_cast<FwAssertArgType>(_deserStatus)
8811  );
8812  // Call handler function
8813  this->cmdResponseIn_handler(
8814  portNum,
8815  opCode,
8816  cmdSeq,
8817  response
8818  );
8819 
8820  break;
8821  }
8822 
8823  // Handle async input port seqRunIn
8824  case SEQRUNIN_CMDSEQIN: {
8825  // Deserialize argument filename
8826  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
8827  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
8828  _deserStatus = _msg.deserializeTo(filename);
8829  FW_ASSERT(
8830  _deserStatus == Fw::FW_SERIALIZE_OK,
8831  static_cast<FwAssertArgType>(_deserStatus)
8832  );
8833 
8834  // Deserialize argument args
8835  Svc::SeqArgs args;
8836  _deserStatus = _msg.deserializeTo(args);
8837  FW_ASSERT(
8838  _deserStatus == Fw::FW_SERIALIZE_OK,
8839  static_cast<FwAssertArgType>(_deserStatus)
8840  );
8841  // Call handler function
8842  this->seqRunIn_handler(
8843  portNum,
8844  filename,
8845  args
8846  );
8847 
8848  break;
8849  }
8850 
8851  // Handle async input port writeTelemetry
8852  case WRITETELEMETRY_SCHED: {
8853  // Deserialize argument context
8854  U32 context;
8855  _deserStatus = _msg.deserializeTo(context);
8856  FW_ASSERT(
8857  _deserStatus == Fw::FW_SERIALIZE_OK,
8858  static_cast<FwAssertArgType>(_deserStatus)
8859  );
8860  // Call handler function
8861  this->writeTelemetry_handler(
8862  portNum,
8863  context
8864  );
8865 
8866  break;
8867  }
8868 
8869  // Handle command RUN
8870  case CMD_RUN: {
8871  // Deserialize opcode
8872  FwOpcodeType _opCode = 0;
8873  _deserStatus = _msg.deserializeTo(_opCode);
8874  FW_ASSERT (
8875  _deserStatus == Fw::FW_SERIALIZE_OK,
8876  static_cast<FwAssertArgType>(_deserStatus)
8877  );
8878 
8879  // Deserialize command sequence
8880  U32 _cmdSeq = 0;
8881  _deserStatus = _msg.deserializeTo(_cmdSeq);
8882  FW_ASSERT (
8883  _deserStatus == Fw::FW_SERIALIZE_OK,
8884  static_cast<FwAssertArgType>(_deserStatus)
8885  );
8886 
8887  // Deserialize command argument buffer
8888  Fw::CmdArgBuffer args;
8889  _deserStatus = _msg.deserializeTo(args);
8890  FW_ASSERT (
8891  _deserStatus == Fw::FW_SERIALIZE_OK,
8892  static_cast<FwAssertArgType>(_deserStatus)
8893  );
8894 
8895  // Reset buffer
8896  args.resetDeser();
8897 
8898  // Deserialize argument fileName
8899  Fw::CmdStringArg fileName;
8900  _deserStatus = args.deserializeTo(fileName);
8901  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
8903  this->cmdResponse_out(
8904  _opCode,
8905  _cmdSeq,
8907  );
8908  }
8909  // Don't crash the task if bad arguments were passed from the ground
8910  break;
8911  }
8912 
8913  // Deserialize argument block
8914  Svc::BlockState block;
8915  _deserStatus = args.deserializeTo(block);
8916  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
8918  this->cmdResponse_out(
8919  _opCode,
8920  _cmdSeq,
8922  );
8923  }
8924  // Don't crash the task if bad arguments were passed from the ground
8925  break;
8926  }
8927 
8928  // Deserialize argument seqArgs
8929  Svc::SeqArgs seqArgs;
8930  _deserStatus = args.deserializeTo(seqArgs);
8931  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
8933  this->cmdResponse_out(
8934  _opCode,
8935  _cmdSeq,
8937  );
8938  }
8939  // Don't crash the task if bad arguments were passed from the ground
8940  break;
8941  }
8942 
8943  // Make sure there was no data left over.
8944  // That means the argument buffer size was incorrect.
8945 #if FW_CMD_CHECK_RESIDUAL
8946  if (args.getDeserializeSizeLeft() != 0) {
8948  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
8949  }
8950  // Don't crash the task if bad arguments were passed from the ground
8951  break;
8952  }
8953 #endif
8954 
8955  // Call handler function
8956  this->RUN_cmdHandler(
8957  _opCode, _cmdSeq,
8958  fileName,
8959  block,
8960  seqArgs
8961  );
8962 
8963  break;
8964  }
8965 
8966  // Handle command LOAD
8967  case CMD_LOAD: {
8968  // Deserialize opcode
8969  FwOpcodeType _opCode = 0;
8970  _deserStatus = _msg.deserializeTo(_opCode);
8971  FW_ASSERT (
8972  _deserStatus == Fw::FW_SERIALIZE_OK,
8973  static_cast<FwAssertArgType>(_deserStatus)
8974  );
8975 
8976  // Deserialize command sequence
8977  U32 _cmdSeq = 0;
8978  _deserStatus = _msg.deserializeTo(_cmdSeq);
8979  FW_ASSERT (
8980  _deserStatus == Fw::FW_SERIALIZE_OK,
8981  static_cast<FwAssertArgType>(_deserStatus)
8982  );
8983 
8984  // Deserialize command argument buffer
8985  Fw::CmdArgBuffer args;
8986  _deserStatus = _msg.deserializeTo(args);
8987  FW_ASSERT (
8988  _deserStatus == Fw::FW_SERIALIZE_OK,
8989  static_cast<FwAssertArgType>(_deserStatus)
8990  );
8991 
8992  // Reset buffer
8993  args.resetDeser();
8994 
8995  // Deserialize argument fileName
8996  Fw::CmdStringArg fileName;
8997  _deserStatus = args.deserializeTo(fileName);
8998  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9000  this->cmdResponse_out(
9001  _opCode,
9002  _cmdSeq,
9004  );
9005  }
9006  // Don't crash the task if bad arguments were passed from the ground
9007  break;
9008  }
9009 
9010  // Deserialize argument name
9011  Fw::CmdStringArg name;
9012  _deserStatus = args.deserializeTo(name);
9013  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9015  this->cmdResponse_out(
9016  _opCode,
9017  _cmdSeq,
9019  );
9020  }
9021  // Don't crash the task if bad arguments were passed from the ground
9022  break;
9023  }
9024 
9025  // Make sure there was no data left over.
9026  // That means the argument buffer size was incorrect.
9027 #if FW_CMD_CHECK_RESIDUAL
9028  if (args.getDeserializeSizeLeft() != 0) {
9030  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9031  }
9032  // Don't crash the task if bad arguments were passed from the ground
9033  break;
9034  }
9035 #endif
9036 
9037  // Call handler function
9038  this->LOAD_cmdHandler(
9039  _opCode, _cmdSeq,
9040  fileName,
9041  name
9042  );
9043 
9044  break;
9045  }
9046 
9047  // Handle command INVOKE
9048  case CMD_INVOKE: {
9049  // Deserialize opcode
9050  FwOpcodeType _opCode = 0;
9051  _deserStatus = _msg.deserializeTo(_opCode);
9052  FW_ASSERT (
9053  _deserStatus == Fw::FW_SERIALIZE_OK,
9054  static_cast<FwAssertArgType>(_deserStatus)
9055  );
9056 
9057  // Deserialize command sequence
9058  U32 _cmdSeq = 0;
9059  _deserStatus = _msg.deserializeTo(_cmdSeq);
9060  FW_ASSERT (
9061  _deserStatus == Fw::FW_SERIALIZE_OK,
9062  static_cast<FwAssertArgType>(_deserStatus)
9063  );
9064 
9065  // Deserialize command argument buffer
9066  Fw::CmdArgBuffer args;
9067  _deserStatus = _msg.deserializeTo(args);
9068  FW_ASSERT (
9069  _deserStatus == Fw::FW_SERIALIZE_OK,
9070  static_cast<FwAssertArgType>(_deserStatus)
9071  );
9072 
9073  // Reset buffer
9074  args.resetDeser();
9075 
9076  // Deserialize argument module
9077  Fw::CmdStringArg module;
9078  _deserStatus = args.deserializeTo(module);
9079  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9081  this->cmdResponse_out(
9082  _opCode,
9083  _cmdSeq,
9085  );
9086  }
9087  // Don't crash the task if bad arguments were passed from the ground
9088  break;
9089  }
9090 
9091  // Deserialize argument block
9092  Svc::BlockState block;
9093  _deserStatus = args.deserializeTo(block);
9094  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9096  this->cmdResponse_out(
9097  _opCode,
9098  _cmdSeq,
9100  );
9101  }
9102  // Don't crash the task if bad arguments were passed from the ground
9103  break;
9104  }
9105 
9106  // Deserialize argument seqArgs
9107  Svc::SeqArgs seqArgs;
9108  _deserStatus = args.deserializeTo(seqArgs);
9109  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9111  this->cmdResponse_out(
9112  _opCode,
9113  _cmdSeq,
9115  );
9116  }
9117  // Don't crash the task if bad arguments were passed from the ground
9118  break;
9119  }
9120 
9121  // Make sure there was no data left over.
9122  // That means the argument buffer size was incorrect.
9123 #if FW_CMD_CHECK_RESIDUAL
9124  if (args.getDeserializeSizeLeft() != 0) {
9126  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9127  }
9128  // Don't crash the task if bad arguments were passed from the ground
9129  break;
9130  }
9131 #endif
9132 
9133  // Call handler function
9134  this->INVOKE_cmdHandler(
9135  _opCode, _cmdSeq,
9136  module,
9137  block,
9138  seqArgs
9139  );
9140 
9141  break;
9142  }
9143 
9144  // Handle command WAIT
9145  case CMD_WAIT: {
9146  // Deserialize opcode
9147  FwOpcodeType _opCode = 0;
9148  _deserStatus = _msg.deserializeTo(_opCode);
9149  FW_ASSERT (
9150  _deserStatus == Fw::FW_SERIALIZE_OK,
9151  static_cast<FwAssertArgType>(_deserStatus)
9152  );
9153 
9154  // Deserialize command sequence
9155  U32 _cmdSeq = 0;
9156  _deserStatus = _msg.deserializeTo(_cmdSeq);
9157  FW_ASSERT (
9158  _deserStatus == Fw::FW_SERIALIZE_OK,
9159  static_cast<FwAssertArgType>(_deserStatus)
9160  );
9161 
9162  // Deserialize command argument buffer
9163  Fw::CmdArgBuffer args;
9164  _deserStatus = _msg.deserializeTo(args);
9165  FW_ASSERT (
9166  _deserStatus == Fw::FW_SERIALIZE_OK,
9167  static_cast<FwAssertArgType>(_deserStatus)
9168  );
9169 
9170  // Reset buffer
9171  args.resetDeser();
9172 
9173  // Make sure there was no data left over.
9174  // That means the argument buffer size was incorrect.
9175 #if FW_CMD_CHECK_RESIDUAL
9176  if (args.getDeserializeSizeLeft() != 0) {
9178  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9179  }
9180  // Don't crash the task if bad arguments were passed from the ground
9181  break;
9182  }
9183 #endif
9184 
9185  // Call handler function
9186  this->WAIT_cmdHandler(_opCode, _cmdSeq);
9187 
9188  break;
9189  }
9190 
9191  // Handle command PAUSE
9192  case CMD_PAUSE: {
9193  // Deserialize opcode
9194  FwOpcodeType _opCode = 0;
9195  _deserStatus = _msg.deserializeTo(_opCode);
9196  FW_ASSERT (
9197  _deserStatus == Fw::FW_SERIALIZE_OK,
9198  static_cast<FwAssertArgType>(_deserStatus)
9199  );
9200 
9201  // Deserialize command sequence
9202  U32 _cmdSeq = 0;
9203  _deserStatus = _msg.deserializeTo(_cmdSeq);
9204  FW_ASSERT (
9205  _deserStatus == Fw::FW_SERIALIZE_OK,
9206  static_cast<FwAssertArgType>(_deserStatus)
9207  );
9208 
9209  // Deserialize command argument buffer
9210  Fw::CmdArgBuffer args;
9211  _deserStatus = _msg.deserializeTo(args);
9212  FW_ASSERT (
9213  _deserStatus == Fw::FW_SERIALIZE_OK,
9214  static_cast<FwAssertArgType>(_deserStatus)
9215  );
9216 
9217  // Reset buffer
9218  args.resetDeser();
9219 
9220  // Make sure there was no data left over.
9221  // That means the argument buffer size was incorrect.
9222 #if FW_CMD_CHECK_RESIDUAL
9223  if (args.getDeserializeSizeLeft() != 0) {
9225  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9226  }
9227  // Don't crash the task if bad arguments were passed from the ground
9228  break;
9229  }
9230 #endif
9231 
9232  // Call handler function
9233  this->PAUSE_cmdHandler(_opCode, _cmdSeq);
9234 
9235  break;
9236  }
9237 
9238  // Handle command CONTINUE
9239  case CMD_CONTINUE: {
9240  // Deserialize opcode
9241  FwOpcodeType _opCode = 0;
9242  _deserStatus = _msg.deserializeTo(_opCode);
9243  FW_ASSERT (
9244  _deserStatus == Fw::FW_SERIALIZE_OK,
9245  static_cast<FwAssertArgType>(_deserStatus)
9246  );
9247 
9248  // Deserialize command sequence
9249  U32 _cmdSeq = 0;
9250  _deserStatus = _msg.deserializeTo(_cmdSeq);
9251  FW_ASSERT (
9252  _deserStatus == Fw::FW_SERIALIZE_OK,
9253  static_cast<FwAssertArgType>(_deserStatus)
9254  );
9255 
9256  // Deserialize command argument buffer
9257  Fw::CmdArgBuffer args;
9258  _deserStatus = _msg.deserializeTo(args);
9259  FW_ASSERT (
9260  _deserStatus == Fw::FW_SERIALIZE_OK,
9261  static_cast<FwAssertArgType>(_deserStatus)
9262  );
9263 
9264  // Reset buffer
9265  args.resetDeser();
9266 
9267  // Make sure there was no data left over.
9268  // That means the argument buffer size was incorrect.
9269 #if FW_CMD_CHECK_RESIDUAL
9270  if (args.getDeserializeSizeLeft() != 0) {
9272  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9273  }
9274  // Don't crash the task if bad arguments were passed from the ground
9275  break;
9276  }
9277 #endif
9278 
9279  // Call handler function
9280  this->CONTINUE_cmdHandler(_opCode, _cmdSeq);
9281 
9282  break;
9283  }
9284 
9285  // Handle command GLOBAL_SET_I32
9286  case CMD_GLOBAL_SET_I32: {
9287  // Deserialize opcode
9288  FwOpcodeType _opCode = 0;
9289  _deserStatus = _msg.deserializeTo(_opCode);
9290  FW_ASSERT (
9291  _deserStatus == Fw::FW_SERIALIZE_OK,
9292  static_cast<FwAssertArgType>(_deserStatus)
9293  );
9294 
9295  // Deserialize command sequence
9296  U32 _cmdSeq = 0;
9297  _deserStatus = _msg.deserializeTo(_cmdSeq);
9298  FW_ASSERT (
9299  _deserStatus == Fw::FW_SERIALIZE_OK,
9300  static_cast<FwAssertArgType>(_deserStatus)
9301  );
9302 
9303  // Deserialize command argument buffer
9304  Fw::CmdArgBuffer args;
9305  _deserStatus = _msg.deserializeTo(args);
9306  FW_ASSERT (
9307  _deserStatus == Fw::FW_SERIALIZE_OK,
9308  static_cast<FwAssertArgType>(_deserStatus)
9309  );
9310 
9311  // Reset buffer
9312  args.resetDeser();
9313 
9314  // Deserialize argument moduleName
9315  Fw::CmdStringArg moduleName;
9316  _deserStatus = args.deserializeTo(moduleName);
9317  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9319  this->cmdResponse_out(
9320  _opCode,
9321  _cmdSeq,
9323  );
9324  }
9325  // Don't crash the task if bad arguments were passed from the ground
9326  break;
9327  }
9328 
9329  // Deserialize argument name
9330  Fw::CmdStringArg name;
9331  _deserStatus = args.deserializeTo(name);
9332  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9334  this->cmdResponse_out(
9335  _opCode,
9336  _cmdSeq,
9338  );
9339  }
9340  // Don't crash the task if bad arguments were passed from the ground
9341  break;
9342  }
9343 
9344  // Deserialize argument value
9345  I32 value;
9346  _deserStatus = args.deserializeTo(value);
9347  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9349  this->cmdResponse_out(
9350  _opCode,
9351  _cmdSeq,
9353  );
9354  }
9355  // Don't crash the task if bad arguments were passed from the ground
9356  break;
9357  }
9358 
9359  // Make sure there was no data left over.
9360  // That means the argument buffer size was incorrect.
9361 #if FW_CMD_CHECK_RESIDUAL
9362  if (args.getDeserializeSizeLeft() != 0) {
9364  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9365  }
9366  // Don't crash the task if bad arguments were passed from the ground
9367  break;
9368  }
9369 #endif
9370 
9371  // Call handler function
9373  _opCode, _cmdSeq,
9374  moduleName,
9375  name,
9376  value
9377  );
9378 
9379  break;
9380  }
9381 
9382  // Handle command GLOBAL_SET_I64
9383  case CMD_GLOBAL_SET_I64: {
9384  // Deserialize opcode
9385  FwOpcodeType _opCode = 0;
9386  _deserStatus = _msg.deserializeTo(_opCode);
9387  FW_ASSERT (
9388  _deserStatus == Fw::FW_SERIALIZE_OK,
9389  static_cast<FwAssertArgType>(_deserStatus)
9390  );
9391 
9392  // Deserialize command sequence
9393  U32 _cmdSeq = 0;
9394  _deserStatus = _msg.deserializeTo(_cmdSeq);
9395  FW_ASSERT (
9396  _deserStatus == Fw::FW_SERIALIZE_OK,
9397  static_cast<FwAssertArgType>(_deserStatus)
9398  );
9399 
9400  // Deserialize command argument buffer
9401  Fw::CmdArgBuffer args;
9402  _deserStatus = _msg.deserializeTo(args);
9403  FW_ASSERT (
9404  _deserStatus == Fw::FW_SERIALIZE_OK,
9405  static_cast<FwAssertArgType>(_deserStatus)
9406  );
9407 
9408  // Reset buffer
9409  args.resetDeser();
9410 
9411  // Deserialize argument moduleName
9412  Fw::CmdStringArg moduleName;
9413  _deserStatus = args.deserializeTo(moduleName);
9414  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9416  this->cmdResponse_out(
9417  _opCode,
9418  _cmdSeq,
9420  );
9421  }
9422  // Don't crash the task if bad arguments were passed from the ground
9423  break;
9424  }
9425 
9426  // Deserialize argument name
9427  Fw::CmdStringArg name;
9428  _deserStatus = args.deserializeTo(name);
9429  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9431  this->cmdResponse_out(
9432  _opCode,
9433  _cmdSeq,
9435  );
9436  }
9437  // Don't crash the task if bad arguments were passed from the ground
9438  break;
9439  }
9440 
9441  // Deserialize argument value
9442  I64 value;
9443  _deserStatus = args.deserializeTo(value);
9444  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9446  this->cmdResponse_out(
9447  _opCode,
9448  _cmdSeq,
9450  );
9451  }
9452  // Don't crash the task if bad arguments were passed from the ground
9453  break;
9454  }
9455 
9456  // Make sure there was no data left over.
9457  // That means the argument buffer size was incorrect.
9458 #if FW_CMD_CHECK_RESIDUAL
9459  if (args.getDeserializeSizeLeft() != 0) {
9461  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9462  }
9463  // Don't crash the task if bad arguments were passed from the ground
9464  break;
9465  }
9466 #endif
9467 
9468  // Call handler function
9470  _opCode, _cmdSeq,
9471  moduleName,
9472  name,
9473  value
9474  );
9475 
9476  break;
9477  }
9478 
9479  // Handle command GLOBAL_SET_F32
9480  case CMD_GLOBAL_SET_F32: {
9481  // Deserialize opcode
9482  FwOpcodeType _opCode = 0;
9483  _deserStatus = _msg.deserializeTo(_opCode);
9484  FW_ASSERT (
9485  _deserStatus == Fw::FW_SERIALIZE_OK,
9486  static_cast<FwAssertArgType>(_deserStatus)
9487  );
9488 
9489  // Deserialize command sequence
9490  U32 _cmdSeq = 0;
9491  _deserStatus = _msg.deserializeTo(_cmdSeq);
9492  FW_ASSERT (
9493  _deserStatus == Fw::FW_SERIALIZE_OK,
9494  static_cast<FwAssertArgType>(_deserStatus)
9495  );
9496 
9497  // Deserialize command argument buffer
9498  Fw::CmdArgBuffer args;
9499  _deserStatus = _msg.deserializeTo(args);
9500  FW_ASSERT (
9501  _deserStatus == Fw::FW_SERIALIZE_OK,
9502  static_cast<FwAssertArgType>(_deserStatus)
9503  );
9504 
9505  // Reset buffer
9506  args.resetDeser();
9507 
9508  // Deserialize argument moduleName
9509  Fw::CmdStringArg moduleName;
9510  _deserStatus = args.deserializeTo(moduleName);
9511  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9513  this->cmdResponse_out(
9514  _opCode,
9515  _cmdSeq,
9517  );
9518  }
9519  // Don't crash the task if bad arguments were passed from the ground
9520  break;
9521  }
9522 
9523  // Deserialize argument name
9524  Fw::CmdStringArg name;
9525  _deserStatus = args.deserializeTo(name);
9526  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9528  this->cmdResponse_out(
9529  _opCode,
9530  _cmdSeq,
9532  );
9533  }
9534  // Don't crash the task if bad arguments were passed from the ground
9535  break;
9536  }
9537 
9538  // Deserialize argument value
9539  F32 value;
9540  _deserStatus = args.deserializeTo(value);
9541  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9543  this->cmdResponse_out(
9544  _opCode,
9545  _cmdSeq,
9547  );
9548  }
9549  // Don't crash the task if bad arguments were passed from the ground
9550  break;
9551  }
9552 
9553  // Make sure there was no data left over.
9554  // That means the argument buffer size was incorrect.
9555 #if FW_CMD_CHECK_RESIDUAL
9556  if (args.getDeserializeSizeLeft() != 0) {
9558  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9559  }
9560  // Don't crash the task if bad arguments were passed from the ground
9561  break;
9562  }
9563 #endif
9564 
9565  // Call handler function
9567  _opCode, _cmdSeq,
9568  moduleName,
9569  name,
9570  value
9571  );
9572 
9573  break;
9574  }
9575 
9576  // Handle command GLOBAL_SET_F64
9577  case CMD_GLOBAL_SET_F64: {
9578  // Deserialize opcode
9579  FwOpcodeType _opCode = 0;
9580  _deserStatus = _msg.deserializeTo(_opCode);
9581  FW_ASSERT (
9582  _deserStatus == Fw::FW_SERIALIZE_OK,
9583  static_cast<FwAssertArgType>(_deserStatus)
9584  );
9585 
9586  // Deserialize command sequence
9587  U32 _cmdSeq = 0;
9588  _deserStatus = _msg.deserializeTo(_cmdSeq);
9589  FW_ASSERT (
9590  _deserStatus == Fw::FW_SERIALIZE_OK,
9591  static_cast<FwAssertArgType>(_deserStatus)
9592  );
9593 
9594  // Deserialize command argument buffer
9595  Fw::CmdArgBuffer args;
9596  _deserStatus = _msg.deserializeTo(args);
9597  FW_ASSERT (
9598  _deserStatus == Fw::FW_SERIALIZE_OK,
9599  static_cast<FwAssertArgType>(_deserStatus)
9600  );
9601 
9602  // Reset buffer
9603  args.resetDeser();
9604 
9605  // Deserialize argument moduleName
9606  Fw::CmdStringArg moduleName;
9607  _deserStatus = args.deserializeTo(moduleName);
9608  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9610  this->cmdResponse_out(
9611  _opCode,
9612  _cmdSeq,
9614  );
9615  }
9616  // Don't crash the task if bad arguments were passed from the ground
9617  break;
9618  }
9619 
9620  // Deserialize argument name
9621  Fw::CmdStringArg name;
9622  _deserStatus = args.deserializeTo(name);
9623  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9625  this->cmdResponse_out(
9626  _opCode,
9627  _cmdSeq,
9629  );
9630  }
9631  // Don't crash the task if bad arguments were passed from the ground
9632  break;
9633  }
9634 
9635  // Deserialize argument value
9636  F64 value;
9637  _deserStatus = args.deserializeTo(value);
9638  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9640  this->cmdResponse_out(
9641  _opCode,
9642  _cmdSeq,
9644  );
9645  }
9646  // Don't crash the task if bad arguments were passed from the ground
9647  break;
9648  }
9649 
9650  // Make sure there was no data left over.
9651  // That means the argument buffer size was incorrect.
9652 #if FW_CMD_CHECK_RESIDUAL
9653  if (args.getDeserializeSizeLeft() != 0) {
9655  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9656  }
9657  // Don't crash the task if bad arguments were passed from the ground
9658  break;
9659  }
9660 #endif
9661 
9662  // Call handler function
9664  _opCode, _cmdSeq,
9665  moduleName,
9666  name,
9667  value
9668  );
9669 
9670  break;
9671  }
9672 
9673  // Handle command GLOBAL_GET
9674  case CMD_GLOBAL_GET: {
9675  // Deserialize opcode
9676  FwOpcodeType _opCode = 0;
9677  _deserStatus = _msg.deserializeTo(_opCode);
9678  FW_ASSERT (
9679  _deserStatus == Fw::FW_SERIALIZE_OK,
9680  static_cast<FwAssertArgType>(_deserStatus)
9681  );
9682 
9683  // Deserialize command sequence
9684  U32 _cmdSeq = 0;
9685  _deserStatus = _msg.deserializeTo(_cmdSeq);
9686  FW_ASSERT (
9687  _deserStatus == Fw::FW_SERIALIZE_OK,
9688  static_cast<FwAssertArgType>(_deserStatus)
9689  );
9690 
9691  // Deserialize command argument buffer
9692  Fw::CmdArgBuffer args;
9693  _deserStatus = _msg.deserializeTo(args);
9694  FW_ASSERT (
9695  _deserStatus == Fw::FW_SERIALIZE_OK,
9696  static_cast<FwAssertArgType>(_deserStatus)
9697  );
9698 
9699  // Reset buffer
9700  args.resetDeser();
9701 
9702  // Deserialize argument moduleName
9703  Fw::CmdStringArg moduleName;
9704  _deserStatus = args.deserializeTo(moduleName);
9705  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9707  this->cmdResponse_out(
9708  _opCode,
9709  _cmdSeq,
9711  );
9712  }
9713  // Don't crash the task if bad arguments were passed from the ground
9714  break;
9715  }
9716 
9717  // Deserialize argument name
9718  Fw::CmdStringArg name;
9719  _deserStatus = args.deserializeTo(name);
9720  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9722  this->cmdResponse_out(
9723  _opCode,
9724  _cmdSeq,
9726  );
9727  }
9728  // Don't crash the task if bad arguments were passed from the ground
9729  break;
9730  }
9731 
9732  // Make sure there was no data left over.
9733  // That means the argument buffer size was incorrect.
9734 #if FW_CMD_CHECK_RESIDUAL
9735  if (args.getDeserializeSizeLeft() != 0) {
9737  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9738  }
9739  // Don't crash the task if bad arguments were passed from the ground
9740  break;
9741  }
9742 #endif
9743 
9744  // Call handler function
9745  this->GLOBAL_GET_cmdHandler(
9746  _opCode, _cmdSeq,
9747  moduleName,
9748  name
9749  );
9750 
9751  break;
9752  }
9753 
9754 
9755  // Handle signals to internal state machines
9756  case INTERNAL_STATE_MACHINE_SIGNAL:
9757  this->smDispatch(_msg);
9758  break;
9759 
9760  default:
9761  return MSG_DISPATCH_ERROR;
9762  }
9763 
9764  return MSG_DISPATCH_OK;
9765  }
9766 
9767  // ----------------------------------------------------------------------
9768  // Calls for messages received on special input ports
9769  // ----------------------------------------------------------------------
9770 
9771  void WasmSequencerComponentBase ::
9772  m_p_cmdIn_in(
9773  Fw::PassiveComponentBase* callComp,
9774  FwIndexType portNum,
9775  FwOpcodeType opCode,
9776  U32 cmdSeq,
9777  Fw::CmdArgBuffer& args
9778  )
9779  {
9780  FW_ASSERT(callComp != nullptr);
9781  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9782  compPtr->cmdIn_handlerBase(
9783  portNum,
9784  opCode,
9785  cmdSeq,
9786  args
9787  );
9788  }
9789 
9790  // ----------------------------------------------------------------------
9791  // Calls for messages received on typed input ports
9792  // ----------------------------------------------------------------------
9793 
9794  void WasmSequencerComponentBase ::
9795  m_p_checkTimers_in(
9796  Fw::PassiveComponentBase* callComp,
9797  FwIndexType portNum,
9798  U32 context
9799  )
9800  {
9801  FW_ASSERT(callComp != nullptr);
9802  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9803  compPtr->checkTimers_handlerBase(
9804  portNum,
9805  context
9806  );
9807  }
9808 
9809  void WasmSequencerComponentBase ::
9810  m_p_cmdResponseIn_in(
9811  Fw::PassiveComponentBase* callComp,
9812  FwIndexType portNum,
9813  FwOpcodeType opCode,
9814  U32 cmdSeq,
9815  const Fw::CmdResponse& response
9816  )
9817  {
9818  FW_ASSERT(callComp != nullptr);
9819  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9820  compPtr->cmdResponseIn_handlerBase(
9821  portNum,
9822  opCode,
9823  cmdSeq,
9824  response
9825  );
9826  }
9827 
9828  void WasmSequencerComponentBase ::
9829  m_p_seqCancelIn_in(
9830  Fw::PassiveComponentBase* callComp,
9831  FwIndexType portNum
9832  )
9833  {
9834  FW_ASSERT(callComp != nullptr);
9835  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9836  compPtr->seqCancelIn_handlerBase(portNum);
9837  }
9838 
9839  void WasmSequencerComponentBase ::
9840  m_p_seqRunIn_in(
9841  Fw::PassiveComponentBase* callComp,
9842  FwIndexType portNum,
9843  const Fw::StringBase& filename,
9844  const Svc::SeqArgs& args
9845  )
9846  {
9847  FW_ASSERT(callComp != nullptr);
9848  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9849  compPtr->seqRunIn_handlerBase(
9850  portNum,
9851  filename,
9852  args
9853  );
9854  }
9855 
9856  void WasmSequencerComponentBase ::
9857  m_p_writeTelemetry_in(
9858  Fw::PassiveComponentBase* callComp,
9859  FwIndexType portNum,
9860  U32 context
9861  )
9862  {
9863  FW_ASSERT(callComp != nullptr);
9864  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9865  compPtr->writeTelemetry_handlerBase(
9866  portNum,
9867  context
9868  );
9869  }
9870 
9871  // ----------------------------------------------------------------------
9872  // Calls for messages received on serial input ports
9873  // ----------------------------------------------------------------------
9874 
9875 #if FW_PORT_SERIALIZATION
9876 
9877  void WasmSequencerComponentBase ::
9878  m_p_serialIn_in(
9879  Fw::PassiveComponentBase* callComp,
9880  FwIndexType portNum,
9881  Fw::LinearBufferBase& buffer
9882  )
9883  {
9884  FW_ASSERT(callComp != nullptr);
9885  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9886  compPtr->serialIn_handlerBase(
9887  portNum,
9888  buffer
9889  );
9890  }
9891 
9892 #endif
9893 
9894 #if !FW_DIRECT_PORT_CALLS
9895 
9896  // ----------------------------------------------------------------------
9897  // Invocation functions for special output ports
9898  // ----------------------------------------------------------------------
9899 
9900  void WasmSequencerComponentBase ::
9901  cmdRegOut_out(
9902  FwIndexType portNum,
9903  FwOpcodeType opCode
9904  ) const
9905  {
9906  FW_ASSERT(
9907  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
9908  static_cast<FwAssertArgType>(portNum)
9909  );
9910 
9911  FW_ASSERT(
9912  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
9913  static_cast<FwAssertArgType>(portNum)
9914  );
9915  this->m_cmdRegOut_OutputPort[portNum].invoke(
9916  opCode
9917  );
9918  }
9919 
9920  void WasmSequencerComponentBase ::
9921  cmdResponseOut_out(
9922  FwIndexType portNum,
9923  FwOpcodeType opCode,
9924  U32 cmdSeq,
9925  const Fw::CmdResponse& response
9926  ) const
9927  {
9928  FW_ASSERT(
9929  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
9930  static_cast<FwAssertArgType>(portNum)
9931  );
9932 
9933  FW_ASSERT(
9934  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
9935  static_cast<FwAssertArgType>(portNum)
9936  );
9937  this->m_cmdResponseOut_OutputPort[portNum].invoke(
9938  opCode,
9939  cmdSeq,
9940  response
9941  );
9942  }
9943 
9944  void WasmSequencerComponentBase ::
9945  logOut_out(
9946  FwIndexType portNum,
9947  FwEventIdType id,
9948  Fw::Time& timeTag,
9949  const Fw::LogSeverity& severity,
9950  Fw::LogBuffer& args
9951  ) const
9952  {
9953  FW_ASSERT(
9954  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
9955  static_cast<FwAssertArgType>(portNum)
9956  );
9957 
9958  FW_ASSERT(
9959  this->m_logOut_OutputPort[portNum].isConnected(),
9960  static_cast<FwAssertArgType>(portNum)
9961  );
9962  this->m_logOut_OutputPort[portNum].invoke(
9963  id,
9964  timeTag,
9965  severity,
9966  args
9967  );
9968  }
9969 
9970 #if FW_ENABLE_TEXT_LOGGING
9971 
9972  void WasmSequencerComponentBase ::
9973  logTextOut_out(
9974  FwIndexType portNum,
9975  FwEventIdType id,
9976  Fw::Time& timeTag,
9977  const Fw::LogSeverity& severity,
9978  Fw::TextLogString& text
9979  ) const
9980  {
9981  FW_ASSERT(
9982  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
9983  static_cast<FwAssertArgType>(portNum)
9984  );
9985 
9986  FW_ASSERT(
9987  this->m_logTextOut_OutputPort[portNum].isConnected(),
9988  static_cast<FwAssertArgType>(portNum)
9989  );
9990  this->m_logTextOut_OutputPort[portNum].invoke(
9991  id,
9992  timeTag,
9993  severity,
9994  text
9995  );
9996  }
9997 
9998 #endif
9999 
10000  Fw::ParamValid WasmSequencerComponentBase ::
10001  prmGet_out(
10002  FwIndexType portNum,
10003  FwPrmIdType id,
10004  Fw::ParamBuffer& val
10005  ) const
10006  {
10007  FW_ASSERT(
10008  (0 <= portNum) && (portNum < this->getNum_prmGet_OutputPorts()),
10009  static_cast<FwAssertArgType>(portNum)
10010  );
10011 
10012  FW_ASSERT(
10013  this->m_prmGet_OutputPort[portNum].isConnected(),
10014  static_cast<FwAssertArgType>(portNum)
10015  );
10016  return this->m_prmGet_OutputPort[portNum].invoke(
10017  id,
10018  val
10019  );
10020  }
10021 
10022  void WasmSequencerComponentBase ::
10023  prmSet_out(
10024  FwIndexType portNum,
10025  FwPrmIdType id,
10026  Fw::ParamBuffer& val
10027  ) const
10028  {
10029  FW_ASSERT(
10030  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
10031  static_cast<FwAssertArgType>(portNum)
10032  );
10033 
10034  FW_ASSERT(
10035  this->m_prmSet_OutputPort[portNum].isConnected(),
10036  static_cast<FwAssertArgType>(portNum)
10037  );
10038  this->m_prmSet_OutputPort[portNum].invoke(
10039  id,
10040  val
10041  );
10042  }
10043 
10044  void WasmSequencerComponentBase ::
10045  timeCaller_out(
10046  FwIndexType portNum,
10047  Fw::Time& time
10048  ) const
10049  {
10050  FW_ASSERT(
10051  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
10052  static_cast<FwAssertArgType>(portNum)
10053  );
10054 
10055  FW_ASSERT(
10056  this->m_timeCaller_OutputPort[portNum].isConnected(),
10057  static_cast<FwAssertArgType>(portNum)
10058  );
10059  this->m_timeCaller_OutputPort[portNum].invoke(
10060  time
10061  );
10062  }
10063 
10064  void WasmSequencerComponentBase ::
10065  tlmOut_out(
10066  FwIndexType portNum,
10067  FwChanIdType id,
10068  Fw::Time& timeTag,
10069  Fw::TlmBuffer& val
10070  ) const
10071  {
10072  FW_ASSERT(
10073  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
10074  static_cast<FwAssertArgType>(portNum)
10075  );
10076 
10077  FW_ASSERT(
10078  this->m_tlmOut_OutputPort[portNum].isConnected(),
10079  static_cast<FwAssertArgType>(portNum)
10080  );
10081  this->m_tlmOut_OutputPort[portNum].invoke(
10082  id,
10083  timeTag,
10084  val
10085  );
10086  }
10087 
10088 #endif
10089 
10090  // ----------------------------------------------------------------------
10091  // Send signal helper functions
10092  // ----------------------------------------------------------------------
10093 
10094  void WasmSequencerComponentBase ::
10095  sendSignalStart(
10096  SmId smId,
10097  FwEnumStoreType signal,
10098  Fw::SerialBufferBase& buffer
10099  )
10100  {
10102 
10103  // Serialize the message type
10104  status = buffer.serializeFrom(static_cast<FwEnumStoreType>(INTERNAL_STATE_MACHINE_SIGNAL));
10105  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10106 
10107  // Serialize the port number
10108  status = buffer.serializeFrom(static_cast<FwIndexType>(0));
10109  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10110 
10111  // Serialize the state machine ID
10112  status = buffer.serializeFrom(static_cast<FwEnumStoreType>(smId));
10113  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10114 
10115  // Serialize the signal
10116  status = buffer.serializeFrom(static_cast<FwEnumStoreType>(signal));
10117  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10118  }
10119 
10120  void WasmSequencerComponentBase ::
10121  controller_sendSignalFinish(Fw::LinearBufferBase& buffer)
10122  {
10123  // Send message
10125  Os::Queue::Status qStatus = this->m_queue.send(buffer, 0, _block);
10126 
10127  FW_ASSERT(
10128  qStatus == Os::Queue::OP_OK,
10129  static_cast<FwAssertArgType>(qStatus)
10130  );
10131  }
10132 
10133  void WasmSequencerComponentBase ::
10134  interpreter_sendSignalFinish(Fw::LinearBufferBase& buffer)
10135  {
10136  // Send message
10138  Os::Queue::Status qStatus = this->m_queue.send(buffer, 0, _block);
10139 
10140  FW_ASSERT(
10141  qStatus == Os::Queue::OP_OK,
10142  static_cast<FwAssertArgType>(qStatus)
10143  );
10144  }
10145 
10146  // ----------------------------------------------------------------------
10147  // Helper functions for state machine dispatch
10148  // ----------------------------------------------------------------------
10149 
10150  void WasmSequencerComponentBase ::
10151  smDispatch(Fw::SerialBufferBase& buffer)
10152  {
10153  // Deserialize the state machine ID and signal
10154  FwEnumStoreType storedSmId;
10155  FwEnumStoreType storedSignal;
10156  WasmSequencerComponentBase::deserializeSmIdAndSignal(buffer, storedSmId, storedSignal);
10157 
10158  // Select the target state machine instance
10159  const SmId smId = static_cast<SmId>(storedSmId);
10160  switch (smId) {
10161  case SmId::controller: {
10163  this->Svc_WasmSequencer_ControllerStateMachine_smDispatch(buffer, this->m_stateMachine_controller, signal);
10164  break;
10165  }
10166  case SmId::interpreter: {
10168  this->Svc_WasmSequencer_InterpreterStateMachine_smDispatch(buffer, this->m_stateMachine_interpreter, signal);
10169  break;
10170  }
10171  default:
10172  FW_ASSERT(false, static_cast<FwAssertArgType>(smId));
10173  break;
10174  }
10175  }
10176 
10177  void WasmSequencerComponentBase ::
10178  deserializeSmIdAndSignal(
10179  Fw::SerialBufferBase& buffer,
10180  FwEnumStoreType& smId,
10181  FwEnumStoreType& signal
10182  )
10183  {
10184  // Move deserialization beyond the message type and port number
10185  Fw::SerializeStatus status =
10186  buffer.moveDeserToOffset(ComponentIpcSerializableBuffer::DATA_OFFSET);
10187  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10188 
10189  // Deserialize the state machine ID
10190  status = buffer.deserializeTo(smId);
10191  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10192 
10193  // Deserialize the signal
10194  status = buffer.deserializeTo(signal);
10195  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10196  }
10197 
10198  void WasmSequencerComponentBase ::
10199  Svc_WasmSequencer_ControllerStateMachine_smDispatch(
10200  Fw::SerialBufferBase& buffer,
10201  Svc_WasmSequencer_ControllerStateMachine& sm,
10203  )
10204  {
10205  switch (signal) {
10207  // Deserialize the data
10209  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10210  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10211  // Assert no data left in buffer
10212  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10213  // Call the sendSignal function for sm and run
10214  sm.sendSignal_run(value);
10215  break;
10216  }
10218  // Deserialize the data
10220  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10221  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10222  // Assert no data left in buffer
10223  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10224  // Call the sendSignal function for sm and load
10225  sm.sendSignal_load(value);
10226  break;
10227  }
10229  // Deserialize the data
10231  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10232  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10233  // Assert no data left in buffer
10234  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10235  // Call the sendSignal function for sm and invoke
10236  sm.sendSignal_invoke(value);
10237  break;
10238  }
10240  // Deserialize the data
10242  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10243  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10244  // Assert no data left in buffer
10245  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10246  // Call the sendSignal function for sm and invoked
10247  sm.sendSignal_invoked(value);
10248  break;
10249  }
10251  // Deserialize the data
10253  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10254  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10255  // Assert no data left in buffer
10256  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10257  // Call the sendSignal function for sm and invokeFailed
10258  sm.sendSignal_invokeFailed(value);
10259  break;
10260  }
10262  // Assert no data left in buffer
10263  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10264  // Call the sendSignal function for sm and cancel
10265  sm.sendSignal_cancel();
10266  break;
10267  }
10269  // Deserialize the data
10271  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10272  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10273  // Assert no data left in buffer
10274  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10275  // Call the sendSignal function for sm and loadSucceeded
10276  sm.sendSignal_loadSucceeded(value);
10277  break;
10278  }
10280  // Deserialize the data
10282  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10283  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10284  // Assert no data left in buffer
10285  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10286  // Call the sendSignal function for sm and loadFailed
10287  sm.sendSignal_loadFailed(value);
10288  break;
10289  }
10291  // Deserialize the data
10293  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10294  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10295  // Assert no data left in buffer
10296  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10297  // Call the sendSignal function for sm and engineFinished
10298  sm.sendSignal_engineFinished(value);
10299  break;
10300  }
10301  default:
10302  FW_ASSERT(false, static_cast<FwAssertArgType>(signal));
10303  break;
10304  }
10305  }
10306 
10307  void WasmSequencerComponentBase ::
10308  Svc_WasmSequencer_InterpreterStateMachine_smDispatch(
10309  Fw::SerialBufferBase& buffer,
10310  Svc_WasmSequencer_InterpreterStateMachine& sm,
10312  )
10313  {
10314  switch (signal) {
10316  // Assert no data left in buffer
10317  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10318  // Call the sendSignal function for sm and cmd_CONTINUE
10319  sm.sendSignal_cmd_CONTINUE();
10320  break;
10321  }
10323  // Deserialize the data
10325  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10326  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10327  // Assert no data left in buffer
10328  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10329  // Call the sendSignal function for sm and cmdCancel
10330  sm.sendSignal_cmdCancel(value);
10331  break;
10332  }
10334  // Assert no data left in buffer
10335  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10336  // Call the sendSignal function for sm and cancel
10337  sm.sendSignal_cancel();
10338  break;
10339  }
10341  // Assert no data left in buffer
10342  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10343  // Call the sendSignal function for sm and entered
10344  sm.sendSignal_entered();
10345  break;
10346  }
10348  // Deserialize the data
10350  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10351  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10352  // Assert no data left in buffer
10353  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10354  // Call the sendSignal function for sm and run
10355  sm.sendSignal_run(value);
10356  break;
10357  }
10359  // Assert no data left in buffer
10360  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10361  // Call the sendSignal function for sm and checkTimers
10362  sm.sendSignal_checkTimers();
10363  break;
10364  }
10366  // Assert no data left in buffer
10367  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10368  // Call the sendSignal function for sm and hostResume
10369  sm.sendSignal_hostResume();
10370  break;
10371  }
10373  // Deserialize the data
10374  I32 value;
10375  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10376  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10377  // Assert no data left in buffer
10378  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10379  // Call the sendSignal function for sm and hostResumeI32
10380  sm.sendSignal_hostResumeI32(value);
10381  break;
10382  }
10384  // Assert no data left in buffer
10385  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10386  // Call the sendSignal function for sm and hostResponseFailure
10387  sm.sendSignal_hostResponseFailure();
10388  break;
10389  }
10391  // Deserialize the data
10393  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10394  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10395  // Assert no data left in buffer
10396  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10397  // Call the sendSignal function for sm and hostResponseUnexpected
10398  sm.sendSignal_hostResponseUnexpected(value);
10399  break;
10400  }
10402  // Assert no data left in buffer
10403  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10404  // Call the sendSignal function for sm and hostResponseTimeIncomparable
10405  sm.sendSignal_hostResponseTimeIncomparable();
10406  break;
10407  }
10409  // Assert no data left in buffer
10410  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10411  // Call the sendSignal function for sm and hostResponseTimeout
10412  sm.sendSignal_hostResponseTimeout();
10413  break;
10414  }
10416  // Deserialize the data
10417  FwIndexType value;
10418  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10419  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10420  // Assert no data left in buffer
10421  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10422  // Call the sendSignal function for sm and serialInMessage
10423  sm.sendSignal_serialInMessage(value);
10424  break;
10425  }
10427  // Deserialize the data
10428  I32 value;
10429  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10430  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10431  // Assert no data left in buffer
10432  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10433  // Call the sendSignal function for sm and interpreterFinished
10434  sm.sendSignal_interpreterFinished(value);
10435  break;
10436  }
10438  // Deserialize the data
10440  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10441  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10442  // Assert no data left in buffer
10443  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10444  // Call the sendSignal function for sm and interpreterTrap
10445  sm.sendSignal_interpreterTrap(value);
10446  break;
10447  }
10449  // Assert no data left in buffer
10450  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10451  // Call the sendSignal function for sm and interpreterOutOfFuel
10452  sm.sendSignal_interpreterOutOfFuel();
10453  break;
10454  }
10456  // Assert no data left in buffer
10457  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10458  // Call the sendSignal function for sm and interpreterHostFunctionNeedsPause
10459  sm.sendSignal_interpreterHostFunctionNeedsPause();
10460  break;
10461  }
10462  default:
10463  FW_ASSERT(false, static_cast<FwAssertArgType>(signal));
10464  break;
10465  }
10466  }
10467 
10468  // ----------------------------------------------------------------------
10469  // Parameter set functions
10470  // ----------------------------------------------------------------------
10471 
10472  Fw::CmdResponse WasmSequencerComponentBase ::
10473  paramSet_HOST_FUNCTION_TIMEOUT_SECS(Fw::SerialBufferBase& val)
10474  {
10475  F32 _localVal{};
10476  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
10477  if (_stat != Fw::FW_SERIALIZE_OK) {
10479  }
10480 
10481  // Assign value only if successfully deserialized
10482  this->m_paramLock.lock();
10483  this->m_HOST_FUNCTION_TIMEOUT_SECS = _localVal;
10484  this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid = Fw::ParamValid::VALID;
10485  this->m_paramLock.unlock();
10486 
10487  // Call notifier
10489  return Fw::CmdResponse::OK;
10490  }
10491 
10492  Fw::CmdResponse WasmSequencerComponentBase ::
10493  paramSet_INSTRUCTION_FUEL(Fw::SerialBufferBase& val)
10494  {
10495  FwSizeType _localVal{};
10496  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
10497  if (_stat != Fw::FW_SERIALIZE_OK) {
10499  }
10500 
10501  // Assign value only if successfully deserialized
10502  this->m_paramLock.lock();
10503  this->m_INSTRUCTION_FUEL = _localVal;
10504  this->m_param_INSTRUCTION_FUEL_valid = Fw::ParamValid::VALID;
10505  this->m_paramLock.unlock();
10506 
10507  // Call notifier
10509  return Fw::CmdResponse::OK;
10510  }
10511 
10512  Fw::CmdResponse WasmSequencerComponentBase ::
10513  paramSet_SEQ_BASE_DIR(Fw::SerialBufferBase& val)
10514  {
10515  Fw::ParamString _localVal{};
10516  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
10517  if (_stat != Fw::FW_SERIALIZE_OK) {
10519  }
10520 
10521  // Assign value only if successfully deserialized
10522  this->m_paramLock.lock();
10523  this->m_SEQ_BASE_DIR = _localVal;
10524  this->m_param_SEQ_BASE_DIR_valid = Fw::ParamValid::VALID;
10525  this->m_paramLock.unlock();
10526 
10527  // Call notifier
10529  return Fw::CmdResponse::OK;
10530  }
10531 
10532  // ----------------------------------------------------------------------
10533  // Parameter save functions
10534  // ----------------------------------------------------------------------
10535 
10536  Fw::CmdResponse WasmSequencerComponentBase ::
10537  paramSave_HOST_FUNCTION_TIMEOUT_SECS()
10538  {
10539  if (!this->isConnected_prmSet_OutputPort(0)) {
10541  }
10542  Fw::ParamBuffer _paramBuffer;
10543  const FwIdType idBase = this->getIdBase();
10545  // Serialize the parameter
10546  this->m_paramLock.lock();
10547  if ((this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid == Fw::ParamValid::VALID) || (this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid == Fw::ParamValid::DEFAULT)) {
10548  _stat = _paramBuffer.serializeFrom(m_HOST_FUNCTION_TIMEOUT_SECS);
10549  }
10550  this->m_paramLock.unlock();
10551  if (_stat != Fw::FW_SERIALIZE_OK) {
10553  }
10554  // Save the parameter
10555  this->prmSet_out(
10556  0,
10557  static_cast<FwPrmIdType>(idBase + PARAMID_HOST_FUNCTION_TIMEOUT_SECS),
10558  _paramBuffer
10559  );
10560  // Return the command response
10561  return Fw::CmdResponse::OK;
10562  }
10563 
10564  Fw::CmdResponse WasmSequencerComponentBase ::
10565  paramSave_INSTRUCTION_FUEL()
10566  {
10567  if (!this->isConnected_prmSet_OutputPort(0)) {
10569  }
10570  Fw::ParamBuffer _paramBuffer;
10571  const FwIdType idBase = this->getIdBase();
10573  // Serialize the parameter
10574  this->m_paramLock.lock();
10575  if ((this->m_param_INSTRUCTION_FUEL_valid == Fw::ParamValid::VALID) || (this->m_param_INSTRUCTION_FUEL_valid == Fw::ParamValid::DEFAULT)) {
10576  _stat = _paramBuffer.serializeFrom(m_INSTRUCTION_FUEL);
10577  }
10578  this->m_paramLock.unlock();
10579  if (_stat != Fw::FW_SERIALIZE_OK) {
10581  }
10582  // Save the parameter
10583  this->prmSet_out(
10584  0,
10585  static_cast<FwPrmIdType>(idBase + PARAMID_INSTRUCTION_FUEL),
10586  _paramBuffer
10587  );
10588  // Return the command response
10589  return Fw::CmdResponse::OK;
10590  }
10591 
10592  Fw::CmdResponse WasmSequencerComponentBase ::
10593  paramSave_SEQ_BASE_DIR()
10594  {
10595  if (!this->isConnected_prmSet_OutputPort(0)) {
10597  }
10598  Fw::ParamBuffer _paramBuffer;
10599  const FwIdType idBase = this->getIdBase();
10601  // Serialize the parameter
10602  this->m_paramLock.lock();
10603  if ((this->m_param_SEQ_BASE_DIR_valid == Fw::ParamValid::VALID) || (this->m_param_SEQ_BASE_DIR_valid == Fw::ParamValid::DEFAULT)) {
10604  _stat = _paramBuffer.serializeFrom(m_SEQ_BASE_DIR);
10605  }
10606  this->m_paramLock.unlock();
10607  if (_stat != Fw::FW_SERIALIZE_OK) {
10609  }
10610  // Save the parameter
10611  this->prmSet_out(
10612  0,
10613  static_cast<FwPrmIdType>(idBase + PARAMID_SEQ_BASE_DIR),
10614  _paramBuffer
10615  );
10616  // Return the command response
10617  return Fw::CmdResponse::OK;
10618  }
10619 
10620 }
void log_ACTIVITY_LO_LogActivityLo(const Fw::StringBase &msg) const
An ACTIVITY_HI event emitted by the guest program.
Serialization/Deserialization operation was successful.
static constexpr FwIndexType getNum_serialIn_InputPorts()
void interpreter_sendSignal_hostResumeI32(I32 value)
Send signal hostResumeI32 to state machine interpreter.
void controller_sendSignal_loadFailed(const Svc::WasmSequencer_RequestContext &value)
Send signal loadFailed to state machine controller.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
Fw::ParamValid getParam_out(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke output port getParam.
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
Definition: ComPortAc.cpp:181
void init()
Initialization function.
Definition: ComPortAc.cpp:162
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
void checkTimers_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port checkTimers.
void invoke(const Fw::StringBase &filename, const Svc::SeqArgs &args) const
Invoke a port connection.
A function has been invoked, run the interpreter to completion.
void log_WARNING_HI_HostFunctionInvalidId(const Svc::WasmSequencer_HostFunction &host_function, I64 id) const
void log_WARNING_HI_ModuleStartInvokeFailed(const Svc::WasmSequencer_Status &status) const
No sequence is running so we cannot continue from a pause.
Invoke a main function from a loaded module.
void cmdResponseIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port cmdResponseIn.
void tlmWrite_SequencesSucceeded(U64 arg, Fw::Time _tlmTime=Fw::Time())
virtual void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port cmdResponseIn.
Called on CANCEL cmd. Raised in LOADING, READY and RUNNING modes.
FwIdType FwOpcodeType
The type of a command opcode.
A WARNING_LO event emitted by the guest program.
Operation succeeded.
Definition: Os.hpp:27
void GLOBAL_SET_F32_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_WARNING_LO_CmdResponseFromOldSequence(FwOpcodeType opcode, const Fw::CmdResponse &response, U16 oldSequenceIdx, U16 currentSequenceIdx) const
void log_WARNING_HI_SequenceTrapped(Svc::WasmSequencer_ModuleIdx index, const Svc::WasmSequencer_SequencePhase &phase, const Svc::WasmSequencer_TrapReason &reason) const
static constexpr FwSizeType CAPACITY
virtual void GLOBAL_SET_I64_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command GLOBAL_SET_I64.
void log_WARNING_HI_InvalidBlockingTypeValue(I32 invalidValue) const
Log event InvalidBlockingTypeValue.
PlatformSizeType FwSizeType
Auto-generated base for WasmSequencer component.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
virtual void lock()
Lock the guarded mutex.
I32 FwEnumStoreType
void WAIT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void controller_sendSignal_engineFinished(const Svc::WasmSequencer_RequestContext &value)
Send signal engineFinished to state machine controller.
void log_ACTIVITY_LO_GlobalValueF32(const Fw::StringBase &module_name, const Fw::StringBase &globalName, F32 value) const
Log event GlobalValueF32.
void set_getTlmChan_OutputPort(FwIndexType portNum, Fw::InputTlmGetPort *port)
Connect port to getTlmChan[portNum].
Status
status returned from the queue send function
Definition: Queue.hpp:30
virtual void GLOBAL_GET_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &moduleName, const Fw::CmdStringArg &name)=0
void log_ACTIVITY_HI_LogActivityHi(const Fw::StringBase &msg) const
void tlmWrite_InterpreterState(const Svc::WasmSequencer_InterpreterStateMachine_State &arg, Fw::Time _tlmTime=Fw::Time())
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
called when an unexpected or incorrect host-function response comes in. only raised in the RUNNING st...
void init()
Initialization function.
Tracks the currently executing host function.
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
void log_WARNING_HI_SequenceFilePathNotContained(const Fw::StringBase &baseDir, const Fw::StringBase &fileName) const
StringTemplate< FW_FIXED_LENGTH_STRING_SIZE > String
Definition: String.hpp:14
Svc_WasmSequencer_InterpreterStateMachine(WasmSequencerComponentBase &component)
Constructor.
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
virtual void LOAD_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, const Fw::CmdStringArg &name)=0
FwIdType FwPrmIdType
The type of a parameter identifier.
void CONTINUE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void interpreter_sendSignal_entered()
Send signal entered to state machine interpreter.
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
void addCallPort(InputPrmSetPort *callPort)
Register an input port.
void addCallPort(InputTlmGetPort *callPort)
Register an input port.
bool isConnected_getTlmChan_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_prmSet_OutputPorts()
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
void interpreter_sendSignal_serialInMessage(const FwIndexType &value)
Send signal serialInMessage to state machine interpreter.
void seqCancelIn_handlerBase(FwIndexType portNum)
Handler base-class function for input port seqCancelIn.
const Time ZERO_TIME
Definition: Time.cpp:5
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void GLOBAL_SET_I32_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
static constexpr FwIndexType getNum_cmdOut_OutputPorts()
Signal to AWAITING_RESPONSE to resume the interpreter with no host function return value...
Signal emited inside the laod action when module load fails.
void set_seqDoneOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to seqDoneOut[portNum].
void log_WARNING_HI_FileOpenError(const Fw::StringBase &fileName, I32 status) const
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
void log_WARNING_LO_ControllerBusy(const Svc::WasmSequencer_SignalSource &signalSource, const Svc::WasmSequencer_ControllerStateMachine_State &state) const
static constexpr FwIndexType getNum_seqStartOut_OutputPorts()
Enum representing a command response.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
FwSizeType paramGet_INSTRUCTION_FUEL(Fw::ParamValid &valid)
void regCommands()
Register commands with the Command Dispatcher.
An ACTIVITY_LO event emitted by the guest program.
bool isConnected_getParam_OutputPort(FwIndexType portNum) const
virtual SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG)=0
Serialize an 8-bit unsigned integer value.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
virtual void PAUSE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void init()
Initialization function.
void log_WARNING_LO_MemoryGrowRejected(const Svc::WasmSequencer_MemoryGrowFailReason &reason, U64 requestedSize) const
Os::Queue m_queue
queue object for active component
void log_WARNING_HI_HostFunctionInvalidPointer(const Svc::WasmSequencer_HostFunction &host_function, const Svc::WasmSequencer_Status &code) const
Log event HostFunctionInvalidPointer.
Software diagnostic events.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void addCallPort(InputPrmGetPort *callPort)
Register an input port.
void init()
Object initializer.
Definition: ObjBase.cpp:24
The size of the serial representation.
void RUN_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
SerializeStatus
forward declaration for string
void controller_sendSignal_cancel()
Send signal cancel to state machine controller.
static constexpr FwIndexType getNum_getTlmChan_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
float F32
32-bit floating point
Definition: BasicTypes.h:84
called on CONTINUE cmd. only raised in RUNNING.PAUSED state
virtual SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG)=0
Deserialize an 8-bit unsigned integer value.
Message will block until space is available.
Definition: Queue.hpp:47
void unlock()
alias for unLock to meet BasicLockable requirements
Definition: Mutex.hpp:64
void log_ACTIVITY_LO_GlobalValueI32(const Fw::StringBase &module_name, const Fw::StringBase &globalName, I32 value) const
Log event GlobalValueI32.
void set_prmGet_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGet[portNum].
void log_DIAGNOSTIC_StoreAllocationSucceeded(U16 moduleCount) const
void interpreter_sendSignal_cmd_CONTINUE()
Send signal cmd_CONTINUE to state machine interpreter.
void log_WARNING_HI_SequencePanic(Svc::WasmSequencer_ModuleIdx index, const Svc::WasmSequencer_SequencePhase &phase, I32 code) const
void log_WARNING_HI_HostFunctionInvalidPort(const Svc::WasmSequencer_HostFunction &host_function, I32 index, U32 numPorts) const
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
void GLOBAL_SET_I64_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual ~WasmSequencerComponentBase()
Destroy WasmSequencerComponentBase object.
FwIdType FwEventIdType
The type of an event identifier.
called when a paused host function (F´ command) unsuccessfully executed. only raised in RUNNING...
static constexpr FwIndexType getNum_cmdResponseIn_InputPorts()
Svc_WasmSequencer_ControllerStateMachine::State controller_getState() const
Get the state of state machine instance controller.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
virtual void WAIT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
bool isConnected_prmSet_OutputPort(FwIndexType portNum) const
virtual void parameterUpdated(FwPrmIdType id)
Called whenever a parameter is updated.
void controller_sendSignal_load(const Svc::WasmSequencer_LoadRequest &value)
Send signal load to state machine controller.
void cmdOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port cmdOut.
Fw::TlmValid invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Wait for the interpreter to finish and return it&#39;s result as a CmdResponse.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
void init()
Initialization function.
Definition: TimePortAc.cpp:151
Data was the wrong format (e.g. wrong packet type)
virtual void unLock()
Unlock the guarded mutex.
void interpreter_sendSignal_interpreterHostFunctionNeedsPause()
Send signal interpreterHostFunctionNeedsPause to state machine interpreter.
Svc::InputSchedPort * get_writeTelemetry_InputPort(FwIndexType portNum)
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void seqDoneOut_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke output port seqDoneOut.
Signal to AWAITING_RESPONSE to resume the interpreter with an i32 host function return value...
void init()
Initialization function.
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:99
void controller_sendSignal_loadSucceeded(const Svc::WasmSequencer_RequestContext &value)
Send signal loadSucceeded to state machine controller.
void loadParameters()
Load the parameters from a parameter source.
A less serious but recoverable event.
Fw::ParamValid invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Failed to open the requested Wasm module file.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
ActiveComponentBase(const char *name)
Constructor.
virtual void GLOBAL_GET_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command GLOBAL_GET.
static constexpr FwIndexType getNum_seqCancelIn_InputPorts()
bool isConnected_seqDoneOut_OutputPort(FwIndexType portNum) const
bool isConnected_serialOut_OutputPort(FwIndexType portNum) const
void interpreter_sendSignal_hostResponseUnexpected(const Svc::WasmSequencer_HostFunction &value)
Send signal hostResponseUnexpected to state machine interpreter.
void tlmWrite_LastTrapReason(const Svc::WasmSequencer_TrapReason &arg, Fw::Time _tlmTime=Fw::Time())
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
WasmSequencerComponentBase(const char *compName="")
Construct WasmSequencerComponentBase object.
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
A command was issued in a state where it is not valid.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
virtual void CONTINUE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CONTINUE.
Fw::InputSerializePort * get_serialIn_InputPort(FwIndexType portNum)
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void interpreter_sendSignal_hostResponseFailure()
Send signal hostResponseFailure to state machine interpreter.
virtual void GLOBAL_SET_F32_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &moduleName, const Fw::CmdStringArg &name, F32 value)=0
WasmSequencerComponentBase::SmId getId() const
Get the state machine id.
Fw::InputCmdResponsePort * get_cmdResponseIn_InputPort(FwIndexType portNum)
void log_WARNING_HI_SequenceExited(Svc::WasmSequencer_ModuleIdx index, const Svc::WasmSequencer_SequencePhase &phase, I32 code) const
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
Sequencer blocking state.
void init()
Initialization function.
void log_ACTIVITY_LO_GlobalValueF64(const Fw::StringBase &module_name, const Fw::StringBase &globalName, F64 value) const
Log event GlobalValueF64.
void log_WARNING_HI_LogWarningHi(const Fw::StringBase &msg) const
void interpreter_sendSignal_interpreterFinished(I32 value)
Send signal interpreterFinished to state machine interpreter.
static constexpr FwIndexType getNum_seqRunIn_InputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
virtual void writeTelemetry_handler(FwIndexType portNum, U32 context)=0
Handler for input port writeTelemetry.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
void interpreter_sendSignal_hostResume()
Send signal hostResume to state machine interpreter.
void log_WARNING_LO_GlobalSetFailed(const Fw::StringBase &module_name, const Fw::StringBase &globalName, const Svc::WasmSequencer_Status &reason) const
Log event GlobalSetFailed.
WasmSequencerComponentBase::SmId getId() const
Get the state machine id.
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
void log_WARNING_HI_ModuleLoadFailed(const Svc::WasmSequencer_Status &status) const
A string backed by an external buffer.
A serious but recoverable event.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
const char * toChar() const
Convert to a C-style char*.
void log_WARNING_HI_HostFunctionInvalidSeverity(I32 raw, const Fw::StringBase &msg) const
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
Signal sent from command to load a Wasm module but not execute it.
void interpreter_sendSignal_hostResponseTimeout()
Send signal hostResponseTimeout to state machine interpreter.
void log_WARNING_HI_SerialInFrameTooLarge(U32 portIndex, U32 size, U32 maxSize) const
The size of the serial representation.
void GLOBAL_SET_F64_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Signal emited inside of the load action when a module load succeeds.
void tlmWrite_SequencesFailed(U64 arg, Fw::Time _tlmTime=Fw::Time())
#define PRI_FwIndexType
Which phase of a module&#39;s execution a sequence-completion event refers to.
Fw::SerializeStatus serialOut_out(FwIndexType portNum, Fw::LinearBufferBase &buffer)
Invoke output port serialOut.
static constexpr FwIndexType getNum_writeTelemetry_InputPorts()
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
Command successfully executed.
virtual void GLOBAL_SET_I32_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &moduleName, const Fw::CmdStringArg &name, I32 value)=0
void set_prmSet_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSet[portNum].
virtual void checkTimers_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port checkTimers.
void tlmWrite_ControllerState(const Svc::WasmSequencer_ControllerStateMachine_State &arg, Fw::Time _tlmTime=Fw::Time())
void set_seqStartOut_OutputPort(FwIndexType portNum, Svc::InputCmdSeqInPort *port)
Connect port to seqStartOut[portNum].
Fw::TlmValid getTlmChan_out(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke output port getTlmChan.
bool isConnected_seqStartOut_OutputPort(FwIndexType portNum) const
virtual Serializable::SizeType getDeserializeSizeLeft() const =0
Get remaining deserialization buffer size.
void log_ACTIVITY_HI_SequenceStarting(Svc::WasmSequencer_ModuleIdx index) const
void setPortNum(FwIndexType portNum)
void log_ACTIVITY_LO_GlobalValueI64(const Fw::StringBase &module_name, const Fw::StringBase &globalName, I64 value) const
Log event GlobalValueI64.
F32 paramGet_HOST_FUNCTION_TIMEOUT_SECS(Fw::ParamValid &valid)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
Svc_WasmSequencer_InterpreterStateMachine::State interpreter_getState() const
Get the state of state machine instance interpreter.
static constexpr FwSizeType CAPACITY
BlockingType
message type
Definition: Queue.hpp:46
void log_WARNING_LO_LogWarningLo(const Fw::StringBase &msg) const
Svc::InputSchedPort * get_checkTimers_InputPort(FwIndexType portNum)
void init(WasmSequencerComponentBase::SmId smId)
Initialize the state machine.
An asynchronous host function has been called and has requested the interpreter pause.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
A guest serial port host function requested a port index outside the configured range.
virtual void RUN_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, const Svc::BlockState &block, const Svc::SeqArgs &seqArgs)=0
void log_WARNING_HI_BufferTooLarge(const Svc::WasmSequencer_HostFunction &host_function, U32 size, U32 maxSize) const
virtual void writeTelemetry_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port writeTelemetry.
Command failed to deserialize.
void interpreter_sendSignal_checkTimers()
Send signal checkTimers to state machine interpreter.
A WARNING_HI event emitted by the guest program.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
static constexpr FwIndexType getNum_serialOut_OutputPorts()
Command had execution error.
Important informational events.
void controller_sendSignal_run(const Svc::WasmSequencer_LoadRequest &value)
Send signal run to state machine controller.
A command was issued in a state where it is not valid.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:79
void interpreter_sendSignal_interpreterTrap(const Svc::WasmSequencer_TrapReason &value)
Send signal interpreterTrap to state machine interpreter.
void tlmWrite_SeqName(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
Svc::InputCmdSeqCancelPort * get_seqCancelIn_InputPort(FwIndexType portNum)
virtual void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args)=0
Handler for input port seqRunIn.
void init()
Initialization function.
The interpreter aborted the sequence with a byte-code trap.
WasmSequencer_InterpreterStateMachineStateMachineBase::State getState() const
Get the state.
static constexpr FwIndexType getNum_prmGet_OutputPorts()
Fw::ParamString paramGet_SEQ_BASE_DIR(Fw::ParamValid &valid)
void interpreter_sendSignal_run(const Svc::WasmSequencer_RequestContext &value)
Send signal run to state machine interpreter.
void tlmWrite_CommandsFailed(U64 arg, Fw::Time _tlmTime=Fw::Time())
void log_ACTIVITY_HI_SequenceSucceeded(Svc::WasmSequencer_ModuleIdx index) const
void init()
Initialization function.
virtual void CONTINUE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void log_WARNING_HI_SequenceHostFailure(Svc::WasmSequencer_ModuleIdx index, const Svc::WasmSequencer_SequencePhase &phase, const Svc::WasmSequencer_ExitReason &reason, const Svc::WasmSequencer_HostFunction &hostFunction) const
A sequence is starting after the main entrypoint was invoked.
A message was sent requesting an exit of the loop.
virtual void seqRunIn_preMsgHook(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args)
Pre-message hook for async input port seqRunIn.
static constexpr FwIndexType getNum_logOut_OutputPorts()
void interpreter_sendSignal_hostResponseTimeIncomparable()
Send signal hostResponseTimeIncomparable to state machine interpreter.
void log_WARNING_LO_ModuleNotFound(const Fw::StringBase &module_name) const
void writeTelemetry_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port writeTelemetry.
void log_WARNING_HI_WrongCmdResponseIndex(FwOpcodeType opcode, const Fw::CmdResponse &response, U16 actualCmdIdx, U16 expectedCmdIdx) const
PlatformIndexType FwIndexType
The interpreter store was allocated with capacity for the given number of modules.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
WasmSequencer_ControllerStateMachineStateMachineBase::State getState() const
Get the state.
void log_WARNING_HI_InvalidModuleEntrypoint(Svc::WasmSequencer_ModuleIdx moduleIdx, const Svc::WasmSequencer_Status &status) const
Log event InvalidModuleEntrypoint.
void log_WARNING_LO_GlobalGetFailed(const Fw::StringBase &module_name, const Fw::StringBase &globalName, const Svc::WasmSequencer_Status &reason) const
Log event GlobalGetFailed.
void tlmWrite_SequencesCancelled(U64 arg, Fw::Time _tlmTime=Fw::Time())
double F64
64-bit floating point (double). Required for compiler-supplied double promotion.
Definition: BasicTypes.h:86
void log_WARNING_HI_ModuleMainInvokeFailed(const Svc::WasmSequencer_Status &status) const
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
void addCallPort(InputCmdSeqInPort *callPort)
Register an input port.
virtual void GLOBAL_SET_F64_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command GLOBAL_SET_F64.
void seqStartOut_out(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args) const
Invoke output port seqStartOut.
A module failed to decode/validate while loading.
virtual void cmdResponseIn_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port cmdResponseIn.
void init()
Initialization function.
void set_cmdOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to cmdOut[portNum].
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void incNumMsgDropped()
increment the number of messages dropped
Svc_WasmSequencer_ControllerStateMachine(WasmSequencerComponentBase &component)
Constructor.
void interpreter_sendSignal_interpreterOutOfFuel()
Send signal interpreterOutOfFuel to state machine interpreter.
void serialIn_handlerBase(FwIndexType portNum, Fw::LinearBufferBase &buffer)
Handler base-class function for input port serialIn.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
Command failed validation.
RateGroupDivider component implementation.
void CANCEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
A guest host function supplied a buffer too small to hold the host value being returned.
message sent/received okay
Definition: Queue.hpp:31
Enum representing parameter validity.
U8 BYTE
byte type
Definition: BasicTypes.h:57
void log_ACTIVITY_HI_SequenceCancelled(Svc::WasmSequencer_ModuleIdx index, const Svc::WasmSequencer_SequencePhase &phase) const
void controller_sendSignal_invoked(const Svc::WasmSequencer_RequestContext &value)
Send signal invoked to state machine controller.
void init(WasmSequencerComponentBase::SmId smId)
Initialize the state machine.
void invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port connection.
void seqRunIn_handlerBase(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args)
Handler base-class function for input port seqRunIn.
void log_DIAGNOSTIC_LogDiagnostic(const Fw::StringBase &msg) const
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:168
void INVOKE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_getParam_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to getParam[portNum].
Called on CANCEL cmd. Raised in LOADING, READY and RUNNING modes.
virtual void RUN_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RUN.
void PAUSE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void LOAD_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
LinearBufferTemplate< FW_SM_SIGNAL_BUFFER_MAX_SIZE > SmSignalBuffer
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
void log_WARNING_HI_SleepDurationTooLarge(const Svc::WasmSequencer_HostFunction &host_function, U64 micros) const
message to exit active component task
Implementation of malloc based allocator.
virtual void LOAD_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command LOAD.
static constexpr FwIndexType getNum_checkTimers_InputPorts()
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
void log_WARNING_HI_SequenceFilePathTooLong(const Fw::StringBase &baseDir, const Fw::StringBase &fileName) const
virtual void PAUSE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command PAUSE.
Failed to find a loaded module with the requested name.
Corresponds to spacewasm_status_t.
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
virtual void CANCEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void init()
Initialization function.
virtual void GLOBAL_SET_F64_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &moduleName, const Fw::CmdStringArg &name, F64 value)=0
virtual void GLOBAL_SET_I64_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &moduleName, const Fw::CmdStringArg &name, I64 value)=0
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void controller_sendSignal_invokeFailed(const Svc::WasmSequencer_RequestContext &value)
Send signal invokeFailed to state machine controller.
void init()
Initialization function.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
void interpreter_sendSignal_cancel()
Send signal cancel to state machine interpreter.
Signal emitted by processInvoke when the requested module was resolved successfully.
A struct holding the context needed to reply to a command request.
void interpreter_sendSignal_cmdCancel(const Svc::WasmSequencer_CommandRequest &value)
Send signal cmdCancel to state machine interpreter.
virtual SerializeStatus moveDeserToOffset(FwSizeType offset)=0
Move deserialization pointer to specified offset.
virtual void serialIn_handler(FwIndexType portNum, Fw::LinearBufferBase &buffer)=0
Handler for input port serialIn.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
virtual void INVOKE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command INVOKE.
FpySequencer_SequencerStateMachineStateMachineBase::Signal Signal
bool isConnected_prmGet_OutputPort(FwIndexType portNum) const
#define FW_ASSERT(...)
Definition: Assert.hpp:14
virtual void GLOBAL_SET_I32_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command GLOBAL_SET_I32.
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
bool isConnected_cmdOut_OutputPort(FwIndexType portNum) const
Svc::InputCmdSeqInPort * get_seqRunIn_InputPort(FwIndexType portNum)
void log_WARNING_HI_SerialPortSendFailed(const Svc::WasmSequencer_HostFunction &host_function, I32 status) const
Why a guest memory.grow request could not be serviced by the guest bump allocator.
void controller_sendSignal_invoke(const Svc::WasmSequencer_InvokeRequest &value)
Send signal invoke to state machine controller.
virtual void checkTimers_handler(FwIndexType portNum, U32 context)=0
Handler for input port checkTimers.
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
virtual void INVOKE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &module, const Svc::BlockState &block, const Svc::SeqArgs &seqArgs)=0
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
void GLOBAL_GET_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
virtual void WAIT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command WAIT.
A guest host function supplied a buffer larger than the host maximum for that call.
virtual void parametersLoaded()
Called whenever parameters are loaded.
Svc::WasmSequencer_ControllerStateMachine_State State
The state type.
virtual void GLOBAL_SET_F32_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command GLOBAL_SET_F32.
U32 FwIdType
The id type.
A DIAGNOSTIC event emitted by the guest program.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]
void tlmWrite_CommandsDispatched(U64 arg, Fw::Time _tlmTime=Fw::Time())
static constexpr FwIndexType getNum_getParam_OutputPorts()
void log_WARNING_HI_BufferTooSmall(const Svc::WasmSequencer_HostFunction &host_function, U32 size, U32 valueSize) const
static constexpr FwIndexType getNum_seqDoneOut_OutputPorts()
virtual void seqCancelIn_handler(FwIndexType portNum)=0
Handler for input port seqCancelIn.