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/Prm/ParamValid.hpp"
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
14 
15 namespace Svc {
16 
17  namespace {
18 
19  // Constant definitions for the state machine signal buffer
20  namespace SmSignalBuffer {
21 
22  // Union for computing the max size of a signal type
23  union SignalTypeUnion {
24  BYTE size_of_I16[sizeof(I16)];
25  BYTE size_of_I32[sizeof(I32)];
26  BYTE size_of_Svc_WasmSequencer_CommandRequest[Svc::WasmSequencer_CommandRequest::SERIALIZED_SIZE];
27  BYTE size_of_Svc_WasmSequencer_HostFunction[Svc::WasmSequencer_HostFunction::SERIALIZED_SIZE];
28  BYTE size_of_Svc_WasmSequencer_InvokeRequest[Svc::WasmSequencer_InvokeRequest::SERIALIZED_SIZE];
29  BYTE size_of_Svc_WasmSequencer_LoadRequest[Svc::WasmSequencer_LoadRequest::SERIALIZED_SIZE];
30  BYTE size_of_Svc_WasmSequencer_RequestContext[Svc::WasmSequencer_RequestContext::SERIALIZED_SIZE];
31  BYTE size_of_Svc_WasmSequencer_TrapReason[Svc::WasmSequencer_TrapReason::SERIALIZED_SIZE];
32  };
33 
34  // The serialized size
35  static constexpr FwSizeType SERIALIZED_SIZE =
36  2 * sizeof(FwEnumStoreType) +
37  sizeof(SignalTypeUnion);
38 
39  }
40 
41  enum MsgTypeEnum {
42  WASMSEQUENCER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
43  CHECKTIMERS_SCHED,
44  CMDRESPONSEIN_CMDRESPONSE,
45  SEQRUNIN_CMDSEQIN,
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  INT_IF_WRITETELEMETRYINTERNAL,
58  INTERNAL_STATE_MACHINE_SIGNAL,
59  };
60 
61  // Get the max size by constructing a union of the async input, command, and
62  // internal port serialization sizes
63  union BuffUnion {
64  BYTE checkTimersPortSize[Svc::SchedPortBuffer::CAPACITY];
65  BYTE cmdResponseInPortSize[Fw::CmdResponsePortBuffer::CAPACITY];
66  BYTE seqRunInPortSize[Svc::CmdSeqInPortBuffer::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  this->parameterLoaded(PARAMID_HOST_FUNCTION_TIMEOUT_SECS, this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid);
1730 
1731  _id = _baseId + PARAMID_INSTRUCTION_FUEL;
1732 
1733  // Get serialized parameter INSTRUCTION_FUEL
1734  this->m_param_INSTRUCTION_FUEL_valid = this->prmGet_out(
1735  0,
1736  _id,
1737  _paramBuffer
1738  );
1739 
1740  this->m_paramLock.lock();
1741 
1742  // Deserialize parameter or use default value
1743  if (this->m_param_INSTRUCTION_FUEL_valid == Fw::ParamValid::VALID) {
1744  _stat = _paramBuffer.deserializeTo(this->m_INSTRUCTION_FUEL);
1745  if (_stat != Fw::FW_SERIALIZE_OK) {
1746  this->m_param_INSTRUCTION_FUEL_valid = Fw::ParamValid::DEFAULT;
1747  }
1748  }
1749  else {
1750  this->m_param_INSTRUCTION_FUEL_valid = Fw::ParamValid::DEFAULT;
1751  }
1752  if (this->m_param_INSTRUCTION_FUEL_valid == Fw::ParamValid::DEFAULT) {
1753  this->m_INSTRUCTION_FUEL = 1000;
1754  }
1755 
1756  this->m_paramLock.unlock();
1757  this->parameterLoaded(PARAMID_INSTRUCTION_FUEL, this->m_param_INSTRUCTION_FUEL_valid);
1758 
1759  _id = _baseId + PARAMID_SEQ_BASE_DIR;
1760 
1761  // Get serialized parameter SEQ_BASE_DIR
1762  this->m_param_SEQ_BASE_DIR_valid = this->prmGet_out(
1763  0,
1764  _id,
1765  _paramBuffer
1766  );
1767 
1768  this->m_paramLock.lock();
1769 
1770  // Deserialize parameter or use default value
1771  if (this->m_param_SEQ_BASE_DIR_valid == Fw::ParamValid::VALID) {
1772  _stat = _paramBuffer.deserializeTo(this->m_SEQ_BASE_DIR);
1773  if (_stat != Fw::FW_SERIALIZE_OK) {
1774  this->m_param_SEQ_BASE_DIR_valid = Fw::ParamValid::DEFAULT;
1775  }
1776  }
1777  else {
1778  this->m_param_SEQ_BASE_DIR_valid = Fw::ParamValid::DEFAULT;
1779  }
1780  if (this->m_param_SEQ_BASE_DIR_valid == Fw::ParamValid::DEFAULT) {
1781  this->m_SEQ_BASE_DIR = Fw::String("");
1782  }
1783 
1784  this->m_paramLock.unlock();
1785  this->parameterLoaded(PARAMID_SEQ_BASE_DIR, this->m_param_SEQ_BASE_DIR_valid);
1786 
1787  // Call notifier
1788  this->parametersLoaded();
1789  }
1790 
1791  // ----------------------------------------------------------------------
1792  // Component construction and destruction
1793  // ----------------------------------------------------------------------
1794 
1796  WasmSequencerComponentBase(const char* compName) :
1797  Fw::ActiveComponentBase(compName),
1798  m_stateMachine_controller(*this),
1799  m_stateMachine_interpreter(*this)
1800  {
1801 
1802  }
1803 
1806  {
1807 
1808  }
1809 
1810 #if !FW_DIRECT_PORT_CALLS
1811 
1812  // ----------------------------------------------------------------------
1813  // Connection status queries for special output ports
1814  // ----------------------------------------------------------------------
1815 
1818  {
1819  FW_ASSERT(
1820  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1821  static_cast<FwAssertArgType>(portNum)
1822  );
1823 
1824  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1825  }
1826 
1829  {
1830  FW_ASSERT(
1831  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1832  static_cast<FwAssertArgType>(portNum)
1833  );
1834 
1835  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1836  }
1837 
1840  {
1841  FW_ASSERT(
1842  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1843  static_cast<FwAssertArgType>(portNum)
1844  );
1845 
1846  return this->m_logOut_OutputPort[portNum].isConnected();
1847  }
1848 
1849 #if FW_ENABLE_TEXT_LOGGING == 1
1850 
1851  bool WasmSequencerComponentBase ::
1852  isConnected_logTextOut_OutputPort(FwIndexType portNum) const
1853  {
1854  FW_ASSERT(
1855  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1856  static_cast<FwAssertArgType>(portNum)
1857  );
1858 
1859  return this->m_logTextOut_OutputPort[portNum].isConnected();
1860  }
1861 
1862 #endif
1863 
1866  {
1867  FW_ASSERT(
1868  (0 <= portNum) && (portNum < this->getNum_prmGet_OutputPorts()),
1869  static_cast<FwAssertArgType>(portNum)
1870  );
1871 
1872  return this->m_prmGet_OutputPort[portNum].isConnected();
1873  }
1874 
1877  {
1878  FW_ASSERT(
1879  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
1880  static_cast<FwAssertArgType>(portNum)
1881  );
1882 
1883  return this->m_prmSet_OutputPort[portNum].isConnected();
1884  }
1885 
1888  {
1889  FW_ASSERT(
1890  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1891  static_cast<FwAssertArgType>(portNum)
1892  );
1893 
1894  return this->m_timeCaller_OutputPort[portNum].isConnected();
1895  }
1896 
1899  {
1900  FW_ASSERT(
1901  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1902  static_cast<FwAssertArgType>(portNum)
1903  );
1904 
1905  return this->m_tlmOut_OutputPort[portNum].isConnected();
1906  }
1907 
1908 #endif
1909 
1910 #if !FW_DIRECT_PORT_CALLS
1911 
1912  // ----------------------------------------------------------------------
1913  // Connection status queries for typed output ports
1914  // ----------------------------------------------------------------------
1915 
1918  {
1919  FW_ASSERT(
1920  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
1921  static_cast<FwAssertArgType>(portNum)
1922  );
1923 
1924  return this->m_cmdOut_OutputPort[portNum].isConnected();
1925  }
1926 
1929  {
1930  FW_ASSERT(
1931  (0 <= portNum) && (portNum < this->getNum_getParam_OutputPorts()),
1932  static_cast<FwAssertArgType>(portNum)
1933  );
1934 
1935  return this->m_getParam_OutputPort[portNum].isConnected();
1936  }
1937 
1940  {
1941  FW_ASSERT(
1942  (0 <= portNum) && (portNum < this->getNum_getTlmChan_OutputPorts()),
1943  static_cast<FwAssertArgType>(portNum)
1944  );
1945 
1946  return this->m_getTlmChan_OutputPort[portNum].isConnected();
1947  }
1948 
1951  {
1952  FW_ASSERT(
1953  (0 <= portNum) && (portNum < this->getNum_seqDoneOut_OutputPorts()),
1954  static_cast<FwAssertArgType>(portNum)
1955  );
1956 
1957  return this->m_seqDoneOut_OutputPort[portNum].isConnected();
1958  }
1959 
1962  {
1963  FW_ASSERT(
1964  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1965  static_cast<FwAssertArgType>(portNum)
1966  );
1967 
1968  return this->m_seqStartOut_OutputPort[portNum].isConnected();
1969  }
1970 
1971 #endif
1972 
1973 #if !FW_DIRECT_PORT_CALLS
1974 
1975  // ----------------------------------------------------------------------
1976  // Connection status queries for serial output ports
1977  // ----------------------------------------------------------------------
1978 
1981  {
1982  FW_ASSERT(
1983  (0 <= portNum) && (portNum < this->getNum_serialOut_OutputPorts()),
1984  static_cast<FwAssertArgType>(portNum)
1985  );
1986 
1987  return this->m_serialOut_OutputPort[portNum].isConnected();
1988  }
1989 
1990 #endif
1991 
1992  // ----------------------------------------------------------------------
1993  // Port handler base-class functions for special input ports
1994  //
1995  // Call these functions directly to bypass the corresponding ports
1996  // ----------------------------------------------------------------------
1997 
2000  FwIndexType portNum,
2001  FwOpcodeType opCode,
2002  U32 cmdSeq,
2003  Fw::CmdArgBuffer& args
2004  )
2005  {
2006 
2007  const U32 idBase = this->getIdBase();
2008  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
2009 
2010  // Select base class function based on opcode
2011  switch (opCode - idBase) {
2012  case OPCODE_RUN: {
2013  this->RUN_cmdHandlerBase(
2014  opCode,
2015  cmdSeq,
2016  args
2017  );
2018  break;
2019  }
2020 
2021  case OPCODE_LOAD: {
2022  this->LOAD_cmdHandlerBase(
2023  opCode,
2024  cmdSeq,
2025  args
2026  );
2027  break;
2028  }
2029 
2030  case OPCODE_INVOKE: {
2031  this->INVOKE_cmdHandlerBase(
2032  opCode,
2033  cmdSeq,
2034  args
2035  );
2036  break;
2037  }
2038 
2039  case OPCODE_WAIT: {
2040  this->WAIT_cmdHandlerBase(
2041  opCode,
2042  cmdSeq,
2043  args
2044  );
2045  break;
2046  }
2047 
2048  case OPCODE_CANCEL: {
2049  this->CANCEL_cmdHandlerBase(
2050  opCode,
2051  cmdSeq,
2052  args
2053  );
2054  break;
2055  }
2056 
2057  case OPCODE_PAUSE: {
2058  this->PAUSE_cmdHandlerBase(
2059  opCode,
2060  cmdSeq,
2061  args
2062  );
2063  break;
2064  }
2065 
2066  case OPCODE_CONTINUE: {
2068  opCode,
2069  cmdSeq,
2070  args
2071  );
2072  break;
2073  }
2074 
2075  case OPCODE_GLOBAL_SET_I32: {
2077  opCode,
2078  cmdSeq,
2079  args
2080  );
2081  break;
2082  }
2083 
2084  case OPCODE_GLOBAL_SET_I64: {
2086  opCode,
2087  cmdSeq,
2088  args
2089  );
2090  break;
2091  }
2092 
2093  case OPCODE_GLOBAL_SET_F32: {
2095  opCode,
2096  cmdSeq,
2097  args
2098  );
2099  break;
2100  }
2101 
2102  case OPCODE_GLOBAL_SET_F64: {
2104  opCode,
2105  cmdSeq,
2106  args
2107  );
2108  break;
2109  }
2110 
2111  case OPCODE_GLOBAL_GET: {
2113  opCode,
2114  cmdSeq,
2115  args
2116  );
2117  break;
2118  }
2119 
2121  Fw::CmdResponse _cstat = this->paramSet_HOST_FUNCTION_TIMEOUT_SECS(args);
2122  this->cmdResponse_out(
2123  opCode,
2124  cmdSeq,
2125  _cstat
2126  );
2127  break;
2128  }
2129 
2131  Fw::CmdResponse _cstat = this->paramSave_HOST_FUNCTION_TIMEOUT_SECS();
2132  this->cmdResponse_out(
2133  opCode,
2134  cmdSeq,
2135  _cstat
2136  );
2137  break;
2138  }
2139 
2141  Fw::CmdResponse _cstat = this->paramSet_INSTRUCTION_FUEL(args);
2142  this->cmdResponse_out(
2143  opCode,
2144  cmdSeq,
2145  _cstat
2146  );
2147  break;
2148  }
2149 
2151  Fw::CmdResponse _cstat = this->paramSave_INSTRUCTION_FUEL();
2152  this->cmdResponse_out(
2153  opCode,
2154  cmdSeq,
2155  _cstat
2156  );
2157  break;
2158  }
2159 
2160  case OPCODE_SEQ_BASE_DIR_SET: {
2161  Fw::CmdResponse _cstat = this->paramSet_SEQ_BASE_DIR(args);
2162  this->cmdResponse_out(
2163  opCode,
2164  cmdSeq,
2165  _cstat
2166  );
2167  break;
2168  }
2169 
2170  case OPCODE_SEQ_BASE_DIR_SAVE: {
2171  Fw::CmdResponse _cstat = this->paramSave_SEQ_BASE_DIR();
2172  this->cmdResponse_out(
2173  opCode,
2174  cmdSeq,
2175  _cstat
2176  );
2177  break;
2178  }
2179  default:
2180  // Unknown opcode: ignore it
2181  break;
2182  }
2183  }
2184 
2185  // ----------------------------------------------------------------------
2186  // Port handler base-class functions for typed input ports
2187  //
2188  // Call these functions directly to bypass the corresponding ports
2189  // ----------------------------------------------------------------------
2190 
2193  FwIndexType portNum,
2194  U32 context
2195  )
2196  {
2197  // Make sure port number is valid
2198  FW_ASSERT(
2199  (0 <= portNum) && (portNum < this->getNum_checkTimers_InputPorts()),
2200  static_cast<FwAssertArgType>(portNum)
2201  );
2202 
2203  // Call pre-message hook
2205  portNum,
2206  context
2207  );
2208  ComponentIpcSerializableBuffer msg;
2210 
2211  // Serialize message ID
2212  _status = msg.serializeFrom(
2213  static_cast<FwEnumStoreType>(CHECKTIMERS_SCHED)
2214  );
2215  FW_ASSERT(
2216  _status == Fw::FW_SERIALIZE_OK,
2217  static_cast<FwAssertArgType>(_status)
2218  );
2219 
2220  // Serialize port number
2221  _status = msg.serializeFrom(portNum);
2222  FW_ASSERT(
2223  _status == Fw::FW_SERIALIZE_OK,
2224  static_cast<FwAssertArgType>(_status)
2225  );
2226 
2227  // Serialize argument context
2228  _status = msg.serializeFrom(context);
2229  FW_ASSERT(
2230  _status == Fw::FW_SERIALIZE_OK,
2231  static_cast<FwAssertArgType>(_status)
2232  );
2233 
2234  // Send message
2236  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2237 
2238  FW_ASSERT(
2239  qStatus == Os::Queue::OP_OK,
2240  static_cast<FwAssertArgType>(qStatus)
2241  );
2242  }
2243 
2246  FwIndexType portNum,
2247  FwOpcodeType opCode,
2248  U32 cmdSeq,
2249  const Fw::CmdResponse& response
2250  )
2251  {
2252  // Make sure port number is valid
2253  FW_ASSERT(
2254  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
2255  static_cast<FwAssertArgType>(portNum)
2256  );
2257 
2258  // Call pre-message hook
2260  portNum,
2261  opCode,
2262  cmdSeq,
2263  response
2264  );
2265  ComponentIpcSerializableBuffer msg;
2267 
2268  // Serialize message ID
2269  _status = msg.serializeFrom(
2270  static_cast<FwEnumStoreType>(CMDRESPONSEIN_CMDRESPONSE)
2271  );
2272  FW_ASSERT(
2273  _status == Fw::FW_SERIALIZE_OK,
2274  static_cast<FwAssertArgType>(_status)
2275  );
2276 
2277  // Serialize port number
2278  _status = msg.serializeFrom(portNum);
2279  FW_ASSERT(
2280  _status == Fw::FW_SERIALIZE_OK,
2281  static_cast<FwAssertArgType>(_status)
2282  );
2283 
2284  // Serialize argument opCode
2285  _status = msg.serializeFrom(opCode);
2286  FW_ASSERT(
2287  _status == Fw::FW_SERIALIZE_OK,
2288  static_cast<FwAssertArgType>(_status)
2289  );
2290 
2291  // Serialize argument cmdSeq
2292  _status = msg.serializeFrom(cmdSeq);
2293  FW_ASSERT(
2294  _status == Fw::FW_SERIALIZE_OK,
2295  static_cast<FwAssertArgType>(_status)
2296  );
2297 
2298  // Serialize argument response
2299  _status = msg.serializeFrom(response);
2300  FW_ASSERT(
2301  _status == Fw::FW_SERIALIZE_OK,
2302  static_cast<FwAssertArgType>(_status)
2303  );
2304 
2305  // Send message
2307  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2308 
2309  FW_ASSERT(
2310  qStatus == Os::Queue::OP_OK,
2311  static_cast<FwAssertArgType>(qStatus)
2312  );
2313  }
2314 
2317  {
2318  // Make sure port number is valid
2319  FW_ASSERT(
2320  (0 <= portNum) && (portNum < this->getNum_seqCancelIn_InputPorts()),
2321  static_cast<FwAssertArgType>(portNum)
2322  );
2323 
2324  // Call handler function
2325  this->seqCancelIn_handler(portNum);
2326  }
2327 
2330  FwIndexType portNum,
2331  const Fw::StringBase& filename,
2332  const Svc::SeqArgs& args
2333  )
2334  {
2335  // Make sure port number is valid
2336  FW_ASSERT(
2337  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
2338  static_cast<FwAssertArgType>(portNum)
2339  );
2340 
2341  // Call pre-message hook
2343  portNum,
2344  filename,
2345  args
2346  );
2347  ComponentIpcSerializableBuffer msg;
2349 
2350  // Serialize message ID
2351  _status = msg.serializeFrom(
2352  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
2353  );
2354  FW_ASSERT(
2355  _status == Fw::FW_SERIALIZE_OK,
2356  static_cast<FwAssertArgType>(_status)
2357  );
2358 
2359  // Serialize port number
2360  _status = msg.serializeFrom(portNum);
2361  FW_ASSERT(
2362  _status == Fw::FW_SERIALIZE_OK,
2363  static_cast<FwAssertArgType>(_status)
2364  );
2365 
2366  // Serialize argument filename
2367  _status = filename.serializeTo(msg, 240);
2368  FW_ASSERT(
2369  _status == Fw::FW_SERIALIZE_OK,
2370  static_cast<FwAssertArgType>(_status)
2371  );
2372 
2373  // Serialize argument args
2374  _status = msg.serializeFrom(args);
2375  FW_ASSERT(
2376  _status == Fw::FW_SERIALIZE_OK,
2377  static_cast<FwAssertArgType>(_status)
2378  );
2379 
2380  // Send message
2382  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2383 
2384  FW_ASSERT(
2385  qStatus == Os::Queue::OP_OK,
2386  static_cast<FwAssertArgType>(qStatus)
2387  );
2388  }
2389 
2392  FwIndexType portNum,
2393  U32 context
2394  )
2395  {
2396  // Make sure port number is valid
2397  FW_ASSERT(
2398  (0 <= portNum) && (portNum < this->getNum_writeTelemetry_InputPorts()),
2399  static_cast<FwAssertArgType>(portNum)
2400  );
2401 
2402  // Call handler function
2403  this->writeTelemetry_handler(
2404  portNum,
2405  context
2406  );
2407  }
2408 
2409  // ----------------------------------------------------------------------
2410  // Port handler base-class functions for serial input ports
2411  //
2412  // Call these functions directly to bypass the corresponding ports
2413  // ----------------------------------------------------------------------
2414 
2417  FwIndexType portNum,
2418  Fw::LinearBufferBase& buffer
2419  )
2420  {
2421  // Make sure port number is valid
2422  FW_ASSERT(
2423  (0 <= portNum) && (portNum < this->getNum_serialIn_InputPorts()),
2424  static_cast<FwAssertArgType>(portNum)
2425  );
2426 
2427  // Lock guard mutex before calling
2428  this->lock();
2429 
2430  // Call handler function
2431  this->serialIn_handler(
2432  portNum,
2433  buffer
2434  );
2435 
2436  // Unlock guard mutex
2437  this->unLock();
2438  }
2439 
2440  // ----------------------------------------------------------------------
2441  // Pre-message hooks for typed async input ports
2442  //
2443  // Each of these functions is invoked just before processing a message
2444  // on the corresponding port. By default, they do nothing. You can
2445  // override them to provide specific pre-message behavior.
2446  // ----------------------------------------------------------------------
2447 
2450  FwIndexType portNum,
2451  U32 context
2452  )
2453  {
2454  // Default: no-op
2455  }
2456 
2459  FwIndexType portNum,
2460  FwOpcodeType opCode,
2461  U32 cmdSeq,
2462  const Fw::CmdResponse& response
2463  )
2464  {
2465  // Default: no-op
2466  }
2467 
2470  FwIndexType portNum,
2471  const Fw::StringBase& filename,
2472  const Svc::SeqArgs& args
2473  )
2474  {
2475  // Default: no-op
2476  }
2477 
2478 #if !FW_DIRECT_PORT_CALLS
2479 
2480  // ----------------------------------------------------------------------
2481  // Invocation functions for typed output ports
2482  // ----------------------------------------------------------------------
2483 
2486  FwIndexType portNum,
2487  Fw::ComBuffer& data,
2488  U32 context
2489  ) const
2490  {
2491  FW_ASSERT(
2492  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
2493  static_cast<FwAssertArgType>(portNum)
2494  );
2495 
2496  FW_ASSERT(
2497  this->m_cmdOut_OutputPort[portNum].isConnected(),
2498  static_cast<FwAssertArgType>(portNum)
2499  );
2500  this->m_cmdOut_OutputPort[portNum].invoke(
2501  data,
2502  context
2503  );
2504  }
2505 
2508  FwIndexType portNum,
2509  FwPrmIdType id,
2510  Fw::ParamBuffer& val
2511  ) const
2512  {
2513  FW_ASSERT(
2514  (0 <= portNum) && (portNum < this->getNum_getParam_OutputPorts()),
2515  static_cast<FwAssertArgType>(portNum)
2516  );
2517 
2518  FW_ASSERT(
2519  this->m_getParam_OutputPort[portNum].isConnected(),
2520  static_cast<FwAssertArgType>(portNum)
2521  );
2522  return this->m_getParam_OutputPort[portNum].invoke(
2523  id,
2524  val
2525  );
2526  }
2527 
2530  FwIndexType portNum,
2531  FwChanIdType id,
2532  Fw::Time& timeTag,
2533  Fw::TlmBuffer& val
2534  ) const
2535  {
2536  FW_ASSERT(
2537  (0 <= portNum) && (portNum < this->getNum_getTlmChan_OutputPorts()),
2538  static_cast<FwAssertArgType>(portNum)
2539  );
2540 
2541  FW_ASSERT(
2542  this->m_getTlmChan_OutputPort[portNum].isConnected(),
2543  static_cast<FwAssertArgType>(portNum)
2544  );
2545  return this->m_getTlmChan_OutputPort[portNum].invoke(
2546  id,
2547  timeTag,
2548  val
2549  );
2550  }
2551 
2554  FwIndexType portNum,
2555  FwOpcodeType opCode,
2556  U32 cmdSeq,
2557  const Fw::CmdResponse& response
2558  ) const
2559  {
2560  FW_ASSERT(
2561  (0 <= portNum) && (portNum < this->getNum_seqDoneOut_OutputPorts()),
2562  static_cast<FwAssertArgType>(portNum)
2563  );
2564 
2565  FW_ASSERT(
2566  this->m_seqDoneOut_OutputPort[portNum].isConnected(),
2567  static_cast<FwAssertArgType>(portNum)
2568  );
2569  this->m_seqDoneOut_OutputPort[portNum].invoke(
2570  opCode,
2571  cmdSeq,
2572  response
2573  );
2574  }
2575 
2578  FwIndexType portNum,
2579  const Fw::StringBase& filename,
2580  const Svc::SeqArgs& args
2581  ) const
2582  {
2583  FW_ASSERT(
2584  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
2585  static_cast<FwAssertArgType>(portNum)
2586  );
2587 
2588  FW_ASSERT(
2589  this->m_seqStartOut_OutputPort[portNum].isConnected(),
2590  static_cast<FwAssertArgType>(portNum)
2591  );
2592  this->m_seqStartOut_OutputPort[portNum].invoke(
2593  filename,
2594  args
2595  );
2596  }
2597 
2598 #endif
2599 
2600 #if !FW_DIRECT_PORT_CALLS
2601 
2602  // ----------------------------------------------------------------------
2603  // Invocation functions for serial output ports
2604  // ----------------------------------------------------------------------
2605 
2608  FwIndexType portNum,
2609  Fw::LinearBufferBase& buffer
2610  )
2611  {
2612  FW_ASSERT(
2613  (0 <= portNum) && (portNum < this->getNum_serialOut_OutputPorts()),
2614  static_cast<FwAssertArgType>(portNum)
2615  );
2616 
2617  FW_ASSERT(
2618  this->m_serialOut_OutputPort[portNum].isConnected(),
2619  static_cast<FwAssertArgType>(portNum)
2620  );
2621  return this->m_serialOut_OutputPort[portNum].invokeSerial(
2622  buffer
2623  );
2624  }
2625 
2626 #endif
2627 
2628  // ----------------------------------------------------------------------
2629  // Hooks for internal ports
2630  //
2631  // Each of these functions is invoked just before dropping a message
2632  // on the corresponding internal port. You should override them to provide
2633  // specific drop behavior.
2634  // ----------------------------------------------------------------------
2635 
2636  // ----------------------------------------------------------------------
2637  // Internal interface base-class functions
2638  // ----------------------------------------------------------------------
2639 
2642  {
2643  ComponentIpcSerializableBuffer msg;
2645 
2646  // Serialize the message ID
2647  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(INT_IF_WRITETELEMETRYINTERNAL));
2648  FW_ASSERT (
2649  _status == Fw::FW_SERIALIZE_OK,
2650  static_cast<FwAssertArgType>(_status)
2651  );
2652 
2653  // Fake port number to make message dequeue work
2654  _status = msg.serializeFrom(static_cast<FwIndexType>(0));
2655  FW_ASSERT (
2656  _status == Fw::FW_SERIALIZE_OK,
2657  static_cast<FwAssertArgType>(_status)
2658  );
2659 
2660  // Send message
2662  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2663 
2664  if (qStatus == Os::Queue::Status::FULL) {
2666  return;
2667  }
2668 
2669  FW_ASSERT(
2670  qStatus == Os::Queue::OP_OK,
2671  static_cast<FwAssertArgType>(qStatus)
2672  );
2673  }
2674 
2675  // ----------------------------------------------------------------------
2676  // State getter functions
2677  // ----------------------------------------------------------------------
2678 
2681  {
2682  return this->m_stateMachine_controller.getState();
2683  }
2684 
2687  {
2688  return this->m_stateMachine_interpreter.getState();
2689  }
2690 
2691  // ----------------------------------------------------------------------
2692  // Signal send functions
2693  // ----------------------------------------------------------------------
2694 
2697  {
2698  ComponentIpcSerializableBuffer buffer;
2699  // Serialize the message type, port number, state ID, and signal
2700  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::run), buffer);
2701  // Serialize the signal data
2702  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2703  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2704  // Send the message and handle overflow
2705  this->controller_sendSignalFinish(buffer);
2706  }
2707 
2710  {
2711  ComponentIpcSerializableBuffer buffer;
2712  // Serialize the message type, port number, state ID, and signal
2713  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::load), buffer);
2714  // Serialize the signal data
2715  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2716  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2717  // Send the message and handle overflow
2718  this->controller_sendSignalFinish(buffer);
2719  }
2720 
2723  {
2724  ComponentIpcSerializableBuffer buffer;
2725  // Serialize the message type, port number, state ID, and signal
2726  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::invoke), buffer);
2727  // Serialize the signal data
2728  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2729  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2730  // Send the message and handle overflow
2731  this->controller_sendSignalFinish(buffer);
2732  }
2733 
2736  {
2737  ComponentIpcSerializableBuffer buffer;
2738  // Serialize the message type, port number, state ID, and signal
2739  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::invoked), buffer);
2740  // Serialize the signal data
2741  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2742  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2743  // Send the message and handle overflow
2744  this->controller_sendSignalFinish(buffer);
2745  }
2746 
2749  {
2750  ComponentIpcSerializableBuffer buffer;
2751  // Serialize the message type, port number, state ID, and signal
2752  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::invokeFailed), buffer);
2753  // Serialize the signal data
2754  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2755  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2756  // Send the message and handle overflow
2757  this->controller_sendSignalFinish(buffer);
2758  }
2759 
2762  {
2763  ComponentIpcSerializableBuffer buffer;
2764  // Serialize the message type, port number, state ID, and signal
2765  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::cancel), buffer);
2766  // Send the message and handle overflow
2767  this->controller_sendSignalFinish(buffer);
2768  }
2769 
2772  {
2773  ComponentIpcSerializableBuffer buffer;
2774  // Serialize the message type, port number, state ID, and signal
2775  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::loadSucceeded), buffer);
2776  // Serialize the signal data
2777  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2778  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2779  // Send the message and handle overflow
2780  this->controller_sendSignalFinish(buffer);
2781  }
2782 
2785  {
2786  ComponentIpcSerializableBuffer buffer;
2787  // Serialize the message type, port number, state ID, and signal
2788  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::loadFailed), buffer);
2789  // Serialize the signal data
2790  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2791  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2792  // Send the message and handle overflow
2793  this->controller_sendSignalFinish(buffer);
2794  }
2795 
2798  {
2799  ComponentIpcSerializableBuffer buffer;
2800  // Serialize the message type, port number, state ID, and signal
2801  this->sendSignalStart(SmId::controller, static_cast<FwEnumStoreType>(Svc_WasmSequencer_ControllerStateMachine::Signal::engineFinished), buffer);
2802  // Serialize the signal data
2803  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2804  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2805  // Send the message and handle overflow
2806  this->controller_sendSignalFinish(buffer);
2807  }
2808 
2811  {
2812  ComponentIpcSerializableBuffer buffer;
2813  // Serialize the message type, port number, state ID, and signal
2814  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::cmd_CONTINUE), buffer);
2815  // Send the message and handle overflow
2816  this->interpreter_sendSignalFinish(buffer);
2817  }
2818 
2821  {
2822  ComponentIpcSerializableBuffer buffer;
2823  // Serialize the message type, port number, state ID, and signal
2824  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::cmdCancel), buffer);
2825  // Serialize the signal data
2826  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2827  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2828  // Send the message and handle overflow
2829  this->interpreter_sendSignalFinish(buffer);
2830  }
2831 
2834  {
2835  ComponentIpcSerializableBuffer buffer;
2836  // Serialize the message type, port number, state ID, and signal
2837  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::cancel), buffer);
2838  // Send the message and handle overflow
2839  this->interpreter_sendSignalFinish(buffer);
2840  }
2841 
2844  {
2845  ComponentIpcSerializableBuffer buffer;
2846  // Serialize the message type, port number, state ID, and signal
2847  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::entered), buffer);
2848  // Send the message and handle overflow
2849  this->interpreter_sendSignalFinish(buffer);
2850  }
2851 
2854  {
2855  ComponentIpcSerializableBuffer buffer;
2856  // Serialize the message type, port number, state ID, and signal
2857  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::run), buffer);
2858  // Serialize the signal data
2859  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2860  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2861  // Send the message and handle overflow
2862  this->interpreter_sendSignalFinish(buffer);
2863  }
2864 
2867  {
2868  ComponentIpcSerializableBuffer buffer;
2869  // Serialize the message type, port number, state ID, and signal
2870  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::checkTimers), buffer);
2871  // Send the message and handle overflow
2872  this->interpreter_sendSignalFinish(buffer);
2873  }
2874 
2877  {
2878  ComponentIpcSerializableBuffer buffer;
2879  // Serialize the message type, port number, state ID, and signal
2880  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResume), buffer);
2881  // Send the message and handle overflow
2882  this->interpreter_sendSignalFinish(buffer);
2883  }
2884 
2887  {
2888  ComponentIpcSerializableBuffer buffer;
2889  // Serialize the message type, port number, state ID, and signal
2890  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResumeI32), buffer);
2891  // Serialize the signal data
2892  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2893  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2894  // Send the message and handle overflow
2895  this->interpreter_sendSignalFinish(buffer);
2896  }
2897 
2900  {
2901  ComponentIpcSerializableBuffer buffer;
2902  // Serialize the message type, port number, state ID, and signal
2903  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResponseFailure), buffer);
2904  // Send the message and handle overflow
2905  this->interpreter_sendSignalFinish(buffer);
2906  }
2907 
2910  {
2911  ComponentIpcSerializableBuffer buffer;
2912  // Serialize the message type, port number, state ID, and signal
2913  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResponseUnexpected), buffer);
2914  // Serialize the signal data
2915  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2916  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2917  // Send the message and handle overflow
2918  this->interpreter_sendSignalFinish(buffer);
2919  }
2920 
2923  {
2924  ComponentIpcSerializableBuffer buffer;
2925  // Serialize the message type, port number, state ID, and signal
2926  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResponseTimeIncomparable), buffer);
2927  // Send the message and handle overflow
2928  this->interpreter_sendSignalFinish(buffer);
2929  }
2930 
2933  {
2934  ComponentIpcSerializableBuffer buffer;
2935  // Serialize the message type, port number, state ID, and signal
2936  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::hostResponseTimeout), buffer);
2937  // Send the message and handle overflow
2938  this->interpreter_sendSignalFinish(buffer);
2939  }
2940 
2943  {
2944  ComponentIpcSerializableBuffer buffer;
2945  // Serialize the message type, port number, state ID, and signal
2946  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::serialInMessage), buffer);
2947  // Serialize the signal data
2948  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2949  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2950  // Send the message and handle overflow
2951  this->interpreter_sendSignalFinish(buffer);
2952  }
2953 
2956  {
2957  ComponentIpcSerializableBuffer buffer;
2958  // Serialize the message type, port number, state ID, and signal
2959  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::interpreterFinished), buffer);
2960  // Serialize the signal data
2961  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2962  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2963  // Send the message and handle overflow
2964  this->interpreter_sendSignalFinish(buffer);
2965  }
2966 
2969  {
2970  ComponentIpcSerializableBuffer buffer;
2971  // Serialize the message type, port number, state ID, and signal
2972  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::interpreterTrap), buffer);
2973  // Serialize the signal data
2974  const Fw::SerializeStatus status = buffer.serializeFrom(value);
2975  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
2976  // Send the message and handle overflow
2977  this->interpreter_sendSignalFinish(buffer);
2978  }
2979 
2982  {
2983  ComponentIpcSerializableBuffer buffer;
2984  // Serialize the message type, port number, state ID, and signal
2985  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::interpreterOutOfFuel), buffer);
2986  // Send the message and handle overflow
2987  this->interpreter_sendSignalFinish(buffer);
2988  }
2989 
2992  {
2993  ComponentIpcSerializableBuffer buffer;
2994  // Serialize the message type, port number, state ID, and signal
2995  this->sendSignalStart(SmId::interpreter, static_cast<FwEnumStoreType>(Svc_WasmSequencer_InterpreterStateMachine::Signal::interpreterHostFunctionNeedsPause), buffer);
2996  // Send the message and handle overflow
2997  this->interpreter_sendSignalFinish(buffer);
2998  }
2999 
3000  // ----------------------------------------------------------------------
3001  // Command response
3002  // ----------------------------------------------------------------------
3003 
3006  FwOpcodeType opCode,
3007  U32 cmdSeq,
3008  Fw::CmdResponse response
3009  )
3010  {
3012  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
3013  }
3014 
3015  // ----------------------------------------------------------------------
3016  // Command handler base-class functions
3017  //
3018  // Call these functions directly to bypass the command input port
3019  // ----------------------------------------------------------------------
3020 
3023  FwOpcodeType opCode,
3024  U32 cmdSeq,
3025  Fw::CmdArgBuffer& args
3026  )
3027  {
3028  // Call pre-message hook
3029  this->RUN_preMsgHook(opCode,cmdSeq);
3030 
3031  // Defer deserializing arguments to the message dispatcher
3032  // to avoid deserializing and reserializing just for IPC
3033  ComponentIpcSerializableBuffer msg;
3035 
3036  // Serialize for IPC
3037  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_RUN));
3038  FW_ASSERT (
3039  _status == Fw::FW_SERIALIZE_OK,
3040  static_cast<FwAssertArgType>(_status)
3041  );
3042 
3043  // Fake port number to make message dequeue work
3044  FwIndexType port = 0;
3045 
3046  _status = msg.serializeFrom(port);
3047  FW_ASSERT (
3048  _status == Fw::FW_SERIALIZE_OK,
3049  static_cast<FwAssertArgType>(_status)
3050  );
3051 
3052  _status = msg.serializeFrom(opCode);
3053  FW_ASSERT (
3054  _status == Fw::FW_SERIALIZE_OK,
3055  static_cast<FwAssertArgType>(_status)
3056  );
3057 
3058  _status = msg.serializeFrom(cmdSeq);
3059  FW_ASSERT (
3060  _status == Fw::FW_SERIALIZE_OK,
3061  static_cast<FwAssertArgType>(_status)
3062  );
3063 
3064  _status = msg.serializeFrom(args);
3065  FW_ASSERT (
3066  _status == Fw::FW_SERIALIZE_OK,
3067  static_cast<FwAssertArgType>(_status)
3068  );
3069 
3070  // Send message
3072  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3073 
3074  FW_ASSERT(
3075  qStatus == Os::Queue::OP_OK,
3076  static_cast<FwAssertArgType>(qStatus)
3077  );
3078  }
3079 
3082  FwOpcodeType opCode,
3083  U32 cmdSeq,
3084  Fw::CmdArgBuffer& args
3085  )
3086  {
3087  // Call pre-message hook
3088  this->LOAD_preMsgHook(opCode,cmdSeq);
3089 
3090  // Defer deserializing arguments to the message dispatcher
3091  // to avoid deserializing and reserializing just for IPC
3092  ComponentIpcSerializableBuffer msg;
3094 
3095  // Serialize for IPC
3096  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_LOAD));
3097  FW_ASSERT (
3098  _status == Fw::FW_SERIALIZE_OK,
3099  static_cast<FwAssertArgType>(_status)
3100  );
3101 
3102  // Fake port number to make message dequeue work
3103  FwIndexType port = 0;
3104 
3105  _status = msg.serializeFrom(port);
3106  FW_ASSERT (
3107  _status == Fw::FW_SERIALIZE_OK,
3108  static_cast<FwAssertArgType>(_status)
3109  );
3110 
3111  _status = msg.serializeFrom(opCode);
3112  FW_ASSERT (
3113  _status == Fw::FW_SERIALIZE_OK,
3114  static_cast<FwAssertArgType>(_status)
3115  );
3116 
3117  _status = msg.serializeFrom(cmdSeq);
3118  FW_ASSERT (
3119  _status == Fw::FW_SERIALIZE_OK,
3120  static_cast<FwAssertArgType>(_status)
3121  );
3122 
3123  _status = msg.serializeFrom(args);
3124  FW_ASSERT (
3125  _status == Fw::FW_SERIALIZE_OK,
3126  static_cast<FwAssertArgType>(_status)
3127  );
3128 
3129  // Send message
3131  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3132 
3133  FW_ASSERT(
3134  qStatus == Os::Queue::OP_OK,
3135  static_cast<FwAssertArgType>(qStatus)
3136  );
3137  }
3138 
3141  FwOpcodeType opCode,
3142  U32 cmdSeq,
3143  Fw::CmdArgBuffer& args
3144  )
3145  {
3146  // Call pre-message hook
3147  this->INVOKE_preMsgHook(opCode,cmdSeq);
3148 
3149  // Defer deserializing arguments to the message dispatcher
3150  // to avoid deserializing and reserializing just for IPC
3151  ComponentIpcSerializableBuffer msg;
3153 
3154  // Serialize for IPC
3155  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_INVOKE));
3156  FW_ASSERT (
3157  _status == Fw::FW_SERIALIZE_OK,
3158  static_cast<FwAssertArgType>(_status)
3159  );
3160 
3161  // Fake port number to make message dequeue work
3162  FwIndexType port = 0;
3163 
3164  _status = msg.serializeFrom(port);
3165  FW_ASSERT (
3166  _status == Fw::FW_SERIALIZE_OK,
3167  static_cast<FwAssertArgType>(_status)
3168  );
3169 
3170  _status = msg.serializeFrom(opCode);
3171  FW_ASSERT (
3172  _status == Fw::FW_SERIALIZE_OK,
3173  static_cast<FwAssertArgType>(_status)
3174  );
3175 
3176  _status = msg.serializeFrom(cmdSeq);
3177  FW_ASSERT (
3178  _status == Fw::FW_SERIALIZE_OK,
3179  static_cast<FwAssertArgType>(_status)
3180  );
3181 
3182  _status = msg.serializeFrom(args);
3183  FW_ASSERT (
3184  _status == Fw::FW_SERIALIZE_OK,
3185  static_cast<FwAssertArgType>(_status)
3186  );
3187 
3188  // Send message
3190  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3191 
3192  FW_ASSERT(
3193  qStatus == Os::Queue::OP_OK,
3194  static_cast<FwAssertArgType>(qStatus)
3195  );
3196  }
3197 
3200  FwOpcodeType opCode,
3201  U32 cmdSeq,
3202  Fw::CmdArgBuffer& args
3203  )
3204  {
3205  // Call pre-message hook
3206  this->WAIT_preMsgHook(opCode,cmdSeq);
3207 
3208  // Defer deserializing arguments to the message dispatcher
3209  // to avoid deserializing and reserializing just for IPC
3210  ComponentIpcSerializableBuffer msg;
3212 
3213  // Serialize for IPC
3214  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_WAIT));
3215  FW_ASSERT (
3216  _status == Fw::FW_SERIALIZE_OK,
3217  static_cast<FwAssertArgType>(_status)
3218  );
3219 
3220  // Fake port number to make message dequeue work
3221  FwIndexType port = 0;
3222 
3223  _status = msg.serializeFrom(port);
3224  FW_ASSERT (
3225  _status == Fw::FW_SERIALIZE_OK,
3226  static_cast<FwAssertArgType>(_status)
3227  );
3228 
3229  _status = msg.serializeFrom(opCode);
3230  FW_ASSERT (
3231  _status == Fw::FW_SERIALIZE_OK,
3232  static_cast<FwAssertArgType>(_status)
3233  );
3234 
3235  _status = msg.serializeFrom(cmdSeq);
3236  FW_ASSERT (
3237  _status == Fw::FW_SERIALIZE_OK,
3238  static_cast<FwAssertArgType>(_status)
3239  );
3240 
3241  _status = msg.serializeFrom(args);
3242  FW_ASSERT (
3243  _status == Fw::FW_SERIALIZE_OK,
3244  static_cast<FwAssertArgType>(_status)
3245  );
3246 
3247  // Send message
3249  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3250 
3251  FW_ASSERT(
3252  qStatus == Os::Queue::OP_OK,
3253  static_cast<FwAssertArgType>(qStatus)
3254  );
3255  }
3256 
3259  FwOpcodeType opCode,
3260  U32 cmdSeq,
3261  Fw::CmdArgBuffer& args
3262  )
3263  {
3264 #if FW_CMD_CHECK_RESIDUAL
3265  // Make sure there was no data left over.
3266  // That means the argument buffer size was incorrect.
3267  if (args.getDeserializeSizeLeft() != 0) {
3269  this->cmdResponseOut_out(
3270  0,
3271  opCode,
3272  cmdSeq,
3274  );
3275  }
3276  return;
3277  }
3278 #endif
3279 
3280  this->CANCEL_cmdHandler(opCode, cmdSeq);
3281  }
3282 
3285  FwOpcodeType opCode,
3286  U32 cmdSeq,
3287  Fw::CmdArgBuffer& args
3288  )
3289  {
3290  // Call pre-message hook
3291  this->PAUSE_preMsgHook(opCode,cmdSeq);
3292 
3293  // Defer deserializing arguments to the message dispatcher
3294  // to avoid deserializing and reserializing just for IPC
3295  ComponentIpcSerializableBuffer msg;
3297 
3298  // Serialize for IPC
3299  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_PAUSE));
3300  FW_ASSERT (
3301  _status == Fw::FW_SERIALIZE_OK,
3302  static_cast<FwAssertArgType>(_status)
3303  );
3304 
3305  // Fake port number to make message dequeue work
3306  FwIndexType port = 0;
3307 
3308  _status = msg.serializeFrom(port);
3309  FW_ASSERT (
3310  _status == Fw::FW_SERIALIZE_OK,
3311  static_cast<FwAssertArgType>(_status)
3312  );
3313 
3314  _status = msg.serializeFrom(opCode);
3315  FW_ASSERT (
3316  _status == Fw::FW_SERIALIZE_OK,
3317  static_cast<FwAssertArgType>(_status)
3318  );
3319 
3320  _status = msg.serializeFrom(cmdSeq);
3321  FW_ASSERT (
3322  _status == Fw::FW_SERIALIZE_OK,
3323  static_cast<FwAssertArgType>(_status)
3324  );
3325 
3326  _status = msg.serializeFrom(args);
3327  FW_ASSERT (
3328  _status == Fw::FW_SERIALIZE_OK,
3329  static_cast<FwAssertArgType>(_status)
3330  );
3331 
3332  // Send message
3334  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3335 
3336  FW_ASSERT(
3337  qStatus == Os::Queue::OP_OK,
3338  static_cast<FwAssertArgType>(qStatus)
3339  );
3340  }
3341 
3344  FwOpcodeType opCode,
3345  U32 cmdSeq,
3346  Fw::CmdArgBuffer& args
3347  )
3348  {
3349  // Call pre-message hook
3350  this->CONTINUE_preMsgHook(opCode,cmdSeq);
3351 
3352  // Defer deserializing arguments to the message dispatcher
3353  // to avoid deserializing and reserializing just for IPC
3354  ComponentIpcSerializableBuffer msg;
3356 
3357  // Serialize for IPC
3358  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CONTINUE));
3359  FW_ASSERT (
3360  _status == Fw::FW_SERIALIZE_OK,
3361  static_cast<FwAssertArgType>(_status)
3362  );
3363 
3364  // Fake port number to make message dequeue work
3365  FwIndexType port = 0;
3366 
3367  _status = msg.serializeFrom(port);
3368  FW_ASSERT (
3369  _status == Fw::FW_SERIALIZE_OK,
3370  static_cast<FwAssertArgType>(_status)
3371  );
3372 
3373  _status = msg.serializeFrom(opCode);
3374  FW_ASSERT (
3375  _status == Fw::FW_SERIALIZE_OK,
3376  static_cast<FwAssertArgType>(_status)
3377  );
3378 
3379  _status = msg.serializeFrom(cmdSeq);
3380  FW_ASSERT (
3381  _status == Fw::FW_SERIALIZE_OK,
3382  static_cast<FwAssertArgType>(_status)
3383  );
3384 
3385  _status = msg.serializeFrom(args);
3386  FW_ASSERT (
3387  _status == Fw::FW_SERIALIZE_OK,
3388  static_cast<FwAssertArgType>(_status)
3389  );
3390 
3391  // Send message
3393  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3394 
3395  FW_ASSERT(
3396  qStatus == Os::Queue::OP_OK,
3397  static_cast<FwAssertArgType>(qStatus)
3398  );
3399  }
3400 
3403  FwOpcodeType opCode,
3404  U32 cmdSeq,
3405  Fw::CmdArgBuffer& args
3406  )
3407  {
3408  // Call pre-message hook
3409  this->GLOBAL_SET_I32_preMsgHook(opCode,cmdSeq);
3410 
3411  // Defer deserializing arguments to the message dispatcher
3412  // to avoid deserializing and reserializing just for IPC
3413  ComponentIpcSerializableBuffer msg;
3415 
3416  // Serialize for IPC
3417  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_SET_I32));
3418  FW_ASSERT (
3419  _status == Fw::FW_SERIALIZE_OK,
3420  static_cast<FwAssertArgType>(_status)
3421  );
3422 
3423  // Fake port number to make message dequeue work
3424  FwIndexType port = 0;
3425 
3426  _status = msg.serializeFrom(port);
3427  FW_ASSERT (
3428  _status == Fw::FW_SERIALIZE_OK,
3429  static_cast<FwAssertArgType>(_status)
3430  );
3431 
3432  _status = msg.serializeFrom(opCode);
3433  FW_ASSERT (
3434  _status == Fw::FW_SERIALIZE_OK,
3435  static_cast<FwAssertArgType>(_status)
3436  );
3437 
3438  _status = msg.serializeFrom(cmdSeq);
3439  FW_ASSERT (
3440  _status == Fw::FW_SERIALIZE_OK,
3441  static_cast<FwAssertArgType>(_status)
3442  );
3443 
3444  _status = msg.serializeFrom(args);
3445  FW_ASSERT (
3446  _status == Fw::FW_SERIALIZE_OK,
3447  static_cast<FwAssertArgType>(_status)
3448  );
3449 
3450  // Send message
3452  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3453 
3454  FW_ASSERT(
3455  qStatus == Os::Queue::OP_OK,
3456  static_cast<FwAssertArgType>(qStatus)
3457  );
3458  }
3459 
3462  FwOpcodeType opCode,
3463  U32 cmdSeq,
3464  Fw::CmdArgBuffer& args
3465  )
3466  {
3467  // Call pre-message hook
3468  this->GLOBAL_SET_I64_preMsgHook(opCode,cmdSeq);
3469 
3470  // Defer deserializing arguments to the message dispatcher
3471  // to avoid deserializing and reserializing just for IPC
3472  ComponentIpcSerializableBuffer msg;
3474 
3475  // Serialize for IPC
3476  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_SET_I64));
3477  FW_ASSERT (
3478  _status == Fw::FW_SERIALIZE_OK,
3479  static_cast<FwAssertArgType>(_status)
3480  );
3481 
3482  // Fake port number to make message dequeue work
3483  FwIndexType port = 0;
3484 
3485  _status = msg.serializeFrom(port);
3486  FW_ASSERT (
3487  _status == Fw::FW_SERIALIZE_OK,
3488  static_cast<FwAssertArgType>(_status)
3489  );
3490 
3491  _status = msg.serializeFrom(opCode);
3492  FW_ASSERT (
3493  _status == Fw::FW_SERIALIZE_OK,
3494  static_cast<FwAssertArgType>(_status)
3495  );
3496 
3497  _status = msg.serializeFrom(cmdSeq);
3498  FW_ASSERT (
3499  _status == Fw::FW_SERIALIZE_OK,
3500  static_cast<FwAssertArgType>(_status)
3501  );
3502 
3503  _status = msg.serializeFrom(args);
3504  FW_ASSERT (
3505  _status == Fw::FW_SERIALIZE_OK,
3506  static_cast<FwAssertArgType>(_status)
3507  );
3508 
3509  // Send message
3511  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3512 
3513  FW_ASSERT(
3514  qStatus == Os::Queue::OP_OK,
3515  static_cast<FwAssertArgType>(qStatus)
3516  );
3517  }
3518 
3521  FwOpcodeType opCode,
3522  U32 cmdSeq,
3523  Fw::CmdArgBuffer& args
3524  )
3525  {
3526  // Call pre-message hook
3527  this->GLOBAL_SET_F32_preMsgHook(opCode,cmdSeq);
3528 
3529  // Defer deserializing arguments to the message dispatcher
3530  // to avoid deserializing and reserializing just for IPC
3531  ComponentIpcSerializableBuffer msg;
3533 
3534  // Serialize for IPC
3535  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_SET_F32));
3536  FW_ASSERT (
3537  _status == Fw::FW_SERIALIZE_OK,
3538  static_cast<FwAssertArgType>(_status)
3539  );
3540 
3541  // Fake port number to make message dequeue work
3542  FwIndexType port = 0;
3543 
3544  _status = msg.serializeFrom(port);
3545  FW_ASSERT (
3546  _status == Fw::FW_SERIALIZE_OK,
3547  static_cast<FwAssertArgType>(_status)
3548  );
3549 
3550  _status = msg.serializeFrom(opCode);
3551  FW_ASSERT (
3552  _status == Fw::FW_SERIALIZE_OK,
3553  static_cast<FwAssertArgType>(_status)
3554  );
3555 
3556  _status = msg.serializeFrom(cmdSeq);
3557  FW_ASSERT (
3558  _status == Fw::FW_SERIALIZE_OK,
3559  static_cast<FwAssertArgType>(_status)
3560  );
3561 
3562  _status = msg.serializeFrom(args);
3563  FW_ASSERT (
3564  _status == Fw::FW_SERIALIZE_OK,
3565  static_cast<FwAssertArgType>(_status)
3566  );
3567 
3568  // Send message
3570  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3571 
3572  FW_ASSERT(
3573  qStatus == Os::Queue::OP_OK,
3574  static_cast<FwAssertArgType>(qStatus)
3575  );
3576  }
3577 
3580  FwOpcodeType opCode,
3581  U32 cmdSeq,
3582  Fw::CmdArgBuffer& args
3583  )
3584  {
3585  // Call pre-message hook
3586  this->GLOBAL_SET_F64_preMsgHook(opCode,cmdSeq);
3587 
3588  // Defer deserializing arguments to the message dispatcher
3589  // to avoid deserializing and reserializing just for IPC
3590  ComponentIpcSerializableBuffer msg;
3592 
3593  // Serialize for IPC
3594  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_SET_F64));
3595  FW_ASSERT (
3596  _status == Fw::FW_SERIALIZE_OK,
3597  static_cast<FwAssertArgType>(_status)
3598  );
3599 
3600  // Fake port number to make message dequeue work
3601  FwIndexType port = 0;
3602 
3603  _status = msg.serializeFrom(port);
3604  FW_ASSERT (
3605  _status == Fw::FW_SERIALIZE_OK,
3606  static_cast<FwAssertArgType>(_status)
3607  );
3608 
3609  _status = msg.serializeFrom(opCode);
3610  FW_ASSERT (
3611  _status == Fw::FW_SERIALIZE_OK,
3612  static_cast<FwAssertArgType>(_status)
3613  );
3614 
3615  _status = msg.serializeFrom(cmdSeq);
3616  FW_ASSERT (
3617  _status == Fw::FW_SERIALIZE_OK,
3618  static_cast<FwAssertArgType>(_status)
3619  );
3620 
3621  _status = msg.serializeFrom(args);
3622  FW_ASSERT (
3623  _status == Fw::FW_SERIALIZE_OK,
3624  static_cast<FwAssertArgType>(_status)
3625  );
3626 
3627  // Send message
3629  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3630 
3631  FW_ASSERT(
3632  qStatus == Os::Queue::OP_OK,
3633  static_cast<FwAssertArgType>(qStatus)
3634  );
3635  }
3636 
3639  FwOpcodeType opCode,
3640  U32 cmdSeq,
3641  Fw::CmdArgBuffer& args
3642  )
3643  {
3644  // Call pre-message hook
3645  this->GLOBAL_GET_preMsgHook(opCode,cmdSeq);
3646 
3647  // Defer deserializing arguments to the message dispatcher
3648  // to avoid deserializing and reserializing just for IPC
3649  ComponentIpcSerializableBuffer msg;
3651 
3652  // Serialize for IPC
3653  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GLOBAL_GET));
3654  FW_ASSERT (
3655  _status == Fw::FW_SERIALIZE_OK,
3656  static_cast<FwAssertArgType>(_status)
3657  );
3658 
3659  // Fake port number to make message dequeue work
3660  FwIndexType port = 0;
3661 
3662  _status = msg.serializeFrom(port);
3663  FW_ASSERT (
3664  _status == Fw::FW_SERIALIZE_OK,
3665  static_cast<FwAssertArgType>(_status)
3666  );
3667 
3668  _status = msg.serializeFrom(opCode);
3669  FW_ASSERT (
3670  _status == Fw::FW_SERIALIZE_OK,
3671  static_cast<FwAssertArgType>(_status)
3672  );
3673 
3674  _status = msg.serializeFrom(cmdSeq);
3675  FW_ASSERT (
3676  _status == Fw::FW_SERIALIZE_OK,
3677  static_cast<FwAssertArgType>(_status)
3678  );
3679 
3680  _status = msg.serializeFrom(args);
3681  FW_ASSERT (
3682  _status == Fw::FW_SERIALIZE_OK,
3683  static_cast<FwAssertArgType>(_status)
3684  );
3685 
3686  // Send message
3688  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
3689 
3690  FW_ASSERT(
3691  qStatus == Os::Queue::OP_OK,
3692  static_cast<FwAssertArgType>(qStatus)
3693  );
3694  }
3695 
3696  // ----------------------------------------------------------------------
3697  // Pre-message hooks for async commands
3698  //
3699  // Each of these functions is invoked just before processing the
3700  // corresponding command. By default they do nothing. You can
3701  // override them to provide specific pre-command behavior.
3702  // ----------------------------------------------------------------------
3703 
3706  FwOpcodeType opCode,
3707  U32 cmdSeq
3708  )
3709  {
3710  // Defaults to no-op; can be overridden
3711  (void) opCode;
3712  (void) cmdSeq;
3713  }
3714 
3717  FwOpcodeType opCode,
3718  U32 cmdSeq
3719  )
3720  {
3721  // Defaults to no-op; can be overridden
3722  (void) opCode;
3723  (void) cmdSeq;
3724  }
3725 
3728  FwOpcodeType opCode,
3729  U32 cmdSeq
3730  )
3731  {
3732  // Defaults to no-op; can be overridden
3733  (void) opCode;
3734  (void) cmdSeq;
3735  }
3736 
3739  FwOpcodeType opCode,
3740  U32 cmdSeq
3741  )
3742  {
3743  // Defaults to no-op; can be overridden
3744  (void) opCode;
3745  (void) cmdSeq;
3746  }
3747 
3750  FwOpcodeType opCode,
3751  U32 cmdSeq
3752  )
3753  {
3754  // Defaults to no-op; can be overridden
3755  (void) opCode;
3756  (void) cmdSeq;
3757  }
3758 
3761  FwOpcodeType opCode,
3762  U32 cmdSeq
3763  )
3764  {
3765  // Defaults to no-op; can be overridden
3766  (void) opCode;
3767  (void) cmdSeq;
3768  }
3769 
3772  FwOpcodeType opCode,
3773  U32 cmdSeq
3774  )
3775  {
3776  // Defaults to no-op; can be overridden
3777  (void) opCode;
3778  (void) cmdSeq;
3779  }
3780 
3783  FwOpcodeType opCode,
3784  U32 cmdSeq
3785  )
3786  {
3787  // Defaults to no-op; can be overridden
3788  (void) opCode;
3789  (void) cmdSeq;
3790  }
3791 
3794  FwOpcodeType opCode,
3795  U32 cmdSeq
3796  )
3797  {
3798  // Defaults to no-op; can be overridden
3799  (void) opCode;
3800  (void) cmdSeq;
3801  }
3802 
3805  FwOpcodeType opCode,
3806  U32 cmdSeq
3807  )
3808  {
3809  // Defaults to no-op; can be overridden
3810  (void) opCode;
3811  (void) cmdSeq;
3812  }
3813 
3816  FwOpcodeType opCode,
3817  U32 cmdSeq
3818  )
3819  {
3820  // Defaults to no-op; can be overridden
3821  (void) opCode;
3822  (void) cmdSeq;
3823  }
3824 
3825  // ----------------------------------------------------------------------
3826  // Event logging functions
3827  // ----------------------------------------------------------------------
3828 
3831  {
3832  // Get the time
3833  Fw::Time _logTime;
3834  if (this->isConnected_timeCaller_OutputPort(0)) {
3835  this->timeCaller_out(0, _logTime);
3836  }
3837 
3839 
3840  // Emit the event on the log port
3841  if (this->isConnected_logOut_OutputPort(0)) {
3842  Fw::LogBuffer _logBuff;
3844 
3845 #if FW_AMPCS_COMPATIBLE
3846  // Serialize the number of arguments
3847  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3848  FW_ASSERT(
3849  _status == Fw::FW_SERIALIZE_OK,
3850  static_cast<FwAssertArgType>(_status)
3851  );
3852 #endif
3853 
3854 #if FW_AMPCS_COMPATIBLE
3855  // Serialize the argument size
3856  _status = _logBuff.serializeFrom(
3857  static_cast<U8>(sizeof(U16))
3858  );
3859  FW_ASSERT(
3860  _status == Fw::FW_SERIALIZE_OK,
3861  static_cast<FwAssertArgType>(_status)
3862  );
3863 #endif
3864  _status = _logBuff.serializeFrom(moduleCount);
3865  FW_ASSERT(
3866  _status == Fw::FW_SERIALIZE_OK,
3867  static_cast<FwAssertArgType>(_status)
3868  );
3869 
3870  this->logOut_out(
3871  0,
3872  _id,
3873  _logTime,
3875  _logBuff
3876  );
3877  }
3878 
3879  // Emit the event on the text log port
3880 #if FW_ENABLE_TEXT_LOGGING
3881  if (this->isConnected_logTextOut_OutputPort(0)) {
3882 #if FW_OBJECT_NAMES == 1
3883  const char* _formatString =
3884  "(%s) %s: Successfully allocated store with %" PRIu16 " modules";
3885 #else
3886  const char* _formatString =
3887  "%s: Successfully allocated store with %" PRIu16 " modules";
3888 #endif
3889 
3890  Fw::TextLogString _logString;
3891  (void) _logString.format(
3892  _formatString,
3893 #if FW_OBJECT_NAMES == 1
3894  this->m_objName.toChar(),
3895 #endif
3896  "StoreAllocationSucceeded ",
3897  moduleCount
3898  );
3899 
3900  this->logTextOut_out(
3901  0,
3902  _id,
3903  _logTime,
3905  _logString
3906  );
3907  }
3908 #endif
3909  }
3910 
3913  {
3914  // Get the time
3915  Fw::Time _logTime;
3916  if (this->isConnected_timeCaller_OutputPort(0)) {
3917  this->timeCaller_out(0, _logTime);
3918  }
3919 
3921 
3922  // Emit the event on the log port
3923  if (this->isConnected_logOut_OutputPort(0)) {
3924  Fw::LogBuffer _logBuff;
3925 
3926 #if FW_AMPCS_COMPATIBLE
3928  // Serialize the number of arguments
3929  _status = _logBuff.serializeFrom(static_cast<U8>(0));
3930  FW_ASSERT(
3931  _status == Fw::FW_SERIALIZE_OK,
3932  static_cast<FwAssertArgType>(_status)
3933  );
3934 #endif
3935 
3936  this->logOut_out(
3937  0,
3938  _id,
3939  _logTime,
3941  _logBuff
3942  );
3943  }
3944 
3945  // Emit the event on the text log port
3946 #if FW_ENABLE_TEXT_LOGGING
3947  if (this->isConnected_logTextOut_OutputPort(0)) {
3948 #if FW_OBJECT_NAMES == 1
3949  const char* _formatString =
3950  "(%s) %s: Cannot invoke a module when no module is loaded";
3951 #else
3952  const char* _formatString =
3953  "%s: Cannot invoke a module when no module is loaded";
3954 #endif
3955 
3956  Fw::TextLogString _logString;
3957  (void) _logString.format(
3958  _formatString,
3959 #if FW_OBJECT_NAMES == 1
3960  this->m_objName.toChar(),
3961 #endif
3962  "ControllerCannotInvoke "
3963  );
3964 
3965  this->logTextOut_out(
3966  0,
3967  _id,
3968  _logTime,
3970  _logString
3971  );
3972  }
3973 #endif
3974  }
3975 
3978  const Svc::WasmSequencer_SignalSource& signalSource,
3980  ) const
3981  {
3982  // Get the time
3983  Fw::Time _logTime;
3984  if (this->isConnected_timeCaller_OutputPort(0)) {
3985  this->timeCaller_out(0, _logTime);
3986  }
3987 
3988  const FwEventIdType _id = this->getIdBase() + EVENTID_CONTROLLERBUSY;
3989 
3990  // Emit the event on the log port
3991  if (this->isConnected_logOut_OutputPort(0)) {
3992  Fw::LogBuffer _logBuff;
3994 
3995 #if FW_AMPCS_COMPATIBLE
3996  // Serialize the number of arguments
3997  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3998  FW_ASSERT(
3999  _status == Fw::FW_SERIALIZE_OK,
4000  static_cast<FwAssertArgType>(_status)
4001  );
4002 #endif
4003 
4004 #if FW_AMPCS_COMPATIBLE
4005  // Serialize the argument size
4006  _status = _logBuff.serializeFrom(
4008  );
4009  FW_ASSERT(
4010  _status == Fw::FW_SERIALIZE_OK,
4011  static_cast<FwAssertArgType>(_status)
4012  );
4013 #endif
4014  _status = _logBuff.serializeFrom(signalSource);
4015  FW_ASSERT(
4016  _status == Fw::FW_SERIALIZE_OK,
4017  static_cast<FwAssertArgType>(_status)
4018  );
4019 
4020 #if FW_AMPCS_COMPATIBLE
4021  // Serialize the argument size
4022  _status = _logBuff.serializeFrom(
4024  );
4025  FW_ASSERT(
4026  _status == Fw::FW_SERIALIZE_OK,
4027  static_cast<FwAssertArgType>(_status)
4028  );
4029 #endif
4030  _status = _logBuff.serializeFrom(state);
4031  FW_ASSERT(
4032  _status == Fw::FW_SERIALIZE_OK,
4033  static_cast<FwAssertArgType>(_status)
4034  );
4035 
4036  this->logOut_out(
4037  0,
4038  _id,
4039  _logTime,
4041  _logBuff
4042  );
4043  }
4044 
4045  // Emit the event on the text log port
4046 #if FW_ENABLE_TEXT_LOGGING
4047  if (this->isConnected_logTextOut_OutputPort(0)) {
4048 #if FW_OBJECT_NAMES == 1
4049  const char* _formatString =
4050  "(%s) %s: Controller cannot process signal %s in state %s";
4051 #else
4052  const char* _formatString =
4053  "%s: Controller cannot process signal %s in state %s";
4054 #endif
4055 
4056  Fw::String signalSourceStr;
4057  signalSource.toString(signalSourceStr);
4058  Fw::String stateStr;
4059  state.toString(stateStr);
4060 
4061  Fw::TextLogString _logString;
4062  (void) _logString.format(
4063  _formatString,
4064 #if FW_OBJECT_NAMES == 1
4065  this->m_objName.toChar(),
4066 #endif
4067  "ControllerBusy ",
4068  signalSourceStr.toChar(),
4069  stateStr.toChar()
4070  );
4071 
4072  this->logTextOut_out(
4073  0,
4074  _id,
4075  _logTime,
4077  _logString
4078  );
4079  }
4080 #endif
4081  }
4082 
4085  {
4086  // Get the time
4087  Fw::Time _logTime;
4088  if (this->isConnected_timeCaller_OutputPort(0)) {
4089  this->timeCaller_out(0, _logTime);
4090  }
4091 
4092  const FwEventIdType _id = this->getIdBase() + EVENTID_MODULENOTFOUND;
4093 
4094  // Emit the event on the log port
4095  if (this->isConnected_logOut_OutputPort(0)) {
4096  Fw::LogBuffer _logBuff;
4098 
4099 #if FW_AMPCS_COMPATIBLE
4100  // Serialize the number of arguments
4101  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4102  FW_ASSERT(
4103  _status == Fw::FW_SERIALIZE_OK,
4104  static_cast<FwAssertArgType>(_status)
4105  );
4106 #endif
4107 
4108  _status = module_name.serializeTo(
4109  _logBuff,
4110  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4111  );
4112  FW_ASSERT(
4113  _status == Fw::FW_SERIALIZE_OK,
4114  static_cast<FwAssertArgType>(_status)
4115  );
4116 
4117  this->logOut_out(
4118  0,
4119  _id,
4120  _logTime,
4122  _logBuff
4123  );
4124  }
4125 
4126  // Emit the event on the text log port
4127 #if FW_ENABLE_TEXT_LOGGING
4128  if (this->isConnected_logTextOut_OutputPort(0)) {
4129 #if FW_OBJECT_NAMES == 1
4130  const char* _formatString =
4131  "(%s) %s: Module with name %s is not loaded into the store";
4132 #else
4133  const char* _formatString =
4134  "%s: Module with name %s is not loaded into the store";
4135 #endif
4136 
4137  Fw::TextLogString _logString;
4138  (void) _logString.format(
4139  _formatString,
4140 #if FW_OBJECT_NAMES == 1
4141  this->m_objName.toChar(),
4142 #endif
4143  "ModuleNotFound ",
4144  module_name.toChar()
4145  );
4146 
4147  this->logTextOut_out(
4148  0,
4149  _id,
4150  _logTime,
4152  _logString
4153  );
4154  }
4155 #endif
4156  }
4157 
4161  U64 requestedSize
4162  ) const
4163  {
4164  // Get the time
4165  Fw::Time _logTime;
4166  if (this->isConnected_timeCaller_OutputPort(0)) {
4167  this->timeCaller_out(0, _logTime);
4168  }
4169 
4170  const FwEventIdType _id = this->getIdBase() + EVENTID_MEMORYGROWREJECTED;
4171 
4172  // Emit the event on the log port
4173  if (this->isConnected_logOut_OutputPort(0)) {
4174  Fw::LogBuffer _logBuff;
4176 
4177 #if FW_AMPCS_COMPATIBLE
4178  // Serialize the number of arguments
4179  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4180  FW_ASSERT(
4181  _status == Fw::FW_SERIALIZE_OK,
4182  static_cast<FwAssertArgType>(_status)
4183  );
4184 #endif
4185 
4186 #if FW_AMPCS_COMPATIBLE
4187  // Serialize the argument size
4188  _status = _logBuff.serializeFrom(
4190  );
4191  FW_ASSERT(
4192  _status == Fw::FW_SERIALIZE_OK,
4193  static_cast<FwAssertArgType>(_status)
4194  );
4195 #endif
4196  _status = _logBuff.serializeFrom(reason);
4197  FW_ASSERT(
4198  _status == Fw::FW_SERIALIZE_OK,
4199  static_cast<FwAssertArgType>(_status)
4200  );
4201 
4202 #if FW_AMPCS_COMPATIBLE
4203  // Serialize the argument size
4204  _status = _logBuff.serializeFrom(
4205  static_cast<U8>(sizeof(U64))
4206  );
4207  FW_ASSERT(
4208  _status == Fw::FW_SERIALIZE_OK,
4209  static_cast<FwAssertArgType>(_status)
4210  );
4211 #endif
4212  _status = _logBuff.serializeFrom(requestedSize);
4213  FW_ASSERT(
4214  _status == Fw::FW_SERIALIZE_OK,
4215  static_cast<FwAssertArgType>(_status)
4216  );
4217 
4218  this->logOut_out(
4219  0,
4220  _id,
4221  _logTime,
4223  _logBuff
4224  );
4225  }
4226 
4227  // Emit the event on the text log port
4228 #if FW_ENABLE_TEXT_LOGGING
4229  if (this->isConnected_logTextOut_OutputPort(0)) {
4230 #if FW_OBJECT_NAMES == 1
4231  const char* _formatString =
4232  "(%s) %s: Guest memory.grow rejected: %s (requested %" PRIu64 " bytes)";
4233 #else
4234  const char* _formatString =
4235  "%s: Guest memory.grow rejected: %s (requested %" PRIu64 " bytes)";
4236 #endif
4237 
4238  Fw::String reasonStr;
4239  reason.toString(reasonStr);
4240 
4241  Fw::TextLogString _logString;
4242  (void) _logString.format(
4243  _formatString,
4244 #if FW_OBJECT_NAMES == 1
4245  this->m_objName.toChar(),
4246 #endif
4247  "MemoryGrowRejected ",
4248  reasonStr.toChar(),
4249  requestedSize
4250  );
4251 
4252  this->logTextOut_out(
4253  0,
4254  _id,
4255  _logTime,
4257  _logString
4258  );
4259  }
4260 #endif
4261  }
4262 
4265  const Fw::StringBase& module_name,
4266  const Fw::StringBase& globalName,
4267  const Svc::WasmSequencer_Status& reason
4268  ) const
4269  {
4270  // Get the time
4271  Fw::Time _logTime;
4272  if (this->isConnected_timeCaller_OutputPort(0)) {
4273  this->timeCaller_out(0, _logTime);
4274  }
4275 
4276  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALSETFAILED;
4277 
4278  // Emit the event on the log port
4279  if (this->isConnected_logOut_OutputPort(0)) {
4280  Fw::LogBuffer _logBuff;
4282 
4283 #if FW_AMPCS_COMPATIBLE
4284  // Serialize the number of arguments
4285  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4286  FW_ASSERT(
4287  _status == Fw::FW_SERIALIZE_OK,
4288  static_cast<FwAssertArgType>(_status)
4289  );
4290 #endif
4291 
4292  _status = module_name.serializeTo(
4293  _logBuff,
4294  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4295  );
4296  FW_ASSERT(
4297  _status == Fw::FW_SERIALIZE_OK,
4298  static_cast<FwAssertArgType>(_status)
4299  );
4300 
4301  _status = globalName.serializeTo(
4302  _logBuff,
4303  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4304  );
4305  FW_ASSERT(
4306  _status == Fw::FW_SERIALIZE_OK,
4307  static_cast<FwAssertArgType>(_status)
4308  );
4309 
4310 #if FW_AMPCS_COMPATIBLE
4311  // Serialize the argument size
4312  _status = _logBuff.serializeFrom(
4314  );
4315  FW_ASSERT(
4316  _status == Fw::FW_SERIALIZE_OK,
4317  static_cast<FwAssertArgType>(_status)
4318  );
4319 #endif
4320  _status = _logBuff.serializeFrom(reason);
4321  FW_ASSERT(
4322  _status == Fw::FW_SERIALIZE_OK,
4323  static_cast<FwAssertArgType>(_status)
4324  );
4325 
4326  this->logOut_out(
4327  0,
4328  _id,
4329  _logTime,
4331  _logBuff
4332  );
4333  }
4334 
4335  // Emit the event on the text log port
4336 #if FW_ENABLE_TEXT_LOGGING
4337  if (this->isConnected_logTextOut_OutputPort(0)) {
4338 #if FW_OBJECT_NAMES == 1
4339  const char* _formatString =
4340  "(%s) %s: Failed to set global value for module %s global name %s: %s";
4341 #else
4342  const char* _formatString =
4343  "%s: Failed to set global value for module %s global name %s: %s";
4344 #endif
4345 
4346  Fw::String reasonStr;
4347  reason.toString(reasonStr);
4348 
4349  Fw::TextLogString _logString;
4350  (void) _logString.format(
4351  _formatString,
4352 #if FW_OBJECT_NAMES == 1
4353  this->m_objName.toChar(),
4354 #endif
4355  "GlobalSetFailed ",
4356  module_name.toChar(),
4357  globalName.toChar(),
4358  reasonStr.toChar()
4359  );
4360 
4361  this->logTextOut_out(
4362  0,
4363  _id,
4364  _logTime,
4366  _logString
4367  );
4368  }
4369 #endif
4370  }
4371 
4374  const Fw::StringBase& module_name,
4375  const Fw::StringBase& globalName,
4376  const Svc::WasmSequencer_Status& reason
4377  ) const
4378  {
4379  // Get the time
4380  Fw::Time _logTime;
4381  if (this->isConnected_timeCaller_OutputPort(0)) {
4382  this->timeCaller_out(0, _logTime);
4383  }
4384 
4385  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALGETFAILED;
4386 
4387  // Emit the event on the log port
4388  if (this->isConnected_logOut_OutputPort(0)) {
4389  Fw::LogBuffer _logBuff;
4391 
4392 #if FW_AMPCS_COMPATIBLE
4393  // Serialize the number of arguments
4394  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4395  FW_ASSERT(
4396  _status == Fw::FW_SERIALIZE_OK,
4397  static_cast<FwAssertArgType>(_status)
4398  );
4399 #endif
4400 
4401  _status = module_name.serializeTo(
4402  _logBuff,
4403  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4404  );
4405  FW_ASSERT(
4406  _status == Fw::FW_SERIALIZE_OK,
4407  static_cast<FwAssertArgType>(_status)
4408  );
4409 
4410  _status = globalName.serializeTo(
4411  _logBuff,
4412  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4413  );
4414  FW_ASSERT(
4415  _status == Fw::FW_SERIALIZE_OK,
4416  static_cast<FwAssertArgType>(_status)
4417  );
4418 
4419 #if FW_AMPCS_COMPATIBLE
4420  // Serialize the argument size
4421  _status = _logBuff.serializeFrom(
4423  );
4424  FW_ASSERT(
4425  _status == Fw::FW_SERIALIZE_OK,
4426  static_cast<FwAssertArgType>(_status)
4427  );
4428 #endif
4429  _status = _logBuff.serializeFrom(reason);
4430  FW_ASSERT(
4431  _status == Fw::FW_SERIALIZE_OK,
4432  static_cast<FwAssertArgType>(_status)
4433  );
4434 
4435  this->logOut_out(
4436  0,
4437  _id,
4438  _logTime,
4440  _logBuff
4441  );
4442  }
4443 
4444  // Emit the event on the text log port
4445 #if FW_ENABLE_TEXT_LOGGING
4446  if (this->isConnected_logTextOut_OutputPort(0)) {
4447 #if FW_OBJECT_NAMES == 1
4448  const char* _formatString =
4449  "(%s) %s: Failed to get global value for module %s global name %s: %s";
4450 #else
4451  const char* _formatString =
4452  "%s: Failed to get global value for module %s global name %s: %s";
4453 #endif
4454 
4455  Fw::String reasonStr;
4456  reason.toString(reasonStr);
4457 
4458  Fw::TextLogString _logString;
4459  (void) _logString.format(
4460  _formatString,
4461 #if FW_OBJECT_NAMES == 1
4462  this->m_objName.toChar(),
4463 #endif
4464  "GlobalGetFailed ",
4465  module_name.toChar(),
4466  globalName.toChar(),
4467  reasonStr.toChar()
4468  );
4469 
4470  this->logTextOut_out(
4471  0,
4472  _id,
4473  _logTime,
4475  _logString
4476  );
4477  }
4478 #endif
4479  }
4480 
4483  const Fw::StringBase& module_name,
4484  const Fw::StringBase& globalName,
4485  I32 value
4486  ) const
4487  {
4488  // Get the time
4489  Fw::Time _logTime;
4490  if (this->isConnected_timeCaller_OutputPort(0)) {
4491  this->timeCaller_out(0, _logTime);
4492  }
4493 
4494  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALVALUEI32;
4495 
4496  // Emit the event on the log port
4497  if (this->isConnected_logOut_OutputPort(0)) {
4498  Fw::LogBuffer _logBuff;
4500 
4501 #if FW_AMPCS_COMPATIBLE
4502  // Serialize the number of arguments
4503  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4504  FW_ASSERT(
4505  _status == Fw::FW_SERIALIZE_OK,
4506  static_cast<FwAssertArgType>(_status)
4507  );
4508 #endif
4509 
4510  _status = module_name.serializeTo(
4511  _logBuff,
4512  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4513  );
4514  FW_ASSERT(
4515  _status == Fw::FW_SERIALIZE_OK,
4516  static_cast<FwAssertArgType>(_status)
4517  );
4518 
4519  _status = globalName.serializeTo(
4520  _logBuff,
4521  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4522  );
4523  FW_ASSERT(
4524  _status == Fw::FW_SERIALIZE_OK,
4525  static_cast<FwAssertArgType>(_status)
4526  );
4527 
4528 #if FW_AMPCS_COMPATIBLE
4529  // Serialize the argument size
4530  _status = _logBuff.serializeFrom(
4531  static_cast<U8>(sizeof(I32))
4532  );
4533  FW_ASSERT(
4534  _status == Fw::FW_SERIALIZE_OK,
4535  static_cast<FwAssertArgType>(_status)
4536  );
4537 #endif
4538  _status = _logBuff.serializeFrom(value);
4539  FW_ASSERT(
4540  _status == Fw::FW_SERIALIZE_OK,
4541  static_cast<FwAssertArgType>(_status)
4542  );
4543 
4544  this->logOut_out(
4545  0,
4546  _id,
4547  _logTime,
4549  _logBuff
4550  );
4551  }
4552 
4553  // Emit the event on the text log port
4554 #if FW_ENABLE_TEXT_LOGGING
4555  if (this->isConnected_logTextOut_OutputPort(0)) {
4556 #if FW_OBJECT_NAMES == 1
4557  const char* _formatString =
4558  "(%s) %s: Global value module=%s name=%s value=%" PRIi32 "";
4559 #else
4560  const char* _formatString =
4561  "%s: Global value module=%s name=%s value=%" PRIi32 "";
4562 #endif
4563 
4564  Fw::TextLogString _logString;
4565  (void) _logString.format(
4566  _formatString,
4567 #if FW_OBJECT_NAMES == 1
4568  this->m_objName.toChar(),
4569 #endif
4570  "GlobalValueI32 ",
4571  module_name.toChar(),
4572  globalName.toChar(),
4573  value
4574  );
4575 
4576  this->logTextOut_out(
4577  0,
4578  _id,
4579  _logTime,
4581  _logString
4582  );
4583  }
4584 #endif
4585  }
4586 
4589  const Fw::StringBase& module_name,
4590  const Fw::StringBase& globalName,
4591  I64 value
4592  ) const
4593  {
4594  // Get the time
4595  Fw::Time _logTime;
4596  if (this->isConnected_timeCaller_OutputPort(0)) {
4597  this->timeCaller_out(0, _logTime);
4598  }
4599 
4600  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALVALUEI64;
4601 
4602  // Emit the event on the log port
4603  if (this->isConnected_logOut_OutputPort(0)) {
4604  Fw::LogBuffer _logBuff;
4606 
4607 #if FW_AMPCS_COMPATIBLE
4608  // Serialize the number of arguments
4609  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4610  FW_ASSERT(
4611  _status == Fw::FW_SERIALIZE_OK,
4612  static_cast<FwAssertArgType>(_status)
4613  );
4614 #endif
4615 
4616  _status = module_name.serializeTo(
4617  _logBuff,
4618  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4619  );
4620  FW_ASSERT(
4621  _status == Fw::FW_SERIALIZE_OK,
4622  static_cast<FwAssertArgType>(_status)
4623  );
4624 
4625  _status = globalName.serializeTo(
4626  _logBuff,
4627  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4628  );
4629  FW_ASSERT(
4630  _status == Fw::FW_SERIALIZE_OK,
4631  static_cast<FwAssertArgType>(_status)
4632  );
4633 
4634 #if FW_AMPCS_COMPATIBLE
4635  // Serialize the argument size
4636  _status = _logBuff.serializeFrom(
4637  static_cast<U8>(sizeof(I64))
4638  );
4639  FW_ASSERT(
4640  _status == Fw::FW_SERIALIZE_OK,
4641  static_cast<FwAssertArgType>(_status)
4642  );
4643 #endif
4644  _status = _logBuff.serializeFrom(value);
4645  FW_ASSERT(
4646  _status == Fw::FW_SERIALIZE_OK,
4647  static_cast<FwAssertArgType>(_status)
4648  );
4649 
4650  this->logOut_out(
4651  0,
4652  _id,
4653  _logTime,
4655  _logBuff
4656  );
4657  }
4658 
4659  // Emit the event on the text log port
4660 #if FW_ENABLE_TEXT_LOGGING
4661  if (this->isConnected_logTextOut_OutputPort(0)) {
4662 #if FW_OBJECT_NAMES == 1
4663  const char* _formatString =
4664  "(%s) %s: Global value module=%s name=%s value=%" PRIi64 "";
4665 #else
4666  const char* _formatString =
4667  "%s: Global value module=%s name=%s value=%" PRIi64 "";
4668 #endif
4669 
4670  Fw::TextLogString _logString;
4671  (void) _logString.format(
4672  _formatString,
4673 #if FW_OBJECT_NAMES == 1
4674  this->m_objName.toChar(),
4675 #endif
4676  "GlobalValueI64 ",
4677  module_name.toChar(),
4678  globalName.toChar(),
4679  value
4680  );
4681 
4682  this->logTextOut_out(
4683  0,
4684  _id,
4685  _logTime,
4687  _logString
4688  );
4689  }
4690 #endif
4691  }
4692 
4695  const Fw::StringBase& module_name,
4696  const Fw::StringBase& globalName,
4697  F32 value
4698  ) const
4699  {
4700  // Get the time
4701  Fw::Time _logTime;
4702  if (this->isConnected_timeCaller_OutputPort(0)) {
4703  this->timeCaller_out(0, _logTime);
4704  }
4705 
4706  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALVALUEF32;
4707 
4708  // Emit the event on the log port
4709  if (this->isConnected_logOut_OutputPort(0)) {
4710  Fw::LogBuffer _logBuff;
4712 
4713 #if FW_AMPCS_COMPATIBLE
4714  // Serialize the number of arguments
4715  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4716  FW_ASSERT(
4717  _status == Fw::FW_SERIALIZE_OK,
4718  static_cast<FwAssertArgType>(_status)
4719  );
4720 #endif
4721 
4722  _status = module_name.serializeTo(
4723  _logBuff,
4724  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4725  );
4726  FW_ASSERT(
4727  _status == Fw::FW_SERIALIZE_OK,
4728  static_cast<FwAssertArgType>(_status)
4729  );
4730 
4731  _status = globalName.serializeTo(
4732  _logBuff,
4733  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4734  );
4735  FW_ASSERT(
4736  _status == Fw::FW_SERIALIZE_OK,
4737  static_cast<FwAssertArgType>(_status)
4738  );
4739 
4740 #if FW_AMPCS_COMPATIBLE
4741  // Serialize the argument size
4742  _status = _logBuff.serializeFrom(
4743  static_cast<U8>(sizeof(F32))
4744  );
4745  FW_ASSERT(
4746  _status == Fw::FW_SERIALIZE_OK,
4747  static_cast<FwAssertArgType>(_status)
4748  );
4749 #endif
4750  _status = _logBuff.serializeFrom(value);
4751  FW_ASSERT(
4752  _status == Fw::FW_SERIALIZE_OK,
4753  static_cast<FwAssertArgType>(_status)
4754  );
4755 
4756  this->logOut_out(
4757  0,
4758  _id,
4759  _logTime,
4761  _logBuff
4762  );
4763  }
4764 
4765  // Emit the event on the text log port
4766 #if FW_ENABLE_TEXT_LOGGING
4767  if (this->isConnected_logTextOut_OutputPort(0)) {
4768 #if FW_OBJECT_NAMES == 1
4769  const char* _formatString =
4770  "(%s) %s: Global value module=%s name=%s value=%f";
4771 #else
4772  const char* _formatString =
4773  "%s: Global value module=%s name=%s value=%f";
4774 #endif
4775 
4776  Fw::TextLogString _logString;
4777  (void) _logString.format(
4778  _formatString,
4779 #if FW_OBJECT_NAMES == 1
4780  this->m_objName.toChar(),
4781 #endif
4782  "GlobalValueF32 ",
4783  module_name.toChar(),
4784  globalName.toChar(),
4785  static_cast<F64>(value)
4786  );
4787 
4788  this->logTextOut_out(
4789  0,
4790  _id,
4791  _logTime,
4793  _logString
4794  );
4795  }
4796 #endif
4797  }
4798 
4801  const Fw::StringBase& module_name,
4802  const Fw::StringBase& globalName,
4803  F64 value
4804  ) const
4805  {
4806  // Get the time
4807  Fw::Time _logTime;
4808  if (this->isConnected_timeCaller_OutputPort(0)) {
4809  this->timeCaller_out(0, _logTime);
4810  }
4811 
4812  const FwEventIdType _id = this->getIdBase() + EVENTID_GLOBALVALUEF64;
4813 
4814  // Emit the event on the log port
4815  if (this->isConnected_logOut_OutputPort(0)) {
4816  Fw::LogBuffer _logBuff;
4818 
4819 #if FW_AMPCS_COMPATIBLE
4820  // Serialize the number of arguments
4821  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4822  FW_ASSERT(
4823  _status == Fw::FW_SERIALIZE_OK,
4824  static_cast<FwAssertArgType>(_status)
4825  );
4826 #endif
4827 
4828  _status = module_name.serializeTo(
4829  _logBuff,
4830  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4831  );
4832  FW_ASSERT(
4833  _status == Fw::FW_SERIALIZE_OK,
4834  static_cast<FwAssertArgType>(_status)
4835  );
4836 
4837  _status = globalName.serializeTo(
4838  _logBuff,
4839  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 16)
4840  );
4841  FW_ASSERT(
4842  _status == Fw::FW_SERIALIZE_OK,
4843  static_cast<FwAssertArgType>(_status)
4844  );
4845 
4846 #if FW_AMPCS_COMPATIBLE
4847  // Serialize the argument size
4848  _status = _logBuff.serializeFrom(
4849  static_cast<U8>(sizeof(F64))
4850  );
4851  FW_ASSERT(
4852  _status == Fw::FW_SERIALIZE_OK,
4853  static_cast<FwAssertArgType>(_status)
4854  );
4855 #endif
4856  _status = _logBuff.serializeFrom(value);
4857  FW_ASSERT(
4858  _status == Fw::FW_SERIALIZE_OK,
4859  static_cast<FwAssertArgType>(_status)
4860  );
4861 
4862  this->logOut_out(
4863  0,
4864  _id,
4865  _logTime,
4867  _logBuff
4868  );
4869  }
4870 
4871  // Emit the event on the text log port
4872 #if FW_ENABLE_TEXT_LOGGING
4873  if (this->isConnected_logTextOut_OutputPort(0)) {
4874 #if FW_OBJECT_NAMES == 1
4875  const char* _formatString =
4876  "(%s) %s: Global value module=%s name=%s value=%f";
4877 #else
4878  const char* _formatString =
4879  "%s: Global value module=%s name=%s value=%f";
4880 #endif
4881 
4882  Fw::TextLogString _logString;
4883  (void) _logString.format(
4884  _formatString,
4885 #if FW_OBJECT_NAMES == 1
4886  this->m_objName.toChar(),
4887 #endif
4888  "GlobalValueF64 ",
4889  module_name.toChar(),
4890  globalName.toChar(),
4891  value
4892  );
4893 
4894  this->logTextOut_out(
4895  0,
4896  _id,
4897  _logTime,
4899  _logString
4900  );
4901  }
4902 #endif
4903  }
4904 
4907  const Fw::StringBase& fileName,
4908  I32 status
4909  ) const
4910  {
4911  // Get the time
4912  Fw::Time _logTime;
4913  if (this->isConnected_timeCaller_OutputPort(0)) {
4914  this->timeCaller_out(0, _logTime);
4915  }
4916 
4917  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEOPENERROR;
4918 
4919  // Emit the event on the log port
4920  if (this->isConnected_logOut_OutputPort(0)) {
4921  Fw::LogBuffer _logBuff;
4923 
4924 #if FW_AMPCS_COMPATIBLE
4925  // Serialize the number of arguments
4926  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4927  FW_ASSERT(
4928  _status == Fw::FW_SERIALIZE_OK,
4929  static_cast<FwAssertArgType>(_status)
4930  );
4931 #endif
4932 
4933  _status = fileName.serializeTo(
4934  _logBuff,
4935  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4936  );
4937  FW_ASSERT(
4938  _status == Fw::FW_SERIALIZE_OK,
4939  static_cast<FwAssertArgType>(_status)
4940  );
4941 
4942 #if FW_AMPCS_COMPATIBLE
4943  // Serialize the argument size
4944  _status = _logBuff.serializeFrom(
4945  static_cast<U8>(sizeof(I32))
4946  );
4947  FW_ASSERT(
4948  _status == Fw::FW_SERIALIZE_OK,
4949  static_cast<FwAssertArgType>(_status)
4950  );
4951 #endif
4952  _status = _logBuff.serializeFrom(status);
4953  FW_ASSERT(
4954  _status == Fw::FW_SERIALIZE_OK,
4955  static_cast<FwAssertArgType>(_status)
4956  );
4957 
4958  this->logOut_out(
4959  0,
4960  _id,
4961  _logTime,
4963  _logBuff
4964  );
4965  }
4966 
4967  // Emit the event on the text log port
4968 #if FW_ENABLE_TEXT_LOGGING
4969  if (this->isConnected_logTextOut_OutputPort(0)) {
4970 #if FW_OBJECT_NAMES == 1
4971  const char* _formatString =
4972  "(%s) %s: Failed to open Wasm module file %s: status %" PRIi32 "";
4973 #else
4974  const char* _formatString =
4975  "%s: Failed to open Wasm module file %s: status %" PRIi32 "";
4976 #endif
4977 
4978  Fw::TextLogString _logString;
4979  (void) _logString.format(
4980  _formatString,
4981 #if FW_OBJECT_NAMES == 1
4982  this->m_objName.toChar(),
4983 #endif
4984  "FileOpenError ",
4985  fileName.toChar(),
4986  status
4987  );
4988 
4989  this->logTextOut_out(
4990  0,
4991  _id,
4992  _logTime,
4994  _logString
4995  );
4996  }
4997 #endif
4998  }
4999 
5002  const Fw::StringBase& baseDir,
5003  const Fw::StringBase& fileName
5004  ) const
5005  {
5006  // Get the time
5007  Fw::Time _logTime;
5008  if (this->isConnected_timeCaller_OutputPort(0)) {
5009  this->timeCaller_out(0, _logTime);
5010  }
5011 
5013 
5014  // Emit the event on the log port
5015  if (this->isConnected_logOut_OutputPort(0)) {
5016  Fw::LogBuffer _logBuff;
5018 
5019 #if FW_AMPCS_COMPATIBLE
5020  // Serialize the number of arguments
5021  _status = _logBuff.serializeFrom(static_cast<U8>(2));
5022  FW_ASSERT(
5023  _status == Fw::FW_SERIALIZE_OK,
5024  static_cast<FwAssertArgType>(_status)
5025  );
5026 #endif
5027 
5028  _status = baseDir.serializeTo(
5029  _logBuff,
5030  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
5031  );
5032  FW_ASSERT(
5033  _status == Fw::FW_SERIALIZE_OK,
5034  static_cast<FwAssertArgType>(_status)
5035  );
5036 
5037  _status = fileName.serializeTo(
5038  _logBuff,
5039  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
5040  );
5041  FW_ASSERT(
5042  _status == Fw::FW_SERIALIZE_OK,
5043  static_cast<FwAssertArgType>(_status)
5044  );
5045 
5046  this->logOut_out(
5047  0,
5048  _id,
5049  _logTime,
5051  _logBuff
5052  );
5053  }
5054 
5055  // Emit the event on the text log port
5056 #if FW_ENABLE_TEXT_LOGGING
5057  if (this->isConnected_logTextOut_OutputPort(0)) {
5058 #if FW_OBJECT_NAMES == 1
5059  const char* _formatString =
5060  "(%s) %s: Sequence file path too long: base dir %s + file %s";
5061 #else
5062  const char* _formatString =
5063  "%s: Sequence file path too long: base dir %s + file %s";
5064 #endif
5065 
5066  Fw::TextLogString _logString;
5067  (void) _logString.format(
5068  _formatString,
5069 #if FW_OBJECT_NAMES == 1
5070  this->m_objName.toChar(),
5071 #endif
5072  "SequenceFilePathTooLong ",
5073  baseDir.toChar(),
5074  fileName.toChar()
5075  );
5076 
5077  this->logTextOut_out(
5078  0,
5079  _id,
5080  _logTime,
5082  _logString
5083  );
5084  }
5085 #endif
5086  }
5087 
5090  const Fw::StringBase& baseDir,
5091  const Fw::StringBase& fileName
5092  ) const
5093  {
5094  // Get the time
5095  Fw::Time _logTime;
5096  if (this->isConnected_timeCaller_OutputPort(0)) {
5097  this->timeCaller_out(0, _logTime);
5098  }
5099 
5101 
5102  // Emit the event on the log port
5103  if (this->isConnected_logOut_OutputPort(0)) {
5104  Fw::LogBuffer _logBuff;
5106 
5107 #if FW_AMPCS_COMPATIBLE
5108  // Serialize the number of arguments
5109  _status = _logBuff.serializeFrom(static_cast<U8>(2));
5110  FW_ASSERT(
5111  _status == Fw::FW_SERIALIZE_OK,
5112  static_cast<FwAssertArgType>(_status)
5113  );
5114 #endif
5115 
5116  _status = baseDir.serializeTo(
5117  _logBuff,
5118  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
5119  );
5120  FW_ASSERT(
5121  _status == Fw::FW_SERIALIZE_OK,
5122  static_cast<FwAssertArgType>(_status)
5123  );
5124 
5125  _status = fileName.serializeTo(
5126  _logBuff,
5127  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
5128  );
5129  FW_ASSERT(
5130  _status == Fw::FW_SERIALIZE_OK,
5131  static_cast<FwAssertArgType>(_status)
5132  );
5133 
5134  this->logOut_out(
5135  0,
5136  _id,
5137  _logTime,
5139  _logBuff
5140  );
5141  }
5142 
5143  // Emit the event on the text log port
5144 #if FW_ENABLE_TEXT_LOGGING
5145  if (this->isConnected_logTextOut_OutputPort(0)) {
5146 #if FW_OBJECT_NAMES == 1
5147  const char* _formatString =
5148  "(%s) %s: Sequence file %s is not contained within base dir %s (path traversal rejected)";
5149 #else
5150  const char* _formatString =
5151  "%s: Sequence file %s is not contained within base dir %s (path traversal rejected)";
5152 #endif
5153 
5154  Fw::TextLogString _logString;
5155  (void) _logString.format(
5156  _formatString,
5157 #if FW_OBJECT_NAMES == 1
5158  this->m_objName.toChar(),
5159 #endif
5160  "SequenceFilePathNotContained ",
5161  baseDir.toChar(),
5162  fileName.toChar()
5163  );
5164 
5165  this->logTextOut_out(
5166  0,
5167  _id,
5168  _logTime,
5170  _logString
5171  );
5172  }
5173 #endif
5174  }
5175 
5178  {
5179  // Get the time
5180  Fw::Time _logTime;
5181  if (this->isConnected_timeCaller_OutputPort(0)) {
5182  this->timeCaller_out(0, _logTime);
5183  }
5184 
5185  const FwEventIdType _id = this->getIdBase() + EVENTID_MODULELOADFAILED;
5186 
5187  // Emit the event on the log port
5188  if (this->isConnected_logOut_OutputPort(0)) {
5189  Fw::LogBuffer _logBuff;
5191 
5192 #if FW_AMPCS_COMPATIBLE
5193  // Serialize the number of arguments
5194  _status = _logBuff.serializeFrom(static_cast<U8>(1));
5195  FW_ASSERT(
5196  _status == Fw::FW_SERIALIZE_OK,
5197  static_cast<FwAssertArgType>(_status)
5198  );
5199 #endif
5200 
5201 #if FW_AMPCS_COMPATIBLE
5202  // Serialize the argument size
5203  _status = _logBuff.serializeFrom(
5205  );
5206  FW_ASSERT(
5207  _status == Fw::FW_SERIALIZE_OK,
5208  static_cast<FwAssertArgType>(_status)
5209  );
5210 #endif
5211  _status = _logBuff.serializeFrom(status);
5212  FW_ASSERT(
5213  _status == Fw::FW_SERIALIZE_OK,
5214  static_cast<FwAssertArgType>(_status)
5215  );
5216 
5217  this->logOut_out(
5218  0,
5219  _id,
5220  _logTime,
5222  _logBuff
5223  );
5224  }
5225 
5226  // Emit the event on the text log port
5227 #if FW_ENABLE_TEXT_LOGGING
5228  if (this->isConnected_logTextOut_OutputPort(0)) {
5229 #if FW_OBJECT_NAMES == 1
5230  const char* _formatString =
5231  "(%s) %s: Module load failed: %s";
5232 #else
5233  const char* _formatString =
5234  "%s: Module load failed: %s";
5235 #endif
5236 
5237  Fw::String statusStr;
5238  status.toString(statusStr);
5239 
5240  Fw::TextLogString _logString;
5241  (void) _logString.format(
5242  _formatString,
5243 #if FW_OBJECT_NAMES == 1
5244  this->m_objName.toChar(),
5245 #endif
5246  "ModuleLoadFailed ",
5247  statusStr.toChar()
5248  );
5249 
5250  this->logTextOut_out(
5251  0,
5252  _id,
5253  _logTime,
5255  _logString
5256  );
5257  }
5258 #endif
5259  }
5260 
5263  {
5264  // Get the time
5265  Fw::Time _logTime;
5266  if (this->isConnected_timeCaller_OutputPort(0)) {
5267  this->timeCaller_out(0, _logTime);
5268  }
5269 
5271 
5272  // Emit the event on the log port
5273  if (this->isConnected_logOut_OutputPort(0)) {
5274  Fw::LogBuffer _logBuff;
5276 
5277 #if FW_AMPCS_COMPATIBLE
5278  // Serialize the number of arguments
5279  _status = _logBuff.serializeFrom(static_cast<U8>(1));
5280  FW_ASSERT(
5281  _status == Fw::FW_SERIALIZE_OK,
5282  static_cast<FwAssertArgType>(_status)
5283  );
5284 #endif
5285 
5286 #if FW_AMPCS_COMPATIBLE
5287  // Serialize the argument size
5288  _status = _logBuff.serializeFrom(
5290  );
5291  FW_ASSERT(
5292  _status == Fw::FW_SERIALIZE_OK,
5293  static_cast<FwAssertArgType>(_status)
5294  );
5295 #endif
5296  _status = _logBuff.serializeFrom(status);
5297  FW_ASSERT(
5298  _status == Fw::FW_SERIALIZE_OK,
5299  static_cast<FwAssertArgType>(_status)
5300  );
5301 
5302  this->logOut_out(
5303  0,
5304  _id,
5305  _logTime,
5307  _logBuff
5308  );
5309  }
5310 
5311  // Emit the event on the text log port
5312 #if FW_ENABLE_TEXT_LOGGING
5313  if (this->isConnected_logTextOut_OutputPort(0)) {
5314 #if FW_OBJECT_NAMES == 1
5315  const char* _formatString =
5316  "(%s) %s: Module main invoke failed: %s";
5317 #else
5318  const char* _formatString =
5319  "%s: Module main invoke failed: %s";
5320 #endif
5321 
5322  Fw::String statusStr;
5323  status.toString(statusStr);
5324 
5325  Fw::TextLogString _logString;
5326  (void) _logString.format(
5327  _formatString,
5328 #if FW_OBJECT_NAMES == 1
5329  this->m_objName.toChar(),
5330 #endif
5331  "ModuleMainInvokeFailed ",
5332  statusStr.toChar()
5333  );
5334 
5335  this->logTextOut_out(
5336  0,
5337  _id,
5338  _logTime,
5340  _logString
5341  );
5342  }
5343 #endif
5344  }
5345 
5348  {
5349  // Get the time
5350  Fw::Time _logTime;
5351  if (this->isConnected_timeCaller_OutputPort(0)) {
5352  this->timeCaller_out(0, _logTime);
5353  }
5354 
5356 
5357  // Emit the event on the log port
5358  if (this->isConnected_logOut_OutputPort(0)) {
5359  Fw::LogBuffer _logBuff;
5361 
5362 #if FW_AMPCS_COMPATIBLE
5363  // Serialize the number of arguments
5364  _status = _logBuff.serializeFrom(static_cast<U8>(1));
5365  FW_ASSERT(
5366  _status == Fw::FW_SERIALIZE_OK,
5367  static_cast<FwAssertArgType>(_status)
5368  );
5369 #endif
5370 
5371 #if FW_AMPCS_COMPATIBLE
5372  // Serialize the argument size
5373  _status = _logBuff.serializeFrom(
5375  );
5376  FW_ASSERT(
5377  _status == Fw::FW_SERIALIZE_OK,
5378  static_cast<FwAssertArgType>(_status)
5379  );
5380 #endif
5381  _status = _logBuff.serializeFrom(status);
5382  FW_ASSERT(
5383  _status == Fw::FW_SERIALIZE_OK,
5384  static_cast<FwAssertArgType>(_status)
5385  );
5386 
5387  this->logOut_out(
5388  0,
5389  _id,
5390  _logTime,
5392  _logBuff
5393  );
5394  }
5395 
5396  // Emit the event on the text log port
5397 #if FW_ENABLE_TEXT_LOGGING
5398  if (this->isConnected_logTextOut_OutputPort(0)) {
5399 #if FW_OBJECT_NAMES == 1
5400  const char* _formatString =
5401  "(%s) %s: Module start invoke failed: %s";
5402 #else
5403  const char* _formatString =
5404  "%s: Module start invoke failed: %s";
5405 #endif
5406 
5407  Fw::String statusStr;
5408  status.toString(statusStr);
5409 
5410  Fw::TextLogString _logString;
5411  (void) _logString.format(
5412  _formatString,
5413 #if FW_OBJECT_NAMES == 1
5414  this->m_objName.toChar(),
5415 #endif
5416  "ModuleStartInvokeFailed ",
5417  statusStr.toChar()
5418  );
5419 
5420  this->logTextOut_out(
5421  0,
5422  _id,
5423  _logTime,
5425  _logString
5426  );
5427  }
5428 #endif
5429  }
5430 
5433  {
5434  // Get the time
5435  Fw::Time _logTime;
5436  if (this->isConnected_timeCaller_OutputPort(0)) {
5437  this->timeCaller_out(0, _logTime);
5438  }
5439 
5441 
5442  // Emit the event on the log port
5443  if (this->isConnected_logOut_OutputPort(0)) {
5444  Fw::LogBuffer _logBuff;
5445 
5446 #if FW_AMPCS_COMPATIBLE
5448  // Serialize the number of arguments
5449  _status = _logBuff.serializeFrom(static_cast<U8>(0));
5450  FW_ASSERT(
5451  _status == Fw::FW_SERIALIZE_OK,
5452  static_cast<FwAssertArgType>(_status)
5453  );
5454 #endif
5455 
5456  this->logOut_out(
5457  0,
5458  _id,
5459  _logTime,
5461  _logBuff
5462  );
5463  }
5464 
5465  // Emit the event on the text log port
5466 #if FW_ENABLE_TEXT_LOGGING
5467  if (this->isConnected_logTextOut_OutputPort(0)) {
5468 #if FW_OBJECT_NAMES == 1
5469  const char* _formatString =
5470  "(%s) %s: Too many commands blocking on sequencer finish";
5471 #else
5472  const char* _formatString =
5473  "%s: Too many commands blocking on sequencer finish";
5474 #endif
5475 
5476  Fw::TextLogString _logString;
5477  (void) _logString.format(
5478  _formatString,
5479 #if FW_OBJECT_NAMES == 1
5480  this->m_objName.toChar(),
5481 #endif
5482  "TooManyBlockingCommands "
5483  );
5484 
5485  this->logTextOut_out(
5486  0,
5487  _id,
5488  _logTime,
5490  _logString
5491  );
5492  }
5493 #endif
5494  }
5495 
5498  const Svc::WasmSequencer_HostFunction& host_function,
5499  U32 size,
5500  U32 maxSize
5501  ) const
5502  {
5503  // Get the time
5504  Fw::Time _logTime;
5505  if (this->isConnected_timeCaller_OutputPort(0)) {
5506  this->timeCaller_out(0, _logTime);
5507  }
5508 
5509  const FwEventIdType _id = this->getIdBase() + EVENTID_BUFFERTOOLARGE;
5510 
5511  // Emit the event on the log port
5512  if (this->isConnected_logOut_OutputPort(0)) {
5513  Fw::LogBuffer _logBuff;
5515 
5516 #if FW_AMPCS_COMPATIBLE
5517  // Serialize the number of arguments
5518  _status = _logBuff.serializeFrom(static_cast<U8>(3));
5519  FW_ASSERT(
5520  _status == Fw::FW_SERIALIZE_OK,
5521  static_cast<FwAssertArgType>(_status)
5522  );
5523 #endif
5524 
5525 #if FW_AMPCS_COMPATIBLE
5526  // Serialize the argument size
5527  _status = _logBuff.serializeFrom(
5529  );
5530  FW_ASSERT(
5531  _status == Fw::FW_SERIALIZE_OK,
5532  static_cast<FwAssertArgType>(_status)
5533  );
5534 #endif
5535  _status = _logBuff.serializeFrom(host_function);
5536  FW_ASSERT(
5537  _status == Fw::FW_SERIALIZE_OK,
5538  static_cast<FwAssertArgType>(_status)
5539  );
5540 
5541 #if FW_AMPCS_COMPATIBLE
5542  // Serialize the argument size
5543  _status = _logBuff.serializeFrom(
5544  static_cast<U8>(sizeof(U32))
5545  );
5546  FW_ASSERT(
5547  _status == Fw::FW_SERIALIZE_OK,
5548  static_cast<FwAssertArgType>(_status)
5549  );
5550 #endif
5551  _status = _logBuff.serializeFrom(size);
5552  FW_ASSERT(
5553  _status == Fw::FW_SERIALIZE_OK,
5554  static_cast<FwAssertArgType>(_status)
5555  );
5556 
5557 #if FW_AMPCS_COMPATIBLE
5558  // Serialize the argument size
5559  _status = _logBuff.serializeFrom(
5560  static_cast<U8>(sizeof(U32))
5561  );
5562  FW_ASSERT(
5563  _status == Fw::FW_SERIALIZE_OK,
5564  static_cast<FwAssertArgType>(_status)
5565  );
5566 #endif
5567  _status = _logBuff.serializeFrom(maxSize);
5568  FW_ASSERT(
5569  _status == Fw::FW_SERIALIZE_OK,
5570  static_cast<FwAssertArgType>(_status)
5571  );
5572 
5573  this->logOut_out(
5574  0,
5575  _id,
5576  _logTime,
5578  _logBuff
5579  );
5580  }
5581 
5582  // Emit the event on the text log port
5583 #if FW_ENABLE_TEXT_LOGGING
5584  if (this->isConnected_logTextOut_OutputPort(0)) {
5585 #if FW_OBJECT_NAMES == 1
5586  const char* _formatString =
5587  "(%s) %s: Host function %s buffer payload size %" PRIu32 " larger than host maximum size %" PRIu32 "";
5588 #else
5589  const char* _formatString =
5590  "%s: Host function %s buffer payload size %" PRIu32 " larger than host maximum size %" PRIu32 "";
5591 #endif
5592 
5593  Fw::String host_functionStr;
5594  host_function.toString(host_functionStr);
5595 
5596  Fw::TextLogString _logString;
5597  (void) _logString.format(
5598  _formatString,
5599 #if FW_OBJECT_NAMES == 1
5600  this->m_objName.toChar(),
5601 #endif
5602  "BufferTooLarge ",
5603  host_functionStr.toChar(),
5604  size,
5605  maxSize
5606  );
5607 
5608  this->logTextOut_out(
5609  0,
5610  _id,
5611  _logTime,
5613  _logString
5614  );
5615  }
5616 #endif
5617  }
5618 
5621  const Svc::WasmSequencer_HostFunction& host_function,
5622  U32 size,
5623  U32 valueSize
5624  ) const
5625  {
5626  // Get the time
5627  Fw::Time _logTime;
5628  if (this->isConnected_timeCaller_OutputPort(0)) {
5629  this->timeCaller_out(0, _logTime);
5630  }
5631 
5632  const FwEventIdType _id = this->getIdBase() + EVENTID_BUFFERTOOSMALL;
5633 
5634  // Emit the event on the log port
5635  if (this->isConnected_logOut_OutputPort(0)) {
5636  Fw::LogBuffer _logBuff;
5638 
5639 #if FW_AMPCS_COMPATIBLE
5640  // Serialize the number of arguments
5641  _status = _logBuff.serializeFrom(static_cast<U8>(3));
5642  FW_ASSERT(
5643  _status == Fw::FW_SERIALIZE_OK,
5644  static_cast<FwAssertArgType>(_status)
5645  );
5646 #endif
5647 
5648 #if FW_AMPCS_COMPATIBLE
5649  // Serialize the argument size
5650  _status = _logBuff.serializeFrom(
5652  );
5653  FW_ASSERT(
5654  _status == Fw::FW_SERIALIZE_OK,
5655  static_cast<FwAssertArgType>(_status)
5656  );
5657 #endif
5658  _status = _logBuff.serializeFrom(host_function);
5659  FW_ASSERT(
5660  _status == Fw::FW_SERIALIZE_OK,
5661  static_cast<FwAssertArgType>(_status)
5662  );
5663 
5664 #if FW_AMPCS_COMPATIBLE
5665  // Serialize the argument size
5666  _status = _logBuff.serializeFrom(
5667  static_cast<U8>(sizeof(U32))
5668  );
5669  FW_ASSERT(
5670  _status == Fw::FW_SERIALIZE_OK,
5671  static_cast<FwAssertArgType>(_status)
5672  );
5673 #endif
5674  _status = _logBuff.serializeFrom(size);
5675  FW_ASSERT(
5676  _status == Fw::FW_SERIALIZE_OK,
5677  static_cast<FwAssertArgType>(_status)
5678  );
5679 
5680 #if FW_AMPCS_COMPATIBLE
5681  // Serialize the argument size
5682  _status = _logBuff.serializeFrom(
5683  static_cast<U8>(sizeof(U32))
5684  );
5685  FW_ASSERT(
5686  _status == Fw::FW_SERIALIZE_OK,
5687  static_cast<FwAssertArgType>(_status)
5688  );
5689 #endif
5690  _status = _logBuff.serializeFrom(valueSize);
5691  FW_ASSERT(
5692  _status == Fw::FW_SERIALIZE_OK,
5693  static_cast<FwAssertArgType>(_status)
5694  );
5695 
5696  this->logOut_out(
5697  0,
5698  _id,
5699  _logTime,
5701  _logBuff
5702  );
5703  }
5704 
5705  // Emit the event on the text log port
5706 #if FW_ENABLE_TEXT_LOGGING
5707  if (this->isConnected_logTextOut_OutputPort(0)) {
5708 #if FW_OBJECT_NAMES == 1
5709  const char* _formatString =
5710  "(%s) %s: Host function %s buffer payload size %" PRIu32 " smaller than host value size %" PRIu32 "";
5711 #else
5712  const char* _formatString =
5713  "%s: Host function %s buffer payload size %" PRIu32 " smaller than host value size %" PRIu32 "";
5714 #endif
5715 
5716  Fw::String host_functionStr;
5717  host_function.toString(host_functionStr);
5718 
5719  Fw::TextLogString _logString;
5720  (void) _logString.format(
5721  _formatString,
5722 #if FW_OBJECT_NAMES == 1
5723  this->m_objName.toChar(),
5724 #endif
5725  "BufferTooSmall ",
5726  host_functionStr.toChar(),
5727  size,
5728  valueSize
5729  );
5730 
5731  this->logTextOut_out(
5732  0,
5733  _id,
5734  _logTime,
5736  _logString
5737  );
5738  }
5739 #endif
5740  }
5741 
5744  const Svc::WasmSequencer_HostFunction& host_function,
5745  const Svc::WasmSequencer_Status& code
5746  ) const
5747  {
5748  // Get the time
5749  Fw::Time _logTime;
5750  if (this->isConnected_timeCaller_OutputPort(0)) {
5751  this->timeCaller_out(0, _logTime);
5752  }
5753 
5755 
5756  // Emit the event on the log port
5757  if (this->isConnected_logOut_OutputPort(0)) {
5758  Fw::LogBuffer _logBuff;
5760 
5761 #if FW_AMPCS_COMPATIBLE
5762  // Serialize the number of arguments
5763  _status = _logBuff.serializeFrom(static_cast<U8>(2));
5764  FW_ASSERT(
5765  _status == Fw::FW_SERIALIZE_OK,
5766  static_cast<FwAssertArgType>(_status)
5767  );
5768 #endif
5769 
5770 #if FW_AMPCS_COMPATIBLE
5771  // Serialize the argument size
5772  _status = _logBuff.serializeFrom(
5774  );
5775  FW_ASSERT(
5776  _status == Fw::FW_SERIALIZE_OK,
5777  static_cast<FwAssertArgType>(_status)
5778  );
5779 #endif
5780  _status = _logBuff.serializeFrom(host_function);
5781  FW_ASSERT(
5782  _status == Fw::FW_SERIALIZE_OK,
5783  static_cast<FwAssertArgType>(_status)
5784  );
5785 
5786 #if FW_AMPCS_COMPATIBLE
5787  // Serialize the argument size
5788  _status = _logBuff.serializeFrom(
5790  );
5791  FW_ASSERT(
5792  _status == Fw::FW_SERIALIZE_OK,
5793  static_cast<FwAssertArgType>(_status)
5794  );
5795 #endif
5796  _status = _logBuff.serializeFrom(code);
5797  FW_ASSERT(
5798  _status == Fw::FW_SERIALIZE_OK,
5799  static_cast<FwAssertArgType>(_status)
5800  );
5801 
5802  this->logOut_out(
5803  0,
5804  _id,
5805  _logTime,
5807  _logBuff
5808  );
5809  }
5810 
5811  // Emit the event on the text log port
5812 #if FW_ENABLE_TEXT_LOGGING
5813  if (this->isConnected_logTextOut_OutputPort(0)) {
5814 #if FW_OBJECT_NAMES == 1
5815  const char* _formatString =
5816  "(%s) %s: Failed to read guest pointer in host function %s: %s";
5817 #else
5818  const char* _formatString =
5819  "%s: Failed to read guest pointer in host function %s: %s";
5820 #endif
5821 
5822  Fw::String host_functionStr;
5823  host_function.toString(host_functionStr);
5824  Fw::String codeStr;
5825  code.toString(codeStr);
5826 
5827  Fw::TextLogString _logString;
5828  (void) _logString.format(
5829  _formatString,
5830 #if FW_OBJECT_NAMES == 1
5831  this->m_objName.toChar(),
5832 #endif
5833  "HostFunctionInvalidPointer ",
5834  host_functionStr.toChar(),
5835  codeStr.toChar()
5836  );
5837 
5838  this->logTextOut_out(
5839  0,
5840  _id,
5841  _logTime,
5843  _logString
5844  );
5845  }
5846 #endif
5847  }
5848 
5851  {
5852  // Get the time
5853  Fw::Time _logTime;
5854  if (this->isConnected_timeCaller_OutputPort(0)) {
5855  this->timeCaller_out(0, _logTime);
5856  }
5857 
5859 
5860  // Emit the event on the log port
5861  if (this->isConnected_logOut_OutputPort(0)) {
5862  Fw::LogBuffer _logBuff;
5864 
5865 #if FW_AMPCS_COMPATIBLE
5866  // Serialize the number of arguments
5867  _status = _logBuff.serializeFrom(static_cast<U8>(1));
5868  FW_ASSERT(
5869  _status == Fw::FW_SERIALIZE_OK,
5870  static_cast<FwAssertArgType>(_status)
5871  );
5872 #endif
5873 
5874 #if FW_AMPCS_COMPATIBLE
5875  // Serialize the argument size
5876  _status = _logBuff.serializeFrom(
5877  static_cast<U8>(sizeof(I32))
5878  );
5879  FW_ASSERT(
5880  _status == Fw::FW_SERIALIZE_OK,
5881  static_cast<FwAssertArgType>(_status)
5882  );
5883 #endif
5884  _status = _logBuff.serializeFrom(invalidValue);
5885  FW_ASSERT(
5886  _status == Fw::FW_SERIALIZE_OK,
5887  static_cast<FwAssertArgType>(_status)
5888  );
5889 
5890  this->logOut_out(
5891  0,
5892  _id,
5893  _logTime,
5895  _logBuff
5896  );
5897  }
5898 
5899  // Emit the event on the text log port
5900 #if FW_ENABLE_TEXT_LOGGING
5901  if (this->isConnected_logTextOut_OutputPort(0)) {
5902 #if FW_OBJECT_NAMES == 1
5903  const char* _formatString =
5904  "(%s) %s: Invalid blocking type value passed to serial_recv: %" PRIi32 "";
5905 #else
5906  const char* _formatString =
5907  "%s: Invalid blocking type value passed to serial_recv: %" PRIi32 "";
5908 #endif
5909 
5910  Fw::TextLogString _logString;
5911  (void) _logString.format(
5912  _formatString,
5913 #if FW_OBJECT_NAMES == 1
5914  this->m_objName.toChar(),
5915 #endif
5916  "InvalidBlockingTypeValue ",
5917  invalidValue
5918  );
5919 
5920  this->logTextOut_out(
5921  0,
5922  _id,
5923  _logTime,
5925  _logString
5926  );
5927  }
5928 #endif
5929  }
5930 
5933  const Svc::WasmSequencer_HostFunction& host_function,
5934  I32 index,
5935  U32 numPorts
5936  ) const
5937  {
5938  // Get the time
5939  Fw::Time _logTime;
5940  if (this->isConnected_timeCaller_OutputPort(0)) {
5941  this->timeCaller_out(0, _logTime);
5942  }
5943 
5945 
5946  // Emit the event on the log port
5947  if (this->isConnected_logOut_OutputPort(0)) {
5948  Fw::LogBuffer _logBuff;
5950 
5951 #if FW_AMPCS_COMPATIBLE
5952  // Serialize the number of arguments
5953  _status = _logBuff.serializeFrom(static_cast<U8>(3));
5954  FW_ASSERT(
5955  _status == Fw::FW_SERIALIZE_OK,
5956  static_cast<FwAssertArgType>(_status)
5957  );
5958 #endif
5959 
5960 #if FW_AMPCS_COMPATIBLE
5961  // Serialize the argument size
5962  _status = _logBuff.serializeFrom(
5964  );
5965  FW_ASSERT(
5966  _status == Fw::FW_SERIALIZE_OK,
5967  static_cast<FwAssertArgType>(_status)
5968  );
5969 #endif
5970  _status = _logBuff.serializeFrom(host_function);
5971  FW_ASSERT(
5972  _status == Fw::FW_SERIALIZE_OK,
5973  static_cast<FwAssertArgType>(_status)
5974  );
5975 
5976 #if FW_AMPCS_COMPATIBLE
5977  // Serialize the argument size
5978  _status = _logBuff.serializeFrom(
5979  static_cast<U8>(sizeof(I32))
5980  );
5981  FW_ASSERT(
5982  _status == Fw::FW_SERIALIZE_OK,
5983  static_cast<FwAssertArgType>(_status)
5984  );
5985 #endif
5986  _status = _logBuff.serializeFrom(index);
5987  FW_ASSERT(
5988  _status == Fw::FW_SERIALIZE_OK,
5989  static_cast<FwAssertArgType>(_status)
5990  );
5991 
5992 #if FW_AMPCS_COMPATIBLE
5993  // Serialize the argument size
5994  _status = _logBuff.serializeFrom(
5995  static_cast<U8>(sizeof(U32))
5996  );
5997  FW_ASSERT(
5998  _status == Fw::FW_SERIALIZE_OK,
5999  static_cast<FwAssertArgType>(_status)
6000  );
6001 #endif
6002  _status = _logBuff.serializeFrom(numPorts);
6003  FW_ASSERT(
6004  _status == Fw::FW_SERIALIZE_OK,
6005  static_cast<FwAssertArgType>(_status)
6006  );
6007 
6008  this->logOut_out(
6009  0,
6010  _id,
6011  _logTime,
6013  _logBuff
6014  );
6015  }
6016 
6017  // Emit the event on the text log port
6018 #if FW_ENABLE_TEXT_LOGGING
6019  if (this->isConnected_logTextOut_OutputPort(0)) {
6020 #if FW_OBJECT_NAMES == 1
6021  const char* _formatString =
6022  "(%s) %s: Host function %s requested invalid serial port index %" PRIi32 " (have %" PRIu32 " ports)";
6023 #else
6024  const char* _formatString =
6025  "%s: Host function %s requested invalid serial port index %" PRIi32 " (have %" PRIu32 " ports)";
6026 #endif
6027 
6028  Fw::String host_functionStr;
6029  host_function.toString(host_functionStr);
6030 
6031  Fw::TextLogString _logString;
6032  (void) _logString.format(
6033  _formatString,
6034 #if FW_OBJECT_NAMES == 1
6035  this->m_objName.toChar(),
6036 #endif
6037  "HostFunctionInvalidPort ",
6038  host_functionStr.toChar(),
6039  index,
6040  numPorts
6041  );
6042 
6043  this->logTextOut_out(
6044  0,
6045  _id,
6046  _logTime,
6048  _logString
6049  );
6050  }
6051 #endif
6052  }
6053 
6056  const Svc::WasmSequencer_HostFunction& host_function,
6057  I32 status
6058  ) const
6059  {
6060  // Get the time
6061  Fw::Time _logTime;
6062  if (this->isConnected_timeCaller_OutputPort(0)) {
6063  this->timeCaller_out(0, _logTime);
6064  }
6065 
6067 
6068  // Emit the event on the log port
6069  if (this->isConnected_logOut_OutputPort(0)) {
6070  Fw::LogBuffer _logBuff;
6072 
6073 #if FW_AMPCS_COMPATIBLE
6074  // Serialize the number of arguments
6075  _status = _logBuff.serializeFrom(static_cast<U8>(2));
6076  FW_ASSERT(
6077  _status == Fw::FW_SERIALIZE_OK,
6078  static_cast<FwAssertArgType>(_status)
6079  );
6080 #endif
6081 
6082 #if FW_AMPCS_COMPATIBLE
6083  // Serialize the argument size
6084  _status = _logBuff.serializeFrom(
6086  );
6087  FW_ASSERT(
6088  _status == Fw::FW_SERIALIZE_OK,
6089  static_cast<FwAssertArgType>(_status)
6090  );
6091 #endif
6092  _status = _logBuff.serializeFrom(host_function);
6093  FW_ASSERT(
6094  _status == Fw::FW_SERIALIZE_OK,
6095  static_cast<FwAssertArgType>(_status)
6096  );
6097 
6098 #if FW_AMPCS_COMPATIBLE
6099  // Serialize the argument size
6100  _status = _logBuff.serializeFrom(
6101  static_cast<U8>(sizeof(I32))
6102  );
6103  FW_ASSERT(
6104  _status == Fw::FW_SERIALIZE_OK,
6105  static_cast<FwAssertArgType>(_status)
6106  );
6107 #endif
6108  _status = _logBuff.serializeFrom(status);
6109  FW_ASSERT(
6110  _status == Fw::FW_SERIALIZE_OK,
6111  static_cast<FwAssertArgType>(_status)
6112  );
6113 
6114  this->logOut_out(
6115  0,
6116  _id,
6117  _logTime,
6119  _logBuff
6120  );
6121  }
6122 
6123  // Emit the event on the text log port
6124 #if FW_ENABLE_TEXT_LOGGING
6125  if (this->isConnected_logTextOut_OutputPort(0)) {
6126 #if FW_OBJECT_NAMES == 1
6127  const char* _formatString =
6128  "(%s) %s: Host function %s failed to send on serial port: serialize status %" PRIi32 "";
6129 #else
6130  const char* _formatString =
6131  "%s: Host function %s failed to send on serial port: serialize status %" PRIi32 "";
6132 #endif
6133 
6134  Fw::String host_functionStr;
6135  host_function.toString(host_functionStr);
6136 
6137  Fw::TextLogString _logString;
6138  (void) _logString.format(
6139  _formatString,
6140 #if FW_OBJECT_NAMES == 1
6141  this->m_objName.toChar(),
6142 #endif
6143  "SerialPortSendFailed ",
6144  host_functionStr.toChar(),
6145  status
6146  );
6147 
6148  this->logTextOut_out(
6149  0,
6150  _id,
6151  _logTime,
6153  _logString
6154  );
6155  }
6156 #endif
6157  }
6158 
6161  U32 portIndex,
6162  U32 size,
6163  U32 maxSize
6164  ) const
6165  {
6166  // Get the time
6167  Fw::Time _logTime;
6168  if (this->isConnected_timeCaller_OutputPort(0)) {
6169  this->timeCaller_out(0, _logTime);
6170  }
6171 
6173 
6174  // Emit the event on the log port
6175  if (this->isConnected_logOut_OutputPort(0)) {
6176  Fw::LogBuffer _logBuff;
6178 
6179 #if FW_AMPCS_COMPATIBLE
6180  // Serialize the number of arguments
6181  _status = _logBuff.serializeFrom(static_cast<U8>(3));
6182  FW_ASSERT(
6183  _status == Fw::FW_SERIALIZE_OK,
6184  static_cast<FwAssertArgType>(_status)
6185  );
6186 #endif
6187 
6188 #if FW_AMPCS_COMPATIBLE
6189  // Serialize the argument size
6190  _status = _logBuff.serializeFrom(
6191  static_cast<U8>(sizeof(U32))
6192  );
6193  FW_ASSERT(
6194  _status == Fw::FW_SERIALIZE_OK,
6195  static_cast<FwAssertArgType>(_status)
6196  );
6197 #endif
6198  _status = _logBuff.serializeFrom(portIndex);
6199  FW_ASSERT(
6200  _status == Fw::FW_SERIALIZE_OK,
6201  static_cast<FwAssertArgType>(_status)
6202  );
6203 
6204 #if FW_AMPCS_COMPATIBLE
6205  // Serialize the argument size
6206  _status = _logBuff.serializeFrom(
6207  static_cast<U8>(sizeof(U32))
6208  );
6209  FW_ASSERT(
6210  _status == Fw::FW_SERIALIZE_OK,
6211  static_cast<FwAssertArgType>(_status)
6212  );
6213 #endif
6214  _status = _logBuff.serializeFrom(size);
6215  FW_ASSERT(
6216  _status == Fw::FW_SERIALIZE_OK,
6217  static_cast<FwAssertArgType>(_status)
6218  );
6219 
6220 #if FW_AMPCS_COMPATIBLE
6221  // Serialize the argument size
6222  _status = _logBuff.serializeFrom(
6223  static_cast<U8>(sizeof(U32))
6224  );
6225  FW_ASSERT(
6226  _status == Fw::FW_SERIALIZE_OK,
6227  static_cast<FwAssertArgType>(_status)
6228  );
6229 #endif
6230  _status = _logBuff.serializeFrom(maxSize);
6231  FW_ASSERT(
6232  _status == Fw::FW_SERIALIZE_OK,
6233  static_cast<FwAssertArgType>(_status)
6234  );
6235 
6236  this->logOut_out(
6237  0,
6238  _id,
6239  _logTime,
6241  _logBuff
6242  );
6243  }
6244 
6245  // Emit the event on the text log port
6246 #if FW_ENABLE_TEXT_LOGGING
6247  if (this->isConnected_logTextOut_OutputPort(0)) {
6248 #if FW_OBJECT_NAMES == 1
6249  const char* _formatString =
6250  "(%s) %s: Serial input port %" PRIu32 " dropped oversized frame of %" PRIu32 " bytes (queue max %" PRIu32 ")";
6251 #else
6252  const char* _formatString =
6253  "%s: Serial input port %" PRIu32 " dropped oversized frame of %" PRIu32 " bytes (queue max %" PRIu32 ")";
6254 #endif
6255 
6256  Fw::TextLogString _logString;
6257  (void) _logString.format(
6258  _formatString,
6259 #if FW_OBJECT_NAMES == 1
6260  this->m_objName.toChar(),
6261 #endif
6262  "SerialInFrameTooLarge ",
6263  portIndex,
6264  size,
6265  maxSize
6266  );
6267 
6268  this->logTextOut_out(
6269  0,
6270  _id,
6271  _logTime,
6273  _logString
6274  );
6275  }
6276 #endif
6277  }
6278 
6281  I32 raw,
6282  const Fw::StringBase& msg
6283  ) const
6284  {
6285  // Get the time
6286  Fw::Time _logTime;
6287  if (this->isConnected_timeCaller_OutputPort(0)) {
6288  this->timeCaller_out(0, _logTime);
6289  }
6290 
6292 
6293  // Emit the event on the log port
6294  if (this->isConnected_logOut_OutputPort(0)) {
6295  Fw::LogBuffer _logBuff;
6297 
6298 #if FW_AMPCS_COMPATIBLE
6299  // Serialize the number of arguments
6300  _status = _logBuff.serializeFrom(static_cast<U8>(2));
6301  FW_ASSERT(
6302  _status == Fw::FW_SERIALIZE_OK,
6303  static_cast<FwAssertArgType>(_status)
6304  );
6305 #endif
6306 
6307 #if FW_AMPCS_COMPATIBLE
6308  // Serialize the argument size
6309  _status = _logBuff.serializeFrom(
6310  static_cast<U8>(sizeof(I32))
6311  );
6312  FW_ASSERT(
6313  _status == Fw::FW_SERIALIZE_OK,
6314  static_cast<FwAssertArgType>(_status)
6315  );
6316 #endif
6317  _status = _logBuff.serializeFrom(raw);
6318  FW_ASSERT(
6319  _status == Fw::FW_SERIALIZE_OK,
6320  static_cast<FwAssertArgType>(_status)
6321  );
6322 
6323  _status = msg.serializeTo(
6324  _logBuff,
6325  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
6326  );
6327  FW_ASSERT(
6328  _status == Fw::FW_SERIALIZE_OK,
6329  static_cast<FwAssertArgType>(_status)
6330  );
6331 
6332  this->logOut_out(
6333  0,
6334  _id,
6335  _logTime,
6337  _logBuff
6338  );
6339  }
6340 
6341  // Emit the event on the text log port
6342 #if FW_ENABLE_TEXT_LOGGING
6343  if (this->isConnected_logTextOut_OutputPort(0)) {
6344 #if FW_OBJECT_NAMES == 1
6345  const char* _formatString =
6346  "(%s) %s: Guest event at invalid/forbidden severity '%" PRIi32 "': %s";
6347 #else
6348  const char* _formatString =
6349  "%s: Guest event at invalid/forbidden severity '%" PRIi32 "': %s";
6350 #endif
6351 
6352  Fw::TextLogString _logString;
6353  (void) _logString.format(
6354  _formatString,
6355 #if FW_OBJECT_NAMES == 1
6356  this->m_objName.toChar(),
6357 #endif
6358  "HostFunctionInvalidSeverity ",
6359  raw,
6360  msg.toChar()
6361  );
6362 
6363  this->logTextOut_out(
6364  0,
6365  _id,
6366  _logTime,
6368  _logString
6369  );
6370  }
6371 #endif
6372  }
6373 
6376  {
6377  // Get the time
6378  Fw::Time _logTime;
6379  if (this->isConnected_timeCaller_OutputPort(0)) {
6380  this->timeCaller_out(0, _logTime);
6381  }
6382 
6383  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCESTARTING;
6384 
6385  // Emit the event on the log port
6386  if (this->isConnected_logOut_OutputPort(0)) {
6387  Fw::LogBuffer _logBuff;
6389 
6390 #if FW_AMPCS_COMPATIBLE
6391  // Serialize the number of arguments
6392  _status = _logBuff.serializeFrom(static_cast<U8>(1));
6393  FW_ASSERT(
6394  _status == Fw::FW_SERIALIZE_OK,
6395  static_cast<FwAssertArgType>(_status)
6396  );
6397 #endif
6398 
6399 #if FW_AMPCS_COMPATIBLE
6400  // Serialize the argument size
6401  _status = _logBuff.serializeFrom(
6402  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6403  );
6404  FW_ASSERT(
6405  _status == Fw::FW_SERIALIZE_OK,
6406  static_cast<FwAssertArgType>(_status)
6407  );
6408 #endif
6409  _status = _logBuff.serializeFrom(index);
6410  FW_ASSERT(
6411  _status == Fw::FW_SERIALIZE_OK,
6412  static_cast<FwAssertArgType>(_status)
6413  );
6414 
6415  this->logOut_out(
6416  0,
6417  _id,
6418  _logTime,
6420  _logBuff
6421  );
6422  }
6423 
6424  // Emit the event on the text log port
6425 #if FW_ENABLE_TEXT_LOGGING
6426  if (this->isConnected_logTextOut_OutputPort(0)) {
6427 #if FW_OBJECT_NAMES == 1
6428  const char* _formatString =
6429  "(%s) %s: Sequence at index %" PRIu8 " finished starting";
6430 #else
6431  const char* _formatString =
6432  "%s: Sequence at index %" PRIu8 " finished starting";
6433 #endif
6434 
6435  Fw::TextLogString _logString;
6436  (void) _logString.format(
6437  _formatString,
6438 #if FW_OBJECT_NAMES == 1
6439  this->m_objName.toChar(),
6440 #endif
6441  "SequenceStarting ",
6442  index
6443  );
6444 
6445  this->logTextOut_out(
6446  0,
6447  _id,
6448  _logTime,
6450  _logString
6451  );
6452  }
6453 #endif
6454  }
6455 
6458  {
6459  // Get the time
6460  Fw::Time _logTime;
6461  if (this->isConnected_timeCaller_OutputPort(0)) {
6462  this->timeCaller_out(0, _logTime);
6463  }
6464 
6465  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCESUCCEEDED;
6466 
6467  // Emit the event on the log port
6468  if (this->isConnected_logOut_OutputPort(0)) {
6469  Fw::LogBuffer _logBuff;
6471 
6472 #if FW_AMPCS_COMPATIBLE
6473  // Serialize the number of arguments
6474  _status = _logBuff.serializeFrom(static_cast<U8>(1));
6475  FW_ASSERT(
6476  _status == Fw::FW_SERIALIZE_OK,
6477  static_cast<FwAssertArgType>(_status)
6478  );
6479 #endif
6480 
6481 #if FW_AMPCS_COMPATIBLE
6482  // Serialize the argument size
6483  _status = _logBuff.serializeFrom(
6484  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6485  );
6486  FW_ASSERT(
6487  _status == Fw::FW_SERIALIZE_OK,
6488  static_cast<FwAssertArgType>(_status)
6489  );
6490 #endif
6491  _status = _logBuff.serializeFrom(index);
6492  FW_ASSERT(
6493  _status == Fw::FW_SERIALIZE_OK,
6494  static_cast<FwAssertArgType>(_status)
6495  );
6496 
6497  this->logOut_out(
6498  0,
6499  _id,
6500  _logTime,
6502  _logBuff
6503  );
6504  }
6505 
6506  // Emit the event on the text log port
6507 #if FW_ENABLE_TEXT_LOGGING
6508  if (this->isConnected_logTextOut_OutputPort(0)) {
6509 #if FW_OBJECT_NAMES == 1
6510  const char* _formatString =
6511  "(%s) %s: Sequence at index %" PRIu8 " finished successfully";
6512 #else
6513  const char* _formatString =
6514  "%s: Sequence at index %" PRIu8 " finished successfully";
6515 #endif
6516 
6517  Fw::TextLogString _logString;
6518  (void) _logString.format(
6519  _formatString,
6520 #if FW_OBJECT_NAMES == 1
6521  this->m_objName.toChar(),
6522 #endif
6523  "SequenceSucceeded ",
6524  index
6525  );
6526 
6527  this->logTextOut_out(
6528  0,
6529  _id,
6530  _logTime,
6532  _logString
6533  );
6534  }
6535 #endif
6536  }
6537 
6542  ) const
6543  {
6544  // Get the time
6545  Fw::Time _logTime;
6546  if (this->isConnected_timeCaller_OutputPort(0)) {
6547  this->timeCaller_out(0, _logTime);
6548  }
6549 
6550  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCECANCELLED;
6551 
6552  // Emit the event on the log port
6553  if (this->isConnected_logOut_OutputPort(0)) {
6554  Fw::LogBuffer _logBuff;
6556 
6557 #if FW_AMPCS_COMPATIBLE
6558  // Serialize the number of arguments
6559  _status = _logBuff.serializeFrom(static_cast<U8>(2));
6560  FW_ASSERT(
6561  _status == Fw::FW_SERIALIZE_OK,
6562  static_cast<FwAssertArgType>(_status)
6563  );
6564 #endif
6565 
6566 #if FW_AMPCS_COMPATIBLE
6567  // Serialize the argument size
6568  _status = _logBuff.serializeFrom(
6569  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6570  );
6571  FW_ASSERT(
6572  _status == Fw::FW_SERIALIZE_OK,
6573  static_cast<FwAssertArgType>(_status)
6574  );
6575 #endif
6576  _status = _logBuff.serializeFrom(index);
6577  FW_ASSERT(
6578  _status == Fw::FW_SERIALIZE_OK,
6579  static_cast<FwAssertArgType>(_status)
6580  );
6581 
6582 #if FW_AMPCS_COMPATIBLE
6583  // Serialize the argument size
6584  _status = _logBuff.serializeFrom(
6586  );
6587  FW_ASSERT(
6588  _status == Fw::FW_SERIALIZE_OK,
6589  static_cast<FwAssertArgType>(_status)
6590  );
6591 #endif
6592  _status = _logBuff.serializeFrom(phase);
6593  FW_ASSERT(
6594  _status == Fw::FW_SERIALIZE_OK,
6595  static_cast<FwAssertArgType>(_status)
6596  );
6597 
6598  this->logOut_out(
6599  0,
6600  _id,
6601  _logTime,
6603  _logBuff
6604  );
6605  }
6606 
6607  // Emit the event on the text log port
6608 #if FW_ENABLE_TEXT_LOGGING
6609  if (this->isConnected_logTextOut_OutputPort(0)) {
6610 #if FW_OBJECT_NAMES == 1
6611  const char* _formatString =
6612  "(%s) %s: Sequence at index %" PRIu8 " was cancelled during %s";
6613 #else
6614  const char* _formatString =
6615  "%s: Sequence at index %" PRIu8 " was cancelled during %s";
6616 #endif
6617 
6618  Fw::String phaseStr;
6619  phase.toString(phaseStr);
6620 
6621  Fw::TextLogString _logString;
6622  (void) _logString.format(
6623  _formatString,
6624 #if FW_OBJECT_NAMES == 1
6625  this->m_objName.toChar(),
6626 #endif
6627  "SequenceCancelled ",
6628  index,
6629  phaseStr.toChar()
6630  );
6631 
6632  this->logTextOut_out(
6633  0,
6634  _id,
6635  _logTime,
6637  _logString
6638  );
6639  }
6640 #endif
6641  }
6642 
6646  const Svc::WasmSequencer_SequencePhase& phase,
6647  I32 code
6648  ) const
6649  {
6650  // Get the time
6651  Fw::Time _logTime;
6652  if (this->isConnected_timeCaller_OutputPort(0)) {
6653  this->timeCaller_out(0, _logTime);
6654  }
6655 
6656  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCEEXITED;
6657 
6658  // Emit the event on the log port
6659  if (this->isConnected_logOut_OutputPort(0)) {
6660  Fw::LogBuffer _logBuff;
6662 
6663 #if FW_AMPCS_COMPATIBLE
6664  // Serialize the number of arguments
6665  _status = _logBuff.serializeFrom(static_cast<U8>(3));
6666  FW_ASSERT(
6667  _status == Fw::FW_SERIALIZE_OK,
6668  static_cast<FwAssertArgType>(_status)
6669  );
6670 #endif
6671 
6672 #if FW_AMPCS_COMPATIBLE
6673  // Serialize the argument size
6674  _status = _logBuff.serializeFrom(
6675  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6676  );
6677  FW_ASSERT(
6678  _status == Fw::FW_SERIALIZE_OK,
6679  static_cast<FwAssertArgType>(_status)
6680  );
6681 #endif
6682  _status = _logBuff.serializeFrom(index);
6683  FW_ASSERT(
6684  _status == Fw::FW_SERIALIZE_OK,
6685  static_cast<FwAssertArgType>(_status)
6686  );
6687 
6688 #if FW_AMPCS_COMPATIBLE
6689  // Serialize the argument size
6690  _status = _logBuff.serializeFrom(
6692  );
6693  FW_ASSERT(
6694  _status == Fw::FW_SERIALIZE_OK,
6695  static_cast<FwAssertArgType>(_status)
6696  );
6697 #endif
6698  _status = _logBuff.serializeFrom(phase);
6699  FW_ASSERT(
6700  _status == Fw::FW_SERIALIZE_OK,
6701  static_cast<FwAssertArgType>(_status)
6702  );
6703 
6704 #if FW_AMPCS_COMPATIBLE
6705  // Serialize the argument size
6706  _status = _logBuff.serializeFrom(
6707  static_cast<U8>(sizeof(I32))
6708  );
6709  FW_ASSERT(
6710  _status == Fw::FW_SERIALIZE_OK,
6711  static_cast<FwAssertArgType>(_status)
6712  );
6713 #endif
6714  _status = _logBuff.serializeFrom(code);
6715  FW_ASSERT(
6716  _status == Fw::FW_SERIALIZE_OK,
6717  static_cast<FwAssertArgType>(_status)
6718  );
6719 
6720  this->logOut_out(
6721  0,
6722  _id,
6723  _logTime,
6725  _logBuff
6726  );
6727  }
6728 
6729  // Emit the event on the text log port
6730 #if FW_ENABLE_TEXT_LOGGING
6731  if (this->isConnected_logTextOut_OutputPort(0)) {
6732 #if FW_OBJECT_NAMES == 1
6733  const char* _formatString =
6734  "(%s) %s: Sequence at index %" PRIu8 " exited during %s with non-zero code %" PRIi32 "";
6735 #else
6736  const char* _formatString =
6737  "%s: Sequence at index %" PRIu8 " exited during %s with non-zero code %" PRIi32 "";
6738 #endif
6739 
6740  Fw::String phaseStr;
6741  phase.toString(phaseStr);
6742 
6743  Fw::TextLogString _logString;
6744  (void) _logString.format(
6745  _formatString,
6746 #if FW_OBJECT_NAMES == 1
6747  this->m_objName.toChar(),
6748 #endif
6749  "SequenceExited ",
6750  index,
6751  phaseStr.toChar(),
6752  code
6753  );
6754 
6755  this->logTextOut_out(
6756  0,
6757  _id,
6758  _logTime,
6760  _logString
6761  );
6762  }
6763 #endif
6764  }
6765 
6769  const Svc::WasmSequencer_SequencePhase& phase,
6770  I32 code
6771  ) const
6772  {
6773  // Get the time
6774  Fw::Time _logTime;
6775  if (this->isConnected_timeCaller_OutputPort(0)) {
6776  this->timeCaller_out(0, _logTime);
6777  }
6778 
6779  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCEPANIC;
6780 
6781  // Emit the event on the log port
6782  if (this->isConnected_logOut_OutputPort(0)) {
6783  Fw::LogBuffer _logBuff;
6785 
6786 #if FW_AMPCS_COMPATIBLE
6787  // Serialize the number of arguments
6788  _status = _logBuff.serializeFrom(static_cast<U8>(3));
6789  FW_ASSERT(
6790  _status == Fw::FW_SERIALIZE_OK,
6791  static_cast<FwAssertArgType>(_status)
6792  );
6793 #endif
6794 
6795 #if FW_AMPCS_COMPATIBLE
6796  // Serialize the argument size
6797  _status = _logBuff.serializeFrom(
6798  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6799  );
6800  FW_ASSERT(
6801  _status == Fw::FW_SERIALIZE_OK,
6802  static_cast<FwAssertArgType>(_status)
6803  );
6804 #endif
6805  _status = _logBuff.serializeFrom(index);
6806  FW_ASSERT(
6807  _status == Fw::FW_SERIALIZE_OK,
6808  static_cast<FwAssertArgType>(_status)
6809  );
6810 
6811 #if FW_AMPCS_COMPATIBLE
6812  // Serialize the argument size
6813  _status = _logBuff.serializeFrom(
6815  );
6816  FW_ASSERT(
6817  _status == Fw::FW_SERIALIZE_OK,
6818  static_cast<FwAssertArgType>(_status)
6819  );
6820 #endif
6821  _status = _logBuff.serializeFrom(phase);
6822  FW_ASSERT(
6823  _status == Fw::FW_SERIALIZE_OK,
6824  static_cast<FwAssertArgType>(_status)
6825  );
6826 
6827 #if FW_AMPCS_COMPATIBLE
6828  // Serialize the argument size
6829  _status = _logBuff.serializeFrom(
6830  static_cast<U8>(sizeof(I32))
6831  );
6832  FW_ASSERT(
6833  _status == Fw::FW_SERIALIZE_OK,
6834  static_cast<FwAssertArgType>(_status)
6835  );
6836 #endif
6837  _status = _logBuff.serializeFrom(code);
6838  FW_ASSERT(
6839  _status == Fw::FW_SERIALIZE_OK,
6840  static_cast<FwAssertArgType>(_status)
6841  );
6842 
6843  this->logOut_out(
6844  0,
6845  _id,
6846  _logTime,
6848  _logBuff
6849  );
6850  }
6851 
6852  // Emit the event on the text log port
6853 #if FW_ENABLE_TEXT_LOGGING
6854  if (this->isConnected_logTextOut_OutputPort(0)) {
6855 #if FW_OBJECT_NAMES == 1
6856  const char* _formatString =
6857  "(%s) %s: Sequence at index %" PRIu8 " panicked during %s with code %" PRIi32 "";
6858 #else
6859  const char* _formatString =
6860  "%s: Sequence at index %" PRIu8 " panicked during %s with code %" PRIi32 "";
6861 #endif
6862 
6863  Fw::String phaseStr;
6864  phase.toString(phaseStr);
6865 
6866  Fw::TextLogString _logString;
6867  (void) _logString.format(
6868  _formatString,
6869 #if FW_OBJECT_NAMES == 1
6870  this->m_objName.toChar(),
6871 #endif
6872  "SequencePanic ",
6873  index,
6874  phaseStr.toChar(),
6875  code
6876  );
6877 
6878  this->logTextOut_out(
6879  0,
6880  _id,
6881  _logTime,
6883  _logString
6884  );
6885  }
6886 #endif
6887  }
6888 
6892  const Svc::WasmSequencer_SequencePhase& phase,
6893  const Svc::WasmSequencer_TrapReason& reason
6894  ) const
6895  {
6896  // Get the time
6897  Fw::Time _logTime;
6898  if (this->isConnected_timeCaller_OutputPort(0)) {
6899  this->timeCaller_out(0, _logTime);
6900  }
6901 
6902  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCETRAPPED;
6903 
6904  // Emit the event on the log port
6905  if (this->isConnected_logOut_OutputPort(0)) {
6906  Fw::LogBuffer _logBuff;
6908 
6909 #if FW_AMPCS_COMPATIBLE
6910  // Serialize the number of arguments
6911  _status = _logBuff.serializeFrom(static_cast<U8>(3));
6912  FW_ASSERT(
6913  _status == Fw::FW_SERIALIZE_OK,
6914  static_cast<FwAssertArgType>(_status)
6915  );
6916 #endif
6917 
6918 #if FW_AMPCS_COMPATIBLE
6919  // Serialize the argument size
6920  _status = _logBuff.serializeFrom(
6921  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
6922  );
6923  FW_ASSERT(
6924  _status == Fw::FW_SERIALIZE_OK,
6925  static_cast<FwAssertArgType>(_status)
6926  );
6927 #endif
6928  _status = _logBuff.serializeFrom(index);
6929  FW_ASSERT(
6930  _status == Fw::FW_SERIALIZE_OK,
6931  static_cast<FwAssertArgType>(_status)
6932  );
6933 
6934 #if FW_AMPCS_COMPATIBLE
6935  // Serialize the argument size
6936  _status = _logBuff.serializeFrom(
6938  );
6939  FW_ASSERT(
6940  _status == Fw::FW_SERIALIZE_OK,
6941  static_cast<FwAssertArgType>(_status)
6942  );
6943 #endif
6944  _status = _logBuff.serializeFrom(phase);
6945  FW_ASSERT(
6946  _status == Fw::FW_SERIALIZE_OK,
6947  static_cast<FwAssertArgType>(_status)
6948  );
6949 
6950 #if FW_AMPCS_COMPATIBLE
6951  // Serialize the argument size
6952  _status = _logBuff.serializeFrom(
6954  );
6955  FW_ASSERT(
6956  _status == Fw::FW_SERIALIZE_OK,
6957  static_cast<FwAssertArgType>(_status)
6958  );
6959 #endif
6960  _status = _logBuff.serializeFrom(reason);
6961  FW_ASSERT(
6962  _status == Fw::FW_SERIALIZE_OK,
6963  static_cast<FwAssertArgType>(_status)
6964  );
6965 
6966  this->logOut_out(
6967  0,
6968  _id,
6969  _logTime,
6971  _logBuff
6972  );
6973  }
6974 
6975  // Emit the event on the text log port
6976 #if FW_ENABLE_TEXT_LOGGING
6977  if (this->isConnected_logTextOut_OutputPort(0)) {
6978 #if FW_OBJECT_NAMES == 1
6979  const char* _formatString =
6980  "(%s) %s: Sequence at index %" PRIu8 " trapped during %s: %s";
6981 #else
6982  const char* _formatString =
6983  "%s: Sequence at index %" PRIu8 " trapped during %s: %s";
6984 #endif
6985 
6986  Fw::String phaseStr;
6987  phase.toString(phaseStr);
6988  Fw::String reasonStr;
6989  reason.toString(reasonStr);
6990 
6991  Fw::TextLogString _logString;
6992  (void) _logString.format(
6993  _formatString,
6994 #if FW_OBJECT_NAMES == 1
6995  this->m_objName.toChar(),
6996 #endif
6997  "SequenceTrapped ",
6998  index,
6999  phaseStr.toChar(),
7000  reasonStr.toChar()
7001  );
7002 
7003  this->logTextOut_out(
7004  0,
7005  _id,
7006  _logTime,
7008  _logString
7009  );
7010  }
7011 #endif
7012  }
7013 
7017  const Svc::WasmSequencer_SequencePhase& phase,
7018  const Svc::WasmSequencer_ExitReason& reason,
7019  const Svc::WasmSequencer_HostFunction& hostFunction
7020  ) const
7021  {
7022  // Get the time
7023  Fw::Time _logTime;
7024  if (this->isConnected_timeCaller_OutputPort(0)) {
7025  this->timeCaller_out(0, _logTime);
7026  }
7027 
7028  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCEHOSTFAILURE;
7029 
7030  // Emit the event on the log port
7031  if (this->isConnected_logOut_OutputPort(0)) {
7032  Fw::LogBuffer _logBuff;
7034 
7035 #if FW_AMPCS_COMPATIBLE
7036  // Serialize the number of arguments
7037  _status = _logBuff.serializeFrom(static_cast<U8>(4));
7038  FW_ASSERT(
7039  _status == Fw::FW_SERIALIZE_OK,
7040  static_cast<FwAssertArgType>(_status)
7041  );
7042 #endif
7043 
7044 #if FW_AMPCS_COMPATIBLE
7045  // Serialize the argument size
7046  _status = _logBuff.serializeFrom(
7047  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
7048  );
7049  FW_ASSERT(
7050  _status == Fw::FW_SERIALIZE_OK,
7051  static_cast<FwAssertArgType>(_status)
7052  );
7053 #endif
7054  _status = _logBuff.serializeFrom(index);
7055  FW_ASSERT(
7056  _status == Fw::FW_SERIALIZE_OK,
7057  static_cast<FwAssertArgType>(_status)
7058  );
7059 
7060 #if FW_AMPCS_COMPATIBLE
7061  // Serialize the argument size
7062  _status = _logBuff.serializeFrom(
7064  );
7065  FW_ASSERT(
7066  _status == Fw::FW_SERIALIZE_OK,
7067  static_cast<FwAssertArgType>(_status)
7068  );
7069 #endif
7070  _status = _logBuff.serializeFrom(phase);
7071  FW_ASSERT(
7072  _status == Fw::FW_SERIALIZE_OK,
7073  static_cast<FwAssertArgType>(_status)
7074  );
7075 
7076 #if FW_AMPCS_COMPATIBLE
7077  // Serialize the argument size
7078  _status = _logBuff.serializeFrom(
7080  );
7081  FW_ASSERT(
7082  _status == Fw::FW_SERIALIZE_OK,
7083  static_cast<FwAssertArgType>(_status)
7084  );
7085 #endif
7086  _status = _logBuff.serializeFrom(reason);
7087  FW_ASSERT(
7088  _status == Fw::FW_SERIALIZE_OK,
7089  static_cast<FwAssertArgType>(_status)
7090  );
7091 
7092 #if FW_AMPCS_COMPATIBLE
7093  // Serialize the argument size
7094  _status = _logBuff.serializeFrom(
7096  );
7097  FW_ASSERT(
7098  _status == Fw::FW_SERIALIZE_OK,
7099  static_cast<FwAssertArgType>(_status)
7100  );
7101 #endif
7102  _status = _logBuff.serializeFrom(hostFunction);
7103  FW_ASSERT(
7104  _status == Fw::FW_SERIALIZE_OK,
7105  static_cast<FwAssertArgType>(_status)
7106  );
7107 
7108  this->logOut_out(
7109  0,
7110  _id,
7111  _logTime,
7113  _logBuff
7114  );
7115  }
7116 
7117  // Emit the event on the text log port
7118 #if FW_ENABLE_TEXT_LOGGING
7119  if (this->isConnected_logTextOut_OutputPort(0)) {
7120 #if FW_OBJECT_NAMES == 1
7121  const char* _formatString =
7122  "(%s) %s: Sequence at index %" PRIu8 " failed during %s: %s while awaiting host function %s";
7123 #else
7124  const char* _formatString =
7125  "%s: Sequence at index %" PRIu8 " failed during %s: %s while awaiting host function %s";
7126 #endif
7127 
7128  Fw::String phaseStr;
7129  phase.toString(phaseStr);
7130  Fw::String reasonStr;
7131  reason.toString(reasonStr);
7132  Fw::String hostFunctionStr;
7133  hostFunction.toString(hostFunctionStr);
7134 
7135  Fw::TextLogString _logString;
7136  (void) _logString.format(
7137  _formatString,
7138 #if FW_OBJECT_NAMES == 1
7139  this->m_objName.toChar(),
7140 #endif
7141  "SequenceHostFailure ",
7142  index,
7143  phaseStr.toChar(),
7144  reasonStr.toChar(),
7145  hostFunctionStr.toChar()
7146  );
7147 
7148  this->logTextOut_out(
7149  0,
7150  _id,
7151  _logTime,
7153  _logString
7154  );
7155  }
7156 #endif
7157  }
7158 
7161  {
7162  // Get the time
7163  Fw::Time _logTime;
7164  if (this->isConnected_timeCaller_OutputPort(0)) {
7165  this->timeCaller_out(0, _logTime);
7166  }
7167 
7168  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCEPAUSED;
7169 
7170  // Emit the event on the log port
7171  if (this->isConnected_logOut_OutputPort(0)) {
7172  Fw::LogBuffer _logBuff;
7173 
7174 #if FW_AMPCS_COMPATIBLE
7176  // Serialize the number of arguments
7177  _status = _logBuff.serializeFrom(static_cast<U8>(0));
7178  FW_ASSERT(
7179  _status == Fw::FW_SERIALIZE_OK,
7180  static_cast<FwAssertArgType>(_status)
7181  );
7182 #endif
7183 
7184  this->logOut_out(
7185  0,
7186  _id,
7187  _logTime,
7189  _logBuff
7190  );
7191  }
7192 
7193  // Emit the event on the text log port
7194 #if FW_ENABLE_TEXT_LOGGING
7195  if (this->isConnected_logTextOut_OutputPort(0)) {
7196 #if FW_OBJECT_NAMES == 1
7197  const char* _formatString =
7198  "(%s) %s: Sequence execution paused";
7199 #else
7200  const char* _formatString =
7201  "%s: Sequence execution paused";
7202 #endif
7203 
7204  Fw::TextLogString _logString;
7205  (void) _logString.format(
7206  _formatString,
7207 #if FW_OBJECT_NAMES == 1
7208  this->m_objName.toChar(),
7209 #endif
7210  "SequencePaused "
7211  );
7212 
7213  this->logTextOut_out(
7214  0,
7215  _id,
7216  _logTime,
7218  _logString
7219  );
7220  }
7221 #endif
7222  }
7223 
7226  {
7227  // Get the time
7228  Fw::Time _logTime;
7229  if (this->isConnected_timeCaller_OutputPort(0)) {
7230  this->timeCaller_out(0, _logTime);
7231  }
7232 
7233  const FwEventIdType _id = this->getIdBase() + EVENTID_SEQUENCENOTRUNNING;
7234 
7235  // Emit the event on the log port
7236  if (this->isConnected_logOut_OutputPort(0)) {
7237  Fw::LogBuffer _logBuff;
7238 
7239 #if FW_AMPCS_COMPATIBLE
7241  // Serialize the number of arguments
7242  _status = _logBuff.serializeFrom(static_cast<U8>(0));
7243  FW_ASSERT(
7244  _status == Fw::FW_SERIALIZE_OK,
7245  static_cast<FwAssertArgType>(_status)
7246  );
7247 #endif
7248 
7249  this->logOut_out(
7250  0,
7251  _id,
7252  _logTime,
7254  _logBuff
7255  );
7256  }
7257 
7258  // Emit the event on the text log port
7259 #if FW_ENABLE_TEXT_LOGGING
7260  if (this->isConnected_logTextOut_OutputPort(0)) {
7261 #if FW_OBJECT_NAMES == 1
7262  const char* _formatString =
7263  "(%s) %s: Sequence cannot continue when interpreter is not running";
7264 #else
7265  const char* _formatString =
7266  "%s: Sequence cannot continue when interpreter is not running";
7267 #endif
7268 
7269  Fw::TextLogString _logString;
7270  (void) _logString.format(
7271  _formatString,
7272 #if FW_OBJECT_NAMES == 1
7273  this->m_objName.toChar(),
7274 #endif
7275  "SequenceNotRunning "
7276  );
7277 
7278  this->logTextOut_out(
7279  0,
7280  _id,
7281  _logTime,
7283  _logString
7284  );
7285  }
7286 #endif
7287  }
7288 
7291  const Svc::WasmSequencer_HostFunction& host_function,
7292  U64 micros
7293  ) const
7294  {
7295  // Get the time
7296  Fw::Time _logTime;
7297  if (this->isConnected_timeCaller_OutputPort(0)) {
7298  this->timeCaller_out(0, _logTime);
7299  }
7300 
7302 
7303  // Emit the event on the log port
7304  if (this->isConnected_logOut_OutputPort(0)) {
7305  Fw::LogBuffer _logBuff;
7307 
7308 #if FW_AMPCS_COMPATIBLE
7309  // Serialize the number of arguments
7310  _status = _logBuff.serializeFrom(static_cast<U8>(2));
7311  FW_ASSERT(
7312  _status == Fw::FW_SERIALIZE_OK,
7313  static_cast<FwAssertArgType>(_status)
7314  );
7315 #endif
7316 
7317 #if FW_AMPCS_COMPATIBLE
7318  // Serialize the argument size
7319  _status = _logBuff.serializeFrom(
7321  );
7322  FW_ASSERT(
7323  _status == Fw::FW_SERIALIZE_OK,
7324  static_cast<FwAssertArgType>(_status)
7325  );
7326 #endif
7327  _status = _logBuff.serializeFrom(host_function);
7328  FW_ASSERT(
7329  _status == Fw::FW_SERIALIZE_OK,
7330  static_cast<FwAssertArgType>(_status)
7331  );
7332 
7333 #if FW_AMPCS_COMPATIBLE
7334  // Serialize the argument size
7335  _status = _logBuff.serializeFrom(
7336  static_cast<U8>(sizeof(U64))
7337  );
7338  FW_ASSERT(
7339  _status == Fw::FW_SERIALIZE_OK,
7340  static_cast<FwAssertArgType>(_status)
7341  );
7342 #endif
7343  _status = _logBuff.serializeFrom(micros);
7344  FW_ASSERT(
7345  _status == Fw::FW_SERIALIZE_OK,
7346  static_cast<FwAssertArgType>(_status)
7347  );
7348 
7349  this->logOut_out(
7350  0,
7351  _id,
7352  _logTime,
7354  _logBuff
7355  );
7356  }
7357 
7358  // Emit the event on the text log port
7359 #if FW_ENABLE_TEXT_LOGGING
7360  if (this->isConnected_logTextOut_OutputPort(0)) {
7361 #if FW_OBJECT_NAMES == 1
7362  const char* _formatString =
7363  "(%s) %s: Host function %s requested a sleep of %" PRIu64 " us that overflows the host timer";
7364 #else
7365  const char* _formatString =
7366  "%s: Host function %s requested a sleep of %" PRIu64 " us that overflows the host timer";
7367 #endif
7368 
7369  Fw::String host_functionStr;
7370  host_function.toString(host_functionStr);
7371 
7372  Fw::TextLogString _logString;
7373  (void) _logString.format(
7374  _formatString,
7375 #if FW_OBJECT_NAMES == 1
7376  this->m_objName.toChar(),
7377 #endif
7378  "SleepDurationTooLarge ",
7379  host_functionStr.toChar(),
7380  micros
7381  );
7382 
7383  this->logTextOut_out(
7384  0,
7385  _id,
7386  _logTime,
7388  _logString
7389  );
7390  }
7391 #endif
7392  }
7393 
7396  const Svc::WasmSequencer_HostFunction& host_function,
7397  I64 id
7398  ) const
7399  {
7400  // Get the time
7401  Fw::Time _logTime;
7402  if (this->isConnected_timeCaller_OutputPort(0)) {
7403  this->timeCaller_out(0, _logTime);
7404  }
7405 
7407 
7408  // Emit the event on the log port
7409  if (this->isConnected_logOut_OutputPort(0)) {
7410  Fw::LogBuffer _logBuff;
7412 
7413 #if FW_AMPCS_COMPATIBLE
7414  // Serialize the number of arguments
7415  _status = _logBuff.serializeFrom(static_cast<U8>(2));
7416  FW_ASSERT(
7417  _status == Fw::FW_SERIALIZE_OK,
7418  static_cast<FwAssertArgType>(_status)
7419  );
7420 #endif
7421 
7422 #if FW_AMPCS_COMPATIBLE
7423  // Serialize the argument size
7424  _status = _logBuff.serializeFrom(
7426  );
7427  FW_ASSERT(
7428  _status == Fw::FW_SERIALIZE_OK,
7429  static_cast<FwAssertArgType>(_status)
7430  );
7431 #endif
7432  _status = _logBuff.serializeFrom(host_function);
7433  FW_ASSERT(
7434  _status == Fw::FW_SERIALIZE_OK,
7435  static_cast<FwAssertArgType>(_status)
7436  );
7437 
7438 #if FW_AMPCS_COMPATIBLE
7439  // Serialize the argument size
7440  _status = _logBuff.serializeFrom(
7441  static_cast<U8>(sizeof(I64))
7442  );
7443  FW_ASSERT(
7444  _status == Fw::FW_SERIALIZE_OK,
7445  static_cast<FwAssertArgType>(_status)
7446  );
7447 #endif
7448  _status = _logBuff.serializeFrom(id);
7449  FW_ASSERT(
7450  _status == Fw::FW_SERIALIZE_OK,
7451  static_cast<FwAssertArgType>(_status)
7452  );
7453 
7454  this->logOut_out(
7455  0,
7456  _id,
7457  _logTime,
7459  _logBuff
7460  );
7461  }
7462 
7463  // Emit the event on the text log port
7464 #if FW_ENABLE_TEXT_LOGGING
7465  if (this->isConnected_logTextOut_OutputPort(0)) {
7466 #if FW_OBJECT_NAMES == 1
7467  const char* _formatString =
7468  "(%s) %s: Host function %s requested id %" PRIi64 " outside representable id range";
7469 #else
7470  const char* _formatString =
7471  "%s: Host function %s requested id %" PRIi64 " outside representable id range";
7472 #endif
7473 
7474  Fw::String host_functionStr;
7475  host_function.toString(host_functionStr);
7476 
7477  Fw::TextLogString _logString;
7478  (void) _logString.format(
7479  _formatString,
7480 #if FW_OBJECT_NAMES == 1
7481  this->m_objName.toChar(),
7482 #endif
7483  "HostFunctionInvalidId ",
7484  host_functionStr.toChar(),
7485  id
7486  );
7487 
7488  this->logTextOut_out(
7489  0,
7490  _id,
7491  _logTime,
7493  _logString
7494  );
7495  }
7496 #endif
7497  }
7498 
7501  FwOpcodeType opcode,
7502  const Fw::CmdResponse& response,
7503  U16 oldSequenceIdx,
7504  U16 currentSequenceIdx
7505  ) const
7506  {
7507  // Get the time
7508  Fw::Time _logTime;
7509  if (this->isConnected_timeCaller_OutputPort(0)) {
7510  this->timeCaller_out(0, _logTime);
7511  }
7512 
7514 
7515  // Emit the event on the log port
7516  if (this->isConnected_logOut_OutputPort(0)) {
7517  Fw::LogBuffer _logBuff;
7519 
7520 #if FW_AMPCS_COMPATIBLE
7521  // Serialize the number of arguments
7522  _status = _logBuff.serializeFrom(static_cast<U8>(4));
7523  FW_ASSERT(
7524  _status == Fw::FW_SERIALIZE_OK,
7525  static_cast<FwAssertArgType>(_status)
7526  );
7527 #endif
7528 
7529 #if FW_AMPCS_COMPATIBLE
7530  // Serialize the argument size
7531  _status = _logBuff.serializeFrom(
7532  static_cast<U8>(sizeof(FwOpcodeType))
7533  );
7534  FW_ASSERT(
7535  _status == Fw::FW_SERIALIZE_OK,
7536  static_cast<FwAssertArgType>(_status)
7537  );
7538 #endif
7539  _status = _logBuff.serializeFrom(opcode);
7540  FW_ASSERT(
7541  _status == Fw::FW_SERIALIZE_OK,
7542  static_cast<FwAssertArgType>(_status)
7543  );
7544 
7545 #if FW_AMPCS_COMPATIBLE
7546  // Serialize the argument size
7547  _status = _logBuff.serializeFrom(
7548  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
7549  );
7550  FW_ASSERT(
7551  _status == Fw::FW_SERIALIZE_OK,
7552  static_cast<FwAssertArgType>(_status)
7553  );
7554 #endif
7555  _status = _logBuff.serializeFrom(response);
7556  FW_ASSERT(
7557  _status == Fw::FW_SERIALIZE_OK,
7558  static_cast<FwAssertArgType>(_status)
7559  );
7560 
7561 #if FW_AMPCS_COMPATIBLE
7562  // Serialize the argument size
7563  _status = _logBuff.serializeFrom(
7564  static_cast<U8>(sizeof(U16))
7565  );
7566  FW_ASSERT(
7567  _status == Fw::FW_SERIALIZE_OK,
7568  static_cast<FwAssertArgType>(_status)
7569  );
7570 #endif
7571  _status = _logBuff.serializeFrom(oldSequenceIdx);
7572  FW_ASSERT(
7573  _status == Fw::FW_SERIALIZE_OK,
7574  static_cast<FwAssertArgType>(_status)
7575  );
7576 
7577 #if FW_AMPCS_COMPATIBLE
7578  // Serialize the argument size
7579  _status = _logBuff.serializeFrom(
7580  static_cast<U8>(sizeof(U16))
7581  );
7582  FW_ASSERT(
7583  _status == Fw::FW_SERIALIZE_OK,
7584  static_cast<FwAssertArgType>(_status)
7585  );
7586 #endif
7587  _status = _logBuff.serializeFrom(currentSequenceIdx);
7588  FW_ASSERT(
7589  _status == Fw::FW_SERIALIZE_OK,
7590  static_cast<FwAssertArgType>(_status)
7591  );
7592 
7593  this->logOut_out(
7594  0,
7595  _id,
7596  _logTime,
7598  _logBuff
7599  );
7600  }
7601 
7602  // Emit the event on the text log port
7603 #if FW_ENABLE_TEXT_LOGGING
7604  if (this->isConnected_logTextOut_OutputPort(0)) {
7605 #if FW_OBJECT_NAMES == 1
7606  const char* _formatString =
7607  "(%s) %s: Command response (opcode %" PRIu32 ", response %s) was from a previous sequence (old idx %" PRIu16 ", current idx %" PRIu16 ")";
7608 #else
7609  const char* _formatString =
7610  "%s: Command response (opcode %" PRIu32 ", response %s) was from a previous sequence (old idx %" PRIu16 ", current idx %" PRIu16 ")";
7611 #endif
7612 
7613  Fw::String responseStr;
7614  response.toString(responseStr);
7615 
7616  Fw::TextLogString _logString;
7617  (void) _logString.format(
7618  _formatString,
7619 #if FW_OBJECT_NAMES == 1
7620  this->m_objName.toChar(),
7621 #endif
7622  "CmdResponseFromOldSequence ",
7623  opcode,
7624  responseStr.toChar(),
7625  oldSequenceIdx,
7626  currentSequenceIdx
7627  );
7628 
7629  this->logTextOut_out(
7630  0,
7631  _id,
7632  _logTime,
7634  _logString
7635  );
7636  }
7637 #endif
7638  }
7639 
7642  FwOpcodeType opcode,
7643  const Fw::CmdResponse& response,
7644  U16 actualCmdIdx,
7645  U16 expectedCmdIdx
7646  ) const
7647  {
7648  // Get the time
7649  Fw::Time _logTime;
7650  if (this->isConnected_timeCaller_OutputPort(0)) {
7651  this->timeCaller_out(0, _logTime);
7652  }
7653 
7655 
7656  // Emit the event on the log port
7657  if (this->isConnected_logOut_OutputPort(0)) {
7658  Fw::LogBuffer _logBuff;
7660 
7661 #if FW_AMPCS_COMPATIBLE
7662  // Serialize the number of arguments
7663  _status = _logBuff.serializeFrom(static_cast<U8>(4));
7664  FW_ASSERT(
7665  _status == Fw::FW_SERIALIZE_OK,
7666  static_cast<FwAssertArgType>(_status)
7667  );
7668 #endif
7669 
7670 #if FW_AMPCS_COMPATIBLE
7671  // Serialize the argument size
7672  _status = _logBuff.serializeFrom(
7673  static_cast<U8>(sizeof(FwOpcodeType))
7674  );
7675  FW_ASSERT(
7676  _status == Fw::FW_SERIALIZE_OK,
7677  static_cast<FwAssertArgType>(_status)
7678  );
7679 #endif
7680  _status = _logBuff.serializeFrom(opcode);
7681  FW_ASSERT(
7682  _status == Fw::FW_SERIALIZE_OK,
7683  static_cast<FwAssertArgType>(_status)
7684  );
7685 
7686 #if FW_AMPCS_COMPATIBLE
7687  // Serialize the argument size
7688  _status = _logBuff.serializeFrom(
7689  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
7690  );
7691  FW_ASSERT(
7692  _status == Fw::FW_SERIALIZE_OK,
7693  static_cast<FwAssertArgType>(_status)
7694  );
7695 #endif
7696  _status = _logBuff.serializeFrom(response);
7697  FW_ASSERT(
7698  _status == Fw::FW_SERIALIZE_OK,
7699  static_cast<FwAssertArgType>(_status)
7700  );
7701 
7702 #if FW_AMPCS_COMPATIBLE
7703  // Serialize the argument size
7704  _status = _logBuff.serializeFrom(
7705  static_cast<U8>(sizeof(U16))
7706  );
7707  FW_ASSERT(
7708  _status == Fw::FW_SERIALIZE_OK,
7709  static_cast<FwAssertArgType>(_status)
7710  );
7711 #endif
7712  _status = _logBuff.serializeFrom(actualCmdIdx);
7713  FW_ASSERT(
7714  _status == Fw::FW_SERIALIZE_OK,
7715  static_cast<FwAssertArgType>(_status)
7716  );
7717 
7718 #if FW_AMPCS_COMPATIBLE
7719  // Serialize the argument size
7720  _status = _logBuff.serializeFrom(
7721  static_cast<U8>(sizeof(U16))
7722  );
7723  FW_ASSERT(
7724  _status == Fw::FW_SERIALIZE_OK,
7725  static_cast<FwAssertArgType>(_status)
7726  );
7727 #endif
7728  _status = _logBuff.serializeFrom(expectedCmdIdx);
7729  FW_ASSERT(
7730  _status == Fw::FW_SERIALIZE_OK,
7731  static_cast<FwAssertArgType>(_status)
7732  );
7733 
7734  this->logOut_out(
7735  0,
7736  _id,
7737  _logTime,
7739  _logBuff
7740  );
7741  }
7742 
7743  // Emit the event on the text log port
7744 #if FW_ENABLE_TEXT_LOGGING
7745  if (this->isConnected_logTextOut_OutputPort(0)) {
7746 #if FW_OBJECT_NAMES == 1
7747  const char* _formatString =
7748  "(%s) %s: Command response (opcode %" PRIu32 ", response %s) was for a different command instance (actual idx %" PRIu16 ", expected %" PRIu16 ")";
7749 #else
7750  const char* _formatString =
7751  "%s: Command response (opcode %" PRIu32 ", response %s) was for a different command instance (actual idx %" PRIu16 ", expected %" PRIu16 ")";
7752 #endif
7753 
7754  Fw::String responseStr;
7755  response.toString(responseStr);
7756 
7757  Fw::TextLogString _logString;
7758  (void) _logString.format(
7759  _formatString,
7760 #if FW_OBJECT_NAMES == 1
7761  this->m_objName.toChar(),
7762 #endif
7763  "WrongCmdResponseIndex ",
7764  opcode,
7765  responseStr.toChar(),
7766  actualCmdIdx,
7767  expectedCmdIdx
7768  );
7769 
7770  this->logTextOut_out(
7771  0,
7772  _id,
7773  _logTime,
7775  _logString
7776  );
7777  }
7778 #endif
7779  }
7780 
7783  Svc::WasmSequencer_ModuleIdx moduleIdx,
7784  const Svc::WasmSequencer_Status& status
7785  ) const
7786  {
7787  // Get the time
7788  Fw::Time _logTime;
7789  if (this->isConnected_timeCaller_OutputPort(0)) {
7790  this->timeCaller_out(0, _logTime);
7791  }
7792 
7794 
7795  // Emit the event on the log port
7796  if (this->isConnected_logOut_OutputPort(0)) {
7797  Fw::LogBuffer _logBuff;
7799 
7800 #if FW_AMPCS_COMPATIBLE
7801  // Serialize the number of arguments
7802  _status = _logBuff.serializeFrom(static_cast<U8>(2));
7803  FW_ASSERT(
7804  _status == Fw::FW_SERIALIZE_OK,
7805  static_cast<FwAssertArgType>(_status)
7806  );
7807 #endif
7808 
7809 #if FW_AMPCS_COMPATIBLE
7810  // Serialize the argument size
7811  _status = _logBuff.serializeFrom(
7812  static_cast<U8>(sizeof(Svc::WasmSequencer_ModuleIdx))
7813  );
7814  FW_ASSERT(
7815  _status == Fw::FW_SERIALIZE_OK,
7816  static_cast<FwAssertArgType>(_status)
7817  );
7818 #endif
7819  _status = _logBuff.serializeFrom(moduleIdx);
7820  FW_ASSERT(
7821  _status == Fw::FW_SERIALIZE_OK,
7822  static_cast<FwAssertArgType>(_status)
7823  );
7824 
7825 #if FW_AMPCS_COMPATIBLE
7826  // Serialize the argument size
7827  _status = _logBuff.serializeFrom(
7829  );
7830  FW_ASSERT(
7831  _status == Fw::FW_SERIALIZE_OK,
7832  static_cast<FwAssertArgType>(_status)
7833  );
7834 #endif
7835  _status = _logBuff.serializeFrom(status);
7836  FW_ASSERT(
7837  _status == Fw::FW_SERIALIZE_OK,
7838  static_cast<FwAssertArgType>(_status)
7839  );
7840 
7841  this->logOut_out(
7842  0,
7843  _id,
7844  _logTime,
7846  _logBuff
7847  );
7848  }
7849 
7850  // Emit the event on the text log port
7851 #if FW_ENABLE_TEXT_LOGGING
7852  if (this->isConnected_logTextOut_OutputPort(0)) {
7853 #if FW_OBJECT_NAMES == 1
7854  const char* _formatString =
7855  "(%s) %s: Module at index %" PRIu8 " does not have a valid 'main' entrypoint: %s";
7856 #else
7857  const char* _formatString =
7858  "%s: Module at index %" PRIu8 " does not have a valid 'main' entrypoint: %s";
7859 #endif
7860 
7861  Fw::String statusStr;
7862  status.toString(statusStr);
7863 
7864  Fw::TextLogString _logString;
7865  (void) _logString.format(
7866  _formatString,
7867 #if FW_OBJECT_NAMES == 1
7868  this->m_objName.toChar(),
7869 #endif
7870  "InvalidModuleEntrypoint ",
7871  moduleIdx,
7872  statusStr.toChar()
7873  );
7874 
7875  this->logTextOut_out(
7876  0,
7877  _id,
7878  _logTime,
7880  _logString
7881  );
7882  }
7883 #endif
7884  }
7885 
7888  {
7889  // Get the time
7890  Fw::Time _logTime;
7891  if (this->isConnected_timeCaller_OutputPort(0)) {
7892  this->timeCaller_out(0, _logTime);
7893  }
7894 
7895  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGWARNINGHI;
7896 
7897  // Emit the event on the log port
7898  if (this->isConnected_logOut_OutputPort(0)) {
7899  Fw::LogBuffer _logBuff;
7901 
7902 #if FW_AMPCS_COMPATIBLE
7903  // Serialize the number of arguments
7904  _status = _logBuff.serializeFrom(static_cast<U8>(1));
7905  FW_ASSERT(
7906  _status == Fw::FW_SERIALIZE_OK,
7907  static_cast<FwAssertArgType>(_status)
7908  );
7909 #endif
7910 
7911  _status = msg.serializeTo(
7912  _logBuff,
7913  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
7914  );
7915  FW_ASSERT(
7916  _status == Fw::FW_SERIALIZE_OK,
7917  static_cast<FwAssertArgType>(_status)
7918  );
7919 
7920  this->logOut_out(
7921  0,
7922  _id,
7923  _logTime,
7925  _logBuff
7926  );
7927  }
7928 
7929  // Emit the event on the text log port
7930 #if FW_ENABLE_TEXT_LOGGING
7931  if (this->isConnected_logTextOut_OutputPort(0)) {
7932 #if FW_OBJECT_NAMES == 1
7933  const char* _formatString =
7934  "(%s) %s: %s";
7935 #else
7936  const char* _formatString =
7937  "%s: %s";
7938 #endif
7939 
7940  Fw::TextLogString _logString;
7941  (void) _logString.format(
7942  _formatString,
7943 #if FW_OBJECT_NAMES == 1
7944  this->m_objName.toChar(),
7945 #endif
7946  "LogWarningHi ",
7947  msg.toChar()
7948  );
7949 
7950  this->logTextOut_out(
7951  0,
7952  _id,
7953  _logTime,
7955  _logString
7956  );
7957  }
7958 #endif
7959  }
7960 
7963  {
7964  // Get the time
7965  Fw::Time _logTime;
7966  if (this->isConnected_timeCaller_OutputPort(0)) {
7967  this->timeCaller_out(0, _logTime);
7968  }
7969 
7970  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGWARNINGLO;
7971 
7972  // Emit the event on the log port
7973  if (this->isConnected_logOut_OutputPort(0)) {
7974  Fw::LogBuffer _logBuff;
7976 
7977 #if FW_AMPCS_COMPATIBLE
7978  // Serialize the number of arguments
7979  _status = _logBuff.serializeFrom(static_cast<U8>(1));
7980  FW_ASSERT(
7981  _status == Fw::FW_SERIALIZE_OK,
7982  static_cast<FwAssertArgType>(_status)
7983  );
7984 #endif
7985 
7986  _status = msg.serializeTo(
7987  _logBuff,
7988  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
7989  );
7990  FW_ASSERT(
7991  _status == Fw::FW_SERIALIZE_OK,
7992  static_cast<FwAssertArgType>(_status)
7993  );
7994 
7995  this->logOut_out(
7996  0,
7997  _id,
7998  _logTime,
8000  _logBuff
8001  );
8002  }
8003 
8004  // Emit the event on the text log port
8005 #if FW_ENABLE_TEXT_LOGGING
8006  if (this->isConnected_logTextOut_OutputPort(0)) {
8007 #if FW_OBJECT_NAMES == 1
8008  const char* _formatString =
8009  "(%s) %s: %s";
8010 #else
8011  const char* _formatString =
8012  "%s: %s";
8013 #endif
8014 
8015  Fw::TextLogString _logString;
8016  (void) _logString.format(
8017  _formatString,
8018 #if FW_OBJECT_NAMES == 1
8019  this->m_objName.toChar(),
8020 #endif
8021  "LogWarningLo ",
8022  msg.toChar()
8023  );
8024 
8025  this->logTextOut_out(
8026  0,
8027  _id,
8028  _logTime,
8030  _logString
8031  );
8032  }
8033 #endif
8034  }
8035 
8038  {
8039  // Get the time
8040  Fw::Time _logTime;
8041  if (this->isConnected_timeCaller_OutputPort(0)) {
8042  this->timeCaller_out(0, _logTime);
8043  }
8044 
8045  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGACTIVITYHI;
8046 
8047  // Emit the event on the log port
8048  if (this->isConnected_logOut_OutputPort(0)) {
8049  Fw::LogBuffer _logBuff;
8051 
8052 #if FW_AMPCS_COMPATIBLE
8053  // Serialize the number of arguments
8054  _status = _logBuff.serializeFrom(static_cast<U8>(1));
8055  FW_ASSERT(
8056  _status == Fw::FW_SERIALIZE_OK,
8057  static_cast<FwAssertArgType>(_status)
8058  );
8059 #endif
8060 
8061  _status = msg.serializeTo(
8062  _logBuff,
8063  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
8064  );
8065  FW_ASSERT(
8066  _status == Fw::FW_SERIALIZE_OK,
8067  static_cast<FwAssertArgType>(_status)
8068  );
8069 
8070  this->logOut_out(
8071  0,
8072  _id,
8073  _logTime,
8075  _logBuff
8076  );
8077  }
8078 
8079  // Emit the event on the text log port
8080 #if FW_ENABLE_TEXT_LOGGING
8081  if (this->isConnected_logTextOut_OutputPort(0)) {
8082 #if FW_OBJECT_NAMES == 1
8083  const char* _formatString =
8084  "(%s) %s: %s";
8085 #else
8086  const char* _formatString =
8087  "%s: %s";
8088 #endif
8089 
8090  Fw::TextLogString _logString;
8091  (void) _logString.format(
8092  _formatString,
8093 #if FW_OBJECT_NAMES == 1
8094  this->m_objName.toChar(),
8095 #endif
8096  "LogActivityHi ",
8097  msg.toChar()
8098  );
8099 
8100  this->logTextOut_out(
8101  0,
8102  _id,
8103  _logTime,
8105  _logString
8106  );
8107  }
8108 #endif
8109  }
8110 
8113  {
8114  // Get the time
8115  Fw::Time _logTime;
8116  if (this->isConnected_timeCaller_OutputPort(0)) {
8117  this->timeCaller_out(0, _logTime);
8118  }
8119 
8120  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGACTIVITYLO;
8121 
8122  // Emit the event on the log port
8123  if (this->isConnected_logOut_OutputPort(0)) {
8124  Fw::LogBuffer _logBuff;
8126 
8127 #if FW_AMPCS_COMPATIBLE
8128  // Serialize the number of arguments
8129  _status = _logBuff.serializeFrom(static_cast<U8>(1));
8130  FW_ASSERT(
8131  _status == Fw::FW_SERIALIZE_OK,
8132  static_cast<FwAssertArgType>(_status)
8133  );
8134 #endif
8135 
8136  _status = msg.serializeTo(
8137  _logBuff,
8138  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
8139  );
8140  FW_ASSERT(
8141  _status == Fw::FW_SERIALIZE_OK,
8142  static_cast<FwAssertArgType>(_status)
8143  );
8144 
8145  this->logOut_out(
8146  0,
8147  _id,
8148  _logTime,
8150  _logBuff
8151  );
8152  }
8153 
8154  // Emit the event on the text log port
8155 #if FW_ENABLE_TEXT_LOGGING
8156  if (this->isConnected_logTextOut_OutputPort(0)) {
8157 #if FW_OBJECT_NAMES == 1
8158  const char* _formatString =
8159  "(%s) %s: %s";
8160 #else
8161  const char* _formatString =
8162  "%s: %s";
8163 #endif
8164 
8165  Fw::TextLogString _logString;
8166  (void) _logString.format(
8167  _formatString,
8168 #if FW_OBJECT_NAMES == 1
8169  this->m_objName.toChar(),
8170 #endif
8171  "LogActivityLo ",
8172  msg.toChar()
8173  );
8174 
8175  this->logTextOut_out(
8176  0,
8177  _id,
8178  _logTime,
8180  _logString
8181  );
8182  }
8183 #endif
8184  }
8185 
8188  {
8189  // Get the time
8190  Fw::Time _logTime;
8191  if (this->isConnected_timeCaller_OutputPort(0)) {
8192  this->timeCaller_out(0, _logTime);
8193  }
8194 
8195  const FwEventIdType _id = this->getIdBase() + EVENTID_LOGDIAGNOSTIC;
8196 
8197  // Emit the event on the log port
8198  if (this->isConnected_logOut_OutputPort(0)) {
8199  Fw::LogBuffer _logBuff;
8201 
8202 #if FW_AMPCS_COMPATIBLE
8203  // Serialize the number of arguments
8204  _status = _logBuff.serializeFrom(static_cast<U8>(1));
8205  FW_ASSERT(
8206  _status == Fw::FW_SERIALIZE_OK,
8207  static_cast<FwAssertArgType>(_status)
8208  );
8209 #endif
8210 
8211  _status = msg.serializeTo(
8212  _logBuff,
8213  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 128)
8214  );
8215  FW_ASSERT(
8216  _status == Fw::FW_SERIALIZE_OK,
8217  static_cast<FwAssertArgType>(_status)
8218  );
8219 
8220  this->logOut_out(
8221  0,
8222  _id,
8223  _logTime,
8225  _logBuff
8226  );
8227  }
8228 
8229  // Emit the event on the text log port
8230 #if FW_ENABLE_TEXT_LOGGING
8231  if (this->isConnected_logTextOut_OutputPort(0)) {
8232 #if FW_OBJECT_NAMES == 1
8233  const char* _formatString =
8234  "(%s) %s: %s";
8235 #else
8236  const char* _formatString =
8237  "%s: %s";
8238 #endif
8239 
8240  Fw::TextLogString _logString;
8241  (void) _logString.format(
8242  _formatString,
8243 #if FW_OBJECT_NAMES == 1
8244  this->m_objName.toChar(),
8245 #endif
8246  "LogDiagnostic ",
8247  msg.toChar()
8248  );
8249 
8250  this->logTextOut_out(
8251  0,
8252  _id,
8253  _logTime,
8255  _logString
8256  );
8257  }
8258 #endif
8259  }
8260 
8261  // ----------------------------------------------------------------------
8262  // Telemetry serialized write
8263  // ----------------------------------------------------------------------
8264 
8267  FwChanIdType id,
8268  Fw::TlmBuffer& _tlmBuff,
8269  Fw::Time _tlmTime
8270  ) const
8271  {
8272  if (this->isConnected_tlmOut_OutputPort(0)) {
8273  if (
8275  (_tlmTime == Fw::ZERO_TIME)
8276  ) {
8277  this->timeCaller_out(0, _tlmTime);
8278  }
8279 
8280  FwChanIdType _id;
8281  _id = this->getIdBase() + id;
8282 
8283  this->tlmOut_out(
8284  0,
8285  _id,
8286  _tlmTime,
8287  _tlmBuff
8288  );
8289  }
8290  }
8291 
8292  // ----------------------------------------------------------------------
8293  // Telemetry write functions
8294  // ----------------------------------------------------------------------
8295 
8299  Fw::Time _tlmTime
8300  )
8301  {
8302  // Check to see if it is the first time
8303  if (not this->m_first_update_ControllerState) {
8304  // Check to see if value has changed. If not, don't write it.
8305  if (arg == this->m_last_ControllerState) {
8306  return;
8307  }
8308  else {
8309  this->m_last_ControllerState = arg;
8310  }
8311  }
8312  else {
8313  this->m_first_update_ControllerState = false;
8314  this->m_last_ControllerState = arg;
8315  }
8316 
8317  if (this->isConnected_tlmOut_OutputPort(0)) {
8318  Fw::TlmBuffer _tlmBuff;
8319  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8320  FW_ASSERT(
8321  _stat == Fw::FW_SERIALIZE_OK,
8322  static_cast<FwAssertArgType>(_stat)
8323  );
8324 
8325  this->tlmWrite(
8327  _tlmBuff,
8328  _tlmTime
8329  );
8330  }
8331  }
8332 
8336  Fw::Time _tlmTime
8337  )
8338  {
8339  // Check to see if it is the first time
8340  if (not this->m_first_update_InterpreterState) {
8341  // Check to see if value has changed. If not, don't write it.
8342  if (arg == this->m_last_InterpreterState) {
8343  return;
8344  }
8345  else {
8346  this->m_last_InterpreterState = arg;
8347  }
8348  }
8349  else {
8350  this->m_first_update_InterpreterState = false;
8351  this->m_last_InterpreterState = arg;
8352  }
8353 
8354  if (this->isConnected_tlmOut_OutputPort(0)) {
8355  Fw::TlmBuffer _tlmBuff;
8356  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8357  FW_ASSERT(
8358  _stat == Fw::FW_SERIALIZE_OK,
8359  static_cast<FwAssertArgType>(_stat)
8360  );
8361 
8362  this->tlmWrite(
8364  _tlmBuff,
8365  _tlmTime
8366  );
8367  }
8368  }
8369 
8372  U64 arg,
8373  Fw::Time _tlmTime
8374  )
8375  {
8376  // Check to see if it is the first time
8377  if (not this->m_first_update_SequencesSucceeded) {
8378  // Check to see if value has changed. If not, don't write it.
8379  if (arg == this->m_last_SequencesSucceeded) {
8380  return;
8381  }
8382  else {
8383  this->m_last_SequencesSucceeded = arg;
8384  }
8385  }
8386  else {
8387  this->m_first_update_SequencesSucceeded = false;
8388  this->m_last_SequencesSucceeded = arg;
8389  }
8390 
8391  if (this->isConnected_tlmOut_OutputPort(0)) {
8392  Fw::TlmBuffer _tlmBuff;
8393  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8394  FW_ASSERT(
8395  _stat == Fw::FW_SERIALIZE_OK,
8396  static_cast<FwAssertArgType>(_stat)
8397  );
8398 
8399  this->tlmWrite(
8401  _tlmBuff,
8402  _tlmTime
8403  );
8404  }
8405  }
8406 
8409  U64 arg,
8410  Fw::Time _tlmTime
8411  )
8412  {
8413  // Check to see if it is the first time
8414  if (not this->m_first_update_SequencesFailed) {
8415  // Check to see if value has changed. If not, don't write it.
8416  if (arg == this->m_last_SequencesFailed) {
8417  return;
8418  }
8419  else {
8420  this->m_last_SequencesFailed = arg;
8421  }
8422  }
8423  else {
8424  this->m_first_update_SequencesFailed = false;
8425  this->m_last_SequencesFailed = arg;
8426  }
8427 
8428  if (this->isConnected_tlmOut_OutputPort(0)) {
8429  Fw::TlmBuffer _tlmBuff;
8430  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8431  FW_ASSERT(
8432  _stat == Fw::FW_SERIALIZE_OK,
8433  static_cast<FwAssertArgType>(_stat)
8434  );
8435 
8436  this->tlmWrite(
8438  _tlmBuff,
8439  _tlmTime
8440  );
8441  }
8442  }
8443 
8446  U64 arg,
8447  Fw::Time _tlmTime
8448  )
8449  {
8450  // Check to see if it is the first time
8451  if (not this->m_first_update_SequencesCancelled) {
8452  // Check to see if value has changed. If not, don't write it.
8453  if (arg == this->m_last_SequencesCancelled) {
8454  return;
8455  }
8456  else {
8457  this->m_last_SequencesCancelled = arg;
8458  }
8459  }
8460  else {
8461  this->m_first_update_SequencesCancelled = false;
8462  this->m_last_SequencesCancelled = arg;
8463  }
8464 
8465  if (this->isConnected_tlmOut_OutputPort(0)) {
8466  Fw::TlmBuffer _tlmBuff;
8467  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8468  FW_ASSERT(
8469  _stat == Fw::FW_SERIALIZE_OK,
8470  static_cast<FwAssertArgType>(_stat)
8471  );
8472 
8473  this->tlmWrite(
8475  _tlmBuff,
8476  _tlmTime
8477  );
8478  }
8479  }
8480 
8483  U64 arg,
8484  Fw::Time _tlmTime
8485  )
8486  {
8487  // Check to see if it is the first time
8488  if (not this->m_first_update_CommandsDispatched) {
8489  // Check to see if value has changed. If not, don't write it.
8490  if (arg == this->m_last_CommandsDispatched) {
8491  return;
8492  }
8493  else {
8494  this->m_last_CommandsDispatched = arg;
8495  }
8496  }
8497  else {
8498  this->m_first_update_CommandsDispatched = false;
8499  this->m_last_CommandsDispatched = arg;
8500  }
8501 
8502  if (this->isConnected_tlmOut_OutputPort(0)) {
8503  Fw::TlmBuffer _tlmBuff;
8504  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8505  FW_ASSERT(
8506  _stat == Fw::FW_SERIALIZE_OK,
8507  static_cast<FwAssertArgType>(_stat)
8508  );
8509 
8510  this->tlmWrite(
8512  _tlmBuff,
8513  _tlmTime
8514  );
8515  }
8516  }
8517 
8520  U64 arg,
8521  Fw::Time _tlmTime
8522  )
8523  {
8524  // Check to see if it is the first time
8525  if (not this->m_first_update_CommandsFailed) {
8526  // Check to see if value has changed. If not, don't write it.
8527  if (arg == this->m_last_CommandsFailed) {
8528  return;
8529  }
8530  else {
8531  this->m_last_CommandsFailed = arg;
8532  }
8533  }
8534  else {
8535  this->m_first_update_CommandsFailed = false;
8536  this->m_last_CommandsFailed = arg;
8537  }
8538 
8539  if (this->isConnected_tlmOut_OutputPort(0)) {
8540  Fw::TlmBuffer _tlmBuff;
8541  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8542  FW_ASSERT(
8543  _stat == Fw::FW_SERIALIZE_OK,
8544  static_cast<FwAssertArgType>(_stat)
8545  );
8546 
8547  this->tlmWrite(
8549  _tlmBuff,
8550  _tlmTime
8551  );
8552  }
8553  }
8554 
8557  const Svc::WasmSequencer_TrapReason& arg,
8558  Fw::Time _tlmTime
8559  )
8560  {
8561  // Check to see if it is the first time
8562  if (not this->m_first_update_LastTrapReason) {
8563  // Check to see if value has changed. If not, don't write it.
8564  if (arg == this->m_last_LastTrapReason) {
8565  return;
8566  }
8567  else {
8568  this->m_last_LastTrapReason = arg;
8569  }
8570  }
8571  else {
8572  this->m_first_update_LastTrapReason = false;
8573  this->m_last_LastTrapReason = arg;
8574  }
8575 
8576  if (this->isConnected_tlmOut_OutputPort(0)) {
8577  Fw::TlmBuffer _tlmBuff;
8578  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
8579  FW_ASSERT(
8580  _stat == Fw::FW_SERIALIZE_OK,
8581  static_cast<FwAssertArgType>(_stat)
8582  );
8583 
8584  this->tlmWrite(
8586  _tlmBuff,
8587  _tlmTime
8588  );
8589  }
8590  }
8591 
8594  const Fw::StringBase& arg,
8595  Fw::Time _tlmTime
8596  )
8597  {
8598  // Check to see if it is the first time
8599  if (not this->m_first_update_SeqName) {
8600  // Check to see if value has changed. If not, don't write it.
8601  if (arg == this->m_last_SeqName) {
8602  return;
8603  }
8604  else {
8605  this->m_last_SeqName = arg;
8606  }
8607  }
8608  else {
8609  this->m_first_update_SeqName = false;
8610  this->m_last_SeqName = arg;
8611  }
8612 
8613  if (this->isConnected_tlmOut_OutputPort(0)) {
8614  Fw::TlmBuffer _tlmBuff;
8615  Fw::SerializeStatus _stat = arg.serializeTo(
8616  _tlmBuff,
8617  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 240)
8618  );
8619  FW_ASSERT(
8620  _stat == Fw::FW_SERIALIZE_OK,
8621  static_cast<FwAssertArgType>(_stat)
8622  );
8623 
8624  this->tlmWrite(
8626  _tlmBuff,
8627  _tlmTime
8628  );
8629  }
8630  }
8631 
8632  // ----------------------------------------------------------------------
8633  // Parameter hook functions
8634  // ----------------------------------------------------------------------
8635 
8638  {
8639  // Do nothing by default
8640  }
8641 
8644  {
8645  // Do nothing by default
8646  }
8647 
8650  FwPrmIdType id,
8651  Fw::ParamValid valid
8652  )
8653  {
8654  if (FW_PARAM_OK(valid)) {
8655  this->parameterUpdated(id);
8656  }
8657  }
8658 
8659  // ----------------------------------------------------------------------
8660  // Parameter get functions
8661  // ----------------------------------------------------------------------
8662 
8665  {
8666  F32 _local{};
8667  this->m_paramLock.lock();
8668  valid = this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid;
8669  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
8670  _local = this->m_HOST_FUNCTION_TIMEOUT_SECS;
8671  }
8672  this->m_paramLock.unlock();
8673  return _local;
8674  }
8675 
8678  {
8679  FwSizeType _local{};
8680  this->m_paramLock.lock();
8681  valid = this->m_param_INSTRUCTION_FUEL_valid;
8682  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
8683  _local = this->m_INSTRUCTION_FUEL;
8684  }
8685  this->m_paramLock.unlock();
8686  return _local;
8687  }
8688 
8691  {
8692  Fw::ParamString _local{};
8693  this->m_paramLock.lock();
8694  valid = this->m_param_SEQ_BASE_DIR_valid;
8695  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
8696  _local = this->m_SEQ_BASE_DIR;
8697  }
8698  this->m_paramLock.unlock();
8699  return _local;
8700  }
8701 
8702  // ----------------------------------------------------------------------
8703  // Time
8704  // ----------------------------------------------------------------------
8705 
8707  getTime() const
8708  {
8709  if (this->isConnected_timeCaller_OutputPort(0)) {
8710  Fw::Time _time;
8711  this->timeCaller_out(0, _time);
8712  return _time;
8713  }
8714  else {
8715  return Fw::Time(TimeBase::TB_NONE, 0, 0);
8716  }
8717  }
8718 
8719  // ----------------------------------------------------------------------
8720  // Mutex operations for guarded ports
8721  //
8722  // You can override these operations to provide more sophisticated
8723  // synchronization
8724  // ----------------------------------------------------------------------
8725 
8728  {
8729  this->m_guardedPortMutex.lock();
8730  }
8731 
8734  {
8735  this->m_guardedPortMutex.unLock();
8736  }
8737 
8738  // ----------------------------------------------------------------------
8739  // Message dispatch functions
8740  // ----------------------------------------------------------------------
8741 
8742  Fw::QueuedComponentBase::MsgDispatchStatus WasmSequencerComponentBase ::
8743  doDispatch()
8744  {
8745  ComponentIpcSerializableBuffer _msg;
8746  FwQueuePriorityType _priority = 0;
8747 
8748  Os::Queue::Status _msgStatus = this->m_queue.receive(
8749  _msg,
8751  _priority
8752  );
8753  FW_ASSERT(
8754  _msgStatus == Os::Queue::OP_OK,
8755  static_cast<FwAssertArgType>(_msgStatus)
8756  );
8757 
8758  // Reset to beginning of buffer
8759  _msg.resetDeser();
8760 
8761  FwEnumStoreType _desMsg = 0;
8762  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
8763  FW_ASSERT(
8764  _deserStatus == Fw::FW_SERIALIZE_OK,
8765  static_cast<FwAssertArgType>(_deserStatus)
8766  );
8767 
8768  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
8769 
8770  if (_msgType == WASMSEQUENCER_COMPONENT_EXIT) {
8771  return MSG_DISPATCH_EXIT;
8772  }
8773 
8774  FwIndexType portNum = 0;
8775  _deserStatus = _msg.deserializeTo(portNum);
8776  FW_ASSERT(
8777  _deserStatus == Fw::FW_SERIALIZE_OK,
8778  static_cast<FwAssertArgType>(_deserStatus)
8779  );
8780 
8781  switch (_msgType) {
8782  // Handle async input port checkTimers
8783  case CHECKTIMERS_SCHED: {
8784  // Deserialize argument context
8785  U32 context;
8786  _deserStatus = _msg.deserializeTo(context);
8787  FW_ASSERT(
8788  _deserStatus == Fw::FW_SERIALIZE_OK,
8789  static_cast<FwAssertArgType>(_deserStatus)
8790  );
8791  // Call handler function
8792  this->checkTimers_handler(
8793  portNum,
8794  context
8795  );
8796 
8797  break;
8798  }
8799 
8800  // Handle async input port cmdResponseIn
8801  case CMDRESPONSEIN_CMDRESPONSE: {
8802  // Deserialize argument opCode
8803  FwOpcodeType opCode;
8804  _deserStatus = _msg.deserializeTo(opCode);
8805  FW_ASSERT(
8806  _deserStatus == Fw::FW_SERIALIZE_OK,
8807  static_cast<FwAssertArgType>(_deserStatus)
8808  );
8809 
8810  // Deserialize argument cmdSeq
8811  U32 cmdSeq;
8812  _deserStatus = _msg.deserializeTo(cmdSeq);
8813  FW_ASSERT(
8814  _deserStatus == Fw::FW_SERIALIZE_OK,
8815  static_cast<FwAssertArgType>(_deserStatus)
8816  );
8817 
8818  // Deserialize argument response
8819  Fw::CmdResponse response;
8820  _deserStatus = _msg.deserializeTo(response);
8821  FW_ASSERT(
8822  _deserStatus == Fw::FW_SERIALIZE_OK,
8823  static_cast<FwAssertArgType>(_deserStatus)
8824  );
8825  // Call handler function
8826  this->cmdResponseIn_handler(
8827  portNum,
8828  opCode,
8829  cmdSeq,
8830  response
8831  );
8832 
8833  break;
8834  }
8835 
8836  // Handle async input port seqRunIn
8837  case SEQRUNIN_CMDSEQIN: {
8838  // Deserialize argument filename
8839  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
8840  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
8841  _deserStatus = _msg.deserializeTo(filename);
8842  FW_ASSERT(
8843  _deserStatus == Fw::FW_SERIALIZE_OK,
8844  static_cast<FwAssertArgType>(_deserStatus)
8845  );
8846 
8847  // Deserialize argument args
8848  Svc::SeqArgs args;
8849  _deserStatus = _msg.deserializeTo(args);
8850  FW_ASSERT(
8851  _deserStatus == Fw::FW_SERIALIZE_OK,
8852  static_cast<FwAssertArgType>(_deserStatus)
8853  );
8854  // Call handler function
8855  this->seqRunIn_handler(
8856  portNum,
8857  filename,
8858  args
8859  );
8860 
8861  break;
8862  }
8863 
8864  // Handle command RUN
8865  case CMD_RUN: {
8866  // Deserialize opcode
8867  FwOpcodeType _opCode = 0;
8868  _deserStatus = _msg.deserializeTo(_opCode);
8869  FW_ASSERT (
8870  _deserStatus == Fw::FW_SERIALIZE_OK,
8871  static_cast<FwAssertArgType>(_deserStatus)
8872  );
8873 
8874  // Deserialize command sequence
8875  U32 _cmdSeq = 0;
8876  _deserStatus = _msg.deserializeTo(_cmdSeq);
8877  FW_ASSERT (
8878  _deserStatus == Fw::FW_SERIALIZE_OK,
8879  static_cast<FwAssertArgType>(_deserStatus)
8880  );
8881 
8882  // Deserialize command argument buffer
8883  Fw::CmdArgBuffer args;
8884  _deserStatus = _msg.deserializeTo(args);
8885  FW_ASSERT (
8886  _deserStatus == Fw::FW_SERIALIZE_OK,
8887  static_cast<FwAssertArgType>(_deserStatus)
8888  );
8889 
8890  // Reset buffer
8891  args.resetDeser();
8892 
8893  // Deserialize argument fileName
8894  Fw::CmdStringArg fileName;
8895  _deserStatus = args.deserializeTo(fileName);
8896  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
8898  this->cmdResponse_out(
8899  _opCode,
8900  _cmdSeq,
8902  );
8903  }
8904  // Don't crash the task if bad arguments were passed from the ground
8905  break;
8906  }
8907 
8908  // Deserialize argument block
8909  Svc::BlockState block;
8910  _deserStatus = args.deserializeTo(block);
8911  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
8913  this->cmdResponse_out(
8914  _opCode,
8915  _cmdSeq,
8917  );
8918  }
8919  // Don't crash the task if bad arguments were passed from the ground
8920  break;
8921  }
8922 
8923  // Make sure there was no data left over.
8924  // That means the argument buffer size was incorrect.
8925 #if FW_CMD_CHECK_RESIDUAL
8926  if (args.getDeserializeSizeLeft() != 0) {
8928  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
8929  }
8930  // Don't crash the task if bad arguments were passed from the ground
8931  break;
8932  }
8933 #endif
8934 
8935  // Call handler function
8936  this->RUN_cmdHandler(
8937  _opCode, _cmdSeq,
8938  fileName,
8939  block
8940  );
8941 
8942  break;
8943  }
8944 
8945  // Handle command LOAD
8946  case CMD_LOAD: {
8947  // Deserialize opcode
8948  FwOpcodeType _opCode = 0;
8949  _deserStatus = _msg.deserializeTo(_opCode);
8950  FW_ASSERT (
8951  _deserStatus == Fw::FW_SERIALIZE_OK,
8952  static_cast<FwAssertArgType>(_deserStatus)
8953  );
8954 
8955  // Deserialize command sequence
8956  U32 _cmdSeq = 0;
8957  _deserStatus = _msg.deserializeTo(_cmdSeq);
8958  FW_ASSERT (
8959  _deserStatus == Fw::FW_SERIALIZE_OK,
8960  static_cast<FwAssertArgType>(_deserStatus)
8961  );
8962 
8963  // Deserialize command argument buffer
8964  Fw::CmdArgBuffer args;
8965  _deserStatus = _msg.deserializeTo(args);
8966  FW_ASSERT (
8967  _deserStatus == Fw::FW_SERIALIZE_OK,
8968  static_cast<FwAssertArgType>(_deserStatus)
8969  );
8970 
8971  // Reset buffer
8972  args.resetDeser();
8973 
8974  // Deserialize argument fileName
8975  Fw::CmdStringArg fileName;
8976  _deserStatus = args.deserializeTo(fileName);
8977  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
8979  this->cmdResponse_out(
8980  _opCode,
8981  _cmdSeq,
8983  );
8984  }
8985  // Don't crash the task if bad arguments were passed from the ground
8986  break;
8987  }
8988 
8989  // Deserialize argument name
8990  Fw::CmdStringArg name;
8991  _deserStatus = args.deserializeTo(name);
8992  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
8994  this->cmdResponse_out(
8995  _opCode,
8996  _cmdSeq,
8998  );
8999  }
9000  // Don't crash the task if bad arguments were passed from the ground
9001  break;
9002  }
9003 
9004  // Make sure there was no data left over.
9005  // That means the argument buffer size was incorrect.
9006 #if FW_CMD_CHECK_RESIDUAL
9007  if (args.getDeserializeSizeLeft() != 0) {
9009  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9010  }
9011  // Don't crash the task if bad arguments were passed from the ground
9012  break;
9013  }
9014 #endif
9015 
9016  // Call handler function
9017  this->LOAD_cmdHandler(
9018  _opCode, _cmdSeq,
9019  fileName,
9020  name
9021  );
9022 
9023  break;
9024  }
9025 
9026  // Handle command INVOKE
9027  case CMD_INVOKE: {
9028  // Deserialize opcode
9029  FwOpcodeType _opCode = 0;
9030  _deserStatus = _msg.deserializeTo(_opCode);
9031  FW_ASSERT (
9032  _deserStatus == Fw::FW_SERIALIZE_OK,
9033  static_cast<FwAssertArgType>(_deserStatus)
9034  );
9035 
9036  // Deserialize command sequence
9037  U32 _cmdSeq = 0;
9038  _deserStatus = _msg.deserializeTo(_cmdSeq);
9039  FW_ASSERT (
9040  _deserStatus == Fw::FW_SERIALIZE_OK,
9041  static_cast<FwAssertArgType>(_deserStatus)
9042  );
9043 
9044  // Deserialize command argument buffer
9045  Fw::CmdArgBuffer args;
9046  _deserStatus = _msg.deserializeTo(args);
9047  FW_ASSERT (
9048  _deserStatus == Fw::FW_SERIALIZE_OK,
9049  static_cast<FwAssertArgType>(_deserStatus)
9050  );
9051 
9052  // Reset buffer
9053  args.resetDeser();
9054 
9055  // Deserialize argument module
9056  Fw::CmdStringArg module;
9057  _deserStatus = args.deserializeTo(module);
9058  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9060  this->cmdResponse_out(
9061  _opCode,
9062  _cmdSeq,
9064  );
9065  }
9066  // Don't crash the task if bad arguments were passed from the ground
9067  break;
9068  }
9069 
9070  // Deserialize argument block
9071  Svc::BlockState block;
9072  _deserStatus = args.deserializeTo(block);
9073  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9075  this->cmdResponse_out(
9076  _opCode,
9077  _cmdSeq,
9079  );
9080  }
9081  // Don't crash the task if bad arguments were passed from the ground
9082  break;
9083  }
9084 
9085  // Make sure there was no data left over.
9086  // That means the argument buffer size was incorrect.
9087 #if FW_CMD_CHECK_RESIDUAL
9088  if (args.getDeserializeSizeLeft() != 0) {
9090  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9091  }
9092  // Don't crash the task if bad arguments were passed from the ground
9093  break;
9094  }
9095 #endif
9096 
9097  // Call handler function
9098  this->INVOKE_cmdHandler(
9099  _opCode, _cmdSeq,
9100  module,
9101  block
9102  );
9103 
9104  break;
9105  }
9106 
9107  // Handle command WAIT
9108  case CMD_WAIT: {
9109  // Deserialize opcode
9110  FwOpcodeType _opCode = 0;
9111  _deserStatus = _msg.deserializeTo(_opCode);
9112  FW_ASSERT (
9113  _deserStatus == Fw::FW_SERIALIZE_OK,
9114  static_cast<FwAssertArgType>(_deserStatus)
9115  );
9116 
9117  // Deserialize command sequence
9118  U32 _cmdSeq = 0;
9119  _deserStatus = _msg.deserializeTo(_cmdSeq);
9120  FW_ASSERT (
9121  _deserStatus == Fw::FW_SERIALIZE_OK,
9122  static_cast<FwAssertArgType>(_deserStatus)
9123  );
9124 
9125  // Deserialize command argument buffer
9126  Fw::CmdArgBuffer args;
9127  _deserStatus = _msg.deserializeTo(args);
9128  FW_ASSERT (
9129  _deserStatus == Fw::FW_SERIALIZE_OK,
9130  static_cast<FwAssertArgType>(_deserStatus)
9131  );
9132 
9133  // Reset buffer
9134  args.resetDeser();
9135 
9136  // Make sure there was no data left over.
9137  // That means the argument buffer size was incorrect.
9138 #if FW_CMD_CHECK_RESIDUAL
9139  if (args.getDeserializeSizeLeft() != 0) {
9141  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9142  }
9143  // Don't crash the task if bad arguments were passed from the ground
9144  break;
9145  }
9146 #endif
9147 
9148  // Call handler function
9149  this->WAIT_cmdHandler(_opCode, _cmdSeq);
9150 
9151  break;
9152  }
9153 
9154  // Handle command PAUSE
9155  case CMD_PAUSE: {
9156  // Deserialize opcode
9157  FwOpcodeType _opCode = 0;
9158  _deserStatus = _msg.deserializeTo(_opCode);
9159  FW_ASSERT (
9160  _deserStatus == Fw::FW_SERIALIZE_OK,
9161  static_cast<FwAssertArgType>(_deserStatus)
9162  );
9163 
9164  // Deserialize command sequence
9165  U32 _cmdSeq = 0;
9166  _deserStatus = _msg.deserializeTo(_cmdSeq);
9167  FW_ASSERT (
9168  _deserStatus == Fw::FW_SERIALIZE_OK,
9169  static_cast<FwAssertArgType>(_deserStatus)
9170  );
9171 
9172  // Deserialize command argument buffer
9173  Fw::CmdArgBuffer args;
9174  _deserStatus = _msg.deserializeTo(args);
9175  FW_ASSERT (
9176  _deserStatus == Fw::FW_SERIALIZE_OK,
9177  static_cast<FwAssertArgType>(_deserStatus)
9178  );
9179 
9180  // Reset buffer
9181  args.resetDeser();
9182 
9183  // Make sure there was no data left over.
9184  // That means the argument buffer size was incorrect.
9185 #if FW_CMD_CHECK_RESIDUAL
9186  if (args.getDeserializeSizeLeft() != 0) {
9188  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9189  }
9190  // Don't crash the task if bad arguments were passed from the ground
9191  break;
9192  }
9193 #endif
9194 
9195  // Call handler function
9196  this->PAUSE_cmdHandler(_opCode, _cmdSeq);
9197 
9198  break;
9199  }
9200 
9201  // Handle command CONTINUE
9202  case CMD_CONTINUE: {
9203  // Deserialize opcode
9204  FwOpcodeType _opCode = 0;
9205  _deserStatus = _msg.deserializeTo(_opCode);
9206  FW_ASSERT (
9207  _deserStatus == Fw::FW_SERIALIZE_OK,
9208  static_cast<FwAssertArgType>(_deserStatus)
9209  );
9210 
9211  // Deserialize command sequence
9212  U32 _cmdSeq = 0;
9213  _deserStatus = _msg.deserializeTo(_cmdSeq);
9214  FW_ASSERT (
9215  _deserStatus == Fw::FW_SERIALIZE_OK,
9216  static_cast<FwAssertArgType>(_deserStatus)
9217  );
9218 
9219  // Deserialize command argument buffer
9220  Fw::CmdArgBuffer args;
9221  _deserStatus = _msg.deserializeTo(args);
9222  FW_ASSERT (
9223  _deserStatus == Fw::FW_SERIALIZE_OK,
9224  static_cast<FwAssertArgType>(_deserStatus)
9225  );
9226 
9227  // Reset buffer
9228  args.resetDeser();
9229 
9230  // Make sure there was no data left over.
9231  // That means the argument buffer size was incorrect.
9232 #if FW_CMD_CHECK_RESIDUAL
9233  if (args.getDeserializeSizeLeft() != 0) {
9235  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9236  }
9237  // Don't crash the task if bad arguments were passed from the ground
9238  break;
9239  }
9240 #endif
9241 
9242  // Call handler function
9243  this->CONTINUE_cmdHandler(_opCode, _cmdSeq);
9244 
9245  break;
9246  }
9247 
9248  // Handle command GLOBAL_SET_I32
9249  case CMD_GLOBAL_SET_I32: {
9250  // Deserialize opcode
9251  FwOpcodeType _opCode = 0;
9252  _deserStatus = _msg.deserializeTo(_opCode);
9253  FW_ASSERT (
9254  _deserStatus == Fw::FW_SERIALIZE_OK,
9255  static_cast<FwAssertArgType>(_deserStatus)
9256  );
9257 
9258  // Deserialize command sequence
9259  U32 _cmdSeq = 0;
9260  _deserStatus = _msg.deserializeTo(_cmdSeq);
9261  FW_ASSERT (
9262  _deserStatus == Fw::FW_SERIALIZE_OK,
9263  static_cast<FwAssertArgType>(_deserStatus)
9264  );
9265 
9266  // Deserialize command argument buffer
9267  Fw::CmdArgBuffer args;
9268  _deserStatus = _msg.deserializeTo(args);
9269  FW_ASSERT (
9270  _deserStatus == Fw::FW_SERIALIZE_OK,
9271  static_cast<FwAssertArgType>(_deserStatus)
9272  );
9273 
9274  // Reset buffer
9275  args.resetDeser();
9276 
9277  // Deserialize argument moduleName
9278  Fw::CmdStringArg moduleName;
9279  _deserStatus = args.deserializeTo(moduleName);
9280  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9282  this->cmdResponse_out(
9283  _opCode,
9284  _cmdSeq,
9286  );
9287  }
9288  // Don't crash the task if bad arguments were passed from the ground
9289  break;
9290  }
9291 
9292  // Deserialize argument name
9293  Fw::CmdStringArg name;
9294  _deserStatus = args.deserializeTo(name);
9295  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9297  this->cmdResponse_out(
9298  _opCode,
9299  _cmdSeq,
9301  );
9302  }
9303  // Don't crash the task if bad arguments were passed from the ground
9304  break;
9305  }
9306 
9307  // Deserialize argument value
9308  I32 value;
9309  _deserStatus = args.deserializeTo(value);
9310  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9312  this->cmdResponse_out(
9313  _opCode,
9314  _cmdSeq,
9316  );
9317  }
9318  // Don't crash the task if bad arguments were passed from the ground
9319  break;
9320  }
9321 
9322  // Make sure there was no data left over.
9323  // That means the argument buffer size was incorrect.
9324 #if FW_CMD_CHECK_RESIDUAL
9325  if (args.getDeserializeSizeLeft() != 0) {
9327  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9328  }
9329  // Don't crash the task if bad arguments were passed from the ground
9330  break;
9331  }
9332 #endif
9333 
9334  // Call handler function
9336  _opCode, _cmdSeq,
9337  moduleName,
9338  name,
9339  value
9340  );
9341 
9342  break;
9343  }
9344 
9345  // Handle command GLOBAL_SET_I64
9346  case CMD_GLOBAL_SET_I64: {
9347  // Deserialize opcode
9348  FwOpcodeType _opCode = 0;
9349  _deserStatus = _msg.deserializeTo(_opCode);
9350  FW_ASSERT (
9351  _deserStatus == Fw::FW_SERIALIZE_OK,
9352  static_cast<FwAssertArgType>(_deserStatus)
9353  );
9354 
9355  // Deserialize command sequence
9356  U32 _cmdSeq = 0;
9357  _deserStatus = _msg.deserializeTo(_cmdSeq);
9358  FW_ASSERT (
9359  _deserStatus == Fw::FW_SERIALIZE_OK,
9360  static_cast<FwAssertArgType>(_deserStatus)
9361  );
9362 
9363  // Deserialize command argument buffer
9364  Fw::CmdArgBuffer args;
9365  _deserStatus = _msg.deserializeTo(args);
9366  FW_ASSERT (
9367  _deserStatus == Fw::FW_SERIALIZE_OK,
9368  static_cast<FwAssertArgType>(_deserStatus)
9369  );
9370 
9371  // Reset buffer
9372  args.resetDeser();
9373 
9374  // Deserialize argument moduleName
9375  Fw::CmdStringArg moduleName;
9376  _deserStatus = args.deserializeTo(moduleName);
9377  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9379  this->cmdResponse_out(
9380  _opCode,
9381  _cmdSeq,
9383  );
9384  }
9385  // Don't crash the task if bad arguments were passed from the ground
9386  break;
9387  }
9388 
9389  // Deserialize argument name
9390  Fw::CmdStringArg name;
9391  _deserStatus = args.deserializeTo(name);
9392  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9394  this->cmdResponse_out(
9395  _opCode,
9396  _cmdSeq,
9398  );
9399  }
9400  // Don't crash the task if bad arguments were passed from the ground
9401  break;
9402  }
9403 
9404  // Deserialize argument value
9405  I64 value;
9406  _deserStatus = args.deserializeTo(value);
9407  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9409  this->cmdResponse_out(
9410  _opCode,
9411  _cmdSeq,
9413  );
9414  }
9415  // Don't crash the task if bad arguments were passed from the ground
9416  break;
9417  }
9418 
9419  // Make sure there was no data left over.
9420  // That means the argument buffer size was incorrect.
9421 #if FW_CMD_CHECK_RESIDUAL
9422  if (args.getDeserializeSizeLeft() != 0) {
9424  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9425  }
9426  // Don't crash the task if bad arguments were passed from the ground
9427  break;
9428  }
9429 #endif
9430 
9431  // Call handler function
9433  _opCode, _cmdSeq,
9434  moduleName,
9435  name,
9436  value
9437  );
9438 
9439  break;
9440  }
9441 
9442  // Handle command GLOBAL_SET_F32
9443  case CMD_GLOBAL_SET_F32: {
9444  // Deserialize opcode
9445  FwOpcodeType _opCode = 0;
9446  _deserStatus = _msg.deserializeTo(_opCode);
9447  FW_ASSERT (
9448  _deserStatus == Fw::FW_SERIALIZE_OK,
9449  static_cast<FwAssertArgType>(_deserStatus)
9450  );
9451 
9452  // Deserialize command sequence
9453  U32 _cmdSeq = 0;
9454  _deserStatus = _msg.deserializeTo(_cmdSeq);
9455  FW_ASSERT (
9456  _deserStatus == Fw::FW_SERIALIZE_OK,
9457  static_cast<FwAssertArgType>(_deserStatus)
9458  );
9459 
9460  // Deserialize command argument buffer
9461  Fw::CmdArgBuffer args;
9462  _deserStatus = _msg.deserializeTo(args);
9463  FW_ASSERT (
9464  _deserStatus == Fw::FW_SERIALIZE_OK,
9465  static_cast<FwAssertArgType>(_deserStatus)
9466  );
9467 
9468  // Reset buffer
9469  args.resetDeser();
9470 
9471  // Deserialize argument moduleName
9472  Fw::CmdStringArg moduleName;
9473  _deserStatus = args.deserializeTo(moduleName);
9474  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9476  this->cmdResponse_out(
9477  _opCode,
9478  _cmdSeq,
9480  );
9481  }
9482  // Don't crash the task if bad arguments were passed from the ground
9483  break;
9484  }
9485 
9486  // Deserialize argument name
9487  Fw::CmdStringArg name;
9488  _deserStatus = args.deserializeTo(name);
9489  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9491  this->cmdResponse_out(
9492  _opCode,
9493  _cmdSeq,
9495  );
9496  }
9497  // Don't crash the task if bad arguments were passed from the ground
9498  break;
9499  }
9500 
9501  // Deserialize argument value
9502  F32 value;
9503  _deserStatus = args.deserializeTo(value);
9504  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9506  this->cmdResponse_out(
9507  _opCode,
9508  _cmdSeq,
9510  );
9511  }
9512  // Don't crash the task if bad arguments were passed from the ground
9513  break;
9514  }
9515 
9516  // Make sure there was no data left over.
9517  // That means the argument buffer size was incorrect.
9518 #if FW_CMD_CHECK_RESIDUAL
9519  if (args.getDeserializeSizeLeft() != 0) {
9521  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9522  }
9523  // Don't crash the task if bad arguments were passed from the ground
9524  break;
9525  }
9526 #endif
9527 
9528  // Call handler function
9530  _opCode, _cmdSeq,
9531  moduleName,
9532  name,
9533  value
9534  );
9535 
9536  break;
9537  }
9538 
9539  // Handle command GLOBAL_SET_F64
9540  case CMD_GLOBAL_SET_F64: {
9541  // Deserialize opcode
9542  FwOpcodeType _opCode = 0;
9543  _deserStatus = _msg.deserializeTo(_opCode);
9544  FW_ASSERT (
9545  _deserStatus == Fw::FW_SERIALIZE_OK,
9546  static_cast<FwAssertArgType>(_deserStatus)
9547  );
9548 
9549  // Deserialize command sequence
9550  U32 _cmdSeq = 0;
9551  _deserStatus = _msg.deserializeTo(_cmdSeq);
9552  FW_ASSERT (
9553  _deserStatus == Fw::FW_SERIALIZE_OK,
9554  static_cast<FwAssertArgType>(_deserStatus)
9555  );
9556 
9557  // Deserialize command argument buffer
9558  Fw::CmdArgBuffer args;
9559  _deserStatus = _msg.deserializeTo(args);
9560  FW_ASSERT (
9561  _deserStatus == Fw::FW_SERIALIZE_OK,
9562  static_cast<FwAssertArgType>(_deserStatus)
9563  );
9564 
9565  // Reset buffer
9566  args.resetDeser();
9567 
9568  // Deserialize argument moduleName
9569  Fw::CmdStringArg moduleName;
9570  _deserStatus = args.deserializeTo(moduleName);
9571  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9573  this->cmdResponse_out(
9574  _opCode,
9575  _cmdSeq,
9577  );
9578  }
9579  // Don't crash the task if bad arguments were passed from the ground
9580  break;
9581  }
9582 
9583  // Deserialize argument name
9584  Fw::CmdStringArg name;
9585  _deserStatus = args.deserializeTo(name);
9586  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9588  this->cmdResponse_out(
9589  _opCode,
9590  _cmdSeq,
9592  );
9593  }
9594  // Don't crash the task if bad arguments were passed from the ground
9595  break;
9596  }
9597 
9598  // Deserialize argument value
9599  F64 value;
9600  _deserStatus = args.deserializeTo(value);
9601  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9603  this->cmdResponse_out(
9604  _opCode,
9605  _cmdSeq,
9607  );
9608  }
9609  // Don't crash the task if bad arguments were passed from the ground
9610  break;
9611  }
9612 
9613  // Make sure there was no data left over.
9614  // That means the argument buffer size was incorrect.
9615 #if FW_CMD_CHECK_RESIDUAL
9616  if (args.getDeserializeSizeLeft() != 0) {
9618  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9619  }
9620  // Don't crash the task if bad arguments were passed from the ground
9621  break;
9622  }
9623 #endif
9624 
9625  // Call handler function
9627  _opCode, _cmdSeq,
9628  moduleName,
9629  name,
9630  value
9631  );
9632 
9633  break;
9634  }
9635 
9636  // Handle command GLOBAL_GET
9637  case CMD_GLOBAL_GET: {
9638  // Deserialize opcode
9639  FwOpcodeType _opCode = 0;
9640  _deserStatus = _msg.deserializeTo(_opCode);
9641  FW_ASSERT (
9642  _deserStatus == Fw::FW_SERIALIZE_OK,
9643  static_cast<FwAssertArgType>(_deserStatus)
9644  );
9645 
9646  // Deserialize command sequence
9647  U32 _cmdSeq = 0;
9648  _deserStatus = _msg.deserializeTo(_cmdSeq);
9649  FW_ASSERT (
9650  _deserStatus == Fw::FW_SERIALIZE_OK,
9651  static_cast<FwAssertArgType>(_deserStatus)
9652  );
9653 
9654  // Deserialize command argument buffer
9655  Fw::CmdArgBuffer args;
9656  _deserStatus = _msg.deserializeTo(args);
9657  FW_ASSERT (
9658  _deserStatus == Fw::FW_SERIALIZE_OK,
9659  static_cast<FwAssertArgType>(_deserStatus)
9660  );
9661 
9662  // Reset buffer
9663  args.resetDeser();
9664 
9665  // Deserialize argument moduleName
9666  Fw::CmdStringArg moduleName;
9667  _deserStatus = args.deserializeTo(moduleName);
9668  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9670  this->cmdResponse_out(
9671  _opCode,
9672  _cmdSeq,
9674  );
9675  }
9676  // Don't crash the task if bad arguments were passed from the ground
9677  break;
9678  }
9679 
9680  // Deserialize argument name
9681  Fw::CmdStringArg name;
9682  _deserStatus = args.deserializeTo(name);
9683  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
9685  this->cmdResponse_out(
9686  _opCode,
9687  _cmdSeq,
9689  );
9690  }
9691  // Don't crash the task if bad arguments were passed from the ground
9692  break;
9693  }
9694 
9695  // Make sure there was no data left over.
9696  // That means the argument buffer size was incorrect.
9697 #if FW_CMD_CHECK_RESIDUAL
9698  if (args.getDeserializeSizeLeft() != 0) {
9700  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
9701  }
9702  // Don't crash the task if bad arguments were passed from the ground
9703  break;
9704  }
9705 #endif
9706 
9707  // Call handler function
9708  this->GLOBAL_GET_cmdHandler(
9709  _opCode, _cmdSeq,
9710  moduleName,
9711  name
9712  );
9713 
9714  break;
9715  }
9716 
9717  // Handle internal interface writeTelemetryInternal
9718  case INT_IF_WRITETELEMETRYINTERNAL: {
9719  // Make sure there was no data left over.
9720  // That means the buffer size was incorrect.
9721  FW_ASSERT(
9722  _msg.getDeserializeSizeLeft() == 0,
9723  static_cast<FwAssertArgType>(_msg.getDeserializeSizeLeft())
9724  );
9725 
9726  // Call handler function
9728 
9729  break;
9730  }
9731 
9732 
9733  // Handle signals to internal state machines
9734  case INTERNAL_STATE_MACHINE_SIGNAL:
9735  this->smDispatch(_msg);
9736  break;
9737 
9738  default:
9739  return MSG_DISPATCH_ERROR;
9740  }
9741 
9742  return MSG_DISPATCH_OK;
9743  }
9744 
9745  // ----------------------------------------------------------------------
9746  // Calls for messages received on special input ports
9747  // ----------------------------------------------------------------------
9748 
9749  void WasmSequencerComponentBase ::
9750  m_p_cmdIn_in(
9751  Fw::PassiveComponentBase* callComp,
9752  FwIndexType portNum,
9753  FwOpcodeType opCode,
9754  U32 cmdSeq,
9755  Fw::CmdArgBuffer& args
9756  )
9757  {
9758  FW_ASSERT(callComp != nullptr);
9759  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9760  compPtr->cmdIn_handlerBase(
9761  portNum,
9762  opCode,
9763  cmdSeq,
9764  args
9765  );
9766  }
9767 
9768  // ----------------------------------------------------------------------
9769  // Calls for messages received on typed input ports
9770  // ----------------------------------------------------------------------
9771 
9772  void WasmSequencerComponentBase ::
9773  m_p_checkTimers_in(
9774  Fw::PassiveComponentBase* callComp,
9775  FwIndexType portNum,
9776  U32 context
9777  )
9778  {
9779  FW_ASSERT(callComp != nullptr);
9780  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9781  compPtr->checkTimers_handlerBase(
9782  portNum,
9783  context
9784  );
9785  }
9786 
9787  void WasmSequencerComponentBase ::
9788  m_p_cmdResponseIn_in(
9789  Fw::PassiveComponentBase* callComp,
9790  FwIndexType portNum,
9791  FwOpcodeType opCode,
9792  U32 cmdSeq,
9793  const Fw::CmdResponse& response
9794  )
9795  {
9796  FW_ASSERT(callComp != nullptr);
9797  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9798  compPtr->cmdResponseIn_handlerBase(
9799  portNum,
9800  opCode,
9801  cmdSeq,
9802  response
9803  );
9804  }
9805 
9806  void WasmSequencerComponentBase ::
9807  m_p_seqCancelIn_in(
9808  Fw::PassiveComponentBase* callComp,
9809  FwIndexType portNum
9810  )
9811  {
9812  FW_ASSERT(callComp != nullptr);
9813  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9814  compPtr->seqCancelIn_handlerBase(portNum);
9815  }
9816 
9817  void WasmSequencerComponentBase ::
9818  m_p_seqRunIn_in(
9819  Fw::PassiveComponentBase* callComp,
9820  FwIndexType portNum,
9821  const Fw::StringBase& filename,
9822  const Svc::SeqArgs& args
9823  )
9824  {
9825  FW_ASSERT(callComp != nullptr);
9826  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9827  compPtr->seqRunIn_handlerBase(
9828  portNum,
9829  filename,
9830  args
9831  );
9832  }
9833 
9834  void WasmSequencerComponentBase ::
9835  m_p_writeTelemetry_in(
9836  Fw::PassiveComponentBase* callComp,
9837  FwIndexType portNum,
9838  U32 context
9839  )
9840  {
9841  FW_ASSERT(callComp != nullptr);
9842  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9843  compPtr->writeTelemetry_handlerBase(
9844  portNum,
9845  context
9846  );
9847  }
9848 
9849  // ----------------------------------------------------------------------
9850  // Calls for messages received on serial input ports
9851  // ----------------------------------------------------------------------
9852 
9853 #if FW_PORT_SERIALIZATION
9854 
9855  void WasmSequencerComponentBase ::
9856  m_p_serialIn_in(
9857  Fw::PassiveComponentBase* callComp,
9858  FwIndexType portNum,
9859  Fw::LinearBufferBase& buffer
9860  )
9861  {
9862  FW_ASSERT(callComp != nullptr);
9863  WasmSequencerComponentBase* compPtr = static_cast<WasmSequencerComponentBase*>(callComp);
9864  compPtr->serialIn_handlerBase(
9865  portNum,
9866  buffer
9867  );
9868  }
9869 
9870 #endif
9871 
9872 #if !FW_DIRECT_PORT_CALLS
9873 
9874  // ----------------------------------------------------------------------
9875  // Invocation functions for special output ports
9876  // ----------------------------------------------------------------------
9877 
9878  void WasmSequencerComponentBase ::
9879  cmdRegOut_out(
9880  FwIndexType portNum,
9881  FwOpcodeType opCode
9882  ) const
9883  {
9884  FW_ASSERT(
9885  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
9886  static_cast<FwAssertArgType>(portNum)
9887  );
9888 
9889  FW_ASSERT(
9890  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
9891  static_cast<FwAssertArgType>(portNum)
9892  );
9893  this->m_cmdRegOut_OutputPort[portNum].invoke(
9894  opCode
9895  );
9896  }
9897 
9898  void WasmSequencerComponentBase ::
9899  cmdResponseOut_out(
9900  FwIndexType portNum,
9901  FwOpcodeType opCode,
9902  U32 cmdSeq,
9903  const Fw::CmdResponse& response
9904  ) const
9905  {
9906  FW_ASSERT(
9907  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
9908  static_cast<FwAssertArgType>(portNum)
9909  );
9910 
9911  FW_ASSERT(
9912  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
9913  static_cast<FwAssertArgType>(portNum)
9914  );
9915  this->m_cmdResponseOut_OutputPort[portNum].invoke(
9916  opCode,
9917  cmdSeq,
9918  response
9919  );
9920  }
9921 
9922  void WasmSequencerComponentBase ::
9923  logOut_out(
9924  FwIndexType portNum,
9925  FwEventIdType id,
9926  Fw::Time& timeTag,
9927  const Fw::LogSeverity& severity,
9928  Fw::LogBuffer& args
9929  ) const
9930  {
9931  FW_ASSERT(
9932  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
9933  static_cast<FwAssertArgType>(portNum)
9934  );
9935 
9936  FW_ASSERT(
9937  this->m_logOut_OutputPort[portNum].isConnected(),
9938  static_cast<FwAssertArgType>(portNum)
9939  );
9940  this->m_logOut_OutputPort[portNum].invoke(
9941  id,
9942  timeTag,
9943  severity,
9944  args
9945  );
9946  }
9947 
9948 #if FW_ENABLE_TEXT_LOGGING
9949 
9950  void WasmSequencerComponentBase ::
9951  logTextOut_out(
9952  FwIndexType portNum,
9953  FwEventIdType id,
9954  Fw::Time& timeTag,
9955  const Fw::LogSeverity& severity,
9956  Fw::TextLogString& text
9957  ) const
9958  {
9959  FW_ASSERT(
9960  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
9961  static_cast<FwAssertArgType>(portNum)
9962  );
9963 
9964  FW_ASSERT(
9965  this->m_logTextOut_OutputPort[portNum].isConnected(),
9966  static_cast<FwAssertArgType>(portNum)
9967  );
9968  this->m_logTextOut_OutputPort[portNum].invoke(
9969  id,
9970  timeTag,
9971  severity,
9972  text
9973  );
9974  }
9975 
9976 #endif
9977 
9978  Fw::ParamValid WasmSequencerComponentBase ::
9979  prmGet_out(
9980  FwIndexType portNum,
9981  FwPrmIdType id,
9982  Fw::ParamBuffer& val
9983  ) const
9984  {
9985  FW_ASSERT(
9986  (0 <= portNum) && (portNum < this->getNum_prmGet_OutputPorts()),
9987  static_cast<FwAssertArgType>(portNum)
9988  );
9989 
9990  FW_ASSERT(
9991  this->m_prmGet_OutputPort[portNum].isConnected(),
9992  static_cast<FwAssertArgType>(portNum)
9993  );
9994  return this->m_prmGet_OutputPort[portNum].invoke(
9995  id,
9996  val
9997  );
9998  }
9999 
10000  void WasmSequencerComponentBase ::
10001  prmSet_out(
10002  FwIndexType portNum,
10003  FwPrmIdType id,
10004  Fw::ParamBuffer& val
10005  ) const
10006  {
10007  FW_ASSERT(
10008  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
10009  static_cast<FwAssertArgType>(portNum)
10010  );
10011 
10012  FW_ASSERT(
10013  this->m_prmSet_OutputPort[portNum].isConnected(),
10014  static_cast<FwAssertArgType>(portNum)
10015  );
10016  this->m_prmSet_OutputPort[portNum].invoke(
10017  id,
10018  val
10019  );
10020  }
10021 
10022  void WasmSequencerComponentBase ::
10023  timeCaller_out(
10024  FwIndexType portNum,
10025  Fw::Time& time
10026  ) const
10027  {
10028  FW_ASSERT(
10029  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
10030  static_cast<FwAssertArgType>(portNum)
10031  );
10032 
10033  FW_ASSERT(
10034  this->m_timeCaller_OutputPort[portNum].isConnected(),
10035  static_cast<FwAssertArgType>(portNum)
10036  );
10037  this->m_timeCaller_OutputPort[portNum].invoke(
10038  time
10039  );
10040  }
10041 
10042  void WasmSequencerComponentBase ::
10043  tlmOut_out(
10044  FwIndexType portNum,
10045  FwChanIdType id,
10046  Fw::Time& timeTag,
10047  Fw::TlmBuffer& val
10048  ) const
10049  {
10050  FW_ASSERT(
10051  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
10052  static_cast<FwAssertArgType>(portNum)
10053  );
10054 
10055  FW_ASSERT(
10056  this->m_tlmOut_OutputPort[portNum].isConnected(),
10057  static_cast<FwAssertArgType>(portNum)
10058  );
10059  this->m_tlmOut_OutputPort[portNum].invoke(
10060  id,
10061  timeTag,
10062  val
10063  );
10064  }
10065 
10066 #endif
10067 
10068  // ----------------------------------------------------------------------
10069  // Send signal helper functions
10070  // ----------------------------------------------------------------------
10071 
10072  void WasmSequencerComponentBase ::
10073  sendSignalStart(
10074  SmId smId,
10075  FwEnumStoreType signal,
10076  Fw::SerialBufferBase& buffer
10077  )
10078  {
10080 
10081  // Serialize the message type
10082  status = buffer.serializeFrom(static_cast<FwEnumStoreType>(INTERNAL_STATE_MACHINE_SIGNAL));
10083  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10084 
10085  // Serialize the port number
10086  status = buffer.serializeFrom(static_cast<FwIndexType>(0));
10087  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10088 
10089  // Serialize the state machine ID
10090  status = buffer.serializeFrom(static_cast<FwEnumStoreType>(smId));
10091  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10092 
10093  // Serialize the signal
10094  status = buffer.serializeFrom(static_cast<FwEnumStoreType>(signal));
10095  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10096  }
10097 
10098  void WasmSequencerComponentBase ::
10099  controller_sendSignalFinish(Fw::LinearBufferBase& buffer)
10100  {
10101  // Send message
10103  Os::Queue::Status qStatus = this->m_queue.send(buffer, 0, _block);
10104 
10105  FW_ASSERT(
10106  qStatus == Os::Queue::OP_OK,
10107  static_cast<FwAssertArgType>(qStatus)
10108  );
10109  }
10110 
10111  void WasmSequencerComponentBase ::
10112  interpreter_sendSignalFinish(Fw::LinearBufferBase& buffer)
10113  {
10114  // Send message
10116  Os::Queue::Status qStatus = this->m_queue.send(buffer, 0, _block);
10117 
10118  FW_ASSERT(
10119  qStatus == Os::Queue::OP_OK,
10120  static_cast<FwAssertArgType>(qStatus)
10121  );
10122  }
10123 
10124  // ----------------------------------------------------------------------
10125  // Helper functions for state machine dispatch
10126  // ----------------------------------------------------------------------
10127 
10128  void WasmSequencerComponentBase ::
10129  smDispatch(Fw::SerialBufferBase& buffer)
10130  {
10131  // Deserialize the state machine ID and signal
10132  FwEnumStoreType storedSmId;
10133  FwEnumStoreType storedSignal;
10134  WasmSequencerComponentBase::deserializeSmIdAndSignal(buffer, storedSmId, storedSignal);
10135 
10136  // Select the target state machine instance
10137  const SmId smId = static_cast<SmId>(storedSmId);
10138  switch (smId) {
10139  case SmId::controller: {
10141  this->Svc_WasmSequencer_ControllerStateMachine_smDispatch(buffer, this->m_stateMachine_controller, signal);
10142  break;
10143  }
10144  case SmId::interpreter: {
10146  this->Svc_WasmSequencer_InterpreterStateMachine_smDispatch(buffer, this->m_stateMachine_interpreter, signal);
10147  break;
10148  }
10149  default:
10150  FW_ASSERT(false, static_cast<FwAssertArgType>(smId));
10151  break;
10152  }
10153  }
10154 
10155  void WasmSequencerComponentBase ::
10156  deserializeSmIdAndSignal(
10157  Fw::SerialBufferBase& buffer,
10158  FwEnumStoreType& smId,
10159  FwEnumStoreType& signal
10160  )
10161  {
10162  // Move deserialization beyond the message type and port number
10163  Fw::SerializeStatus status =
10164  buffer.moveDeserToOffset(ComponentIpcSerializableBuffer::DATA_OFFSET);
10165  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10166 
10167  // Deserialize the state machine ID
10168  status = buffer.deserializeTo(smId);
10169  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10170 
10171  // Deserialize the signal
10172  status = buffer.deserializeTo(signal);
10173  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10174  }
10175 
10176  void WasmSequencerComponentBase ::
10177  Svc_WasmSequencer_ControllerStateMachine_smDispatch(
10178  Fw::SerialBufferBase& buffer,
10179  Svc_WasmSequencer_ControllerStateMachine& sm,
10181  )
10182  {
10183  switch (signal) {
10185  // Deserialize the data
10187  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10188  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10189  // Assert no data left in buffer
10190  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10191  // Call the sendSignal function for sm and run
10192  sm.sendSignal_run(value);
10193  break;
10194  }
10196  // Deserialize the data
10198  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10199  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10200  // Assert no data left in buffer
10201  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10202  // Call the sendSignal function for sm and load
10203  sm.sendSignal_load(value);
10204  break;
10205  }
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 invoke
10214  sm.sendSignal_invoke(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 invoked
10225  sm.sendSignal_invoked(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 invokeFailed
10236  sm.sendSignal_invokeFailed(value);
10237  break;
10238  }
10240  // Assert no data left in buffer
10241  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10242  // Call the sendSignal function for sm and cancel
10243  sm.sendSignal_cancel();
10244  break;
10245  }
10247  // Deserialize the data
10249  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10250  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10251  // Assert no data left in buffer
10252  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10253  // Call the sendSignal function for sm and loadSucceeded
10254  sm.sendSignal_loadSucceeded(value);
10255  break;
10256  }
10258  // Deserialize the data
10260  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10261  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
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 loadFailed
10265  sm.sendSignal_loadFailed(value);
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 engineFinished
10276  sm.sendSignal_engineFinished(value);
10277  break;
10278  }
10279  default:
10280  FW_ASSERT(false, static_cast<FwAssertArgType>(signal));
10281  break;
10282  }
10283  }
10284 
10285  void WasmSequencerComponentBase ::
10286  Svc_WasmSequencer_InterpreterStateMachine_smDispatch(
10287  Fw::SerialBufferBase& buffer,
10288  Svc_WasmSequencer_InterpreterStateMachine& sm,
10290  )
10291  {
10292  switch (signal) {
10294  // Assert no data left in buffer
10295  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10296  // Call the sendSignal function for sm and cmd_CONTINUE
10297  sm.sendSignal_cmd_CONTINUE();
10298  break;
10299  }
10301  // Deserialize the data
10303  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10304  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10305  // Assert no data left in buffer
10306  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10307  // Call the sendSignal function for sm and cmdCancel
10308  sm.sendSignal_cmdCancel(value);
10309  break;
10310  }
10312  // Assert no data left in buffer
10313  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10314  // Call the sendSignal function for sm and cancel
10315  sm.sendSignal_cancel();
10316  break;
10317  }
10319  // Assert no data left in buffer
10320  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10321  // Call the sendSignal function for sm and entered
10322  sm.sendSignal_entered();
10323  break;
10324  }
10326  // Deserialize the data
10328  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10329  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10330  // Assert no data left in buffer
10331  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10332  // Call the sendSignal function for sm and run
10333  sm.sendSignal_run(value);
10334  break;
10335  }
10337  // Assert no data left in buffer
10338  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10339  // Call the sendSignal function for sm and checkTimers
10340  sm.sendSignal_checkTimers();
10341  break;
10342  }
10344  // Assert no data left in buffer
10345  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10346  // Call the sendSignal function for sm and hostResume
10347  sm.sendSignal_hostResume();
10348  break;
10349  }
10351  // Deserialize the data
10352  I32 value;
10353  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10354  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10355  // Assert no data left in buffer
10356  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10357  // Call the sendSignal function for sm and hostResumeI32
10358  sm.sendSignal_hostResumeI32(value);
10359  break;
10360  }
10362  // Assert no data left in buffer
10363  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10364  // Call the sendSignal function for sm and hostResponseFailure
10365  sm.sendSignal_hostResponseFailure();
10366  break;
10367  }
10369  // Deserialize the data
10371  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10372  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10373  // Assert no data left in buffer
10374  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10375  // Call the sendSignal function for sm and hostResponseUnexpected
10376  sm.sendSignal_hostResponseUnexpected(value);
10377  break;
10378  }
10380  // Assert no data left in buffer
10381  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10382  // Call the sendSignal function for sm and hostResponseTimeIncomparable
10383  sm.sendSignal_hostResponseTimeIncomparable();
10384  break;
10385  }
10387  // Assert no data left in buffer
10388  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10389  // Call the sendSignal function for sm and hostResponseTimeout
10390  sm.sendSignal_hostResponseTimeout();
10391  break;
10392  }
10394  // Deserialize the data
10395  FwIndexType value;
10396  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10397  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
10398  // Assert no data left in buffer
10399  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10400  // Call the sendSignal function for sm and serialInMessage
10401  sm.sendSignal_serialInMessage(value);
10402  break;
10403  }
10405  // Deserialize the data
10406  I32 value;
10407  const Fw::SerializeStatus status = buffer.deserializeTo(value);
10408  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
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 interpreterFinished
10412  sm.sendSignal_interpreterFinished(value);
10413  break;
10414  }
10416  // Deserialize the data
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 interpreterTrap
10423  sm.sendSignal_interpreterTrap(value);
10424  break;
10425  }
10427  // Assert no data left in buffer
10428  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10429  // Call the sendSignal function for sm and interpreterOutOfFuel
10430  sm.sendSignal_interpreterOutOfFuel();
10431  break;
10432  }
10434  // Assert no data left in buffer
10435  FW_ASSERT(buffer.getDeserializeSizeLeft() == 0, static_cast<FwAssertArgType>(buffer.getDeserializeSizeLeft()));
10436  // Call the sendSignal function for sm and interpreterHostFunctionNeedsPause
10437  sm.sendSignal_interpreterHostFunctionNeedsPause();
10438  break;
10439  }
10440  default:
10441  FW_ASSERT(false, static_cast<FwAssertArgType>(signal));
10442  break;
10443  }
10444  }
10445 
10446  // ----------------------------------------------------------------------
10447  // Parameter set functions
10448  // ----------------------------------------------------------------------
10449 
10450  Fw::CmdResponse WasmSequencerComponentBase ::
10451  paramSet_HOST_FUNCTION_TIMEOUT_SECS(Fw::SerialBufferBase& val)
10452  {
10453  F32 _localVal{};
10454  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
10455  if (_stat != Fw::FW_SERIALIZE_OK) {
10457  }
10458 
10459  // Assign value only if successfully deserialized
10460  this->m_paramLock.lock();
10461  this->m_HOST_FUNCTION_TIMEOUT_SECS = _localVal;
10462  this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid = Fw::ParamValid::VALID;
10463  this->m_paramLock.unlock();
10464 
10465  // Call notifier
10467  return Fw::CmdResponse::OK;
10468  }
10469 
10470  Fw::CmdResponse WasmSequencerComponentBase ::
10471  paramSet_INSTRUCTION_FUEL(Fw::SerialBufferBase& val)
10472  {
10473  FwSizeType _localVal{};
10474  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
10475  if (_stat != Fw::FW_SERIALIZE_OK) {
10477  }
10478 
10479  // Assign value only if successfully deserialized
10480  this->m_paramLock.lock();
10481  this->m_INSTRUCTION_FUEL = _localVal;
10482  this->m_param_INSTRUCTION_FUEL_valid = Fw::ParamValid::VALID;
10483  this->m_paramLock.unlock();
10484 
10485  // Call notifier
10487  return Fw::CmdResponse::OK;
10488  }
10489 
10490  Fw::CmdResponse WasmSequencerComponentBase ::
10491  paramSet_SEQ_BASE_DIR(Fw::SerialBufferBase& val)
10492  {
10493  Fw::ParamString _localVal{};
10494  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
10495  if (_stat != Fw::FW_SERIALIZE_OK) {
10497  }
10498 
10499  // Assign value only if successfully deserialized
10500  this->m_paramLock.lock();
10501  this->m_SEQ_BASE_DIR = _localVal;
10502  this->m_param_SEQ_BASE_DIR_valid = Fw::ParamValid::VALID;
10503  this->m_paramLock.unlock();
10504 
10505  // Call notifier
10507  return Fw::CmdResponse::OK;
10508  }
10509 
10510  // ----------------------------------------------------------------------
10511  // Parameter save functions
10512  // ----------------------------------------------------------------------
10513 
10514  Fw::CmdResponse WasmSequencerComponentBase ::
10515  paramSave_HOST_FUNCTION_TIMEOUT_SECS()
10516  {
10517  if (!this->isConnected_prmSet_OutputPort(0)) {
10519  }
10520  Fw::ParamBuffer _paramBuffer;
10521  const FwIdType idBase = this->getIdBase();
10523  // Serialize the parameter
10524  this->m_paramLock.lock();
10525  if ((this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid == Fw::ParamValid::VALID) || (this->m_param_HOST_FUNCTION_TIMEOUT_SECS_valid == Fw::ParamValid::DEFAULT)) {
10526  _stat = _paramBuffer.serializeFrom(m_HOST_FUNCTION_TIMEOUT_SECS);
10527  }
10528  this->m_paramLock.unlock();
10529  if (_stat != Fw::FW_SERIALIZE_OK) {
10531  }
10532  // Save the parameter
10533  this->prmSet_out(
10534  0,
10535  static_cast<FwPrmIdType>(idBase + PARAMID_HOST_FUNCTION_TIMEOUT_SECS),
10536  _paramBuffer
10537  );
10538  // Return the command response
10539  return Fw::CmdResponse::OK;
10540  }
10541 
10542  Fw::CmdResponse WasmSequencerComponentBase ::
10543  paramSave_INSTRUCTION_FUEL()
10544  {
10545  if (!this->isConnected_prmSet_OutputPort(0)) {
10547  }
10548  Fw::ParamBuffer _paramBuffer;
10549  const FwIdType idBase = this->getIdBase();
10551  // Serialize the parameter
10552  this->m_paramLock.lock();
10553  if ((this->m_param_INSTRUCTION_FUEL_valid == Fw::ParamValid::VALID) || (this->m_param_INSTRUCTION_FUEL_valid == Fw::ParamValid::DEFAULT)) {
10554  _stat = _paramBuffer.serializeFrom(m_INSTRUCTION_FUEL);
10555  }
10556  this->m_paramLock.unlock();
10557  if (_stat != Fw::FW_SERIALIZE_OK) {
10559  }
10560  // Save the parameter
10561  this->prmSet_out(
10562  0,
10563  static_cast<FwPrmIdType>(idBase + PARAMID_INSTRUCTION_FUEL),
10564  _paramBuffer
10565  );
10566  // Return the command response
10567  return Fw::CmdResponse::OK;
10568  }
10569 
10570  Fw::CmdResponse WasmSequencerComponentBase ::
10571  paramSave_SEQ_BASE_DIR()
10572  {
10573  if (!this->isConnected_prmSet_OutputPort(0)) {
10575  }
10576  Fw::ParamBuffer _paramBuffer;
10577  const FwIdType idBase = this->getIdBase();
10579  // Serialize the parameter
10580  this->m_paramLock.lock();
10581  if ((this->m_param_SEQ_BASE_DIR_valid == Fw::ParamValid::VALID) || (this->m_param_SEQ_BASE_DIR_valid == Fw::ParamValid::DEFAULT)) {
10582  _stat = _paramBuffer.serializeFrom(m_SEQ_BASE_DIR);
10583  }
10584  this->m_paramLock.unlock();
10585  if (_stat != Fw::FW_SERIALIZE_OK) {
10587  }
10588  // Save the parameter
10589  this->prmSet_out(
10590  0,
10591  static_cast<FwPrmIdType>(idBase + PARAMID_SEQ_BASE_DIR),
10592  _paramBuffer
10593  );
10594  // Return the command response
10595  return Fw::CmdResponse::OK;
10596  }
10597 
10598 }
void log_ACTIVITY_LO_LogActivityLo(const Fw::StringBase &msg) const
Serialization/Deserialization operation was successful.
static constexpr FwIndexType getNum_serialIn_InputPorts()
An ACTIVITY_HI event emitted by the guest program.
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.
A command was issued in a state where it is not valid.
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
A guest serial port host function requested a port index outside the configured range.
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.
Operation succeeded.
Definition: Os.hpp:27
virtual void parameterLoaded(FwPrmIdType id, Fw::ParamValid valid)
Called for each parameter when parameters are loaded.
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
#define FW_PARAM_OK(paramValid)
Definition: ParamValid.hpp:22
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.
void writeTelemetryInternal_internalInterfaceInvoke()
Internal interface base-class function for writeTelemetryInternal.
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.
Wait for the interpreter to finish and return it&#39;s result as a CmdResponse.
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 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)
No sequence is running so we cannot continue from a pause.
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.
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
message to exit active component task
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
A WARNING_LO event emitted by the guest program.
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
The interpreter store was allocated with capacity for the given number of modules.
#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
A command was issued in a state where it is not valid.
Data was the wrong format (e.g. wrong packet type)
virtual void unLock()
Unlock the guarded mutex.
Invoke a main function from a loaded module.
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
A module failed to decode/validate while loading.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
ActiveComponentBase(const char *name)
Constructor.
virtual void writeTelemetryInternal_overflowHook()=0
Overflow hook for async input port writeTelemetryInternal.
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.
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.
void unLock()
unlock the mutex and assert success
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.
The size of the serial representation.
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
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
void log_WARNING_HI_BufferTooLarge(const Svc::WasmSequencer_HostFunction &host_function, U32 size, U32 maxSize) const
Command failed to deserialize.
void interpreter_sendSignal_checkTimers()
Send signal checkTimers to state machine interpreter.
void lock()
lock the mutex and assert success
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.
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.
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 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.
Failed to find a loaded module with the requested name.
A guest host function supplied a buffer larger than the host maximum for that call.
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
virtual void writeTelemetryInternal_internalInterfaceHandler()=0
Internal interface handler for writeTelemetryInternal.
PlatformIndexType FwIndexType
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
A sequence is starting after the main entrypoint was invoked.
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.
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)
Svc_WasmSequencer_ControllerStateMachine(WasmSequencerComponentBase &component)
Constructor.
void unlock()
alias for unLock to meet BasicLockable requirements
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.
A WARNING_HI event emitted by the guest program.
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
A DIAGNOSTIC event emitted by the guest program.
void INVOKE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_getParam_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to getParam[portNum].
The size of the serial representation.
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.
virtual void INVOKE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &module, const Svc::BlockState &block)=0
virtual void RUN_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, const Svc::BlockState &block)=0
Failed to open the requested Wasm module file.
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
The interpreter aborted the sequence with a byte-code trap.
void log_WARNING_HI_SleepDurationTooLarge(const Svc::WasmSequencer_HostFunction &host_function, U64 micros) const
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.
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
An ACTIVITY_LO event emitted by the guest program.
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.
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.
virtual void WAIT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command WAIT.
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.
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.