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