F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FpySequencerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FpySequencerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for FpySequencer component base class
5 // ======================================================================
6 
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
13 
14 namespace Svc {
15 
16  namespace {
17 
18  // Constant definitions for the state machine signal buffer
19  namespace SmSignalBuffer {
20 
21  // Union for computing the max size of a signal type
22  union SignalTypeUnion {
23  BYTE size_of_Svc_FpySequencer_SequenceExecutionArgs[Svc::FpySequencer_SequenceExecutionArgs::SERIALIZED_SIZE];
24  };
25 
26  // The serialized size
27  static constexpr FwSizeType SERIALIZED_SIZE =
28  2 * sizeof(FwEnumStoreType) +
29  sizeof(SignalTypeUnion);
30 
31  }
32 
33  enum MsgTypeEnum {
34  FPYSEQUENCER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
35  CHECKTIMERS_SCHED,
36  CMDRESPONSEIN_CMDRESPONSE,
37  PINGIN_PING,
38  TLMWRITE_SCHED,
39  CMD_RUN,
40  CMD_VALIDATE,
41  CMD_RUN_VALIDATED,
42  CMD_CANCEL,
43  INT_IF_DIRECTIVE_WAITABS,
44  INT_IF_DIRECTIVE_WAITREL,
45  INTERNAL_STATE_MACHINE_SIGNAL,
46  };
47 
48  // Get the max size by constructing a union of the async input, command, and
49  // internal port serialization sizes
50  union BuffUnion {
51  BYTE checkTimersPortSize[Svc::InputSchedPort::SERIALIZED_SIZE];
52  BYTE cmdResponseInPortSize[Fw::InputCmdResponsePort::SERIALIZED_SIZE];
56  // Size of directive_waitAbs argument list
57  BYTE directive_waitAbsIntIfSize[
59  ];
60  // Size of directive_waitRel argument list
61  BYTE directive_waitRelIntIfSize[
63  ];
64  // Size of buffer for internal state machine signals
65  // The internal SmSignalBuffer stores the state machine id, the
66  // signal id, and the signal data
67  BYTE internalSmBufferSize[SmSignalBuffer::SERIALIZED_SIZE];
68  };
69 
70  // Define a message buffer class large enough to handle all the
71  // asynchronous inputs to the component
72  class ComponentIpcSerializableBuffer :
74  {
75 
76  public:
77 
78  enum {
79  // Offset into data in buffer: Size of message ID and port number
80  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
81  // Max data size
82  MAX_DATA_SIZE = sizeof(BuffUnion),
83  // Max message size: Size of message id + size of port + max data size
84  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
85  };
86 
87  Fw::Serializable::SizeType getBuffCapacity() const {
88  return sizeof(m_buff);
89  }
90 
91  U8* getBuffAddr() {
92  return m_buff;
93  }
94 
95  const U8* getBuffAddr() const {
96  return m_buff;
97  }
98 
99  private:
100  // Should be the max of all the input ports serialized sizes...
101  U8 m_buff[SERIALIZATION_SIZE];
102 
103  };
104  }
105 
106  // ----------------------------------------------------------------------
107  // Types for internal state machines
108  // ----------------------------------------------------------------------
109 
112  m_component(component)
113  {
114 
115  }
116 
119  {
120  this->initBase(static_cast<FwEnumStoreType>(smId));
121  }
122 
124  getId() const
125  {
126  return static_cast<FpySequencerComponentBase::SmId>(this->m_id);
127  }
128 
129  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
130  action_signalEntered(Signal signal)
131  {
132  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_signalEntered(this->getId(), signal);
133  }
134 
135  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
136  action_setSequenceFilePath(
137  Signal signal,
139  )
140  {
141  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_setSequenceFilePath(this->getId(), signal, value);
142  }
143 
144  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
145  action_setSequenceBlockState(
146  Signal signal,
148  )
149  {
150  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_setSequenceBlockState(this->getId(), signal, value);
151  }
152 
153  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
154  action_validate(Signal signal)
155  {
156  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_validate(this->getId(), signal);
157  }
158 
159  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
160  action_report_seqSucceeded(Signal signal)
161  {
162  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_report_seqSucceeded(this->getId(), signal);
163  }
164 
165  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
166  action_report_seqCancelled(Signal signal)
167  {
168  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_report_seqCancelled(this->getId(), signal);
169  }
170 
171  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
172  action_setGoalState_RUNNING(Signal signal)
173  {
174  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_setGoalState_RUNNING(this->getId(), signal);
175  }
176 
177  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
178  action_setGoalState_VALID(Signal signal)
179  {
180  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_setGoalState_VALID(this->getId(), signal);
181  }
182 
183  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
184  action_setGoalState_IDLE(Signal signal)
185  {
186  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_setGoalState_IDLE(this->getId(), signal);
187  }
188 
189  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
190  action_sendCmdResponse_OK(Signal signal)
191  {
192  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_OK(this->getId(), signal);
193  }
194 
195  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
196  action_sendCmdResponse_EXECUTION_ERROR(Signal signal)
197  {
198  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_sendCmdResponse_EXECUTION_ERROR(this->getId(), signal);
199  }
200 
201  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
202  action_clearSequenceFile(Signal signal)
203  {
204  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_clearSequenceFile(this->getId(), signal);
205  }
206 
207  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
208  action_checkShouldWake(Signal signal)
209  {
210  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_checkShouldWake(this->getId(), signal);
211  }
212 
213  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
214  action_dispatchStatement(Signal signal)
215  {
216  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_dispatchStatement(this->getId(), signal);
217  }
218 
219  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
220  action_resetRuntime(Signal signal)
221  {
222  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_resetRuntime(this->getId(), signal);
223  }
224 
225  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
226  action_checkStatementTimeout(Signal signal)
227  {
228  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_checkStatementTimeout(this->getId(), signal);
229  }
230 
231  void FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
232  action_incrementSequenceCounter(Signal signal)
233  {
234  this->m_component.Svc_FpySequencer_SequencerStateMachine_action_incrementSequenceCounter(this->getId(), signal);
235  }
236 
237  bool FpySequencerComponentBase::Svc_FpySequencer_SequencerStateMachine ::
238  guard_goalStateIs_RUNNING(Signal signal) const
239  {
240  return this->m_component.Svc_FpySequencer_SequencerStateMachine_guard_goalStateIs_RUNNING(this->getId(), signal);
241  }
242 
243  // ----------------------------------------------------------------------
244  // Component initialization
245  // ----------------------------------------------------------------------
246 
249  FwSizeType queueDepth,
250  FwEnumStoreType instance
251  )
252  {
253  // Initialize base class
255 
256  // Initialize state machine instances
257  this->m_stateMachine_sequencer.init(SmId::sequencer);
258 
259  // Connect input port cmdIn
260  for (
261  FwIndexType port = 0;
262  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
263  port++
264  ) {
265  this->m_cmdIn_InputPort[port].init();
266  this->m_cmdIn_InputPort[port].addCallComp(
267  this,
268  m_p_cmdIn_in
269  );
270  this->m_cmdIn_InputPort[port].setPortNum(port);
271 
272 #if FW_OBJECT_NAMES == 1
273  Fw::ObjectName portName;
274  portName.format(
275  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
276  this->m_objName.toChar(),
277  port
278  );
279  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
280 #endif
281  }
282 
283  // Connect input port checkTimers
284  for (
285  FwIndexType port = 0;
286  port < static_cast<FwIndexType>(this->getNum_checkTimers_InputPorts());
287  port++
288  ) {
289  this->m_checkTimers_InputPort[port].init();
290  this->m_checkTimers_InputPort[port].addCallComp(
291  this,
292  m_p_checkTimers_in
293  );
294  this->m_checkTimers_InputPort[port].setPortNum(port);
295 
296 #if FW_OBJECT_NAMES == 1
297  Fw::ObjectName portName;
298  portName.format(
299  "%s_checkTimers_InputPort[%" PRI_FwIndexType "]",
300  this->m_objName.toChar(),
301  port
302  );
303  this->m_checkTimers_InputPort[port].setObjName(portName.toChar());
304 #endif
305  }
306 
307  // Connect input port cmdResponseIn
308  for (
309  FwIndexType port = 0;
310  port < static_cast<FwIndexType>(this->getNum_cmdResponseIn_InputPorts());
311  port++
312  ) {
313  this->m_cmdResponseIn_InputPort[port].init();
314  this->m_cmdResponseIn_InputPort[port].addCallComp(
315  this,
316  m_p_cmdResponseIn_in
317  );
318  this->m_cmdResponseIn_InputPort[port].setPortNum(port);
319 
320 #if FW_OBJECT_NAMES == 1
321  Fw::ObjectName portName;
322  portName.format(
323  "%s_cmdResponseIn_InputPort[%" PRI_FwIndexType "]",
324  this->m_objName.toChar(),
325  port
326  );
327  this->m_cmdResponseIn_InputPort[port].setObjName(portName.toChar());
328 #endif
329  }
330 
331  // Connect input port pingIn
332  for (
333  FwIndexType port = 0;
334  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
335  port++
336  ) {
337  this->m_pingIn_InputPort[port].init();
338  this->m_pingIn_InputPort[port].addCallComp(
339  this,
340  m_p_pingIn_in
341  );
342  this->m_pingIn_InputPort[port].setPortNum(port);
343 
344 #if FW_OBJECT_NAMES == 1
345  Fw::ObjectName portName;
346  portName.format(
347  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
348  this->m_objName.toChar(),
349  port
350  );
351  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
352 #endif
353  }
354 
355  // Connect input port tlmWrite
356  for (
357  FwIndexType port = 0;
358  port < static_cast<FwIndexType>(this->getNum_tlmWrite_InputPorts());
359  port++
360  ) {
361  this->m_tlmWrite_InputPort[port].init();
362  this->m_tlmWrite_InputPort[port].addCallComp(
363  this,
364  m_p_tlmWrite_in
365  );
366  this->m_tlmWrite_InputPort[port].setPortNum(port);
367 
368 #if FW_OBJECT_NAMES == 1
369  Fw::ObjectName portName;
370  portName.format(
371  "%s_tlmWrite_InputPort[%" PRI_FwIndexType "]",
372  this->m_objName.toChar(),
373  port
374  );
375  this->m_tlmWrite_InputPort[port].setObjName(portName.toChar());
376 #endif
377  }
378 
379  // Connect output port cmdRegOut
380  for (
381  FwIndexType port = 0;
382  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
383  port++
384  ) {
385  this->m_cmdRegOut_OutputPort[port].init();
386 
387 #if FW_OBJECT_NAMES == 1
388  Fw::ObjectName portName;
389  portName.format(
390  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
391  this->m_objName.toChar(),
392  port
393  );
394  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
395 #endif
396  }
397 
398  // Connect output port cmdResponseOut
399  for (
400  FwIndexType port = 0;
401  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
402  port++
403  ) {
404  this->m_cmdResponseOut_OutputPort[port].init();
405 
406 #if FW_OBJECT_NAMES == 1
407  Fw::ObjectName portName;
408  portName.format(
409  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
410  this->m_objName.toChar(),
411  port
412  );
413  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
414 #endif
415  }
416 
417  // Connect output port logOut
418  for (
419  FwIndexType port = 0;
420  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
421  port++
422  ) {
423  this->m_logOut_OutputPort[port].init();
424 
425 #if FW_OBJECT_NAMES == 1
426  Fw::ObjectName portName;
427  portName.format(
428  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
429  this->m_objName.toChar(),
430  port
431  );
432  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
433 #endif
434  }
435 
436 #if FW_ENABLE_TEXT_LOGGING == 1
437  // Connect output port logTextOut
438  for (
439  FwIndexType port = 0;
440  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
441  port++
442  ) {
443  this->m_logTextOut_OutputPort[port].init();
444 
445 #if FW_OBJECT_NAMES == 1
446  Fw::ObjectName portName;
447  portName.format(
448  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
449  this->m_objName.toChar(),
450  port
451  );
452  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
453 #endif
454  }
455 #endif
456 
457  // Connect output port prmGet
458  for (
459  FwIndexType port = 0;
460  port < static_cast<FwIndexType>(this->getNum_prmGet_OutputPorts());
461  port++
462  ) {
463  this->m_prmGet_OutputPort[port].init();
464 
465 #if FW_OBJECT_NAMES == 1
466  Fw::ObjectName portName;
467  portName.format(
468  "%s_prmGet_OutputPort[%" PRI_FwIndexType "]",
469  this->m_objName.toChar(),
470  port
471  );
472  this->m_prmGet_OutputPort[port].setObjName(portName.toChar());
473 #endif
474  }
475 
476  // Connect output port prmSet
477  for (
478  FwIndexType port = 0;
479  port < static_cast<FwIndexType>(this->getNum_prmSet_OutputPorts());
480  port++
481  ) {
482  this->m_prmSet_OutputPort[port].init();
483 
484 #if FW_OBJECT_NAMES == 1
485  Fw::ObjectName portName;
486  portName.format(
487  "%s_prmSet_OutputPort[%" PRI_FwIndexType "]",
488  this->m_objName.toChar(),
489  port
490  );
491  this->m_prmSet_OutputPort[port].setObjName(portName.toChar());
492 #endif
493  }
494 
495  // Connect output port timeCaller
496  for (
497  FwIndexType port = 0;
498  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
499  port++
500  ) {
501  this->m_timeCaller_OutputPort[port].init();
502 
503 #if FW_OBJECT_NAMES == 1
504  Fw::ObjectName portName;
505  portName.format(
506  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
507  this->m_objName.toChar(),
508  port
509  );
510  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
511 #endif
512  }
513 
514  // Connect output port tlmOut
515  for (
516  FwIndexType port = 0;
517  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
518  port++
519  ) {
520  this->m_tlmOut_OutputPort[port].init();
521 
522 #if FW_OBJECT_NAMES == 1
523  Fw::ObjectName portName;
524  portName.format(
525  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
526  this->m_objName.toChar(),
527  port
528  );
529  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
530 #endif
531  }
532 
533  // Connect output port cmdOut
534  for (
535  FwIndexType port = 0;
536  port < static_cast<FwIndexType>(this->getNum_cmdOut_OutputPorts());
537  port++
538  ) {
539  this->m_cmdOut_OutputPort[port].init();
540 
541 #if FW_OBJECT_NAMES == 1
542  Fw::ObjectName portName;
543  portName.format(
544  "%s_cmdOut_OutputPort[%" PRI_FwIndexType "]",
545  this->m_objName.toChar(),
546  port
547  );
548  this->m_cmdOut_OutputPort[port].setObjName(portName.toChar());
549 #endif
550  }
551 
552  // Connect output port pingOut
553  for (
554  FwIndexType port = 0;
555  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
556  port++
557  ) {
558  this->m_pingOut_OutputPort[port].init();
559 
560 #if FW_OBJECT_NAMES == 1
561  Fw::ObjectName portName;
562  portName.format(
563  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
564  this->m_objName.toChar(),
565  port
566  );
567  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
568 #endif
569  }
570 
571  // Create the queue
572  Os::Queue::Status qStat = this->createQueue(
573  queueDepth,
574  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
575  );
576  FW_ASSERT(
577  Os::Queue::Status::OP_OK == qStat,
578  static_cast<FwAssertArgType>(qStat)
579  );
580  }
581 
582  // ----------------------------------------------------------------------
583  // Getters for special input ports
584  // ----------------------------------------------------------------------
585 
588  {
589  FW_ASSERT(
590  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
591  static_cast<FwAssertArgType>(portNum)
592  );
593 
594  return &this->m_cmdIn_InputPort[portNum];
595  }
596 
597  // ----------------------------------------------------------------------
598  // Getters for typed input ports
599  // ----------------------------------------------------------------------
600 
603  {
604  FW_ASSERT(
605  (0 <= portNum) && (portNum < this->getNum_checkTimers_InputPorts()),
606  static_cast<FwAssertArgType>(portNum)
607  );
608 
609  return &this->m_checkTimers_InputPort[portNum];
610  }
611 
614  {
615  FW_ASSERT(
616  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
617  static_cast<FwAssertArgType>(portNum)
618  );
619 
620  return &this->m_cmdResponseIn_InputPort[portNum];
621  }
622 
625  {
626  FW_ASSERT(
627  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
628  static_cast<FwAssertArgType>(portNum)
629  );
630 
631  return &this->m_pingIn_InputPort[portNum];
632  }
633 
636  {
637  FW_ASSERT(
638  (0 <= portNum) && (portNum < this->getNum_tlmWrite_InputPorts()),
639  static_cast<FwAssertArgType>(portNum)
640  );
641 
642  return &this->m_tlmWrite_InputPort[portNum];
643  }
644 
645  // ----------------------------------------------------------------------
646  // Connect input ports to special output ports
647  // ----------------------------------------------------------------------
648 
651  FwIndexType portNum,
652  Fw::InputCmdRegPort* port
653  )
654  {
655  FW_ASSERT(
656  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
657  static_cast<FwAssertArgType>(portNum)
658  );
659 
660  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
661  }
662 
665  FwIndexType portNum,
667  )
668  {
669  FW_ASSERT(
670  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
671  static_cast<FwAssertArgType>(portNum)
672  );
673 
674  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
675  }
676 
679  FwIndexType portNum,
680  Fw::InputLogPort* port
681  )
682  {
683  FW_ASSERT(
684  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
685  static_cast<FwAssertArgType>(portNum)
686  );
687 
688  this->m_logOut_OutputPort[portNum].addCallPort(port);
689  }
690 
691 #if FW_ENABLE_TEXT_LOGGING == 1
692 
693  void FpySequencerComponentBase ::
694  set_logTextOut_OutputPort(
695  FwIndexType portNum,
697  )
698  {
699  FW_ASSERT(
700  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
701  static_cast<FwAssertArgType>(portNum)
702  );
703 
704  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
705  }
706 
707 #endif
708 
711  FwIndexType portNum,
712  Fw::InputPrmGetPort* port
713  )
714  {
715  FW_ASSERT(
716  (0 <= portNum) && (portNum < this->getNum_prmGet_OutputPorts()),
717  static_cast<FwAssertArgType>(portNum)
718  );
719 
720  this->m_prmGet_OutputPort[portNum].addCallPort(port);
721  }
722 
725  FwIndexType portNum,
726  Fw::InputPrmSetPort* port
727  )
728  {
729  FW_ASSERT(
730  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
731  static_cast<FwAssertArgType>(portNum)
732  );
733 
734  this->m_prmSet_OutputPort[portNum].addCallPort(port);
735  }
736 
739  FwIndexType portNum,
740  Fw::InputTimePort* port
741  )
742  {
743  FW_ASSERT(
744  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
745  static_cast<FwAssertArgType>(portNum)
746  );
747 
748  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
749  }
750 
753  FwIndexType portNum,
754  Fw::InputTlmPort* port
755  )
756  {
757  FW_ASSERT(
758  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
759  static_cast<FwAssertArgType>(portNum)
760  );
761 
762  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
763  }
764 
765  // ----------------------------------------------------------------------
766  // Connect typed input ports to typed output ports
767  // ----------------------------------------------------------------------
768 
771  FwIndexType portNum,
772  Fw::InputComPort* port
773  )
774  {
775  FW_ASSERT(
776  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
777  static_cast<FwAssertArgType>(portNum)
778  );
779 
780  this->m_cmdOut_OutputPort[portNum].addCallPort(port);
781  }
782 
785  FwIndexType portNum,
786  Svc::InputPingPort* port
787  )
788  {
789  FW_ASSERT(
790  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
791  static_cast<FwAssertArgType>(portNum)
792  );
793 
794  this->m_pingOut_OutputPort[portNum].addCallPort(port);
795  }
796 
797 #if FW_PORT_SERIALIZATION
798 
799  // ----------------------------------------------------------------------
800  // Connect serial input ports to special output ports
801  // ----------------------------------------------------------------------
802 
805  FwIndexType portNum,
806  Fw::InputSerializePort* port
807  )
808  {
809  FW_ASSERT(
810  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
811  static_cast<FwAssertArgType>(portNum)
812  );
813 
814  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
815  }
816 
819  FwIndexType portNum,
820  Fw::InputSerializePort* port
821  )
822  {
823  FW_ASSERT(
824  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
825  static_cast<FwAssertArgType>(portNum)
826  );
827 
828  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
829  }
830 
833  FwIndexType portNum,
834  Fw::InputSerializePort* port
835  )
836  {
837  FW_ASSERT(
838  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
839  static_cast<FwAssertArgType>(portNum)
840  );
841 
842  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
843  }
844 
845 #if FW_ENABLE_TEXT_LOGGING == 1
846 
847  void FpySequencerComponentBase ::
848  set_logTextOut_OutputPort(
849  FwIndexType portNum,
850  Fw::InputSerializePort* port
851  )
852  {
853  FW_ASSERT(
854  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
855  static_cast<FwAssertArgType>(portNum)
856  );
857 
858  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
859  }
860 
861 #endif
862 
865  FwIndexType portNum,
866  Fw::InputSerializePort* port
867  )
868  {
869  FW_ASSERT(
870  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
871  static_cast<FwAssertArgType>(portNum)
872  );
873 
874  this->m_prmSet_OutputPort[portNum].registerSerialPort(port);
875  }
876 
879  FwIndexType portNum,
880  Fw::InputSerializePort* port
881  )
882  {
883  FW_ASSERT(
884  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
885  static_cast<FwAssertArgType>(portNum)
886  );
887 
888  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
889  }
890 
893  FwIndexType portNum,
894  Fw::InputSerializePort* port
895  )
896  {
897  FW_ASSERT(
898  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
899  static_cast<FwAssertArgType>(portNum)
900  );
901 
902  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
903  }
904 
905 #endif
906 
907 #if FW_PORT_SERIALIZATION
908 
909  // ----------------------------------------------------------------------
910  // Connect serial input ports to typed output ports
911  // ----------------------------------------------------------------------
912 
915  FwIndexType portNum,
916  Fw::InputSerializePort* port
917  )
918  {
919  FW_ASSERT(
920  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
921  static_cast<FwAssertArgType>(portNum)
922  );
923 
924  this->m_cmdOut_OutputPort[portNum].registerSerialPort(port);
925  }
926 
929  FwIndexType portNum,
930  Fw::InputSerializePort* port
931  )
932  {
933  FW_ASSERT(
934  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
935  static_cast<FwAssertArgType>(portNum)
936  );
937 
938  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
939  }
940 
941 #endif
942 
943  // ----------------------------------------------------------------------
944  // Command registration
945  // ----------------------------------------------------------------------
946 
949  {
950  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
951 
952  this->m_cmdRegOut_OutputPort[0].invoke(
953  this->getIdBase() + OPCODE_RUN
954  );
955 
956  this->m_cmdRegOut_OutputPort[0].invoke(
957  this->getIdBase() + OPCODE_VALIDATE
958  );
959 
960  this->m_cmdRegOut_OutputPort[0].invoke(
962  );
963 
964  this->m_cmdRegOut_OutputPort[0].invoke(
965  this->getIdBase() + OPCODE_CANCEL
966  );
967 
968  this->m_cmdRegOut_OutputPort[0].invoke(
970  );
971 
972  this->m_cmdRegOut_OutputPort[0].invoke(
974  );
975  }
976 
977  // ----------------------------------------------------------------------
978  // Parameter loading
979  // ----------------------------------------------------------------------
980 
983  {
984  Fw::ParamBuffer buff;
986  FW_ASSERT(this->m_prmGet_OutputPort[0].isConnected());
987 
988  FwPrmIdType _id;
989 
991 
992  // Get parameter STATEMENT_TIMEOUT_SECS
993  this->m_param_STATEMENT_TIMEOUT_SECS_valid =
994  this->m_prmGet_OutputPort[0].invoke(
995  _id,
996  buff
997  );
998 
999  // Deserialize value
1000  this->m_paramLock.lock();
1001 
1002  // If there was a deserialization issue, mark it invalid
1003  if (this->m_param_STATEMENT_TIMEOUT_SECS_valid == Fw::ParamValid::VALID) {
1004  stat = buff.deserialize(this->m_STATEMENT_TIMEOUT_SECS);
1005  if (stat != Fw::FW_SERIALIZE_OK) {
1006  this->m_param_STATEMENT_TIMEOUT_SECS_valid = Fw::ParamValid::DEFAULT;
1007  // Set default value
1008  this->m_STATEMENT_TIMEOUT_SECS = 0.0f;
1009  }
1010  }
1011  else {
1012  // Set default value
1013  this->m_param_STATEMENT_TIMEOUT_SECS_valid = Fw::ParamValid::DEFAULT;
1014  this->m_STATEMENT_TIMEOUT_SECS = 0.0f;
1015  }
1016 
1017  this->m_paramLock.unLock();
1018 
1019  // Call notifier
1020  this->parametersLoaded();
1021  }
1022 
1023  // ----------------------------------------------------------------------
1024  // Component construction and destruction
1025  // ----------------------------------------------------------------------
1026 
1028  FpySequencerComponentBase(const char* compName) :
1029  Fw::ActiveComponentBase(compName),
1030  m_stateMachine_sequencer(*this)
1031  {
1032  // Write telemetry channel SequencesSucceeded
1033  this->m_first_update_SequencesSucceeded = true;
1034  this->m_last_SequencesSucceeded = 0;
1035 
1036  // Write telemetry channel SequencesFailed
1037  this->m_first_update_SequencesFailed = true;
1038  this->m_last_SequencesFailed = 0;
1039 
1040  // Write telemetry channel SequencesCancelled
1041  this->m_first_update_SequencesCancelled = true;
1042  this->m_last_SequencesCancelled = 0;
1043 
1044  // Write telemetry channel StatementsDispatched
1045  this->m_first_update_StatementsDispatched = true;
1046  this->m_last_StatementsDispatched = 0;
1047 
1048  // Write telemetry channel StatementsFailed
1049  this->m_first_update_StatementsFailed = true;
1050  this->m_last_StatementsFailed = 0;
1051 
1052  // Write telemetry channel SeqPath
1053  this->m_first_update_SeqPath = true;
1054 
1055  // Write telemetry channel STATEMENT_TIMEOUT_SECS
1056  this->m_first_update_STATEMENT_TIMEOUT_SECS = true;
1057  this->m_last_STATEMENT_TIMEOUT_SECS = 0;
1058 
1059  this->m_param_STATEMENT_TIMEOUT_SECS_valid = Fw::ParamValid::UNINIT;
1060  }
1061 
1064  {
1065 
1066  }
1067 
1068  // ----------------------------------------------------------------------
1069  // Getters for numbers of special input ports
1070  // ----------------------------------------------------------------------
1071 
1074  {
1075  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
1076  }
1077 
1078  // ----------------------------------------------------------------------
1079  // Getters for numbers of typed input ports
1080  // ----------------------------------------------------------------------
1081 
1084  {
1085  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_checkTimers_InputPort));
1086  }
1087 
1090  {
1091  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseIn_InputPort));
1092  }
1093 
1096  {
1097  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
1098  }
1099 
1102  {
1103  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmWrite_InputPort));
1104  }
1105 
1106  // ----------------------------------------------------------------------
1107  // Getters for numbers of special output ports
1108  // ----------------------------------------------------------------------
1109 
1112  {
1113  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
1114  }
1115 
1118  {
1119  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
1120  }
1121 
1124  {
1125  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
1126  }
1127 
1128 #if FW_ENABLE_TEXT_LOGGING == 1
1129 
1130  FwIndexType FpySequencerComponentBase ::
1131  getNum_logTextOut_OutputPorts() const
1132  {
1133  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logTextOut_OutputPort));
1134  }
1135 
1136 #endif
1137 
1140  {
1141  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_prmGet_OutputPort));
1142  }
1143 
1146  {
1147  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_prmSet_OutputPort));
1148  }
1149 
1152  {
1153  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
1154  }
1155 
1158  {
1159  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
1160  }
1161 
1162  // ----------------------------------------------------------------------
1163  // Getters for numbers of typed output ports
1164  // ----------------------------------------------------------------------
1165 
1168  {
1169  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdOut_OutputPort));
1170  }
1171 
1174  {
1175  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
1176  }
1177 
1178  // ----------------------------------------------------------------------
1179  // Connection status queries for special output ports
1180  // ----------------------------------------------------------------------
1181 
1184  {
1185  FW_ASSERT(
1186  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1187  static_cast<FwAssertArgType>(portNum)
1188  );
1189 
1190  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1191  }
1192 
1195  {
1196  FW_ASSERT(
1197  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1198  static_cast<FwAssertArgType>(portNum)
1199  );
1200 
1201  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1202  }
1203 
1206  {
1207  FW_ASSERT(
1208  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1209  static_cast<FwAssertArgType>(portNum)
1210  );
1211 
1212  return this->m_logOut_OutputPort[portNum].isConnected();
1213  }
1214 
1215 #if FW_ENABLE_TEXT_LOGGING == 1
1216 
1217  bool FpySequencerComponentBase ::
1218  isConnected_logTextOut_OutputPort(FwIndexType portNum)
1219  {
1220  FW_ASSERT(
1221  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1222  static_cast<FwAssertArgType>(portNum)
1223  );
1224 
1225  return this->m_logTextOut_OutputPort[portNum].isConnected();
1226  }
1227 
1228 #endif
1229 
1232  {
1233  FW_ASSERT(
1234  (0 <= portNum) && (portNum < this->getNum_prmGet_OutputPorts()),
1235  static_cast<FwAssertArgType>(portNum)
1236  );
1237 
1238  return this->m_prmGet_OutputPort[portNum].isConnected();
1239  }
1240 
1243  {
1244  FW_ASSERT(
1245  (0 <= portNum) && (portNum < this->getNum_prmSet_OutputPorts()),
1246  static_cast<FwAssertArgType>(portNum)
1247  );
1248 
1249  return this->m_prmSet_OutputPort[portNum].isConnected();
1250  }
1251 
1254  {
1255  FW_ASSERT(
1256  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1257  static_cast<FwAssertArgType>(portNum)
1258  );
1259 
1260  return this->m_timeCaller_OutputPort[portNum].isConnected();
1261  }
1262 
1265  {
1266  FW_ASSERT(
1267  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1268  static_cast<FwAssertArgType>(portNum)
1269  );
1270 
1271  return this->m_tlmOut_OutputPort[portNum].isConnected();
1272  }
1273 
1274  // ----------------------------------------------------------------------
1275  // Connection status queries for typed output ports
1276  // ----------------------------------------------------------------------
1277 
1280  {
1281  FW_ASSERT(
1282  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
1283  static_cast<FwAssertArgType>(portNum)
1284  );
1285 
1286  return this->m_cmdOut_OutputPort[portNum].isConnected();
1287  }
1288 
1291  {
1292  FW_ASSERT(
1293  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1294  static_cast<FwAssertArgType>(portNum)
1295  );
1296 
1297  return this->m_pingOut_OutputPort[portNum].isConnected();
1298  }
1299 
1300  // ----------------------------------------------------------------------
1301  // Port handler base-class functions for typed input ports
1302  //
1303  // Call these functions directly to bypass the corresponding ports
1304  // ----------------------------------------------------------------------
1305 
1308  FwIndexType portNum,
1309  U32 context
1310  )
1311  {
1312  // Make sure port number is valid
1313  FW_ASSERT(
1314  (0 <= portNum) && (portNum < this->getNum_checkTimers_InputPorts()),
1315  static_cast<FwAssertArgType>(portNum)
1316  );
1317 
1318  // Call pre-message hook
1320  portNum,
1321  context
1322  );
1323  ComponentIpcSerializableBuffer msg;
1325 
1326  // Serialize message ID
1327  _status = msg.serialize(
1328  static_cast<FwEnumStoreType>(CHECKTIMERS_SCHED)
1329  );
1330  FW_ASSERT(
1331  _status == Fw::FW_SERIALIZE_OK,
1332  static_cast<FwAssertArgType>(_status)
1333  );
1334 
1335  // Serialize port number
1336  _status = msg.serialize(portNum);
1337  FW_ASSERT(
1338  _status == Fw::FW_SERIALIZE_OK,
1339  static_cast<FwAssertArgType>(_status)
1340  );
1341 
1342  // Serialize argument context
1343  _status = msg.serialize(context);
1344  FW_ASSERT(
1345  _status == Fw::FW_SERIALIZE_OK,
1346  static_cast<FwAssertArgType>(_status)
1347  );
1348 
1349  // Send message
1351  Os::Queue::Status qStatus = this->m_queue.send(msg, 4, _block);
1352 
1353  FW_ASSERT(
1354  qStatus == Os::Queue::OP_OK,
1355  static_cast<FwAssertArgType>(qStatus)
1356  );
1357  }
1358 
1361  FwIndexType portNum,
1362  FwOpcodeType opCode,
1363  U32 cmdSeq,
1364  const Fw::CmdResponse& response
1365  )
1366  {
1367  // Make sure port number is valid
1368  FW_ASSERT(
1369  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
1370  static_cast<FwAssertArgType>(portNum)
1371  );
1372 
1373  // Call pre-message hook
1375  portNum,
1376  opCode,
1377  cmdSeq,
1378  response
1379  );
1380  ComponentIpcSerializableBuffer msg;
1382 
1383  // Serialize message ID
1384  _status = msg.serialize(
1385  static_cast<FwEnumStoreType>(CMDRESPONSEIN_CMDRESPONSE)
1386  );
1387  FW_ASSERT(
1388  _status == Fw::FW_SERIALIZE_OK,
1389  static_cast<FwAssertArgType>(_status)
1390  );
1391 
1392  // Serialize port number
1393  _status = msg.serialize(portNum);
1394  FW_ASSERT(
1395  _status == Fw::FW_SERIALIZE_OK,
1396  static_cast<FwAssertArgType>(_status)
1397  );
1398 
1399  // Serialize argument opCode
1400  _status = msg.serialize(opCode);
1401  FW_ASSERT(
1402  _status == Fw::FW_SERIALIZE_OK,
1403  static_cast<FwAssertArgType>(_status)
1404  );
1405 
1406  // Serialize argument cmdSeq
1407  _status = msg.serialize(cmdSeq);
1408  FW_ASSERT(
1409  _status == Fw::FW_SERIALIZE_OK,
1410  static_cast<FwAssertArgType>(_status)
1411  );
1412 
1413  // Serialize argument response
1414  _status = msg.serialize(response);
1415  FW_ASSERT(
1416  _status == Fw::FW_SERIALIZE_OK,
1417  static_cast<FwAssertArgType>(_status)
1418  );
1419 
1420  // Send message
1422  Os::Queue::Status qStatus = this->m_queue.send(msg, 5, _block);
1423 
1424  FW_ASSERT(
1425  qStatus == Os::Queue::OP_OK,
1426  static_cast<FwAssertArgType>(qStatus)
1427  );
1428  }
1429 
1432  FwIndexType portNum,
1433  U32 key
1434  )
1435  {
1436  // Make sure port number is valid
1437  FW_ASSERT(
1438  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1439  static_cast<FwAssertArgType>(portNum)
1440  );
1441 
1442  // Call pre-message hook
1444  portNum,
1445  key
1446  );
1447  ComponentIpcSerializableBuffer msg;
1449 
1450  // Serialize message ID
1451  _status = msg.serialize(
1452  static_cast<FwEnumStoreType>(PINGIN_PING)
1453  );
1454  FW_ASSERT(
1455  _status == Fw::FW_SERIALIZE_OK,
1456  static_cast<FwAssertArgType>(_status)
1457  );
1458 
1459  // Serialize port number
1460  _status = msg.serialize(portNum);
1461  FW_ASSERT(
1462  _status == Fw::FW_SERIALIZE_OK,
1463  static_cast<FwAssertArgType>(_status)
1464  );
1465 
1466  // Serialize argument key
1467  _status = msg.serialize(key);
1468  FW_ASSERT(
1469  _status == Fw::FW_SERIALIZE_OK,
1470  static_cast<FwAssertArgType>(_status)
1471  );
1472 
1473  // Send message
1475  Os::Queue::Status qStatus = this->m_queue.send(msg, 10, _block);
1476 
1477  FW_ASSERT(
1478  qStatus == Os::Queue::OP_OK,
1479  static_cast<FwAssertArgType>(qStatus)
1480  );
1481  }
1482 
1485  FwIndexType portNum,
1486  U32 context
1487  )
1488  {
1489  // Make sure port number is valid
1490  FW_ASSERT(
1491  (0 <= portNum) && (portNum < this->getNum_tlmWrite_InputPorts()),
1492  static_cast<FwAssertArgType>(portNum)
1493  );
1494 
1495  // Call pre-message hook
1497  portNum,
1498  context
1499  );
1500  ComponentIpcSerializableBuffer msg;
1502 
1503  // Serialize message ID
1504  _status = msg.serialize(
1505  static_cast<FwEnumStoreType>(TLMWRITE_SCHED)
1506  );
1507  FW_ASSERT(
1508  _status == Fw::FW_SERIALIZE_OK,
1509  static_cast<FwAssertArgType>(_status)
1510  );
1511 
1512  // Serialize port number
1513  _status = msg.serialize(portNum);
1514  FW_ASSERT(
1515  _status == Fw::FW_SERIALIZE_OK,
1516  static_cast<FwAssertArgType>(_status)
1517  );
1518 
1519  // Serialize argument context
1520  _status = msg.serialize(context);
1521  FW_ASSERT(
1522  _status == Fw::FW_SERIALIZE_OK,
1523  static_cast<FwAssertArgType>(_status)
1524  );
1525 
1526  // Send message
1528  Os::Queue::Status qStatus = this->m_queue.send(msg, 1, _block);
1529 
1530  FW_ASSERT(
1531  qStatus == Os::Queue::OP_OK,
1532  static_cast<FwAssertArgType>(qStatus)
1533  );
1534  }
1535 
1536  // ----------------------------------------------------------------------
1537  // Pre-message hooks for typed async input ports
1538  //
1539  // Each of these functions is invoked just before processing a message
1540  // on the corresponding port. By default, they do nothing. You can
1541  // override them to provide specific pre-message behavior.
1542  // ----------------------------------------------------------------------
1543 
1546  FwIndexType portNum,
1547  U32 context
1548  )
1549  {
1550  // Default: no-op
1551  }
1552 
1555  FwIndexType portNum,
1556  FwOpcodeType opCode,
1557  U32 cmdSeq,
1558  const Fw::CmdResponse& response
1559  )
1560  {
1561  // Default: no-op
1562  }
1563 
1566  FwIndexType portNum,
1567  U32 key
1568  )
1569  {
1570  // Default: no-op
1571  }
1572 
1575  FwIndexType portNum,
1576  U32 context
1577  )
1578  {
1579  // Default: no-op
1580  }
1581 
1582  // ----------------------------------------------------------------------
1583  // Invocation functions for typed output ports
1584  // ----------------------------------------------------------------------
1585 
1588  FwIndexType portNum,
1589  Fw::ComBuffer& data,
1590  U32 context
1591  )
1592  {
1593  FW_ASSERT(
1594  (0 <= portNum) && (portNum < this->getNum_cmdOut_OutputPorts()),
1595  static_cast<FwAssertArgType>(portNum)
1596  );
1597 
1598  FW_ASSERT(
1599  this->m_cmdOut_OutputPort[portNum].isConnected(),
1600  static_cast<FwAssertArgType>(portNum)
1601  );
1602  this->m_cmdOut_OutputPort[portNum].invoke(
1603  data,
1604  context
1605  );
1606  }
1607 
1610  FwIndexType portNum,
1611  U32 key
1612  )
1613  {
1614  FW_ASSERT(
1615  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1616  static_cast<FwAssertArgType>(portNum)
1617  );
1618 
1619  FW_ASSERT(
1620  this->m_pingOut_OutputPort[portNum].isConnected(),
1621  static_cast<FwAssertArgType>(portNum)
1622  );
1623  this->m_pingOut_OutputPort[portNum].invoke(
1624  key
1625  );
1626  }
1627 
1628  // ----------------------------------------------------------------------
1629  // Internal interface base-class functions
1630  // ----------------------------------------------------------------------
1631 
1634  {
1635  ComponentIpcSerializableBuffer msg;
1637 
1638  // Serialize the message ID
1639  _status = msg.serialize(static_cast<FwEnumStoreType>(INT_IF_DIRECTIVE_WAITABS));
1640  FW_ASSERT (
1641  _status == Fw::FW_SERIALIZE_OK,
1642  static_cast<FwAssertArgType>(_status)
1643  );
1644 
1645  // Fake port number to make message dequeue work
1646  _status = msg.serialize(static_cast<FwIndexType>(0));
1647  FW_ASSERT (
1648  _status == Fw::FW_SERIALIZE_OK,
1649  static_cast<FwAssertArgType>(_status)
1650  );
1651 
1652  _status = msg.serialize(directive);
1653  FW_ASSERT(
1654  _status == Fw::FW_SERIALIZE_OK,
1655  static_cast<FwAssertArgType>(_status)
1656  );
1657 
1658  // Send message
1660  Os::Queue::Status qStatus = this->m_queue.send(msg, 6, _block);
1661 
1662  FW_ASSERT(
1663  qStatus == Os::Queue::OP_OK,
1664  static_cast<FwAssertArgType>(qStatus)
1665  );
1666  }
1667 
1670  {
1671  ComponentIpcSerializableBuffer msg;
1673 
1674  // Serialize the message ID
1675  _status = msg.serialize(static_cast<FwEnumStoreType>(INT_IF_DIRECTIVE_WAITREL));
1676  FW_ASSERT (
1677  _status == Fw::FW_SERIALIZE_OK,
1678  static_cast<FwAssertArgType>(_status)
1679  );
1680 
1681  // Fake port number to make message dequeue work
1682  _status = msg.serialize(static_cast<FwIndexType>(0));
1683  FW_ASSERT (
1684  _status == Fw::FW_SERIALIZE_OK,
1685  static_cast<FwAssertArgType>(_status)
1686  );
1687 
1688  _status = msg.serialize(directive);
1689  FW_ASSERT(
1690  _status == Fw::FW_SERIALIZE_OK,
1691  static_cast<FwAssertArgType>(_status)
1692  );
1693 
1694  // Send message
1696  Os::Queue::Status qStatus = this->m_queue.send(msg, 6, _block);
1697 
1698  FW_ASSERT(
1699  qStatus == Os::Queue::OP_OK,
1700  static_cast<FwAssertArgType>(qStatus)
1701  );
1702  }
1703 
1704  // ----------------------------------------------------------------------
1705  // State getter functions
1706  // ----------------------------------------------------------------------
1707 
1710  {
1711  return this->m_stateMachine_sequencer.getState();
1712  }
1713 
1714  // ----------------------------------------------------------------------
1715  // Signal send functions
1716  // ----------------------------------------------------------------------
1717 
1720  {
1721  ComponentIpcSerializableBuffer buffer;
1722  // Serialize the message type, port number, state ID, and signal
1723  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::cmd_VALIDATE), buffer);
1724  // Serialize the signal data
1725  const Fw::SerializeStatus status = buffer.serialize(value);
1726  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
1727  // Send the message and handle overflow
1728  this->sequencer_sendSignalFinish(buffer);
1729  }
1730 
1733  {
1734  ComponentIpcSerializableBuffer buffer;
1735  // Serialize the message type, port number, state ID, and signal
1736  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::cmd_RUN), buffer);
1737  // Serialize the signal data
1738  const Fw::SerializeStatus status = buffer.serialize(value);
1739  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
1740  // Send the message and handle overflow
1741  this->sequencer_sendSignalFinish(buffer);
1742  }
1743 
1746  {
1747  ComponentIpcSerializableBuffer buffer;
1748  // Serialize the message type, port number, state ID, and signal
1749  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::cmd_RUN_VALIDATED), buffer);
1750  // Serialize the signal data
1751  const Fw::SerializeStatus status = buffer.serialize(value);
1752  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
1753  // Send the message and handle overflow
1754  this->sequencer_sendSignalFinish(buffer);
1755  }
1756 
1759  {
1760  ComponentIpcSerializableBuffer buffer;
1761  // Serialize the message type, port number, state ID, and signal
1762  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::cmd_CANCEL), buffer);
1763  // Send the message and handle overflow
1764  this->sequencer_sendSignalFinish(buffer);
1765  }
1766 
1769  {
1770  ComponentIpcSerializableBuffer buffer;
1771  // Serialize the message type, port number, state ID, and signal
1772  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_failure), buffer);
1773  // Send the message and handle overflow
1774  this->sequencer_sendSignalFinish(buffer);
1775  }
1776 
1779  {
1780  ComponentIpcSerializableBuffer buffer;
1781  // Serialize the message type, port number, state ID, and signal
1782  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_success), buffer);
1783  // Send the message and handle overflow
1784  this->sequencer_sendSignalFinish(buffer);
1785  }
1786 
1789  {
1790  ComponentIpcSerializableBuffer buffer;
1791  // Serialize the message type, port number, state ID, and signal
1792  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::entered), buffer);
1793  // Send the message and handle overflow
1794  this->sequencer_sendSignalFinish(buffer);
1795  }
1796 
1799  {
1800  ComponentIpcSerializableBuffer buffer;
1801  // Serialize the message type, port number, state ID, and signal
1802  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_dispatchStatement_success), buffer);
1803  // Send the message and handle overflow
1804  this->sequencer_sendSignalFinish(buffer);
1805  }
1806 
1809  {
1810  ComponentIpcSerializableBuffer buffer;
1811  // Serialize the message type, port number, state ID, and signal
1812  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_dispatchStatement_failure), buffer);
1813  // Send the message and handle overflow
1814  this->sequencer_sendSignalFinish(buffer);
1815  }
1816 
1819  {
1820  ComponentIpcSerializableBuffer buffer;
1821  // Serialize the message type, port number, state ID, and signal
1822  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_dispatchStatement_noMoreStatements), buffer);
1823  // Send the message and handle overflow
1824  this->sequencer_sendSignalFinish(buffer);
1825  }
1826 
1829  {
1830  ComponentIpcSerializableBuffer buffer;
1831  // Serialize the message type, port number, state ID, and signal
1832  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::checkTimersIn), buffer);
1833  // Send the message and handle overflow
1834  this->sequencer_sendSignalFinish(buffer);
1835  }
1836 
1839  {
1840  ComponentIpcSerializableBuffer buffer;
1841  // Serialize the message type, port number, state ID, and signal
1842  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_checkShouldWake_wakeup), buffer);
1843  // Send the message and handle overflow
1844  this->sequencer_sendSignalFinish(buffer);
1845  }
1846 
1849  {
1850  ComponentIpcSerializableBuffer buffer;
1851  // Serialize the message type, port number, state ID, and signal
1852  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_checkShouldWake_keepSleeping), buffer);
1853  // Send the message and handle overflow
1854  this->sequencer_sendSignalFinish(buffer);
1855  }
1856 
1859  {
1860  ComponentIpcSerializableBuffer buffer;
1861  // Serialize the message type, port number, state ID, and signal
1862  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_timeOpFailed), buffer);
1863  // Send the message and handle overflow
1864  this->sequencer_sendSignalFinish(buffer);
1865  }
1866 
1869  {
1870  ComponentIpcSerializableBuffer buffer;
1871  // Serialize the message type, port number, state ID, and signal
1872  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::stmtResponse_beginSleep), buffer);
1873  // Send the message and handle overflow
1874  this->sequencer_sendSignalFinish(buffer);
1875  }
1876 
1879  {
1880  ComponentIpcSerializableBuffer buffer;
1881  // Serialize the message type, port number, state ID, and signal
1882  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::stmtResponse_success), buffer);
1883  // Send the message and handle overflow
1884  this->sequencer_sendSignalFinish(buffer);
1885  }
1886 
1889  {
1890  ComponentIpcSerializableBuffer buffer;
1891  // Serialize the message type, port number, state ID, and signal
1892  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::stmtResponse_failure), buffer);
1893  // Send the message and handle overflow
1894  this->sequencer_sendSignalFinish(buffer);
1895  }
1896 
1899  {
1900  ComponentIpcSerializableBuffer buffer;
1901  // Serialize the message type, port number, state ID, and signal
1902  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::stmtResponse_unexpected), buffer);
1903  // Send the message and handle overflow
1904  this->sequencer_sendSignalFinish(buffer);
1905  }
1906 
1909  {
1910  ComponentIpcSerializableBuffer buffer;
1911  // Serialize the message type, port number, state ID, and signal
1912  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_checkStatementTimeout_statementTimeout), buffer);
1913  // Send the message and handle overflow
1914  this->sequencer_sendSignalFinish(buffer);
1915  }
1916 
1919  {
1920  ComponentIpcSerializableBuffer buffer;
1921  // Serialize the message type, port number, state ID, and signal
1922  this->sendSignalStart(SmId::sequencer, static_cast<FwEnumStoreType>(Svc_FpySequencer_SequencerStateMachine::Signal::result_checkStatementTimeout_noTimeout), buffer);
1923  // Send the message and handle overflow
1924  this->sequencer_sendSignalFinish(buffer);
1925  }
1926 
1927  // ----------------------------------------------------------------------
1928  // Command response
1929  // ----------------------------------------------------------------------
1930 
1933  FwOpcodeType opCode,
1934  U32 cmdSeq,
1935  Fw::CmdResponse response
1936  )
1937  {
1938  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1939  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1940  }
1941 
1942  // ----------------------------------------------------------------------
1943  // Command handler base-class functions
1944  //
1945  // Call these functions directly to bypass the command input port
1946  // ----------------------------------------------------------------------
1947 
1950  FwOpcodeType opCode,
1951  U32 cmdSeq,
1952  Fw::CmdArgBuffer& args
1953  )
1954  {
1955  // Call pre-message hook
1956  this->RUN_preMsgHook(opCode,cmdSeq);
1957 
1958  // Defer deserializing arguments to the message dispatcher
1959  // to avoid deserializing and reserializing just for IPC
1960  ComponentIpcSerializableBuffer msg;
1962 
1963  // Serialize for IPC
1964  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_RUN));
1965  FW_ASSERT (
1966  _status == Fw::FW_SERIALIZE_OK,
1967  static_cast<FwAssertArgType>(_status)
1968  );
1969 
1970  // Fake port number to make message dequeue work
1971  FwIndexType port = 0;
1972 
1973  _status = msg.serialize(port);
1974  FW_ASSERT (
1975  _status == Fw::FW_SERIALIZE_OK,
1976  static_cast<FwAssertArgType>(_status)
1977  );
1978 
1979  _status = msg.serialize(opCode);
1980  FW_ASSERT (
1981  _status == Fw::FW_SERIALIZE_OK,
1982  static_cast<FwAssertArgType>(_status)
1983  );
1984 
1985  _status = msg.serialize(cmdSeq);
1986  FW_ASSERT (
1987  _status == Fw::FW_SERIALIZE_OK,
1988  static_cast<FwAssertArgType>(_status)
1989  );
1990 
1991  _status = msg.serialize(args);
1992  FW_ASSERT (
1993  _status == Fw::FW_SERIALIZE_OK,
1994  static_cast<FwAssertArgType>(_status)
1995  );
1996 
1997  // Send message
1999  Os::Queue::Status qStatus = this->m_queue.send(msg, 7, _block);
2000 
2001  FW_ASSERT(
2002  qStatus == Os::Queue::OP_OK,
2003  static_cast<FwAssertArgType>(qStatus)
2004  );
2005  }
2006 
2009  FwOpcodeType opCode,
2010  U32 cmdSeq,
2011  Fw::CmdArgBuffer& args
2012  )
2013  {
2014  // Call pre-message hook
2015  this->VALIDATE_preMsgHook(opCode,cmdSeq);
2016 
2017  // Defer deserializing arguments to the message dispatcher
2018  // to avoid deserializing and reserializing just for IPC
2019  ComponentIpcSerializableBuffer msg;
2021 
2022  // Serialize for IPC
2023  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_VALIDATE));
2024  FW_ASSERT (
2025  _status == Fw::FW_SERIALIZE_OK,
2026  static_cast<FwAssertArgType>(_status)
2027  );
2028 
2029  // Fake port number to make message dequeue work
2030  FwIndexType port = 0;
2031 
2032  _status = msg.serialize(port);
2033  FW_ASSERT (
2034  _status == Fw::FW_SERIALIZE_OK,
2035  static_cast<FwAssertArgType>(_status)
2036  );
2037 
2038  _status = msg.serialize(opCode);
2039  FW_ASSERT (
2040  _status == Fw::FW_SERIALIZE_OK,
2041  static_cast<FwAssertArgType>(_status)
2042  );
2043 
2044  _status = msg.serialize(cmdSeq);
2045  FW_ASSERT (
2046  _status == Fw::FW_SERIALIZE_OK,
2047  static_cast<FwAssertArgType>(_status)
2048  );
2049 
2050  _status = msg.serialize(args);
2051  FW_ASSERT (
2052  _status == Fw::FW_SERIALIZE_OK,
2053  static_cast<FwAssertArgType>(_status)
2054  );
2055 
2056  // Send message
2058  Os::Queue::Status qStatus = this->m_queue.send(msg, 7, _block);
2059 
2060  FW_ASSERT(
2061  qStatus == Os::Queue::OP_OK,
2062  static_cast<FwAssertArgType>(qStatus)
2063  );
2064  }
2065 
2068  FwOpcodeType opCode,
2069  U32 cmdSeq,
2070  Fw::CmdArgBuffer& args
2071  )
2072  {
2073  // Call pre-message hook
2074  this->RUN_VALIDATED_preMsgHook(opCode,cmdSeq);
2075 
2076  // Defer deserializing arguments to the message dispatcher
2077  // to avoid deserializing and reserializing just for IPC
2078  ComponentIpcSerializableBuffer msg;
2080 
2081  // Serialize for IPC
2082  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_RUN_VALIDATED));
2083  FW_ASSERT (
2084  _status == Fw::FW_SERIALIZE_OK,
2085  static_cast<FwAssertArgType>(_status)
2086  );
2087 
2088  // Fake port number to make message dequeue work
2089  FwIndexType port = 0;
2090 
2091  _status = msg.serialize(port);
2092  FW_ASSERT (
2093  _status == Fw::FW_SERIALIZE_OK,
2094  static_cast<FwAssertArgType>(_status)
2095  );
2096 
2097  _status = msg.serialize(opCode);
2098  FW_ASSERT (
2099  _status == Fw::FW_SERIALIZE_OK,
2100  static_cast<FwAssertArgType>(_status)
2101  );
2102 
2103  _status = msg.serialize(cmdSeq);
2104  FW_ASSERT (
2105  _status == Fw::FW_SERIALIZE_OK,
2106  static_cast<FwAssertArgType>(_status)
2107  );
2108 
2109  _status = msg.serialize(args);
2110  FW_ASSERT (
2111  _status == Fw::FW_SERIALIZE_OK,
2112  static_cast<FwAssertArgType>(_status)
2113  );
2114 
2115  // Send message
2117  Os::Queue::Status qStatus = this->m_queue.send(msg, 7, _block);
2118 
2119  FW_ASSERT(
2120  qStatus == Os::Queue::OP_OK,
2121  static_cast<FwAssertArgType>(qStatus)
2122  );
2123  }
2124 
2127  FwOpcodeType opCode,
2128  U32 cmdSeq,
2129  Fw::CmdArgBuffer& args
2130  )
2131  {
2132  // Call pre-message hook
2133  this->CANCEL_preMsgHook(opCode,cmdSeq);
2134 
2135  // Defer deserializing arguments to the message dispatcher
2136  // to avoid deserializing and reserializing just for IPC
2137  ComponentIpcSerializableBuffer msg;
2139 
2140  // Serialize for IPC
2141  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CANCEL));
2142  FW_ASSERT (
2143  _status == Fw::FW_SERIALIZE_OK,
2144  static_cast<FwAssertArgType>(_status)
2145  );
2146 
2147  // Fake port number to make message dequeue work
2148  FwIndexType port = 0;
2149 
2150  _status = msg.serialize(port);
2151  FW_ASSERT (
2152  _status == Fw::FW_SERIALIZE_OK,
2153  static_cast<FwAssertArgType>(_status)
2154  );
2155 
2156  _status = msg.serialize(opCode);
2157  FW_ASSERT (
2158  _status == Fw::FW_SERIALIZE_OK,
2159  static_cast<FwAssertArgType>(_status)
2160  );
2161 
2162  _status = msg.serialize(cmdSeq);
2163  FW_ASSERT (
2164  _status == Fw::FW_SERIALIZE_OK,
2165  static_cast<FwAssertArgType>(_status)
2166  );
2167 
2168  _status = msg.serialize(args);
2169  FW_ASSERT (
2170  _status == Fw::FW_SERIALIZE_OK,
2171  static_cast<FwAssertArgType>(_status)
2172  );
2173 
2174  // Send message
2176  Os::Queue::Status qStatus = this->m_queue.send(msg, 8, _block);
2177 
2178  FW_ASSERT(
2179  qStatus == Os::Queue::OP_OK,
2180  static_cast<FwAssertArgType>(qStatus)
2181  );
2182  }
2183 
2184  // ----------------------------------------------------------------------
2185  // Pre-message hooks for async commands
2186  //
2187  // Each of these functions is invoked just before processing the
2188  // corresponding command. By default they do nothing. You can
2189  // override them to provide specific pre-command behavior.
2190  // ----------------------------------------------------------------------
2191 
2194  FwOpcodeType opCode,
2195  U32 cmdSeq
2196  )
2197  {
2198  // Defaults to no-op; can be overridden
2199  (void) opCode;
2200  (void) cmdSeq;
2201  }
2202 
2205  FwOpcodeType opCode,
2206  U32 cmdSeq
2207  )
2208  {
2209  // Defaults to no-op; can be overridden
2210  (void) opCode;
2211  (void) cmdSeq;
2212  }
2213 
2216  FwOpcodeType opCode,
2217  U32 cmdSeq
2218  )
2219  {
2220  // Defaults to no-op; can be overridden
2221  (void) opCode;
2222  (void) cmdSeq;
2223  }
2224 
2227  FwOpcodeType opCode,
2228  U32 cmdSeq
2229  )
2230  {
2231  // Defaults to no-op; can be overridden
2232  (void) opCode;
2233  (void) cmdSeq;
2234  }
2235 
2236  // ----------------------------------------------------------------------
2237  // Event logging functions
2238  // ----------------------------------------------------------------------
2239 
2242  {
2243  // Get the time
2244  Fw::Time _logTime;
2245  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2246  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2247  }
2248 
2249  FwEventIdType _id = static_cast<FwEventIdType>(0);
2250 
2251  _id = this->getIdBase() + EVENTID_INVALIDCOMMAND;
2252 
2253  // Emit the event on the log port
2254  if (this->m_logOut_OutputPort[0].isConnected()) {
2255  Fw::LogBuffer _logBuff;
2257 
2258 #if FW_AMPCS_COMPATIBLE
2259  // Serialize the number of arguments
2260  _status = _logBuff.serialize(static_cast<U8>(1));
2261  FW_ASSERT(
2262  _status == Fw::FW_SERIALIZE_OK,
2263  static_cast<FwAssertArgType>(_status)
2264  );
2265 #endif
2266 
2267 #if FW_AMPCS_COMPATIBLE
2268  // Serialize the argument size
2269  _status = _logBuff.serialize(
2270  static_cast<U8>(sizeof(I32))
2271  );
2272  FW_ASSERT(
2273  _status == Fw::FW_SERIALIZE_OK,
2274  static_cast<FwAssertArgType>(_status)
2275  );
2276 #endif
2277  _status = _logBuff.serialize(state);
2278  FW_ASSERT(
2279  _status == Fw::FW_SERIALIZE_OK,
2280  static_cast<FwAssertArgType>(_status)
2281  );
2282 
2283  this->m_logOut_OutputPort[0].invoke(
2284  _id,
2285  _logTime,
2287  _logBuff
2288  );
2289  }
2290 
2291  // Emit the event on the text log port
2292 #if FW_ENABLE_TEXT_LOGGING
2293  if (this->m_logTextOut_OutputPort[0].isConnected()) {
2294 #if FW_OBJECT_NAMES == 1
2295  const char* _formatString =
2296  "(%s) %s: Cannot run command in state %" PRIi32 "";
2297 #else
2298  const char* _formatString =
2299  "%s: Cannot run command in state %" PRIi32 "";
2300 #endif
2301 
2302  Fw::TextLogString _logString;
2303  _logString.format(
2304  _formatString,
2305 #if FW_OBJECT_NAMES == 1
2306  this->m_objName.toChar(),
2307 #endif
2308  "InvalidCommand ",
2309  state
2310  );
2311 
2312  this->m_logTextOut_OutputPort[0].invoke(
2313  _id,
2314  _logTime,
2316  _logString
2317  );
2318  }
2319 #endif
2320  }
2321 
2324  const Fw::StringBase& filePath,
2325  I32 errorCode
2326  ) const
2327  {
2328  // Get the time
2329  Fw::Time _logTime;
2330  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2331  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2332  }
2333 
2334  FwEventIdType _id = static_cast<FwEventIdType>(0);
2335 
2336  _id = this->getIdBase() + EVENTID_FILEOPENERROR;
2337 
2338  // Emit the event on the log port
2339  if (this->m_logOut_OutputPort[0].isConnected()) {
2340  Fw::LogBuffer _logBuff;
2342 
2343 #if FW_AMPCS_COMPATIBLE
2344  // Serialize the number of arguments
2345  _status = _logBuff.serialize(static_cast<U8>(2));
2346  FW_ASSERT(
2347  _status == Fw::FW_SERIALIZE_OK,
2348  static_cast<FwAssertArgType>(_status)
2349  );
2350 #endif
2351 
2352  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
2353  FW_ASSERT(
2354  _status == Fw::FW_SERIALIZE_OK,
2355  static_cast<FwAssertArgType>(_status)
2356  );
2357 
2358 #if FW_AMPCS_COMPATIBLE
2359  // Serialize the argument size
2360  _status = _logBuff.serialize(
2361  static_cast<U8>(sizeof(I32))
2362  );
2363  FW_ASSERT(
2364  _status == Fw::FW_SERIALIZE_OK,
2365  static_cast<FwAssertArgType>(_status)
2366  );
2367 #endif
2368  _status = _logBuff.serialize(errorCode);
2369  FW_ASSERT(
2370  _status == Fw::FW_SERIALIZE_OK,
2371  static_cast<FwAssertArgType>(_status)
2372  );
2373 
2374  this->m_logOut_OutputPort[0].invoke(
2375  _id,
2376  _logTime,
2378  _logBuff
2379  );
2380  }
2381 
2382  // Emit the event on the text log port
2383 #if FW_ENABLE_TEXT_LOGGING
2384  if (this->m_logTextOut_OutputPort[0].isConnected()) {
2385 #if FW_OBJECT_NAMES == 1
2386  const char* _formatString =
2387  "(%s) %s: File open error encountered while opening %s: %" PRIi32 "";
2388 #else
2389  const char* _formatString =
2390  "%s: File open error encountered while opening %s: %" PRIi32 "";
2391 #endif
2392 
2393  Fw::TextLogString _logString;
2394  _logString.format(
2395  _formatString,
2396 #if FW_OBJECT_NAMES == 1
2397  this->m_objName.toChar(),
2398 #endif
2399  "FileOpenError ",
2400  filePath.toChar(),
2401  errorCode
2402  );
2403 
2404  this->m_logTextOut_OutputPort[0].invoke(
2405  _id,
2406  _logTime,
2408  _logString
2409  );
2410  }
2411 #endif
2412  }
2413 
2416  const Fw::StringBase& filePath,
2417  I32 errorCode
2418  ) const
2419  {
2420  // Get the time
2421  Fw::Time _logTime;
2422  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2423  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2424  }
2425 
2426  FwEventIdType _id = static_cast<FwEventIdType>(0);
2427 
2428  _id = this->getIdBase() + EVENTID_FILEREADERROR;
2429 
2430  // Emit the event on the log port
2431  if (this->m_logOut_OutputPort[0].isConnected()) {
2432  Fw::LogBuffer _logBuff;
2434 
2435 #if FW_AMPCS_COMPATIBLE
2436  // Serialize the number of arguments
2437  _status = _logBuff.serialize(static_cast<U8>(2));
2438  FW_ASSERT(
2439  _status == Fw::FW_SERIALIZE_OK,
2440  static_cast<FwAssertArgType>(_status)
2441  );
2442 #endif
2443 
2444  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
2445  FW_ASSERT(
2446  _status == Fw::FW_SERIALIZE_OK,
2447  static_cast<FwAssertArgType>(_status)
2448  );
2449 
2450 #if FW_AMPCS_COMPATIBLE
2451  // Serialize the argument size
2452  _status = _logBuff.serialize(
2453  static_cast<U8>(sizeof(I32))
2454  );
2455  FW_ASSERT(
2456  _status == Fw::FW_SERIALIZE_OK,
2457  static_cast<FwAssertArgType>(_status)
2458  );
2459 #endif
2460  _status = _logBuff.serialize(errorCode);
2461  FW_ASSERT(
2462  _status == Fw::FW_SERIALIZE_OK,
2463  static_cast<FwAssertArgType>(_status)
2464  );
2465 
2466  this->m_logOut_OutputPort[0].invoke(
2467  _id,
2468  _logTime,
2470  _logBuff
2471  );
2472  }
2473 
2474  // Emit the event on the text log port
2475 #if FW_ENABLE_TEXT_LOGGING
2476  if (this->m_logTextOut_OutputPort[0].isConnected()) {
2477 #if FW_OBJECT_NAMES == 1
2478  const char* _formatString =
2479  "(%s) %s: File read error encountered while reading %s: %" PRIi32 "";
2480 #else
2481  const char* _formatString =
2482  "%s: File read error encountered while reading %s: %" PRIi32 "";
2483 #endif
2484 
2485  Fw::TextLogString _logString;
2486  _logString.format(
2487  _formatString,
2488 #if FW_OBJECT_NAMES == 1
2489  this->m_objName.toChar(),
2490 #endif
2491  "FileReadError ",
2492  filePath.toChar(),
2493  errorCode
2494  );
2495 
2496  this->m_logTextOut_OutputPort[0].invoke(
2497  _id,
2498  _logTime,
2500  _logString
2501  );
2502  }
2503 #endif
2504  }
2505 
2508  {
2509  // Get the time
2510  Fw::Time _logTime;
2511  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2512  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2513  }
2514 
2515  FwEventIdType _id = static_cast<FwEventIdType>(0);
2516 
2517  _id = this->getIdBase() + EVENTID_ENDOFFILEERROR;
2518 
2519  // Emit the event on the log port
2520  if (this->m_logOut_OutputPort[0].isConnected()) {
2521  Fw::LogBuffer _logBuff;
2523 
2524 #if FW_AMPCS_COMPATIBLE
2525  // Serialize the number of arguments
2526  _status = _logBuff.serialize(static_cast<U8>(1));
2527  FW_ASSERT(
2528  _status == Fw::FW_SERIALIZE_OK,
2529  static_cast<FwAssertArgType>(_status)
2530  );
2531 #endif
2532 
2533  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
2534  FW_ASSERT(
2535  _status == Fw::FW_SERIALIZE_OK,
2536  static_cast<FwAssertArgType>(_status)
2537  );
2538 
2539  this->m_logOut_OutputPort[0].invoke(
2540  _id,
2541  _logTime,
2543  _logBuff
2544  );
2545  }
2546 
2547  // Emit the event on the text log port
2548 #if FW_ENABLE_TEXT_LOGGING
2549  if (this->m_logTextOut_OutputPort[0].isConnected()) {
2550 #if FW_OBJECT_NAMES == 1
2551  const char* _formatString =
2552  "(%s) %s: End of file encountered unexpectedly while reading %s";
2553 #else
2554  const char* _formatString =
2555  "%s: End of file encountered unexpectedly while reading %s";
2556 #endif
2557 
2558  Fw::TextLogString _logString;
2559  _logString.format(
2560  _formatString,
2561 #if FW_OBJECT_NAMES == 1
2562  this->m_objName.toChar(),
2563 #endif
2564  "EndOfFileError ",
2565  filePath.toChar()
2566  );
2567 
2568  this->m_logTextOut_OutputPort[0].invoke(
2569  _id,
2570  _logTime,
2572  _logString
2573  );
2574  }
2575 #endif
2576  }
2577 
2580  const Fw::StringBase& filePath,
2581  I32 errorCode,
2582  U64 buffLeft,
2583  U64 buffLength
2584  ) const
2585  {
2586  // Get the time
2587  Fw::Time _logTime;
2588  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2589  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2590  }
2591 
2592  FwEventIdType _id = static_cast<FwEventIdType>(0);
2593 
2595 
2596  // Emit the event on the log port
2597  if (this->m_logOut_OutputPort[0].isConnected()) {
2598  Fw::LogBuffer _logBuff;
2600 
2601 #if FW_AMPCS_COMPATIBLE
2602  // Serialize the number of arguments
2603  _status = _logBuff.serialize(static_cast<U8>(4));
2604  FW_ASSERT(
2605  _status == Fw::FW_SERIALIZE_OK,
2606  static_cast<FwAssertArgType>(_status)
2607  );
2608 #endif
2609 
2610  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
2611  FW_ASSERT(
2612  _status == Fw::FW_SERIALIZE_OK,
2613  static_cast<FwAssertArgType>(_status)
2614  );
2615 
2616 #if FW_AMPCS_COMPATIBLE
2617  // Serialize the argument size
2618  _status = _logBuff.serialize(
2619  static_cast<U8>(sizeof(I32))
2620  );
2621  FW_ASSERT(
2622  _status == Fw::FW_SERIALIZE_OK,
2623  static_cast<FwAssertArgType>(_status)
2624  );
2625 #endif
2626  _status = _logBuff.serialize(errorCode);
2627  FW_ASSERT(
2628  _status == Fw::FW_SERIALIZE_OK,
2629  static_cast<FwAssertArgType>(_status)
2630  );
2631 
2632 #if FW_AMPCS_COMPATIBLE
2633  // Serialize the argument size
2634  _status = _logBuff.serialize(
2635  static_cast<U8>(sizeof(U64))
2636  );
2637  FW_ASSERT(
2638  _status == Fw::FW_SERIALIZE_OK,
2639  static_cast<FwAssertArgType>(_status)
2640  );
2641 #endif
2642  _status = _logBuff.serialize(buffLeft);
2643  FW_ASSERT(
2644  _status == Fw::FW_SERIALIZE_OK,
2645  static_cast<FwAssertArgType>(_status)
2646  );
2647 
2648 #if FW_AMPCS_COMPATIBLE
2649  // Serialize the argument size
2650  _status = _logBuff.serialize(
2651  static_cast<U8>(sizeof(U64))
2652  );
2653  FW_ASSERT(
2654  _status == Fw::FW_SERIALIZE_OK,
2655  static_cast<FwAssertArgType>(_status)
2656  );
2657 #endif
2658  _status = _logBuff.serialize(buffLength);
2659  FW_ASSERT(
2660  _status == Fw::FW_SERIALIZE_OK,
2661  static_cast<FwAssertArgType>(_status)
2662  );
2663 
2664  this->m_logOut_OutputPort[0].invoke(
2665  _id,
2666  _logTime,
2668  _logBuff
2669  );
2670  }
2671 
2672  // Emit the event on the text log port
2673 #if FW_ENABLE_TEXT_LOGGING
2674  if (this->m_logTextOut_OutputPort[0].isConnected()) {
2675 #if FW_OBJECT_NAMES == 1
2676  const char* _formatString =
2677  "(%s) %s: Deserialize error encountered while reading %s: %" PRIi32 " (%" PRIu64 " bytes left out of %" PRIu64 ")";
2678 #else
2679  const char* _formatString =
2680  "%s: Deserialize error encountered while reading %s: %" PRIi32 " (%" PRIu64 " bytes left out of %" PRIu64 ")";
2681 #endif
2682 
2683  Fw::TextLogString _logString;
2684  _logString.format(
2685  _formatString,
2686 #if FW_OBJECT_NAMES == 1
2687  this->m_objName.toChar(),
2688 #endif
2689  "FileReadDeserializeError ",
2690  filePath.toChar(),
2691  errorCode,
2692  buffLeft,
2693  buffLength
2694  );
2695 
2696  this->m_logTextOut_OutputPort[0].invoke(
2697  _id,
2698  _logTime,
2700  _logString
2701  );
2702  }
2703 #endif
2704  }
2705 
2708  U8 expected,
2709  U8 actual
2710  ) const
2711  {
2712  // Get the time
2713  Fw::Time _logTime;
2714  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2715  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2716  }
2717 
2718  FwEventIdType _id = static_cast<FwEventIdType>(0);
2719 
2720  _id = this->getIdBase() + EVENTID_WRONGSCHEMAVERSION;
2721 
2722  // Emit the event on the log port
2723  if (this->m_logOut_OutputPort[0].isConnected()) {
2724  Fw::LogBuffer _logBuff;
2726 
2727 #if FW_AMPCS_COMPATIBLE
2728  // Serialize the number of arguments
2729  _status = _logBuff.serialize(static_cast<U8>(2));
2730  FW_ASSERT(
2731  _status == Fw::FW_SERIALIZE_OK,
2732  static_cast<FwAssertArgType>(_status)
2733  );
2734 #endif
2735 
2736 #if FW_AMPCS_COMPATIBLE
2737  // Serialize the argument size
2738  _status = _logBuff.serialize(
2739  static_cast<U8>(sizeof(U8))
2740  );
2741  FW_ASSERT(
2742  _status == Fw::FW_SERIALIZE_OK,
2743  static_cast<FwAssertArgType>(_status)
2744  );
2745 #endif
2746  _status = _logBuff.serialize(expected);
2747  FW_ASSERT(
2748  _status == Fw::FW_SERIALIZE_OK,
2749  static_cast<FwAssertArgType>(_status)
2750  );
2751 
2752 #if FW_AMPCS_COMPATIBLE
2753  // Serialize the argument size
2754  _status = _logBuff.serialize(
2755  static_cast<U8>(sizeof(U8))
2756  );
2757  FW_ASSERT(
2758  _status == Fw::FW_SERIALIZE_OK,
2759  static_cast<FwAssertArgType>(_status)
2760  );
2761 #endif
2762  _status = _logBuff.serialize(actual);
2763  FW_ASSERT(
2764  _status == Fw::FW_SERIALIZE_OK,
2765  static_cast<FwAssertArgType>(_status)
2766  );
2767 
2768  this->m_logOut_OutputPort[0].invoke(
2769  _id,
2770  _logTime,
2772  _logBuff
2773  );
2774  }
2775 
2776  // Emit the event on the text log port
2777 #if FW_ENABLE_TEXT_LOGGING
2778  if (this->m_logTextOut_OutputPort[0].isConnected()) {
2779 #if FW_OBJECT_NAMES == 1
2780  const char* _formatString =
2781  "(%s) %s: Expected schema version %" PRIu8 ", found %" PRIu8 "";
2782 #else
2783  const char* _formatString =
2784  "%s: Expected schema version %" PRIu8 ", found %" PRIu8 "";
2785 #endif
2786 
2787  Fw::TextLogString _logString;
2788  _logString.format(
2789  _formatString,
2790 #if FW_OBJECT_NAMES == 1
2791  this->m_objName.toChar(),
2792 #endif
2793  "WrongSchemaVersion ",
2794  expected,
2795  actual
2796  );
2797 
2798  this->m_logTextOut_OutputPort[0].invoke(
2799  _id,
2800  _logTime,
2802  _logString
2803  );
2804  }
2805 #endif
2806  }
2807 
2810  U32 expected,
2811  U32 actual
2812  ) const
2813  {
2814  // Get the time
2815  Fw::Time _logTime;
2816  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2817  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2818  }
2819 
2820  FwEventIdType _id = static_cast<FwEventIdType>(0);
2821 
2822  _id = this->getIdBase() + EVENTID_WRONGCRC;
2823 
2824  // Emit the event on the log port
2825  if (this->m_logOut_OutputPort[0].isConnected()) {
2826  Fw::LogBuffer _logBuff;
2828 
2829 #if FW_AMPCS_COMPATIBLE
2830  // Serialize the number of arguments
2831  _status = _logBuff.serialize(static_cast<U8>(2));
2832  FW_ASSERT(
2833  _status == Fw::FW_SERIALIZE_OK,
2834  static_cast<FwAssertArgType>(_status)
2835  );
2836 #endif
2837 
2838 #if FW_AMPCS_COMPATIBLE
2839  // Serialize the argument size
2840  _status = _logBuff.serialize(
2841  static_cast<U8>(sizeof(U32))
2842  );
2843  FW_ASSERT(
2844  _status == Fw::FW_SERIALIZE_OK,
2845  static_cast<FwAssertArgType>(_status)
2846  );
2847 #endif
2848  _status = _logBuff.serialize(expected);
2849  FW_ASSERT(
2850  _status == Fw::FW_SERIALIZE_OK,
2851  static_cast<FwAssertArgType>(_status)
2852  );
2853 
2854 #if FW_AMPCS_COMPATIBLE
2855  // Serialize the argument size
2856  _status = _logBuff.serialize(
2857  static_cast<U8>(sizeof(U32))
2858  );
2859  FW_ASSERT(
2860  _status == Fw::FW_SERIALIZE_OK,
2861  static_cast<FwAssertArgType>(_status)
2862  );
2863 #endif
2864  _status = _logBuff.serialize(actual);
2865  FW_ASSERT(
2866  _status == Fw::FW_SERIALIZE_OK,
2867  static_cast<FwAssertArgType>(_status)
2868  );
2869 
2870  this->m_logOut_OutputPort[0].invoke(
2871  _id,
2872  _logTime,
2874  _logBuff
2875  );
2876  }
2877 
2878  // Emit the event on the text log port
2879 #if FW_ENABLE_TEXT_LOGGING
2880  if (this->m_logTextOut_OutputPort[0].isConnected()) {
2881 #if FW_OBJECT_NAMES == 1
2882  const char* _formatString =
2883  "(%s) %s: Expected CRC %" PRIu32 ", actual was %" PRIu32 "";
2884 #else
2885  const char* _formatString =
2886  "%s: Expected CRC %" PRIu32 ", actual was %" PRIu32 "";
2887 #endif
2888 
2889  Fw::TextLogString _logString;
2890  _logString.format(
2891  _formatString,
2892 #if FW_OBJECT_NAMES == 1
2893  this->m_objName.toChar(),
2894 #endif
2895  "WrongCRC ",
2896  expected,
2897  actual
2898  );
2899 
2900  this->m_logTextOut_OutputPort[0].invoke(
2901  _id,
2902  _logTime,
2904  _logString
2905  );
2906  }
2907 #endif
2908  }
2909 
2912  {
2913  // Get the time
2914  Fw::Time _logTime;
2915  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2916  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2917  }
2918 
2919  FwEventIdType _id = static_cast<FwEventIdType>(0);
2920 
2921  _id = this->getIdBase() + EVENTID_EXTRABYTESINSEQUENCE;
2922 
2923  // Emit the event on the log port
2924  if (this->m_logOut_OutputPort[0].isConnected()) {
2925  Fw::LogBuffer _logBuff;
2927 
2928 #if FW_AMPCS_COMPATIBLE
2929  // Serialize the number of arguments
2930  _status = _logBuff.serialize(static_cast<U8>(1));
2931  FW_ASSERT(
2932  _status == Fw::FW_SERIALIZE_OK,
2933  static_cast<FwAssertArgType>(_status)
2934  );
2935 #endif
2936 
2937 #if FW_AMPCS_COMPATIBLE
2938  // Serialize the argument size
2939  _status = _logBuff.serialize(
2940  static_cast<U8>(sizeof(U32))
2941  );
2942  FW_ASSERT(
2943  _status == Fw::FW_SERIALIZE_OK,
2944  static_cast<FwAssertArgType>(_status)
2945  );
2946 #endif
2947  _status = _logBuff.serialize(remaining);
2948  FW_ASSERT(
2949  _status == Fw::FW_SERIALIZE_OK,
2950  static_cast<FwAssertArgType>(_status)
2951  );
2952 
2953  this->m_logOut_OutputPort[0].invoke(
2954  _id,
2955  _logTime,
2957  _logBuff
2958  );
2959  }
2960 
2961  // Emit the event on the text log port
2962 #if FW_ENABLE_TEXT_LOGGING
2963  if (this->m_logTextOut_OutputPort[0].isConnected()) {
2964 #if FW_OBJECT_NAMES == 1
2965  const char* _formatString =
2966  "(%s) %s: File had %" PRIu32 " extra bytes at the end";
2967 #else
2968  const char* _formatString =
2969  "%s: File had %" PRIu32 " extra bytes at the end";
2970 #endif
2971 
2972  Fw::TextLogString _logString;
2973  _logString.format(
2974  _formatString,
2975 #if FW_OBJECT_NAMES == 1
2976  this->m_objName.toChar(),
2977 #endif
2978  "ExtraBytesInSequence ",
2979  remaining
2980  );
2981 
2982  this->m_logTextOut_OutputPort[0].invoke(
2983  _id,
2984  _logTime,
2986  _logString
2987  );
2988  }
2989 #endif
2990  }
2991 
2994  U64 bufferSize,
2995  const Fw::StringBase& filePath
2996  ) const
2997  {
2998  // Get the time
2999  Fw::Time _logTime;
3000  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3001  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3002  }
3003 
3004  FwEventIdType _id = static_cast<FwEventIdType>(0);
3005 
3007 
3008  // Emit the event on the log port
3009  if (this->m_logOut_OutputPort[0].isConnected()) {
3010  Fw::LogBuffer _logBuff;
3012 
3013 #if FW_AMPCS_COMPATIBLE
3014  // Serialize the number of arguments
3015  _status = _logBuff.serialize(static_cast<U8>(2));
3016  FW_ASSERT(
3017  _status == Fw::FW_SERIALIZE_OK,
3018  static_cast<FwAssertArgType>(_status)
3019  );
3020 #endif
3021 
3022 #if FW_AMPCS_COMPATIBLE
3023  // Serialize the argument size
3024  _status = _logBuff.serialize(
3025  static_cast<U8>(sizeof(U64))
3026  );
3027  FW_ASSERT(
3028  _status == Fw::FW_SERIALIZE_OK,
3029  static_cast<FwAssertArgType>(_status)
3030  );
3031 #endif
3032  _status = _logBuff.serialize(bufferSize);
3033  FW_ASSERT(
3034  _status == Fw::FW_SERIALIZE_OK,
3035  static_cast<FwAssertArgType>(_status)
3036  );
3037 
3038  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
3039  FW_ASSERT(
3040  _status == Fw::FW_SERIALIZE_OK,
3041  static_cast<FwAssertArgType>(_status)
3042  );
3043 
3044  this->m_logOut_OutputPort[0].invoke(
3045  _id,
3046  _logTime,
3048  _logBuff
3049  );
3050  }
3051 
3052  // Emit the event on the text log port
3053 #if FW_ENABLE_TEXT_LOGGING
3054  if (this->m_logTextOut_OutputPort[0].isConnected()) {
3055 #if FW_OBJECT_NAMES == 1
3056  const char* _formatString =
3057  "(%s) %s: Buffer capacity of %" PRIu64 " was not big enough for sequence %s";
3058 #else
3059  const char* _formatString =
3060  "%s: Buffer capacity of %" PRIu64 " was not big enough for sequence %s";
3061 #endif
3062 
3063  Fw::TextLogString _logString;
3064  _logString.format(
3065  _formatString,
3066 #if FW_OBJECT_NAMES == 1
3067  this->m_objName.toChar(),
3068 #endif
3069  "InsufficientBufferSpace ",
3070  bufferSize,
3071  filePath.toChar()
3072  );
3073 
3074  this->m_logTextOut_OutputPort[0].invoke(
3075  _id,
3076  _logTime,
3078  _logString
3079  );
3080  }
3081 #endif
3082  }
3083 
3086  Svc::Fpy::StatementType stmtType,
3087  U32 stmtOpcode,
3088  U32 stmtIdx,
3089  const Fw::StringBase& filePath,
3090  Fw::CmdResponse response
3091  ) const
3092  {
3093  // Get the time
3094  Fw::Time _logTime;
3095  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3096  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3097  }
3098 
3099  FwEventIdType _id = static_cast<FwEventIdType>(0);
3100 
3101  _id = this->getIdBase() + EVENTID_STATEMENTFAILED;
3102 
3103  // Emit the event on the log port
3104  if (this->m_logOut_OutputPort[0].isConnected()) {
3105  Fw::LogBuffer _logBuff;
3107 
3108 #if FW_AMPCS_COMPATIBLE
3109  // Serialize the number of arguments
3110  _status = _logBuff.serialize(static_cast<U8>(5));
3111  FW_ASSERT(
3112  _status == Fw::FW_SERIALIZE_OK,
3113  static_cast<FwAssertArgType>(_status)
3114  );
3115 #endif
3116 
3117 #if FW_AMPCS_COMPATIBLE
3118  // Serialize the argument size
3119  _status = _logBuff.serialize(
3121  );
3122  FW_ASSERT(
3123  _status == Fw::FW_SERIALIZE_OK,
3124  static_cast<FwAssertArgType>(_status)
3125  );
3126 #endif
3127  _status = _logBuff.serialize(stmtType);
3128  FW_ASSERT(
3129  _status == Fw::FW_SERIALIZE_OK,
3130  static_cast<FwAssertArgType>(_status)
3131  );
3132 
3133 #if FW_AMPCS_COMPATIBLE
3134  // Serialize the argument size
3135  _status = _logBuff.serialize(
3136  static_cast<U8>(sizeof(U32))
3137  );
3138  FW_ASSERT(
3139  _status == Fw::FW_SERIALIZE_OK,
3140  static_cast<FwAssertArgType>(_status)
3141  );
3142 #endif
3143  _status = _logBuff.serialize(stmtOpcode);
3144  FW_ASSERT(
3145  _status == Fw::FW_SERIALIZE_OK,
3146  static_cast<FwAssertArgType>(_status)
3147  );
3148 
3149 #if FW_AMPCS_COMPATIBLE
3150  // Serialize the argument size
3151  _status = _logBuff.serialize(
3152  static_cast<U8>(sizeof(U32))
3153  );
3154  FW_ASSERT(
3155  _status == Fw::FW_SERIALIZE_OK,
3156  static_cast<FwAssertArgType>(_status)
3157  );
3158 #endif
3159  _status = _logBuff.serialize(stmtIdx);
3160  FW_ASSERT(
3161  _status == Fw::FW_SERIALIZE_OK,
3162  static_cast<FwAssertArgType>(_status)
3163  );
3164 
3165  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
3166  FW_ASSERT(
3167  _status == Fw::FW_SERIALIZE_OK,
3168  static_cast<FwAssertArgType>(_status)
3169  );
3170 
3171 #if FW_AMPCS_COMPATIBLE
3172  // Serialize the argument size
3173  _status = _logBuff.serialize(
3174  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
3175  );
3176  FW_ASSERT(
3177  _status == Fw::FW_SERIALIZE_OK,
3178  static_cast<FwAssertArgType>(_status)
3179  );
3180 #endif
3181  _status = _logBuff.serialize(response);
3182  FW_ASSERT(
3183  _status == Fw::FW_SERIALIZE_OK,
3184  static_cast<FwAssertArgType>(_status)
3185  );
3186 
3187  this->m_logOut_OutputPort[0].invoke(
3188  _id,
3189  _logTime,
3191  _logBuff
3192  );
3193  }
3194 
3195  // Emit the event on the text log port
3196 #if FW_ENABLE_TEXT_LOGGING
3197  if (this->m_logTextOut_OutputPort[0].isConnected()) {
3198 #if FW_OBJECT_NAMES == 1
3199  const char* _formatString =
3200  "(%s) %s: Failed to execute statement type %s opcode %" PRIu32 " index %" PRIu32 " in sequence file %s: response was %s";
3201 #else
3202  const char* _formatString =
3203  "%s: Failed to execute statement type %s opcode %" PRIu32 " index %" PRIu32 " in sequence file %s: response was %s";
3204 #endif
3205 
3206  Fw::String stmtTypeStr;
3207  stmtType.toString(stmtTypeStr);
3208  Fw::String responseStr;
3209  response.toString(responseStr);
3210 
3211  Fw::TextLogString _logString;
3212  _logString.format(
3213  _formatString,
3214 #if FW_OBJECT_NAMES == 1
3215  this->m_objName.toChar(),
3216 #endif
3217  "StatementFailed ",
3218  stmtTypeStr.toChar(),
3219  stmtOpcode,
3220  stmtIdx,
3221  filePath.toChar(),
3222  responseStr.toChar()
3223  );
3224 
3225  this->m_logTextOut_OutputPort[0].invoke(
3226  _id,
3227  _logTime,
3229  _logString
3230  );
3231  }
3232 #endif
3233  }
3234 
3237  {
3238  // Get the time
3239  Fw::Time _logTime;
3240  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3241  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3242  }
3243 
3244  FwEventIdType _id = static_cast<FwEventIdType>(0);
3245 
3246  _id = this->getIdBase() + EVENTID_SEQUENCEDONE;
3247 
3248  // Emit the event on the log port
3249  if (this->m_logOut_OutputPort[0].isConnected()) {
3250  Fw::LogBuffer _logBuff;
3252 
3253 #if FW_AMPCS_COMPATIBLE
3254  // Serialize the number of arguments
3255  _status = _logBuff.serialize(static_cast<U8>(1));
3256  FW_ASSERT(
3257  _status == Fw::FW_SERIALIZE_OK,
3258  static_cast<FwAssertArgType>(_status)
3259  );
3260 #endif
3261 
3262  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
3263  FW_ASSERT(
3264  _status == Fw::FW_SERIALIZE_OK,
3265  static_cast<FwAssertArgType>(_status)
3266  );
3267 
3268  this->m_logOut_OutputPort[0].invoke(
3269  _id,
3270  _logTime,
3272  _logBuff
3273  );
3274  }
3275 
3276  // Emit the event on the text log port
3277 #if FW_ENABLE_TEXT_LOGGING
3278  if (this->m_logTextOut_OutputPort[0].isConnected()) {
3279 #if FW_OBJECT_NAMES == 1
3280  const char* _formatString =
3281  "(%s) %s: Completed sequence file %s";
3282 #else
3283  const char* _formatString =
3284  "%s: Completed sequence file %s";
3285 #endif
3286 
3287  Fw::TextLogString _logString;
3288  _logString.format(
3289  _formatString,
3290 #if FW_OBJECT_NAMES == 1
3291  this->m_objName.toChar(),
3292 #endif
3293  "SequenceDone ",
3294  filePath.toChar()
3295  );
3296 
3297  this->m_logTextOut_OutputPort[0].invoke(
3298  _id,
3299  _logTime,
3301  _logString
3302  );
3303  }
3304 #endif
3305  }
3306 
3309  {
3310  // Get the time
3311  Fw::Time _logTime;
3312  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3313  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3314  }
3315 
3316  FwEventIdType _id = static_cast<FwEventIdType>(0);
3317 
3318  _id = this->getIdBase() + EVENTID_SEQUENCECANCELLED;
3319 
3320  // Emit the event on the log port
3321  if (this->m_logOut_OutputPort[0].isConnected()) {
3322  Fw::LogBuffer _logBuff;
3324 
3325 #if FW_AMPCS_COMPATIBLE
3326  // Serialize the number of arguments
3327  _status = _logBuff.serialize(static_cast<U8>(1));
3328  FW_ASSERT(
3329  _status == Fw::FW_SERIALIZE_OK,
3330  static_cast<FwAssertArgType>(_status)
3331  );
3332 #endif
3333 
3334  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
3335  FW_ASSERT(
3336  _status == Fw::FW_SERIALIZE_OK,
3337  static_cast<FwAssertArgType>(_status)
3338  );
3339 
3340  this->m_logOut_OutputPort[0].invoke(
3341  _id,
3342  _logTime,
3344  _logBuff
3345  );
3346  }
3347 
3348  // Emit the event on the text log port
3349 #if FW_ENABLE_TEXT_LOGGING
3350  if (this->m_logTextOut_OutputPort[0].isConnected()) {
3351 #if FW_OBJECT_NAMES == 1
3352  const char* _formatString =
3353  "(%s) %s: Cancelled sequence file %s";
3354 #else
3355  const char* _formatString =
3356  "%s: Cancelled sequence file %s";
3357 #endif
3358 
3359  Fw::TextLogString _logString;
3360  _logString.format(
3361  _formatString,
3362 #if FW_OBJECT_NAMES == 1
3363  this->m_objName.toChar(),
3364 #endif
3365  "SequenceCancelled ",
3366  filePath.toChar()
3367  );
3368 
3369  this->m_logTextOut_OutputPort[0].invoke(
3370  _id,
3371  _logTime,
3373  _logString
3374  );
3375  }
3376 #endif
3377  }
3378 
3381  U32 opcode,
3382  U32 stmtIdx,
3383  const Fw::StringBase& filePath
3384  ) const
3385  {
3386  // Get the time
3387  Fw::Time _logTime;
3388  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3389  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3390  }
3391 
3392  FwEventIdType _id = static_cast<FwEventIdType>(0);
3393 
3395 
3396  // Emit the event on the log port
3397  if (this->m_logOut_OutputPort[0].isConnected()) {
3398  Fw::LogBuffer _logBuff;
3400 
3401 #if FW_AMPCS_COMPATIBLE
3402  // Serialize the number of arguments
3403  _status = _logBuff.serialize(static_cast<U8>(3));
3404  FW_ASSERT(
3405  _status == Fw::FW_SERIALIZE_OK,
3406  static_cast<FwAssertArgType>(_status)
3407  );
3408 #endif
3409 
3410 #if FW_AMPCS_COMPATIBLE
3411  // Serialize the argument size
3412  _status = _logBuff.serialize(
3413  static_cast<U8>(sizeof(U32))
3414  );
3415  FW_ASSERT(
3416  _status == Fw::FW_SERIALIZE_OK,
3417  static_cast<FwAssertArgType>(_status)
3418  );
3419 #endif
3420  _status = _logBuff.serialize(opcode);
3421  FW_ASSERT(
3422  _status == Fw::FW_SERIALIZE_OK,
3423  static_cast<FwAssertArgType>(_status)
3424  );
3425 
3426 #if FW_AMPCS_COMPATIBLE
3427  // Serialize the argument size
3428  _status = _logBuff.serialize(
3429  static_cast<U8>(sizeof(U32))
3430  );
3431  FW_ASSERT(
3432  _status == Fw::FW_SERIALIZE_OK,
3433  static_cast<FwAssertArgType>(_status)
3434  );
3435 #endif
3436  _status = _logBuff.serialize(stmtIdx);
3437  FW_ASSERT(
3438  _status == Fw::FW_SERIALIZE_OK,
3439  static_cast<FwAssertArgType>(_status)
3440  );
3441 
3442  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
3443  FW_ASSERT(
3444  _status == Fw::FW_SERIALIZE_OK,
3445  static_cast<FwAssertArgType>(_status)
3446  );
3447 
3448  this->m_logOut_OutputPort[0].invoke(
3449  _id,
3450  _logTime,
3452  _logBuff
3453  );
3454  }
3455 
3456  // Emit the event on the text log port
3457 #if FW_ENABLE_TEXT_LOGGING
3458  if (this->m_logTextOut_OutputPort[0].isConnected()) {
3459 #if FW_OBJECT_NAMES == 1
3460  const char* _formatString =
3461  "(%s) %s: Unknown sequencer directive id %" PRIu32 " at index %" PRIu32 " in file %s";
3462 #else
3463  const char* _formatString =
3464  "%s: Unknown sequencer directive id %" PRIu32 " at index %" PRIu32 " in file %s";
3465 #endif
3466 
3467  Fw::TextLogString _logString;
3468  _logString.format(
3469  _formatString,
3470 #if FW_OBJECT_NAMES == 1
3471  this->m_objName.toChar(),
3472 #endif
3473  "UnknownSequencerDirective ",
3474  opcode,
3475  stmtIdx,
3476  filePath.toChar()
3477  );
3478 
3479  this->m_logTextOut_OutputPort[0].invoke(
3480  _id,
3481  _logTime,
3483  _logString
3484  );
3485  }
3486 #endif
3487  }
3488 
3491  U32 cmdOpcode,
3492  U64 bufCapacity,
3493  U64 curPos,
3494  U64 writeSize,
3495  U8 errorCode,
3496  U32 stmtIdx
3497  ) const
3498  {
3499  // Get the time
3500  Fw::Time _logTime;
3501  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3502  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3503  }
3504 
3505  FwEventIdType _id = static_cast<FwEventIdType>(0);
3506 
3507  _id = this->getIdBase() + EVENTID_COMMANDSERIALIZEERROR;
3508 
3509  // Emit the event on the log port
3510  if (this->m_logOut_OutputPort[0].isConnected()) {
3511  Fw::LogBuffer _logBuff;
3513 
3514 #if FW_AMPCS_COMPATIBLE
3515  // Serialize the number of arguments
3516  _status = _logBuff.serialize(static_cast<U8>(6));
3517  FW_ASSERT(
3518  _status == Fw::FW_SERIALIZE_OK,
3519  static_cast<FwAssertArgType>(_status)
3520  );
3521 #endif
3522 
3523 #if FW_AMPCS_COMPATIBLE
3524  // Serialize the argument size
3525  _status = _logBuff.serialize(
3526  static_cast<U8>(sizeof(U32))
3527  );
3528  FW_ASSERT(
3529  _status == Fw::FW_SERIALIZE_OK,
3530  static_cast<FwAssertArgType>(_status)
3531  );
3532 #endif
3533  _status = _logBuff.serialize(cmdOpcode);
3534  FW_ASSERT(
3535  _status == Fw::FW_SERIALIZE_OK,
3536  static_cast<FwAssertArgType>(_status)
3537  );
3538 
3539 #if FW_AMPCS_COMPATIBLE
3540  // Serialize the argument size
3541  _status = _logBuff.serialize(
3542  static_cast<U8>(sizeof(U64))
3543  );
3544  FW_ASSERT(
3545  _status == Fw::FW_SERIALIZE_OK,
3546  static_cast<FwAssertArgType>(_status)
3547  );
3548 #endif
3549  _status = _logBuff.serialize(bufCapacity);
3550  FW_ASSERT(
3551  _status == Fw::FW_SERIALIZE_OK,
3552  static_cast<FwAssertArgType>(_status)
3553  );
3554 
3555 #if FW_AMPCS_COMPATIBLE
3556  // Serialize the argument size
3557  _status = _logBuff.serialize(
3558  static_cast<U8>(sizeof(U64))
3559  );
3560  FW_ASSERT(
3561  _status == Fw::FW_SERIALIZE_OK,
3562  static_cast<FwAssertArgType>(_status)
3563  );
3564 #endif
3565  _status = _logBuff.serialize(curPos);
3566  FW_ASSERT(
3567  _status == Fw::FW_SERIALIZE_OK,
3568  static_cast<FwAssertArgType>(_status)
3569  );
3570 
3571 #if FW_AMPCS_COMPATIBLE
3572  // Serialize the argument size
3573  _status = _logBuff.serialize(
3574  static_cast<U8>(sizeof(U64))
3575  );
3576  FW_ASSERT(
3577  _status == Fw::FW_SERIALIZE_OK,
3578  static_cast<FwAssertArgType>(_status)
3579  );
3580 #endif
3581  _status = _logBuff.serialize(writeSize);
3582  FW_ASSERT(
3583  _status == Fw::FW_SERIALIZE_OK,
3584  static_cast<FwAssertArgType>(_status)
3585  );
3586 
3587 #if FW_AMPCS_COMPATIBLE
3588  // Serialize the argument size
3589  _status = _logBuff.serialize(
3590  static_cast<U8>(sizeof(U8))
3591  );
3592  FW_ASSERT(
3593  _status == Fw::FW_SERIALIZE_OK,
3594  static_cast<FwAssertArgType>(_status)
3595  );
3596 #endif
3597  _status = _logBuff.serialize(errorCode);
3598  FW_ASSERT(
3599  _status == Fw::FW_SERIALIZE_OK,
3600  static_cast<FwAssertArgType>(_status)
3601  );
3602 
3603 #if FW_AMPCS_COMPATIBLE
3604  // Serialize the argument size
3605  _status = _logBuff.serialize(
3606  static_cast<U8>(sizeof(U32))
3607  );
3608  FW_ASSERT(
3609  _status == Fw::FW_SERIALIZE_OK,
3610  static_cast<FwAssertArgType>(_status)
3611  );
3612 #endif
3613  _status = _logBuff.serialize(stmtIdx);
3614  FW_ASSERT(
3615  _status == Fw::FW_SERIALIZE_OK,
3616  static_cast<FwAssertArgType>(_status)
3617  );
3618 
3619  this->m_logOut_OutputPort[0].invoke(
3620  _id,
3621  _logTime,
3623  _logBuff
3624  );
3625  }
3626 
3627  // Emit the event on the text log port
3628 #if FW_ENABLE_TEXT_LOGGING
3629  if (this->m_logTextOut_OutputPort[0].isConnected()) {
3630 #if FW_OBJECT_NAMES == 1
3631  const char* _formatString =
3632  "(%s) %s: Failure while serializing cmd opcode %" PRIu32 ": buf capacity %" PRIu64 ", cur write pos %" PRIu64 ", write size %" PRIu64 ", error code %" PRIu8 ", current statement index %" PRIu32 "";
3633 #else
3634  const char* _formatString =
3635  "%s: Failure while serializing cmd opcode %" PRIu32 ": buf capacity %" PRIu64 ", cur write pos %" PRIu64 ", write size %" PRIu64 ", error code %" PRIu8 ", current statement index %" PRIu32 "";
3636 #endif
3637 
3638  Fw::TextLogString _logString;
3639  _logString.format(
3640  _formatString,
3641 #if FW_OBJECT_NAMES == 1
3642  this->m_objName.toChar(),
3643 #endif
3644  "CommandSerializeError ",
3645  cmdOpcode,
3646  bufCapacity,
3647  curPos,
3648  writeSize,
3649  errorCode,
3650  stmtIdx
3651  );
3652 
3653  this->m_logTextOut_OutputPort[0].invoke(
3654  _id,
3655  _logTime,
3657  _logString
3658  );
3659  }
3660 #endif
3661  }
3662 
3665  I32 state,
3666  U32 opcode,
3667  Fw::CmdResponse response
3668  ) const
3669  {
3670  // Get the time
3671  Fw::Time _logTime;
3672  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3673  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3674  }
3675 
3676  FwEventIdType _id = static_cast<FwEventIdType>(0);
3677 
3679 
3680  // Emit the event on the log port
3681  if (this->m_logOut_OutputPort[0].isConnected()) {
3682  Fw::LogBuffer _logBuff;
3684 
3685 #if FW_AMPCS_COMPATIBLE
3686  // Serialize the number of arguments
3687  _status = _logBuff.serialize(static_cast<U8>(3));
3688  FW_ASSERT(
3689  _status == Fw::FW_SERIALIZE_OK,
3690  static_cast<FwAssertArgType>(_status)
3691  );
3692 #endif
3693 
3694 #if FW_AMPCS_COMPATIBLE
3695  // Serialize the argument size
3696  _status = _logBuff.serialize(
3697  static_cast<U8>(sizeof(I32))
3698  );
3699  FW_ASSERT(
3700  _status == Fw::FW_SERIALIZE_OK,
3701  static_cast<FwAssertArgType>(_status)
3702  );
3703 #endif
3704  _status = _logBuff.serialize(state);
3705  FW_ASSERT(
3706  _status == Fw::FW_SERIALIZE_OK,
3707  static_cast<FwAssertArgType>(_status)
3708  );
3709 
3710 #if FW_AMPCS_COMPATIBLE
3711  // Serialize the argument size
3712  _status = _logBuff.serialize(
3713  static_cast<U8>(sizeof(U32))
3714  );
3715  FW_ASSERT(
3716  _status == Fw::FW_SERIALIZE_OK,
3717  static_cast<FwAssertArgType>(_status)
3718  );
3719 #endif
3720  _status = _logBuff.serialize(opcode);
3721  FW_ASSERT(
3722  _status == Fw::FW_SERIALIZE_OK,
3723  static_cast<FwAssertArgType>(_status)
3724  );
3725 
3726 #if FW_AMPCS_COMPATIBLE
3727  // Serialize the argument size
3728  _status = _logBuff.serialize(
3729  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
3730  );
3731  FW_ASSERT(
3732  _status == Fw::FW_SERIALIZE_OK,
3733  static_cast<FwAssertArgType>(_status)
3734  );
3735 #endif
3736  _status = _logBuff.serialize(response);
3737  FW_ASSERT(
3738  _status == Fw::FW_SERIALIZE_OK,
3739  static_cast<FwAssertArgType>(_status)
3740  );
3741 
3742  this->m_logOut_OutputPort[0].invoke(
3743  _id,
3744  _logTime,
3746  _logBuff
3747  );
3748  }
3749 
3750  // Emit the event on the text log port
3751 #if FW_ENABLE_TEXT_LOGGING
3752  if (this->m_logTextOut_OutputPort[0].isConnected()) {
3753 #if FW_OBJECT_NAMES == 1
3754  const char* _formatString =
3755  "(%s) %s: Received a command response while not running a sequence (was in state %" PRIi32 " opcode was %" PRIu32 " response code %s)";
3756 #else
3757  const char* _formatString =
3758  "%s: Received a command response while not running a sequence (was in state %" PRIi32 " opcode was %" PRIu32 " response code %s)";
3759 #endif
3760 
3761  Fw::String responseStr;
3762  response.toString(responseStr);
3763 
3764  Fw::TextLogString _logString;
3765  _logString.format(
3766  _formatString,
3767 #if FW_OBJECT_NAMES == 1
3768  this->m_objName.toChar(),
3769 #endif
3770  "CmdResponseWhileNotRunningSequence ",
3771  state,
3772  opcode,
3773  responseStr.toChar()
3774  );
3775 
3776  this->m_logTextOut_OutputPort[0].invoke(
3777  _id,
3778  _logTime,
3780  _logString
3781  );
3782  }
3783 #endif
3784  }
3785 
3788  U32 opcode,
3789  Fw::CmdResponse response,
3790  U16 oldSequenceIdx,
3791  U16 currentSequenceIdx
3792  ) const
3793  {
3794  // Get the time
3795  Fw::Time _logTime;
3796  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3797  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3798  }
3799 
3800  FwEventIdType _id = static_cast<FwEventIdType>(0);
3801 
3803 
3804  // Emit the event on the log port
3805  if (this->m_logOut_OutputPort[0].isConnected()) {
3806  Fw::LogBuffer _logBuff;
3808 
3809 #if FW_AMPCS_COMPATIBLE
3810  // Serialize the number of arguments
3811  _status = _logBuff.serialize(static_cast<U8>(4));
3812  FW_ASSERT(
3813  _status == Fw::FW_SERIALIZE_OK,
3814  static_cast<FwAssertArgType>(_status)
3815  );
3816 #endif
3817 
3818 #if FW_AMPCS_COMPATIBLE
3819  // Serialize the argument size
3820  _status = _logBuff.serialize(
3821  static_cast<U8>(sizeof(U32))
3822  );
3823  FW_ASSERT(
3824  _status == Fw::FW_SERIALIZE_OK,
3825  static_cast<FwAssertArgType>(_status)
3826  );
3827 #endif
3828  _status = _logBuff.serialize(opcode);
3829  FW_ASSERT(
3830  _status == Fw::FW_SERIALIZE_OK,
3831  static_cast<FwAssertArgType>(_status)
3832  );
3833 
3834 #if FW_AMPCS_COMPATIBLE
3835  // Serialize the argument size
3836  _status = _logBuff.serialize(
3837  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
3838  );
3839  FW_ASSERT(
3840  _status == Fw::FW_SERIALIZE_OK,
3841  static_cast<FwAssertArgType>(_status)
3842  );
3843 #endif
3844  _status = _logBuff.serialize(response);
3845  FW_ASSERT(
3846  _status == Fw::FW_SERIALIZE_OK,
3847  static_cast<FwAssertArgType>(_status)
3848  );
3849 
3850 #if FW_AMPCS_COMPATIBLE
3851  // Serialize the argument size
3852  _status = _logBuff.serialize(
3853  static_cast<U8>(sizeof(U16))
3854  );
3855  FW_ASSERT(
3856  _status == Fw::FW_SERIALIZE_OK,
3857  static_cast<FwAssertArgType>(_status)
3858  );
3859 #endif
3860  _status = _logBuff.serialize(oldSequenceIdx);
3861  FW_ASSERT(
3862  _status == Fw::FW_SERIALIZE_OK,
3863  static_cast<FwAssertArgType>(_status)
3864  );
3865 
3866 #if FW_AMPCS_COMPATIBLE
3867  // Serialize the argument size
3868  _status = _logBuff.serialize(
3869  static_cast<U8>(sizeof(U16))
3870  );
3871  FW_ASSERT(
3872  _status == Fw::FW_SERIALIZE_OK,
3873  static_cast<FwAssertArgType>(_status)
3874  );
3875 #endif
3876  _status = _logBuff.serialize(currentSequenceIdx);
3877  FW_ASSERT(
3878  _status == Fw::FW_SERIALIZE_OK,
3879  static_cast<FwAssertArgType>(_status)
3880  );
3881 
3882  this->m_logOut_OutputPort[0].invoke(
3883  _id,
3884  _logTime,
3886  _logBuff
3887  );
3888  }
3889 
3890  // Emit the event on the text log port
3891 #if FW_ENABLE_TEXT_LOGGING
3892  if (this->m_logTextOut_OutputPort[0].isConnected()) {
3893 #if FW_OBJECT_NAMES == 1
3894  const char* _formatString =
3895  "(%s) %s: Received a response from cmd opcode %" PRIu32 " (response %s), but it was from a previous sequence, not the current one (old idx: %" PRIu16 ", current idx: %" PRIu16 ")";
3896 #else
3897  const char* _formatString =
3898  "%s: Received a response from cmd opcode %" PRIu32 " (response %s), but it was from a previous sequence, not the current one (old idx: %" PRIu16 ", current idx: %" PRIu16 ")";
3899 #endif
3900 
3901  Fw::String responseStr;
3902  response.toString(responseStr);
3903 
3904  Fw::TextLogString _logString;
3905  _logString.format(
3906  _formatString,
3907 #if FW_OBJECT_NAMES == 1
3908  this->m_objName.toChar(),
3909 #endif
3910  "CmdResponseFromOldSequence ",
3911  opcode,
3912  responseStr.toChar(),
3913  oldSequenceIdx,
3914  currentSequenceIdx
3915  );
3916 
3917  this->m_logTextOut_OutputPort[0].invoke(
3918  _id,
3919  _logTime,
3921  _logString
3922  );
3923  }
3924 #endif
3925  }
3926 
3929  U32 opcode,
3930  Fw::CmdResponse response
3931  ) const
3932  {
3933  // Get the time
3934  Fw::Time _logTime;
3935  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3936  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3937  }
3938 
3939  FwEventIdType _id = static_cast<FwEventIdType>(0);
3940 
3942 
3943  // Emit the event on the log port
3944  if (this->m_logOut_OutputPort[0].isConnected()) {
3945  Fw::LogBuffer _logBuff;
3947 
3948 #if FW_AMPCS_COMPATIBLE
3949  // Serialize the number of arguments
3950  _status = _logBuff.serialize(static_cast<U8>(2));
3951  FW_ASSERT(
3952  _status == Fw::FW_SERIALIZE_OK,
3953  static_cast<FwAssertArgType>(_status)
3954  );
3955 #endif
3956 
3957 #if FW_AMPCS_COMPATIBLE
3958  // Serialize the argument size
3959  _status = _logBuff.serialize(
3960  static_cast<U8>(sizeof(U32))
3961  );
3962  FW_ASSERT(
3963  _status == Fw::FW_SERIALIZE_OK,
3964  static_cast<FwAssertArgType>(_status)
3965  );
3966 #endif
3967  _status = _logBuff.serialize(opcode);
3968  FW_ASSERT(
3969  _status == Fw::FW_SERIALIZE_OK,
3970  static_cast<FwAssertArgType>(_status)
3971  );
3972 
3973 #if FW_AMPCS_COMPATIBLE
3974  // Serialize the argument size
3975  _status = _logBuff.serialize(
3976  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
3977  );
3978  FW_ASSERT(
3979  _status == Fw::FW_SERIALIZE_OK,
3980  static_cast<FwAssertArgType>(_status)
3981  );
3982 #endif
3983  _status = _logBuff.serialize(response);
3984  FW_ASSERT(
3985  _status == Fw::FW_SERIALIZE_OK,
3986  static_cast<FwAssertArgType>(_status)
3987  );
3988 
3989  this->m_logOut_OutputPort[0].invoke(
3990  _id,
3991  _logTime,
3993  _logBuff
3994  );
3995  }
3996 
3997  // Emit the event on the text log port
3998 #if FW_ENABLE_TEXT_LOGGING
3999  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4000 #if FW_OBJECT_NAMES == 1
4001  const char* _formatString =
4002  "(%s) %s: Received a response from cmd opcode %" PRIu32 " (response %s) from this sequence, but was not awaiting a response";
4003 #else
4004  const char* _formatString =
4005  "%s: Received a response from cmd opcode %" PRIu32 " (response %s) from this sequence, but was not awaiting a response";
4006 #endif
4007 
4008  Fw::String responseStr;
4009  response.toString(responseStr);
4010 
4011  Fw::TextLogString _logString;
4012  _logString.format(
4013  _formatString,
4014 #if FW_OBJECT_NAMES == 1
4015  this->m_objName.toChar(),
4016 #endif
4017  "CmdResponseWhileNotAwaiting ",
4018  opcode,
4019  responseStr.toChar()
4020  );
4021 
4022  this->m_logTextOut_OutputPort[0].invoke(
4023  _id,
4024  _logTime,
4026  _logString
4027  );
4028  }
4029 #endif
4030  }
4031 
4034  U32 opcode,
4035  Fw::CmdResponse response,
4036  U32 expectedOpcode
4037  ) const
4038  {
4039  // Get the time
4040  Fw::Time _logTime;
4041  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4042  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4043  }
4044 
4045  FwEventIdType _id = static_cast<FwEventIdType>(0);
4046 
4047  _id = this->getIdBase() + EVENTID_WRONGCMDRESPONSEOPCODE;
4048 
4049  // Emit the event on the log port
4050  if (this->m_logOut_OutputPort[0].isConnected()) {
4051  Fw::LogBuffer _logBuff;
4053 
4054 #if FW_AMPCS_COMPATIBLE
4055  // Serialize the number of arguments
4056  _status = _logBuff.serialize(static_cast<U8>(3));
4057  FW_ASSERT(
4058  _status == Fw::FW_SERIALIZE_OK,
4059  static_cast<FwAssertArgType>(_status)
4060  );
4061 #endif
4062 
4063 #if FW_AMPCS_COMPATIBLE
4064  // Serialize the argument size
4065  _status = _logBuff.serialize(
4066  static_cast<U8>(sizeof(U32))
4067  );
4068  FW_ASSERT(
4069  _status == Fw::FW_SERIALIZE_OK,
4070  static_cast<FwAssertArgType>(_status)
4071  );
4072 #endif
4073  _status = _logBuff.serialize(opcode);
4074  FW_ASSERT(
4075  _status == Fw::FW_SERIALIZE_OK,
4076  static_cast<FwAssertArgType>(_status)
4077  );
4078 
4079 #if FW_AMPCS_COMPATIBLE
4080  // Serialize the argument size
4081  _status = _logBuff.serialize(
4082  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
4083  );
4084  FW_ASSERT(
4085  _status == Fw::FW_SERIALIZE_OK,
4086  static_cast<FwAssertArgType>(_status)
4087  );
4088 #endif
4089  _status = _logBuff.serialize(response);
4090  FW_ASSERT(
4091  _status == Fw::FW_SERIALIZE_OK,
4092  static_cast<FwAssertArgType>(_status)
4093  );
4094 
4095 #if FW_AMPCS_COMPATIBLE
4096  // Serialize the argument size
4097  _status = _logBuff.serialize(
4098  static_cast<U8>(sizeof(U32))
4099  );
4100  FW_ASSERT(
4101  _status == Fw::FW_SERIALIZE_OK,
4102  static_cast<FwAssertArgType>(_status)
4103  );
4104 #endif
4105  _status = _logBuff.serialize(expectedOpcode);
4106  FW_ASSERT(
4107  _status == Fw::FW_SERIALIZE_OK,
4108  static_cast<FwAssertArgType>(_status)
4109  );
4110 
4111  this->m_logOut_OutputPort[0].invoke(
4112  _id,
4113  _logTime,
4115  _logBuff
4116  );
4117  }
4118 
4119  // Emit the event on the text log port
4120 #if FW_ENABLE_TEXT_LOGGING
4121  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4122 #if FW_OBJECT_NAMES == 1
4123  const char* _formatString =
4124  "(%s) %s: Received a response from cmd opcode %" PRIu32 " (response %s) from this sequence, but was expecting a response from command opcode %" PRIu32 "";
4125 #else
4126  const char* _formatString =
4127  "%s: Received a response from cmd opcode %" PRIu32 " (response %s) from this sequence, but was expecting a response from command opcode %" PRIu32 "";
4128 #endif
4129 
4130  Fw::String responseStr;
4131  response.toString(responseStr);
4132 
4133  Fw::TextLogString _logString;
4134  _logString.format(
4135  _formatString,
4136 #if FW_OBJECT_NAMES == 1
4137  this->m_objName.toChar(),
4138 #endif
4139  "WrongCmdResponseOpcode ",
4140  opcode,
4141  responseStr.toChar(),
4142  expectedOpcode
4143  );
4144 
4145  this->m_logTextOut_OutputPort[0].invoke(
4146  _id,
4147  _logTime,
4149  _logString
4150  );
4151  }
4152 #endif
4153  }
4154 
4157  U32 opcode,
4158  Fw::CmdResponse response,
4159  U16 actualCmdIdx,
4160  U16 expectedCmdIdx
4161  ) const
4162  {
4163  // Get the time
4164  Fw::Time _logTime;
4165  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4166  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4167  }
4168 
4169  FwEventIdType _id = static_cast<FwEventIdType>(0);
4170 
4171  _id = this->getIdBase() + EVENTID_WRONGCMDRESPONSEINDEX;
4172 
4173  // Emit the event on the log port
4174  if (this->m_logOut_OutputPort[0].isConnected()) {
4175  Fw::LogBuffer _logBuff;
4177 
4178 #if FW_AMPCS_COMPATIBLE
4179  // Serialize the number of arguments
4180  _status = _logBuff.serialize(static_cast<U8>(4));
4181  FW_ASSERT(
4182  _status == Fw::FW_SERIALIZE_OK,
4183  static_cast<FwAssertArgType>(_status)
4184  );
4185 #endif
4186 
4187 #if FW_AMPCS_COMPATIBLE
4188  // Serialize the argument size
4189  _status = _logBuff.serialize(
4190  static_cast<U8>(sizeof(U32))
4191  );
4192  FW_ASSERT(
4193  _status == Fw::FW_SERIALIZE_OK,
4194  static_cast<FwAssertArgType>(_status)
4195  );
4196 #endif
4197  _status = _logBuff.serialize(opcode);
4198  FW_ASSERT(
4199  _status == Fw::FW_SERIALIZE_OK,
4200  static_cast<FwAssertArgType>(_status)
4201  );
4202 
4203 #if FW_AMPCS_COMPATIBLE
4204  // Serialize the argument size
4205  _status = _logBuff.serialize(
4206  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
4207  );
4208  FW_ASSERT(
4209  _status == Fw::FW_SERIALIZE_OK,
4210  static_cast<FwAssertArgType>(_status)
4211  );
4212 #endif
4213  _status = _logBuff.serialize(response);
4214  FW_ASSERT(
4215  _status == Fw::FW_SERIALIZE_OK,
4216  static_cast<FwAssertArgType>(_status)
4217  );
4218 
4219 #if FW_AMPCS_COMPATIBLE
4220  // Serialize the argument size
4221  _status = _logBuff.serialize(
4222  static_cast<U8>(sizeof(U16))
4223  );
4224  FW_ASSERT(
4225  _status == Fw::FW_SERIALIZE_OK,
4226  static_cast<FwAssertArgType>(_status)
4227  );
4228 #endif
4229  _status = _logBuff.serialize(actualCmdIdx);
4230  FW_ASSERT(
4231  _status == Fw::FW_SERIALIZE_OK,
4232  static_cast<FwAssertArgType>(_status)
4233  );
4234 
4235 #if FW_AMPCS_COMPATIBLE
4236  // Serialize the argument size
4237  _status = _logBuff.serialize(
4238  static_cast<U8>(sizeof(U16))
4239  );
4240  FW_ASSERT(
4241  _status == Fw::FW_SERIALIZE_OK,
4242  static_cast<FwAssertArgType>(_status)
4243  );
4244 #endif
4245  _status = _logBuff.serialize(expectedCmdIdx);
4246  FW_ASSERT(
4247  _status == Fw::FW_SERIALIZE_OK,
4248  static_cast<FwAssertArgType>(_status)
4249  );
4250 
4251  this->m_logOut_OutputPort[0].invoke(
4252  _id,
4253  _logTime,
4255  _logBuff
4256  );
4257  }
4258 
4259  // Emit the event on the text log port
4260 #if FW_ENABLE_TEXT_LOGGING
4261  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4262 #if FW_OBJECT_NAMES == 1
4263  const char* _formatString =
4264  "(%s) %s: Received a response from the correct cmd (opcode %" PRIu32 " response %s), but it was for a different instance of that opcode in the same sequence (actual idx %" PRIu16 " expected %" PRIu16 ")";
4265 #else
4266  const char* _formatString =
4267  "%s: Received a response from the correct cmd (opcode %" PRIu32 " response %s), but it was for a different instance of that opcode in the same sequence (actual idx %" PRIu16 " expected %" PRIu16 ")";
4268 #endif
4269 
4270  Fw::String responseStr;
4271  response.toString(responseStr);
4272 
4273  Fw::TextLogString _logString;
4274  _logString.format(
4275  _formatString,
4276 #if FW_OBJECT_NAMES == 1
4277  this->m_objName.toChar(),
4278 #endif
4279  "WrongCmdResponseIndex ",
4280  opcode,
4281  responseStr.toChar(),
4282  actualCmdIdx,
4283  expectedCmdIdx
4284  );
4285 
4286  this->m_logTextOut_OutputPort[0].invoke(
4287  _id,
4288  _logTime,
4290  _logString
4291  );
4292  }
4293 #endif
4294  }
4295 
4298  U32 opcode,
4299  U32 stmtIdx,
4300  I32 errorCode,
4301  U64 buffLeft,
4302  U64 buffLength
4303  ) const
4304  {
4305  // Get the time
4306  Fw::Time _logTime;
4307  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4308  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4309  }
4310 
4311  FwEventIdType _id = static_cast<FwEventIdType>(0);
4312 
4314 
4315  // Emit the event on the log port
4316  if (this->m_logOut_OutputPort[0].isConnected()) {
4317  Fw::LogBuffer _logBuff;
4319 
4320 #if FW_AMPCS_COMPATIBLE
4321  // Serialize the number of arguments
4322  _status = _logBuff.serialize(static_cast<U8>(5));
4323  FW_ASSERT(
4324  _status == Fw::FW_SERIALIZE_OK,
4325  static_cast<FwAssertArgType>(_status)
4326  );
4327 #endif
4328 
4329 #if FW_AMPCS_COMPATIBLE
4330  // Serialize the argument size
4331  _status = _logBuff.serialize(
4332  static_cast<U8>(sizeof(U32))
4333  );
4334  FW_ASSERT(
4335  _status == Fw::FW_SERIALIZE_OK,
4336  static_cast<FwAssertArgType>(_status)
4337  );
4338 #endif
4339  _status = _logBuff.serialize(opcode);
4340  FW_ASSERT(
4341  _status == Fw::FW_SERIALIZE_OK,
4342  static_cast<FwAssertArgType>(_status)
4343  );
4344 
4345 #if FW_AMPCS_COMPATIBLE
4346  // Serialize the argument size
4347  _status = _logBuff.serialize(
4348  static_cast<U8>(sizeof(U32))
4349  );
4350  FW_ASSERT(
4351  _status == Fw::FW_SERIALIZE_OK,
4352  static_cast<FwAssertArgType>(_status)
4353  );
4354 #endif
4355  _status = _logBuff.serialize(stmtIdx);
4356  FW_ASSERT(
4357  _status == Fw::FW_SERIALIZE_OK,
4358  static_cast<FwAssertArgType>(_status)
4359  );
4360 
4361 #if FW_AMPCS_COMPATIBLE
4362  // Serialize the argument size
4363  _status = _logBuff.serialize(
4364  static_cast<U8>(sizeof(I32))
4365  );
4366  FW_ASSERT(
4367  _status == Fw::FW_SERIALIZE_OK,
4368  static_cast<FwAssertArgType>(_status)
4369  );
4370 #endif
4371  _status = _logBuff.serialize(errorCode);
4372  FW_ASSERT(
4373  _status == Fw::FW_SERIALIZE_OK,
4374  static_cast<FwAssertArgType>(_status)
4375  );
4376 
4377 #if FW_AMPCS_COMPATIBLE
4378  // Serialize the argument size
4379  _status = _logBuff.serialize(
4380  static_cast<U8>(sizeof(U64))
4381  );
4382  FW_ASSERT(
4383  _status == Fw::FW_SERIALIZE_OK,
4384  static_cast<FwAssertArgType>(_status)
4385  );
4386 #endif
4387  _status = _logBuff.serialize(buffLeft);
4388  FW_ASSERT(
4389  _status == Fw::FW_SERIALIZE_OK,
4390  static_cast<FwAssertArgType>(_status)
4391  );
4392 
4393 #if FW_AMPCS_COMPATIBLE
4394  // Serialize the argument size
4395  _status = _logBuff.serialize(
4396  static_cast<U8>(sizeof(U64))
4397  );
4398  FW_ASSERT(
4399  _status == Fw::FW_SERIALIZE_OK,
4400  static_cast<FwAssertArgType>(_status)
4401  );
4402 #endif
4403  _status = _logBuff.serialize(buffLength);
4404  FW_ASSERT(
4405  _status == Fw::FW_SERIALIZE_OK,
4406  static_cast<FwAssertArgType>(_status)
4407  );
4408 
4409  this->m_logOut_OutputPort[0].invoke(
4410  _id,
4411  _logTime,
4413  _logBuff
4414  );
4415  }
4416 
4417  // Emit the event on the text log port
4418 #if FW_ENABLE_TEXT_LOGGING
4419  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4420 #if FW_OBJECT_NAMES == 1
4421  const char* _formatString =
4422  "(%s) %s: Deserialize error encountered while reading directive opcode %" PRIu32 " at index %" PRIu32 ": %" PRIi32 " (%" PRIu64 " bytes left out of %" PRIu64 ")";
4423 #else
4424  const char* _formatString =
4425  "%s: Deserialize error encountered while reading directive opcode %" PRIu32 " at index %" PRIu32 ": %" PRIi32 " (%" PRIu64 " bytes left out of %" PRIu64 ")";
4426 #endif
4427 
4428  Fw::TextLogString _logString;
4429  _logString.format(
4430  _formatString,
4431 #if FW_OBJECT_NAMES == 1
4432  this->m_objName.toChar(),
4433 #endif
4434  "DirectiveDeserializeError ",
4435  opcode,
4436  stmtIdx,
4437  errorCode,
4438  buffLeft,
4439  buffLength
4440  );
4441 
4442  this->m_logTextOut_OutputPort[0].invoke(
4443  _id,
4444  _logTime,
4446  _logString
4447  );
4448  }
4449 #endif
4450  }
4451 
4454  I32 internalTimeBase,
4455  I32 otherTimeBase
4456  ) const
4457  {
4458  // Get the time
4459  Fw::Time _logTime;
4460  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4461  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4462  }
4463 
4464  FwEventIdType _id = static_cast<FwEventIdType>(0);
4465 
4466  _id = this->getIdBase() + EVENTID_MISMATCHEDTIMEBASE;
4467 
4468  // Emit the event on the log port
4469  if (this->m_logOut_OutputPort[0].isConnected()) {
4470  Fw::LogBuffer _logBuff;
4472 
4473 #if FW_AMPCS_COMPATIBLE
4474  // Serialize the number of arguments
4475  _status = _logBuff.serialize(static_cast<U8>(2));
4476  FW_ASSERT(
4477  _status == Fw::FW_SERIALIZE_OK,
4478  static_cast<FwAssertArgType>(_status)
4479  );
4480 #endif
4481 
4482 #if FW_AMPCS_COMPATIBLE
4483  // Serialize the argument size
4484  _status = _logBuff.serialize(
4485  static_cast<U8>(sizeof(I32))
4486  );
4487  FW_ASSERT(
4488  _status == Fw::FW_SERIALIZE_OK,
4489  static_cast<FwAssertArgType>(_status)
4490  );
4491 #endif
4492  _status = _logBuff.serialize(internalTimeBase);
4493  FW_ASSERT(
4494  _status == Fw::FW_SERIALIZE_OK,
4495  static_cast<FwAssertArgType>(_status)
4496  );
4497 
4498 #if FW_AMPCS_COMPATIBLE
4499  // Serialize the argument size
4500  _status = _logBuff.serialize(
4501  static_cast<U8>(sizeof(I32))
4502  );
4503  FW_ASSERT(
4504  _status == Fw::FW_SERIALIZE_OK,
4505  static_cast<FwAssertArgType>(_status)
4506  );
4507 #endif
4508  _status = _logBuff.serialize(otherTimeBase);
4509  FW_ASSERT(
4510  _status == Fw::FW_SERIALIZE_OK,
4511  static_cast<FwAssertArgType>(_status)
4512  );
4513 
4514  this->m_logOut_OutputPort[0].invoke(
4515  _id,
4516  _logTime,
4518  _logBuff
4519  );
4520  }
4521 
4522  // Emit the event on the text log port
4523 #if FW_ENABLE_TEXT_LOGGING
4524  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4525 #if FW_OBJECT_NAMES == 1
4526  const char* _formatString =
4527  "(%s) %s: getTime() time base was %" PRIi32 ", but tried to operate on it with time base %" PRIi32 "";
4528 #else
4529  const char* _formatString =
4530  "%s: getTime() time base was %" PRIi32 ", but tried to operate on it with time base %" PRIi32 "";
4531 #endif
4532 
4533  Fw::TextLogString _logString;
4534  _logString.format(
4535  _formatString,
4536 #if FW_OBJECT_NAMES == 1
4537  this->m_objName.toChar(),
4538 #endif
4539  "MismatchedTimeBase ",
4540  internalTimeBase,
4541  otherTimeBase
4542  );
4543 
4544  this->m_logTextOut_OutputPort[0].invoke(
4545  _id,
4546  _logTime,
4548  _logString
4549  );
4550  }
4551 #endif
4552  }
4553 
4556  I32 internalTimeContext,
4557  I32 otherTimeContext
4558  ) const
4559  {
4560  // Get the time
4561  Fw::Time _logTime;
4562  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4563  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4564  }
4565 
4566  FwEventIdType _id = static_cast<FwEventIdType>(0);
4567 
4568  _id = this->getIdBase() + EVENTID_MISMATCHEDTIMECONTEXT;
4569 
4570  // Emit the event on the log port
4571  if (this->m_logOut_OutputPort[0].isConnected()) {
4572  Fw::LogBuffer _logBuff;
4574 
4575 #if FW_AMPCS_COMPATIBLE
4576  // Serialize the number of arguments
4577  _status = _logBuff.serialize(static_cast<U8>(2));
4578  FW_ASSERT(
4579  _status == Fw::FW_SERIALIZE_OK,
4580  static_cast<FwAssertArgType>(_status)
4581  );
4582 #endif
4583 
4584 #if FW_AMPCS_COMPATIBLE
4585  // Serialize the argument size
4586  _status = _logBuff.serialize(
4587  static_cast<U8>(sizeof(I32))
4588  );
4589  FW_ASSERT(
4590  _status == Fw::FW_SERIALIZE_OK,
4591  static_cast<FwAssertArgType>(_status)
4592  );
4593 #endif
4594  _status = _logBuff.serialize(internalTimeContext);
4595  FW_ASSERT(
4596  _status == Fw::FW_SERIALIZE_OK,
4597  static_cast<FwAssertArgType>(_status)
4598  );
4599 
4600 #if FW_AMPCS_COMPATIBLE
4601  // Serialize the argument size
4602  _status = _logBuff.serialize(
4603  static_cast<U8>(sizeof(I32))
4604  );
4605  FW_ASSERT(
4606  _status == Fw::FW_SERIALIZE_OK,
4607  static_cast<FwAssertArgType>(_status)
4608  );
4609 #endif
4610  _status = _logBuff.serialize(otherTimeContext);
4611  FW_ASSERT(
4612  _status == Fw::FW_SERIALIZE_OK,
4613  static_cast<FwAssertArgType>(_status)
4614  );
4615 
4616  this->m_logOut_OutputPort[0].invoke(
4617  _id,
4618  _logTime,
4620  _logBuff
4621  );
4622  }
4623 
4624  // Emit the event on the text log port
4625 #if FW_ENABLE_TEXT_LOGGING
4626  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4627 #if FW_OBJECT_NAMES == 1
4628  const char* _formatString =
4629  "(%s) %s: getTime() time context was %" PRIi32 ", but tried to operate on it with time context %" PRIi32 "";
4630 #else
4631  const char* _formatString =
4632  "%s: getTime() time context was %" PRIi32 ", but tried to operate on it with time context %" PRIi32 "";
4633 #endif
4634 
4635  Fw::TextLogString _logString;
4636  _logString.format(
4637  _formatString,
4638 #if FW_OBJECT_NAMES == 1
4639  this->m_objName.toChar(),
4640 #endif
4641  "MismatchedTimeContext ",
4642  internalTimeContext,
4643  otherTimeContext
4644  );
4645 
4646  this->m_logTextOut_OutputPort[0].invoke(
4647  _id,
4648  _logTime,
4650  _logString
4651  );
4652  }
4653 #endif
4654  }
4655 
4658  Svc::Fpy::StatementType stmtType,
4659  U32 stmtOpcode,
4660  U32 stmtIdx,
4661  const Fw::StringBase& filePath
4662  ) const
4663  {
4664  // Get the time
4665  Fw::Time _logTime;
4666  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4667  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4668  }
4669 
4670  FwEventIdType _id = static_cast<FwEventIdType>(0);
4671 
4672  _id = this->getIdBase() + EVENTID_STATEMENTTIMEDOUT;
4673 
4674  // Emit the event on the log port
4675  if (this->m_logOut_OutputPort[0].isConnected()) {
4676  Fw::LogBuffer _logBuff;
4678 
4679 #if FW_AMPCS_COMPATIBLE
4680  // Serialize the number of arguments
4681  _status = _logBuff.serialize(static_cast<U8>(4));
4682  FW_ASSERT(
4683  _status == Fw::FW_SERIALIZE_OK,
4684  static_cast<FwAssertArgType>(_status)
4685  );
4686 #endif
4687 
4688 #if FW_AMPCS_COMPATIBLE
4689  // Serialize the argument size
4690  _status = _logBuff.serialize(
4692  );
4693  FW_ASSERT(
4694  _status == Fw::FW_SERIALIZE_OK,
4695  static_cast<FwAssertArgType>(_status)
4696  );
4697 #endif
4698  _status = _logBuff.serialize(stmtType);
4699  FW_ASSERT(
4700  _status == Fw::FW_SERIALIZE_OK,
4701  static_cast<FwAssertArgType>(_status)
4702  );
4703 
4704 #if FW_AMPCS_COMPATIBLE
4705  // Serialize the argument size
4706  _status = _logBuff.serialize(
4707  static_cast<U8>(sizeof(U32))
4708  );
4709  FW_ASSERT(
4710  _status == Fw::FW_SERIALIZE_OK,
4711  static_cast<FwAssertArgType>(_status)
4712  );
4713 #endif
4714  _status = _logBuff.serialize(stmtOpcode);
4715  FW_ASSERT(
4716  _status == Fw::FW_SERIALIZE_OK,
4717  static_cast<FwAssertArgType>(_status)
4718  );
4719 
4720 #if FW_AMPCS_COMPATIBLE
4721  // Serialize the argument size
4722  _status = _logBuff.serialize(
4723  static_cast<U8>(sizeof(U32))
4724  );
4725  FW_ASSERT(
4726  _status == Fw::FW_SERIALIZE_OK,
4727  static_cast<FwAssertArgType>(_status)
4728  );
4729 #endif
4730  _status = _logBuff.serialize(stmtIdx);
4731  FW_ASSERT(
4732  _status == Fw::FW_SERIALIZE_OK,
4733  static_cast<FwAssertArgType>(_status)
4734  );
4735 
4736  _status = filePath.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
4737  FW_ASSERT(
4738  _status == Fw::FW_SERIALIZE_OK,
4739  static_cast<FwAssertArgType>(_status)
4740  );
4741 
4742  this->m_logOut_OutputPort[0].invoke(
4743  _id,
4744  _logTime,
4746  _logBuff
4747  );
4748  }
4749 
4750  // Emit the event on the text log port
4751 #if FW_ENABLE_TEXT_LOGGING
4752  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4753 #if FW_OBJECT_NAMES == 1
4754  const char* _formatString =
4755  "(%s) %s: A statement type %s opcode %" PRIu32 " at index %" PRIu32 " timed out in sequence %s, causing the sequence to fail";
4756 #else
4757  const char* _formatString =
4758  "%s: A statement type %s opcode %" PRIu32 " at index %" PRIu32 " timed out in sequence %s, causing the sequence to fail";
4759 #endif
4760 
4761  Fw::String stmtTypeStr;
4762  stmtType.toString(stmtTypeStr);
4763 
4764  Fw::TextLogString _logString;
4765  _logString.format(
4766  _formatString,
4767 #if FW_OBJECT_NAMES == 1
4768  this->m_objName.toChar(),
4769 #endif
4770  "StatementTimedOut ",
4771  stmtTypeStr.toChar(),
4772  stmtOpcode,
4773  stmtIdx,
4774  filePath.toChar()
4775  );
4776 
4777  this->m_logTextOut_OutputPort[0].invoke(
4778  _id,
4779  _logTime,
4781  _logString
4782  );
4783  }
4784 #endif
4785  }
4786 
4789  U8 count,
4790  U8 max
4791  ) const
4792  {
4793  // Get the time
4794  Fw::Time _logTime;
4795  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4796  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4797  }
4798 
4799  FwEventIdType _id = static_cast<FwEventIdType>(0);
4800 
4801  _id = this->getIdBase() + EVENTID_TOOMANYSEQUENCEARGS;
4802 
4803  // Emit the event on the log port
4804  if (this->m_logOut_OutputPort[0].isConnected()) {
4805  Fw::LogBuffer _logBuff;
4807 
4808 #if FW_AMPCS_COMPATIBLE
4809  // Serialize the number of arguments
4810  _status = _logBuff.serialize(static_cast<U8>(2));
4811  FW_ASSERT(
4812  _status == Fw::FW_SERIALIZE_OK,
4813  static_cast<FwAssertArgType>(_status)
4814  );
4815 #endif
4816 
4817 #if FW_AMPCS_COMPATIBLE
4818  // Serialize the argument size
4819  _status = _logBuff.serialize(
4820  static_cast<U8>(sizeof(U8))
4821  );
4822  FW_ASSERT(
4823  _status == Fw::FW_SERIALIZE_OK,
4824  static_cast<FwAssertArgType>(_status)
4825  );
4826 #endif
4827  _status = _logBuff.serialize(count);
4828  FW_ASSERT(
4829  _status == Fw::FW_SERIALIZE_OK,
4830  static_cast<FwAssertArgType>(_status)
4831  );
4832 
4833 #if FW_AMPCS_COMPATIBLE
4834  // Serialize the argument size
4835  _status = _logBuff.serialize(
4836  static_cast<U8>(sizeof(U8))
4837  );
4838  FW_ASSERT(
4839  _status == Fw::FW_SERIALIZE_OK,
4840  static_cast<FwAssertArgType>(_status)
4841  );
4842 #endif
4843  _status = _logBuff.serialize(max);
4844  FW_ASSERT(
4845  _status == Fw::FW_SERIALIZE_OK,
4846  static_cast<FwAssertArgType>(_status)
4847  );
4848 
4849  this->m_logOut_OutputPort[0].invoke(
4850  _id,
4851  _logTime,
4853  _logBuff
4854  );
4855  }
4856 
4857  // Emit the event on the text log port
4858 #if FW_ENABLE_TEXT_LOGGING
4859  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4860 #if FW_OBJECT_NAMES == 1
4861  const char* _formatString =
4862  "(%s) %s: A sequence specified it had %" PRIu8 " args but the max was %" PRIu8 "";
4863 #else
4864  const char* _formatString =
4865  "%s: A sequence specified it had %" PRIu8 " args but the max was %" PRIu8 "";
4866 #endif
4867 
4868  Fw::TextLogString _logString;
4869  _logString.format(
4870  _formatString,
4871 #if FW_OBJECT_NAMES == 1
4872  this->m_objName.toChar(),
4873 #endif
4874  "TooManySequenceArgs ",
4875  count,
4876  max
4877  );
4878 
4879  this->m_logTextOut_OutputPort[0].invoke(
4880  _id,
4881  _logTime,
4883  _logString
4884  );
4885  }
4886 #endif
4887  }
4888 
4891  U16 count,
4892  U16 max
4893  ) const
4894  {
4895  // Get the time
4896  Fw::Time _logTime;
4897  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4898  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4899  }
4900 
4901  FwEventIdType _id = static_cast<FwEventIdType>(0);
4902 
4904 
4905  // Emit the event on the log port
4906  if (this->m_logOut_OutputPort[0].isConnected()) {
4907  Fw::LogBuffer _logBuff;
4909 
4910 #if FW_AMPCS_COMPATIBLE
4911  // Serialize the number of arguments
4912  _status = _logBuff.serialize(static_cast<U8>(2));
4913  FW_ASSERT(
4914  _status == Fw::FW_SERIALIZE_OK,
4915  static_cast<FwAssertArgType>(_status)
4916  );
4917 #endif
4918 
4919 #if FW_AMPCS_COMPATIBLE
4920  // Serialize the argument size
4921  _status = _logBuff.serialize(
4922  static_cast<U8>(sizeof(U16))
4923  );
4924  FW_ASSERT(
4925  _status == Fw::FW_SERIALIZE_OK,
4926  static_cast<FwAssertArgType>(_status)
4927  );
4928 #endif
4929  _status = _logBuff.serialize(count);
4930  FW_ASSERT(
4931  _status == Fw::FW_SERIALIZE_OK,
4932  static_cast<FwAssertArgType>(_status)
4933  );
4934 
4935 #if FW_AMPCS_COMPATIBLE
4936  // Serialize the argument size
4937  _status = _logBuff.serialize(
4938  static_cast<U8>(sizeof(U16))
4939  );
4940  FW_ASSERT(
4941  _status == Fw::FW_SERIALIZE_OK,
4942  static_cast<FwAssertArgType>(_status)
4943  );
4944 #endif
4945  _status = _logBuff.serialize(max);
4946  FW_ASSERT(
4947  _status == Fw::FW_SERIALIZE_OK,
4948  static_cast<FwAssertArgType>(_status)
4949  );
4950 
4951  this->m_logOut_OutputPort[0].invoke(
4952  _id,
4953  _logTime,
4955  _logBuff
4956  );
4957  }
4958 
4959  // Emit the event on the text log port
4960 #if FW_ENABLE_TEXT_LOGGING
4961  if (this->m_logTextOut_OutputPort[0].isConnected()) {
4962 #if FW_OBJECT_NAMES == 1
4963  const char* _formatString =
4964  "(%s) %s: A sequence specified it had %" PRIu16 " statements but the max was %" PRIu16 "";
4965 #else
4966  const char* _formatString =
4967  "%s: A sequence specified it had %" PRIu16 " statements but the max was %" PRIu16 "";
4968 #endif
4969 
4970  Fw::TextLogString _logString;
4971  _logString.format(
4972  _formatString,
4973 #if FW_OBJECT_NAMES == 1
4974  this->m_objName.toChar(),
4975 #endif
4976  "TooManySequenceStatements ",
4977  count,
4978  max
4979  );
4980 
4981  this->m_logTextOut_OutputPort[0].invoke(
4982  _id,
4983  _logTime,
4985  _logString
4986  );
4987  }
4988 #endif
4989  }
4990 
4991  // ----------------------------------------------------------------------
4992  // Telemetry write functions
4993  // ----------------------------------------------------------------------
4994 
4997  U64 arg,
4998  Fw::Time _tlmTime
4999  )
5000  {
5001  // Check to see if it is the first time
5002  if (not this->m_first_update_SequencesSucceeded) {
5003  // Check to see if value has changed. If not, don't write it.
5004  if (arg == this->m_last_SequencesSucceeded) {
5005  return;
5006  }
5007  else {
5008  this->m_last_SequencesSucceeded = arg;
5009  }
5010  }
5011  else {
5012  this->m_first_update_SequencesSucceeded = false;
5013  this->m_last_SequencesSucceeded = arg;
5014  }
5015 
5016  if (this->m_tlmOut_OutputPort[0].isConnected()) {
5017  if (
5018  this->m_timeCaller_OutputPort[0].isConnected() &&
5019  (_tlmTime == Fw::ZERO_TIME)
5020  ) {
5021  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
5022  }
5023 
5024  Fw::TlmBuffer _tlmBuff;
5025  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
5026  FW_ASSERT(
5027  _stat == Fw::FW_SERIALIZE_OK,
5028  static_cast<FwAssertArgType>(_stat)
5029  );
5030 
5031  FwChanIdType _id;
5032 
5033  _id = this->getIdBase() + CHANNELID_SEQUENCESSUCCEEDED;
5034 
5035  this->m_tlmOut_OutputPort[0].invoke(
5036  _id,
5037  _tlmTime,
5038  _tlmBuff
5039  );
5040  }
5041  }
5042 
5045  U64 arg,
5046  Fw::Time _tlmTime
5047  )
5048  {
5049  // Check to see if it is the first time
5050  if (not this->m_first_update_SequencesFailed) {
5051  // Check to see if value has changed. If not, don't write it.
5052  if (arg == this->m_last_SequencesFailed) {
5053  return;
5054  }
5055  else {
5056  this->m_last_SequencesFailed = arg;
5057  }
5058  }
5059  else {
5060  this->m_first_update_SequencesFailed = false;
5061  this->m_last_SequencesFailed = arg;
5062  }
5063 
5064  if (this->m_tlmOut_OutputPort[0].isConnected()) {
5065  if (
5066  this->m_timeCaller_OutputPort[0].isConnected() &&
5067  (_tlmTime == Fw::ZERO_TIME)
5068  ) {
5069  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
5070  }
5071 
5072  Fw::TlmBuffer _tlmBuff;
5073  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
5074  FW_ASSERT(
5075  _stat == Fw::FW_SERIALIZE_OK,
5076  static_cast<FwAssertArgType>(_stat)
5077  );
5078 
5079  FwChanIdType _id;
5080 
5081  _id = this->getIdBase() + CHANNELID_SEQUENCESFAILED;
5082 
5083  this->m_tlmOut_OutputPort[0].invoke(
5084  _id,
5085  _tlmTime,
5086  _tlmBuff
5087  );
5088  }
5089  }
5090 
5093  U64 arg,
5094  Fw::Time _tlmTime
5095  )
5096  {
5097  // Check to see if it is the first time
5098  if (not this->m_first_update_SequencesCancelled) {
5099  // Check to see if value has changed. If not, don't write it.
5100  if (arg == this->m_last_SequencesCancelled) {
5101  return;
5102  }
5103  else {
5104  this->m_last_SequencesCancelled = arg;
5105  }
5106  }
5107  else {
5108  this->m_first_update_SequencesCancelled = false;
5109  this->m_last_SequencesCancelled = arg;
5110  }
5111 
5112  if (this->m_tlmOut_OutputPort[0].isConnected()) {
5113  if (
5114  this->m_timeCaller_OutputPort[0].isConnected() &&
5115  (_tlmTime == Fw::ZERO_TIME)
5116  ) {
5117  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
5118  }
5119 
5120  Fw::TlmBuffer _tlmBuff;
5121  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
5122  FW_ASSERT(
5123  _stat == Fw::FW_SERIALIZE_OK,
5124  static_cast<FwAssertArgType>(_stat)
5125  );
5126 
5127  FwChanIdType _id;
5128 
5129  _id = this->getIdBase() + CHANNELID_SEQUENCESCANCELLED;
5130 
5131  this->m_tlmOut_OutputPort[0].invoke(
5132  _id,
5133  _tlmTime,
5134  _tlmBuff
5135  );
5136  }
5137  }
5138 
5141  U64 arg,
5142  Fw::Time _tlmTime
5143  )
5144  {
5145  // Check to see if it is the first time
5146  if (not this->m_first_update_StatementsDispatched) {
5147  // Check to see if value has changed. If not, don't write it.
5148  if (arg == this->m_last_StatementsDispatched) {
5149  return;
5150  }
5151  else {
5152  this->m_last_StatementsDispatched = arg;
5153  }
5154  }
5155  else {
5156  this->m_first_update_StatementsDispatched = false;
5157  this->m_last_StatementsDispatched = arg;
5158  }
5159 
5160  if (this->m_tlmOut_OutputPort[0].isConnected()) {
5161  if (
5162  this->m_timeCaller_OutputPort[0].isConnected() &&
5163  (_tlmTime == Fw::ZERO_TIME)
5164  ) {
5165  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
5166  }
5167 
5168  Fw::TlmBuffer _tlmBuff;
5169  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
5170  FW_ASSERT(
5171  _stat == Fw::FW_SERIALIZE_OK,
5172  static_cast<FwAssertArgType>(_stat)
5173  );
5174 
5175  FwChanIdType _id;
5176 
5177  _id = this->getIdBase() + CHANNELID_STATEMENTSDISPATCHED;
5178 
5179  this->m_tlmOut_OutputPort[0].invoke(
5180  _id,
5181  _tlmTime,
5182  _tlmBuff
5183  );
5184  }
5185  }
5186 
5189  U64 arg,
5190  Fw::Time _tlmTime
5191  )
5192  {
5193  // Check to see if it is the first time
5194  if (not this->m_first_update_StatementsFailed) {
5195  // Check to see if value has changed. If not, don't write it.
5196  if (arg == this->m_last_StatementsFailed) {
5197  return;
5198  }
5199  else {
5200  this->m_last_StatementsFailed = arg;
5201  }
5202  }
5203  else {
5204  this->m_first_update_StatementsFailed = false;
5205  this->m_last_StatementsFailed = arg;
5206  }
5207 
5208  if (this->m_tlmOut_OutputPort[0].isConnected()) {
5209  if (
5210  this->m_timeCaller_OutputPort[0].isConnected() &&
5211  (_tlmTime == Fw::ZERO_TIME)
5212  ) {
5213  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
5214  }
5215 
5216  Fw::TlmBuffer _tlmBuff;
5217  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
5218  FW_ASSERT(
5219  _stat == Fw::FW_SERIALIZE_OK,
5220  static_cast<FwAssertArgType>(_stat)
5221  );
5222 
5223  FwChanIdType _id;
5224 
5225  _id = this->getIdBase() + CHANNELID_STATEMENTSFAILED;
5226 
5227  this->m_tlmOut_OutputPort[0].invoke(
5228  _id,
5229  _tlmTime,
5230  _tlmBuff
5231  );
5232  }
5233  }
5234 
5237  const Fw::StringBase& arg,
5238  Fw::Time _tlmTime
5239  )
5240  {
5241  // Check to see if it is the first time
5242  if (not this->m_first_update_SeqPath) {
5243  // Check to see if value has changed. If not, don't write it.
5244  if (arg == this->m_last_SeqPath) {
5245  return;
5246  }
5247  else {
5248  this->m_last_SeqPath = arg;
5249  }
5250  }
5251  else {
5252  this->m_first_update_SeqPath = false;
5253  this->m_last_SeqPath = arg;
5254  }
5255 
5256  if (this->m_tlmOut_OutputPort[0].isConnected()) {
5257  if (
5258  this->m_timeCaller_OutputPort[0].isConnected() &&
5259  (_tlmTime == Fw::ZERO_TIME)
5260  ) {
5261  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
5262  }
5263 
5264  Fw::TlmBuffer _tlmBuff;
5265  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 200));
5266  FW_ASSERT(
5267  _stat == Fw::FW_SERIALIZE_OK,
5268  static_cast<FwAssertArgType>(_stat)
5269  );
5270 
5271  FwChanIdType _id;
5272 
5273  _id = this->getIdBase() + CHANNELID_SEQPATH;
5274 
5275  this->m_tlmOut_OutputPort[0].invoke(
5276  _id,
5277  _tlmTime,
5278  _tlmBuff
5279  );
5280  }
5281  }
5282 
5285  F32 arg,
5286  Fw::Time _tlmTime
5287  )
5288  {
5289  // Check to see if it is the first time
5290  if (not this->m_first_update_STATEMENT_TIMEOUT_SECS) {
5291  // Check to see if value has changed. If not, don't write it.
5292  if (arg == this->m_last_STATEMENT_TIMEOUT_SECS) {
5293  return;
5294  }
5295  else {
5296  this->m_last_STATEMENT_TIMEOUT_SECS = arg;
5297  }
5298  }
5299  else {
5300  this->m_first_update_STATEMENT_TIMEOUT_SECS = false;
5301  this->m_last_STATEMENT_TIMEOUT_SECS = arg;
5302  }
5303 
5304  if (this->m_tlmOut_OutputPort[0].isConnected()) {
5305  if (
5306  this->m_timeCaller_OutputPort[0].isConnected() &&
5307  (_tlmTime == Fw::ZERO_TIME)
5308  ) {
5309  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
5310  }
5311 
5312  Fw::TlmBuffer _tlmBuff;
5313  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
5314  FW_ASSERT(
5315  _stat == Fw::FW_SERIALIZE_OK,
5316  static_cast<FwAssertArgType>(_stat)
5317  );
5318 
5319  FwChanIdType _id;
5320 
5322 
5323  this->m_tlmOut_OutputPort[0].invoke(
5324  _id,
5325  _tlmTime,
5326  _tlmBuff
5327  );
5328  }
5329  }
5330 
5331  // ----------------------------------------------------------------------
5332  // Parameter update hook
5333  // ----------------------------------------------------------------------
5334 
5337  {
5338  // Do nothing by default
5339  }
5340 
5343  {
5344  // Do nothing by default
5345  }
5346 
5347  // ----------------------------------------------------------------------
5348  // Parameter get functions
5349  // ----------------------------------------------------------------------
5350 
5353  {
5354  F32 _local;
5355  this->m_paramLock.lock();
5356  valid = this->m_param_STATEMENT_TIMEOUT_SECS_valid;
5357  _local = this->m_STATEMENT_TIMEOUT_SECS;
5358  this->m_paramLock.unLock();
5359  return _local;
5360  }
5361 
5362  // ----------------------------------------------------------------------
5363  // Time
5364  // ----------------------------------------------------------------------
5365 
5367  getTime() const
5368  {
5369  if (this->m_timeCaller_OutputPort[0].isConnected()) {
5370  Fw::Time _time;
5371  this->m_timeCaller_OutputPort[0].invoke(_time);
5372  return _time;
5373  }
5374  else {
5375  return Fw::Time(TB_NONE, 0, 0);
5376  }
5377  }
5378 
5379  // ----------------------------------------------------------------------
5380  // Message dispatch functions
5381  // ----------------------------------------------------------------------
5382 
5383  Fw::QueuedComponentBase::MsgDispatchStatus FpySequencerComponentBase ::
5384  doDispatch()
5385  {
5386  ComponentIpcSerializableBuffer _msg;
5387  FwQueuePriorityType _priority = 0;
5388 
5389  Os::Queue::Status _msgStatus = this->m_queue.receive(
5390  _msg,
5392  _priority
5393  );
5394  FW_ASSERT(
5395  _msgStatus == Os::Queue::OP_OK,
5396  static_cast<FwAssertArgType>(_msgStatus)
5397  );
5398 
5399  // Reset to beginning of buffer
5400  _msg.resetDeser();
5401 
5402  FwEnumStoreType _desMsg = 0;
5403  Fw::SerializeStatus _deserStatus = _msg.deserialize(_desMsg);
5404  FW_ASSERT(
5405  _deserStatus == Fw::FW_SERIALIZE_OK,
5406  static_cast<FwAssertArgType>(_deserStatus)
5407  );
5408 
5409  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
5410 
5411  if (_msgType == FPYSEQUENCER_COMPONENT_EXIT) {
5412  return MSG_DISPATCH_EXIT;
5413  }
5414 
5415  FwIndexType portNum = 0;
5416  _deserStatus = _msg.deserialize(portNum);
5417  FW_ASSERT(
5418  _deserStatus == Fw::FW_SERIALIZE_OK,
5419  static_cast<FwAssertArgType>(_deserStatus)
5420  );
5421 
5422  switch (_msgType) {
5423  // Handle async input port checkTimers
5424  case CHECKTIMERS_SCHED: {
5425  // Deserialize argument context
5426  U32 context;
5427  _deserStatus = _msg.deserialize(context);
5428  FW_ASSERT(
5429  _deserStatus == Fw::FW_SERIALIZE_OK,
5430  static_cast<FwAssertArgType>(_deserStatus)
5431  );
5432  // Call handler function
5433  this->checkTimers_handler(
5434  portNum,
5435  context
5436  );
5437 
5438  break;
5439  }
5440 
5441  // Handle async input port cmdResponseIn
5442  case CMDRESPONSEIN_CMDRESPONSE: {
5443  // Deserialize argument opCode
5444  FwOpcodeType opCode;
5445  _deserStatus = _msg.deserialize(opCode);
5446  FW_ASSERT(
5447  _deserStatus == Fw::FW_SERIALIZE_OK,
5448  static_cast<FwAssertArgType>(_deserStatus)
5449  );
5450 
5451  // Deserialize argument cmdSeq
5452  U32 cmdSeq;
5453  _deserStatus = _msg.deserialize(cmdSeq);
5454  FW_ASSERT(
5455  _deserStatus == Fw::FW_SERIALIZE_OK,
5456  static_cast<FwAssertArgType>(_deserStatus)
5457  );
5458 
5459  // Deserialize argument response
5460  Fw::CmdResponse response;
5461  _deserStatus = _msg.deserialize(response);
5462  FW_ASSERT(
5463  _deserStatus == Fw::FW_SERIALIZE_OK,
5464  static_cast<FwAssertArgType>(_deserStatus)
5465  );
5466  // Call handler function
5467  this->cmdResponseIn_handler(
5468  portNum,
5469  opCode,
5470  cmdSeq,
5471  response
5472  );
5473 
5474  break;
5475  }
5476 
5477  // Handle async input port pingIn
5478  case PINGIN_PING: {
5479  // Deserialize argument key
5480  U32 key;
5481  _deserStatus = _msg.deserialize(key);
5482  FW_ASSERT(
5483  _deserStatus == Fw::FW_SERIALIZE_OK,
5484  static_cast<FwAssertArgType>(_deserStatus)
5485  );
5486  // Call handler function
5487  this->pingIn_handler(
5488  portNum,
5489  key
5490  );
5491 
5492  break;
5493  }
5494 
5495  // Handle async input port tlmWrite
5496  case TLMWRITE_SCHED: {
5497  // Deserialize argument context
5498  U32 context;
5499  _deserStatus = _msg.deserialize(context);
5500  FW_ASSERT(
5501  _deserStatus == Fw::FW_SERIALIZE_OK,
5502  static_cast<FwAssertArgType>(_deserStatus)
5503  );
5504  // Call handler function
5505  this->tlmWrite_handler(
5506  portNum,
5507  context
5508  );
5509 
5510  break;
5511  }
5512 
5513  // Handle command RUN
5514  case CMD_RUN: {
5515  // Deserialize opcode
5516  FwOpcodeType _opCode = 0;
5517  _deserStatus = _msg.deserialize(_opCode);
5518  FW_ASSERT (
5519  _deserStatus == Fw::FW_SERIALIZE_OK,
5520  static_cast<FwAssertArgType>(_deserStatus)
5521  );
5522 
5523  // Deserialize command sequence
5524  U32 _cmdSeq = 0;
5525  _deserStatus = _msg.deserialize(_cmdSeq);
5526  FW_ASSERT (
5527  _deserStatus == Fw::FW_SERIALIZE_OK,
5528  static_cast<FwAssertArgType>(_deserStatus)
5529  );
5530 
5531  // Deserialize command argument buffer
5532  Fw::CmdArgBuffer args;
5533  _deserStatus = _msg.deserialize(args);
5534  FW_ASSERT (
5535  _deserStatus == Fw::FW_SERIALIZE_OK,
5536  static_cast<FwAssertArgType>(_deserStatus)
5537  );
5538 
5539  // Reset buffer
5540  args.resetDeser();
5541 
5542  // Deserialize argument fileName
5543  Fw::CmdStringArg fileName;
5544  _deserStatus = args.deserialize(fileName);
5545  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5546  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5547  this->cmdResponse_out(
5548  _opCode,
5549  _cmdSeq,
5551  );
5552  }
5553  // Don't crash the task if bad arguments were passed from the ground
5554  break;
5555  }
5556 
5557  // Deserialize argument block
5559  _deserStatus = args.deserialize(block);
5560  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5561  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5562  this->cmdResponse_out(
5563  _opCode,
5564  _cmdSeq,
5566  );
5567  }
5568  // Don't crash the task if bad arguments were passed from the ground
5569  break;
5570  }
5571 
5572  // Make sure there was no data left over.
5573  // That means the argument buffer size was incorrect.
5574 #if FW_CMD_CHECK_RESIDUAL
5575  if (args.getBuffLeft() != 0) {
5576  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5577  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5578  }
5579  // Don't crash the task if bad arguments were passed from the ground
5580  break;
5581  }
5582 #endif
5583 
5584  // Call handler function
5585  this->RUN_cmdHandler(
5586  _opCode, _cmdSeq,
5587  fileName,
5588  block
5589  );
5590 
5591  break;
5592  }
5593 
5594  // Handle command VALIDATE
5595  case CMD_VALIDATE: {
5596  // Deserialize opcode
5597  FwOpcodeType _opCode = 0;
5598  _deserStatus = _msg.deserialize(_opCode);
5599  FW_ASSERT (
5600  _deserStatus == Fw::FW_SERIALIZE_OK,
5601  static_cast<FwAssertArgType>(_deserStatus)
5602  );
5603 
5604  // Deserialize command sequence
5605  U32 _cmdSeq = 0;
5606  _deserStatus = _msg.deserialize(_cmdSeq);
5607  FW_ASSERT (
5608  _deserStatus == Fw::FW_SERIALIZE_OK,
5609  static_cast<FwAssertArgType>(_deserStatus)
5610  );
5611 
5612  // Deserialize command argument buffer
5613  Fw::CmdArgBuffer args;
5614  _deserStatus = _msg.deserialize(args);
5615  FW_ASSERT (
5616  _deserStatus == Fw::FW_SERIALIZE_OK,
5617  static_cast<FwAssertArgType>(_deserStatus)
5618  );
5619 
5620  // Reset buffer
5621  args.resetDeser();
5622 
5623  // Deserialize argument fileName
5624  Fw::CmdStringArg fileName;
5625  _deserStatus = args.deserialize(fileName);
5626  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5627  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5628  this->cmdResponse_out(
5629  _opCode,
5630  _cmdSeq,
5632  );
5633  }
5634  // Don't crash the task if bad arguments were passed from the ground
5635  break;
5636  }
5637 
5638  // Make sure there was no data left over.
5639  // That means the argument buffer size was incorrect.
5640 #if FW_CMD_CHECK_RESIDUAL
5641  if (args.getBuffLeft() != 0) {
5642  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5643  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5644  }
5645  // Don't crash the task if bad arguments were passed from the ground
5646  break;
5647  }
5648 #endif
5649 
5650  // Call handler function
5651  this->VALIDATE_cmdHandler(
5652  _opCode, _cmdSeq,
5653  fileName
5654  );
5655 
5656  break;
5657  }
5658 
5659  // Handle command RUN_VALIDATED
5660  case CMD_RUN_VALIDATED: {
5661  // Deserialize opcode
5662  FwOpcodeType _opCode = 0;
5663  _deserStatus = _msg.deserialize(_opCode);
5664  FW_ASSERT (
5665  _deserStatus == Fw::FW_SERIALIZE_OK,
5666  static_cast<FwAssertArgType>(_deserStatus)
5667  );
5668 
5669  // Deserialize command sequence
5670  U32 _cmdSeq = 0;
5671  _deserStatus = _msg.deserialize(_cmdSeq);
5672  FW_ASSERT (
5673  _deserStatus == Fw::FW_SERIALIZE_OK,
5674  static_cast<FwAssertArgType>(_deserStatus)
5675  );
5676 
5677  // Deserialize command argument buffer
5678  Fw::CmdArgBuffer args;
5679  _deserStatus = _msg.deserialize(args);
5680  FW_ASSERT (
5681  _deserStatus == Fw::FW_SERIALIZE_OK,
5682  static_cast<FwAssertArgType>(_deserStatus)
5683  );
5684 
5685  // Reset buffer
5686  args.resetDeser();
5687 
5688  // Deserialize argument block
5690  _deserStatus = args.deserialize(block);
5691  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5692  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5693  this->cmdResponse_out(
5694  _opCode,
5695  _cmdSeq,
5697  );
5698  }
5699  // Don't crash the task if bad arguments were passed from the ground
5700  break;
5701  }
5702 
5703  // Make sure there was no data left over.
5704  // That means the argument buffer size was incorrect.
5705 #if FW_CMD_CHECK_RESIDUAL
5706  if (args.getBuffLeft() != 0) {
5707  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5708  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5709  }
5710  // Don't crash the task if bad arguments were passed from the ground
5711  break;
5712  }
5713 #endif
5714 
5715  // Call handler function
5717  _opCode, _cmdSeq,
5718  block
5719  );
5720 
5721  break;
5722  }
5723 
5724  // Handle command CANCEL
5725  case CMD_CANCEL: {
5726  // Deserialize opcode
5727  FwOpcodeType _opCode = 0;
5728  _deserStatus = _msg.deserialize(_opCode);
5729  FW_ASSERT (
5730  _deserStatus == Fw::FW_SERIALIZE_OK,
5731  static_cast<FwAssertArgType>(_deserStatus)
5732  );
5733 
5734  // Deserialize command sequence
5735  U32 _cmdSeq = 0;
5736  _deserStatus = _msg.deserialize(_cmdSeq);
5737  FW_ASSERT (
5738  _deserStatus == Fw::FW_SERIALIZE_OK,
5739  static_cast<FwAssertArgType>(_deserStatus)
5740  );
5741 
5742  // Deserialize command argument buffer
5743  Fw::CmdArgBuffer args;
5744  _deserStatus = _msg.deserialize(args);
5745  FW_ASSERT (
5746  _deserStatus == Fw::FW_SERIALIZE_OK,
5747  static_cast<FwAssertArgType>(_deserStatus)
5748  );
5749 
5750  // Reset buffer
5751  args.resetDeser();
5752 
5753  // Make sure there was no data left over.
5754  // That means the argument buffer size was incorrect.
5755 #if FW_CMD_CHECK_RESIDUAL
5756  if (args.getBuffLeft() != 0) {
5757  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5758  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5759  }
5760  // Don't crash the task if bad arguments were passed from the ground
5761  break;
5762  }
5763 #endif
5764 
5765  // Call handler function
5766  this->CANCEL_cmdHandler(_opCode, _cmdSeq);
5767 
5768  break;
5769  }
5770 
5771  // Handle internal interface directive_waitAbs
5772  case INT_IF_DIRECTIVE_WAITABS: {
5774  _deserStatus = _msg.deserialize(directive);
5775 
5776  // Internal interface should always deserialize
5777  FW_ASSERT(
5778  Fw::FW_SERIALIZE_OK == _deserStatus,
5779  static_cast<FwAssertArgType>(_deserStatus)
5780  );
5781 
5782  // Make sure there was no data left over.
5783  // That means the buffer size was incorrect.
5784  FW_ASSERT(
5785  _msg.getBuffLeft() == 0,
5786  static_cast<FwAssertArgType>(_msg.getBuffLeft())
5787  );
5788 
5789  // Call handler function
5791  directive
5792  );
5793 
5794  break;
5795  }
5796 
5797  // Handle internal interface directive_waitRel
5798  case INT_IF_DIRECTIVE_WAITREL: {
5800  _deserStatus = _msg.deserialize(directive);
5801 
5802  // Internal interface should always deserialize
5803  FW_ASSERT(
5804  Fw::FW_SERIALIZE_OK == _deserStatus,
5805  static_cast<FwAssertArgType>(_deserStatus)
5806  );
5807 
5808  // Make sure there was no data left over.
5809  // That means the buffer size was incorrect.
5810  FW_ASSERT(
5811  _msg.getBuffLeft() == 0,
5812  static_cast<FwAssertArgType>(_msg.getBuffLeft())
5813  );
5814 
5815  // Call handler function
5817  directive
5818  );
5819 
5820  break;
5821  }
5822 
5823 
5824  // Handle signals to internal state machines
5825  case INTERNAL_STATE_MACHINE_SIGNAL:
5826  this->smDispatch(_msg);
5827  break;
5828 
5829  default:
5830  return MSG_DISPATCH_ERROR;
5831  }
5832 
5833  return MSG_DISPATCH_OK;
5834  }
5835 
5836  // ----------------------------------------------------------------------
5837  // Calls for messages received on special input ports
5838  // ----------------------------------------------------------------------
5839 
5840  void FpySequencerComponentBase ::
5841  m_p_cmdIn_in(
5842  Fw::PassiveComponentBase* callComp,
5843  FwIndexType portNum,
5844  FwOpcodeType opCode,
5845  U32 cmdSeq,
5846  Fw::CmdArgBuffer& args
5847  )
5848  {
5849  FW_ASSERT(callComp);
5850  FpySequencerComponentBase* compPtr = static_cast<FpySequencerComponentBase*>(callComp);
5851 
5852  const U32 idBase = callComp->getIdBase();
5853  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
5854 
5855  // Select base class function based on opcode
5856  switch (opCode - idBase) {
5857  case OPCODE_RUN: {
5858  compPtr->RUN_cmdHandlerBase(
5859  opCode,
5860  cmdSeq,
5861  args
5862  );
5863  break;
5864  }
5865 
5866  case OPCODE_VALIDATE: {
5867  compPtr->VALIDATE_cmdHandlerBase(
5868  opCode,
5869  cmdSeq,
5870  args
5871  );
5872  break;
5873  }
5874 
5875  case OPCODE_RUN_VALIDATED: {
5876  compPtr->RUN_VALIDATED_cmdHandlerBase(
5877  opCode,
5878  cmdSeq,
5879  args
5880  );
5881  break;
5882  }
5883 
5884  case OPCODE_CANCEL: {
5885  compPtr->CANCEL_cmdHandlerBase(
5886  opCode,
5887  cmdSeq,
5888  args
5889  );
5890  break;
5891  }
5892 
5894  Fw::CmdResponse _cstat = compPtr->paramSet_STATEMENT_TIMEOUT_SECS(args);
5895  compPtr->cmdResponse_out(
5896  opCode,
5897  cmdSeq,
5898  _cstat
5899  );
5900  break;
5901  }
5902 
5904  Fw::CmdResponse _cstat = compPtr->paramSave_STATEMENT_TIMEOUT_SECS();
5905  compPtr->cmdResponse_out(
5906  opCode,
5907  cmdSeq,
5908  _cstat
5909  );
5910  break;
5911  }
5912  }
5913  }
5914 
5915  // ----------------------------------------------------------------------
5916  // Calls for messages received on typed input ports
5917  // ----------------------------------------------------------------------
5918 
5919  void FpySequencerComponentBase ::
5920  m_p_checkTimers_in(
5921  Fw::PassiveComponentBase* callComp,
5922  FwIndexType portNum,
5923  U32 context
5924  )
5925  {
5926  FW_ASSERT(callComp);
5927  FpySequencerComponentBase* compPtr = static_cast<FpySequencerComponentBase*>(callComp);
5928  compPtr->checkTimers_handlerBase(
5929  portNum,
5930  context
5931  );
5932  }
5933 
5934  void FpySequencerComponentBase ::
5935  m_p_cmdResponseIn_in(
5936  Fw::PassiveComponentBase* callComp,
5937  FwIndexType portNum,
5938  FwOpcodeType opCode,
5939  U32 cmdSeq,
5940  const Fw::CmdResponse& response
5941  )
5942  {
5943  FW_ASSERT(callComp);
5944  FpySequencerComponentBase* compPtr = static_cast<FpySequencerComponentBase*>(callComp);
5945  compPtr->cmdResponseIn_handlerBase(
5946  portNum,
5947  opCode,
5948  cmdSeq,
5949  response
5950  );
5951  }
5952 
5953  void FpySequencerComponentBase ::
5954  m_p_pingIn_in(
5955  Fw::PassiveComponentBase* callComp,
5956  FwIndexType portNum,
5957  U32 key
5958  )
5959  {
5960  FW_ASSERT(callComp);
5961  FpySequencerComponentBase* compPtr = static_cast<FpySequencerComponentBase*>(callComp);
5962  compPtr->pingIn_handlerBase(
5963  portNum,
5964  key
5965  );
5966  }
5967 
5968  void FpySequencerComponentBase ::
5969  m_p_tlmWrite_in(
5970  Fw::PassiveComponentBase* callComp,
5971  FwIndexType portNum,
5972  U32 context
5973  )
5974  {
5975  FW_ASSERT(callComp);
5976  FpySequencerComponentBase* compPtr = static_cast<FpySequencerComponentBase*>(callComp);
5977  compPtr->tlmWrite_handlerBase(
5978  portNum,
5979  context
5980  );
5981  }
5982 
5983  // ----------------------------------------------------------------------
5984  // Send signal helper functions
5985  // ----------------------------------------------------------------------
5986 
5987  void FpySequencerComponentBase ::
5988  sendSignalStart(
5989  SmId smId,
5990  FwEnumStoreType signal,
5991  Fw::SerializeBufferBase& buffer
5992  )
5993  {
5995 
5996  // Serialize the message type
5997  status = buffer.serialize(static_cast<FwEnumStoreType>(INTERNAL_STATE_MACHINE_SIGNAL));
5998  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
5999 
6000  // Serialize the port number
6001  status = buffer.serialize(static_cast<FwIndexType>(0));
6002  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6003 
6004  // Serialize the state machine ID
6005  status = buffer.serialize(static_cast<FwEnumStoreType>(smId));
6006  FW_ASSERT (status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6007 
6008  // Serialize the signal
6009  status = buffer.serialize(static_cast<FwEnumStoreType>(signal));
6010  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6011  }
6012 
6013  void FpySequencerComponentBase ::
6014  sequencer_sendSignalFinish(Fw::SerializeBufferBase& buffer)
6015  {
6016  // Send message
6018  Os::Queue::Status qStatus = this->m_queue.send(buffer, 9, _block);
6019 
6020  FW_ASSERT(
6021  qStatus == Os::Queue::OP_OK,
6022  static_cast<FwAssertArgType>(qStatus)
6023  );
6024  }
6025 
6026  // ----------------------------------------------------------------------
6027  // Helper functions for state machine dispatch
6028  // ----------------------------------------------------------------------
6029 
6030  void FpySequencerComponentBase ::
6031  smDispatch(Fw::SerializeBufferBase& buffer)
6032  {
6033  // Deserialize the state machine ID and signal
6034  FwEnumStoreType storedSmId;
6035  FwEnumStoreType storedSignal;
6036  FpySequencerComponentBase::deserializeSmIdAndSignal(buffer, storedSmId, storedSignal);
6037 
6038  // Select the target state machine instance
6039  const SmId smId = static_cast<SmId>(storedSmId);
6040  switch (smId) {
6041  case SmId::sequencer: {
6043  this->Svc_FpySequencer_SequencerStateMachine_smDispatch(buffer, this->m_stateMachine_sequencer, signal);
6044  break;
6045  }
6046  default:
6047  FW_ASSERT(0, static_cast<FwAssertArgType>(smId));
6048  break;
6049  }
6050  }
6051 
6052  void FpySequencerComponentBase ::
6053  deserializeSmIdAndSignal(
6054  Fw::SerializeBufferBase& buffer,
6055  FwEnumStoreType& smId,
6056  FwEnumStoreType& signal
6057  )
6058  {
6059  // Move deserialization beyond the message type and port number
6060  Fw::SerializeStatus status =
6061  buffer.moveDeserToOffset(ComponentIpcSerializableBuffer::DATA_OFFSET);
6062  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6063 
6064  // Deserialize the state machine ID
6065  status = buffer.deserialize(smId);
6066  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6067 
6068  // Deserialize the signal
6069  status = buffer.deserialize(signal);
6070  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6071  }
6072 
6073  void FpySequencerComponentBase ::
6074  Svc_FpySequencer_SequencerStateMachine_smDispatch(
6075  Fw::SerializeBufferBase& buffer,
6076  Svc_FpySequencer_SequencerStateMachine& sm,
6078  )
6079  {
6080  switch (signal) {
6082  // Deserialize the data
6084  const Fw::SerializeStatus status = buffer.deserialize(value);
6085  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6086  // Assert no data left in buffer
6087  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6088  // Call the sendSignal function for sm and cmd_VALIDATE
6089  sm.sendSignal_cmd_VALIDATE(value);
6090  break;
6091  }
6093  // Deserialize the data
6095  const Fw::SerializeStatus status = buffer.deserialize(value);
6096  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6097  // Assert no data left in buffer
6098  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6099  // Call the sendSignal function for sm and cmd_RUN
6100  sm.sendSignal_cmd_RUN(value);
6101  break;
6102  }
6104  // Deserialize the data
6106  const Fw::SerializeStatus status = buffer.deserialize(value);
6107  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
6108  // Assert no data left in buffer
6109  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6110  // Call the sendSignal function for sm and cmd_RUN_VALIDATED
6111  sm.sendSignal_cmd_RUN_VALIDATED(value);
6112  break;
6113  }
6115  // Assert no data left in buffer
6116  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6117  // Call the sendSignal function for sm and cmd_CANCEL
6118  sm.sendSignal_cmd_CANCEL();
6119  break;
6120  }
6122  // Assert no data left in buffer
6123  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6124  // Call the sendSignal function for sm and result_failure
6125  sm.sendSignal_result_failure();
6126  break;
6127  }
6129  // Assert no data left in buffer
6130  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6131  // Call the sendSignal function for sm and result_success
6132  sm.sendSignal_result_success();
6133  break;
6134  }
6136  // Assert no data left in buffer
6137  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6138  // Call the sendSignal function for sm and entered
6139  sm.sendSignal_entered();
6140  break;
6141  }
6143  // Assert no data left in buffer
6144  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6145  // Call the sendSignal function for sm and result_dispatchStatement_success
6146  sm.sendSignal_result_dispatchStatement_success();
6147  break;
6148  }
6150  // Assert no data left in buffer
6151  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6152  // Call the sendSignal function for sm and result_dispatchStatement_failure
6153  sm.sendSignal_result_dispatchStatement_failure();
6154  break;
6155  }
6157  // Assert no data left in buffer
6158  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6159  // Call the sendSignal function for sm and result_dispatchStatement_noMoreStatements
6160  sm.sendSignal_result_dispatchStatement_noMoreStatements();
6161  break;
6162  }
6164  // Assert no data left in buffer
6165  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6166  // Call the sendSignal function for sm and checkTimersIn
6167  sm.sendSignal_checkTimersIn();
6168  break;
6169  }
6171  // Assert no data left in buffer
6172  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6173  // Call the sendSignal function for sm and result_checkShouldWake_wakeup
6174  sm.sendSignal_result_checkShouldWake_wakeup();
6175  break;
6176  }
6178  // Assert no data left in buffer
6179  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6180  // Call the sendSignal function for sm and result_checkShouldWake_keepSleeping
6181  sm.sendSignal_result_checkShouldWake_keepSleeping();
6182  break;
6183  }
6185  // Assert no data left in buffer
6186  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6187  // Call the sendSignal function for sm and result_timeOpFailed
6188  sm.sendSignal_result_timeOpFailed();
6189  break;
6190  }
6192  // Assert no data left in buffer
6193  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6194  // Call the sendSignal function for sm and stmtResponse_beginSleep
6195  sm.sendSignal_stmtResponse_beginSleep();
6196  break;
6197  }
6199  // Assert no data left in buffer
6200  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6201  // Call the sendSignal function for sm and stmtResponse_success
6202  sm.sendSignal_stmtResponse_success();
6203  break;
6204  }
6206  // Assert no data left in buffer
6207  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6208  // Call the sendSignal function for sm and stmtResponse_failure
6209  sm.sendSignal_stmtResponse_failure();
6210  break;
6211  }
6213  // Assert no data left in buffer
6214  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6215  // Call the sendSignal function for sm and stmtResponse_unexpected
6216  sm.sendSignal_stmtResponse_unexpected();
6217  break;
6218  }
6220  // Assert no data left in buffer
6221  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6222  // Call the sendSignal function for sm and result_checkStatementTimeout_statementTimeout
6223  sm.sendSignal_result_checkStatementTimeout_statementTimeout();
6224  break;
6225  }
6227  // Assert no data left in buffer
6228  FW_ASSERT(buffer.getBuffLeft() == 0, static_cast<FwAssertArgType>(buffer.getBuffLeft()));
6229  // Call the sendSignal function for sm and result_checkStatementTimeout_noTimeout
6230  sm.sendSignal_result_checkStatementTimeout_noTimeout();
6231  break;
6232  }
6233  default:
6234  FW_ASSERT(0, static_cast<FwAssertArgType>(signal));
6235  break;
6236  }
6237  }
6238 
6239  // ----------------------------------------------------------------------
6240  // Parameter set functions
6241  // ----------------------------------------------------------------------
6242 
6243  Fw::CmdResponse FpySequencerComponentBase ::
6244  paramSet_STATEMENT_TIMEOUT_SECS(Fw::SerializeBufferBase& val)
6245  {
6246  F32 _local_val;
6247  Fw::SerializeStatus _stat = val.deserialize(_local_val);
6248  if (_stat != Fw::FW_SERIALIZE_OK) {
6250  }
6251 
6252  // Assign value only if successfully deserialized
6253  this->m_paramLock.lock();
6254  this->m_STATEMENT_TIMEOUT_SECS = _local_val;
6255  this->m_param_STATEMENT_TIMEOUT_SECS_valid = Fw::ParamValid::VALID;
6256  this->m_paramLock.unLock();
6257 
6258  // Call notifier
6260  return Fw::CmdResponse::OK;
6261  }
6262 
6263  // ----------------------------------------------------------------------
6264  // Parameter save functions
6265  // ----------------------------------------------------------------------
6266 
6267  Fw::CmdResponse FpySequencerComponentBase ::
6268  paramSave_STATEMENT_TIMEOUT_SECS()
6269  {
6270  if (this->m_prmSet_OutputPort[0].isConnected()) {
6271  Fw::ParamBuffer saveBuff;
6272  this->m_paramLock.lock();
6273 
6274  Fw::SerializeStatus stat = saveBuff.serialize(m_STATEMENT_TIMEOUT_SECS);
6275 
6276  this->m_paramLock.unLock();
6277  if (stat != Fw::FW_SERIALIZE_OK) {
6279  }
6280 
6281  FwPrmIdType id = 0;
6283 
6284  // Save the parameter
6285  this->m_prmSet_OutputPort[0].invoke(
6286  id,
6287  saveBuff
6288  );
6289 
6290  return Fw::CmdResponse::OK;
6291  }
6292 
6294  }
6295 
6296 }
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
Serialization/Deserialization operation was successful.
void sequencer_sendSignal_result_dispatchStatement_noMoreStatements()
Send signal result_dispatchStatement_noMoreStatements to state machine sequencer. ...
void sequencer_sendSignal_result_checkShouldWake_keepSleeping()
Send signal result_checkShouldWake_keepSleeping to state machine sequencer.
called when an unexpected or incorrect statement response comes in. only raised in the RUNNING state ...
virtual void directive_waitRel_internalInterfaceHandler(const Svc::FpySequencer_WaitRelDirective &directive)=0
Internal interface handler for directive_waitRel.
called in dispatchStatement method when a statement was unable to be sent out
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port interface.
Definition: ComPortAc.cpp:156
Definition: Time.hpp:9
void init()
Initialization function.
Definition: ComPortAc.cpp:137
The size of the serial representations of the port arguments.
Fw::InputCmdResponsePort * get_cmdResponseIn_InputPort(FwIndexType portNum)
Operation succeeded.
Definition: Os.hpp:26
void set_cmdOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to cmdOut[portNum].
called in dispatchStatement method when there were no more statements in the sequence ...
virtual void parametersLoaded()
Called whenever parameters are loaded.
void log_WARNING_HI_StatementFailed(Svc::Fpy::StatementType stmtType, U32 stmtOpcode, U32 stmtIdx, const Fw::StringBase &filePath, Fw::CmdResponse response) const
Log event StatementFailed.
void log_WARNING_HI_InsufficientBufferSpace(U64 bufferSize, const Fw::StringBase &filePath) const
Log event InsufficientBufferSpace.
PlatformSizeType FwSizeType
FwIndexType getNum_cmdResponseOut_OutputPorts() const
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:59
void log_WARNING_HI_CmdResponseWhileNotAwaiting(U32 opcode, Fw::CmdResponse response) const
Log event CmdResponseWhileNotAwaiting.
I32 FwEnumStoreType
virtual void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port cmdResponseIn.
void sequencer_sendSignal_result_dispatchStatement_success()
Send signal result_dispatchStatement_success to state machine sequencer.
void log_WARNING_HI_WrongCRC(U32 expected, U32 actual) const
Log event WrongCRC.
#define FW_TLM_STRING_MAX_SIZE
Max size of channelized telemetry string type.
Definition: FpConfig.h:239
Status
status returned from the queue send function
Definition: Queue.hpp:30
virtual void parameterUpdated(FwPrmIdType id)
Called whenever a parameter is updated.
called when the expected statement response comes in, and it is OK. only raised in the RUNNING...
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
called on VALIDATE cmd with the path of the sequence file to validate. only raised in IDLE state ...
called on RUN cmd with the path of the sequence file to run. only raised in IDLE state ...
called on RUN_VALIDATED cmd. only raised in AWAITING_CMD_RUN_VALIDATED state
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
virtual void tlmWrite_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port tlmWrite.
const char * toChar() const
Definition: String.hpp:50
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void RUN_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:40
void addCallPort(InputPrmSetPort *callPort)
Register an input port.
U32 FwChanIdType
The type of a telemetry channel identifier.
virtual void CANCEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void invoke(U32 key) const
Invoke a port interface.
Definition: PingPortAc.cpp:147
void log_WARNING_HI_FileReadError(const Fw::StringBase &filePath, I32 errorCode) const
Log event FileReadError.
void sequencer_sendSignal_result_checkShouldWake_wakeup()
Send signal result_checkShouldWake_wakeup to state machine sequencer.
const Time ZERO_TIME
Definition: Time.cpp:5
void sequencer_sendSignal_result_success()
Send signal result_success to state machine sequencer.
void log_WARNING_HI_FileReadDeserializeError(const Fw::StringBase &filePath, I32 errorCode, U64 buffLeft, U64 buffLength) const
Log event FileReadDeserializeError.
void cmdResponseIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port cmdResponseIn.
void sequencer_sendSignal_stmtResponse_success()
Send signal stmtResponse_success to state machine sequencer.
virtual ~FpySequencerComponentBase()
Destroy FpySequencerComponentBase object.
void sequencer_sendSignal_cmd_VALIDATE(const Svc::FpySequencer_SequenceExecutionArgs &value)
Send signal cmd_VALIDATE to state machine sequencer.
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
Enum representing a command response.
virtual void RUN_VALIDATED_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RUN_VALIDATED.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void tlmWrite_SequencesSucceeded(U64 arg, Fw::Time _tlmTime=Fw::Time())
virtual void directive_waitAbs_internalInterfaceHandler(const Svc::FpySequencer_WaitAbsDirective &directive)=0
Internal interface handler for directive_waitAbs.
void init()
Initialization function.
virtual void RUN_VALIDATED_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::FpySequencer_BlockState block)=0
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
Os::Queue m_queue
queue object for active component
void sequencer_sendSignal_stmtResponse_unexpected()
Send signal stmtResponse_unexpected to state machine sequencer.
virtual void RUN_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, Svc::FpySequencer_BlockState block)=0
void sequencer_sendSignal_result_dispatchStatement_failure()
Send signal result_dispatchStatement_failure to state machine sequencer.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
Svc::InputSchedPort * get_checkTimers_InputPort(FwIndexType portNum)
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void addCallPort(InputPrmGetPort *callPort)
Register an input port.
void RUN_VALIDATED_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Object initializer.
Definition: ObjBase.cpp:26
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
U32 FwEventIdType
The type of an event identifier.
SerializeStatus
forward declaration for string
Svc_FpySequencer_SequencerStateMachine::State sequencer_getState() const
Get the state of state machine instance sequencer.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
float F32
32-bit floating point
Definition: BasicTypes.h:86
virtual void checkTimers_handler(FwIndexType portNum, U32 context)=0
Handler for input port checkTimers.
Message will block until space is available.
Definition: Queue.hpp:46
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
void log_WARNING_HI_ExtraBytesInSequence(U32 remaining) const
Log event ExtraBytesInSequence.
void tlmWrite_StatementsFailed(U64 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_StatementTimedOut(Svc::Fpy::StatementType stmtType, U32 stmtOpcode, U32 stmtIdx, const Fw::StringBase &filePath) const
Log event StatementTimedOut.
void regCommands()
Register commands with the Command Dispatcher.
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
called in dispatchStatement method when a statement was successfully dispatched
F32 paramGet_STATEMENT_TIMEOUT_SECS(Fw::ParamValid &valid)
void log_WARNING_HI_EndOfFileError(const Fw::StringBase &filePath) const
Log event EndOfFileError.
void log_WARNING_HI_WrongCmdResponseOpcode(U32 opcode, Fw::CmdResponse response, U32 expectedOpcode) const
Log event WrongCmdResponseOpcode.
The size of the serial representation.
U32 FwOpcodeType
The type of a command opcode.
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void tlmWrite_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port tlmWrite.
bool isConnected_prmSet_OutputPort(FwIndexType portNum)
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:95
A less serious but recoverable event.
Fw::ParamValid invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port interface.
ActiveComponentBase(const char *name)
Constructor.
void init()
Initialization function.
Definition: PingPortAc.cpp:128
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
Loads, validates and runs a sequence.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
const char * toChar() const
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
void sequencer_sendSignal_cmd_RUN_VALIDATED(const Svc::FpySequencer_SequenceExecutionArgs &value)
Send signal cmd_RUN_VALIDATED to state machine sequencer.
No time base has been established.
Definition: FpConfig.h:30
Must be called after VALIDATE. Runs the sequence that was validated.
Svc_FpySequencer_SequencerStateMachine(FpySequencerComponentBase &component)
Constructor.
FwSizeType SizeType
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:42
void log_WARNING_HI_WrongCmdResponseIndex(U32 opcode, Fw::CmdResponse response, U16 actualCmdIdx, U16 expectedCmdIdx) const
Log event WrongCmdResponseIndex.
FpySequencerComponentBase(const char *compName="")
Construct FpySequencerComponentBase object.
void sequencer_sendSignal_checkTimersIn()
Send signal checkTimersIn to state machine sequencer.
void tlmWrite_StatementsDispatched(U64 arg, Fw::Time _tlmTime=Fw::Time())
void VALIDATE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
message to exit active component task
void resetDeser()
reset deserialization to beginning
void sequencer_sendSignal_stmtResponse_failure()
Send signal stmtResponse_failure to state machine sequencer.
The size of the serial representation.
void log_WARNING_LO_CmdResponseWhileNotRunningSequence(I32 state, U32 opcode, Fw::CmdResponse response) const
Log event CmdResponseWhileNotRunningSequence.
A serious but recoverable event.
void CANCEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void directive_waitAbs_internalInterfaceInvoke(const Svc::FpySequencer_WaitAbsDirective &directive)
Internal interface base-class function for directive_waitAbs.
void log_WARNING_HI_DirectiveDeserializeError(U32 opcode, U32 stmtIdx, I32 errorCode, U64 buffLeft, U64 buffLength) const
Log event DirectiveDeserializeError.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void sequencer_sendSignal_stmtResponse_beginSleep()
Send signal stmtResponse_beginSleep to state machine sequencer.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:42
void sequencer_sendSignal_result_checkStatementTimeout_noTimeout()
Send signal result_checkStatementTimeout_noTimeout to state machine sequencer.
U32 FwPrmIdType
The type of a parameter identifier.
SerializeStatus moveDeserToOffset(FwSizeType offset)
Moves deserialization to the specified offset.
virtual void tlmWrite_handler(FwIndexType portNum, U32 context)=0
Handler for input port tlmWrite.
void loadParameters()
Load the parameters from a parameter source.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void init()
Initialization function.
Definition: LogPortAc.cpp:151
Command successfully executed.
void log_WARNING_HI_CommandSerializeError(U32 cmdOpcode, U64 bufCapacity, U64 curPos, U64 writeSize, U8 errorCode, U32 stmtIdx) const
Log event CommandSerializeError.
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:56
BlockingType
message type
Definition: Queue.hpp:45
void log_WARNING_HI_TooManySequenceStatements(U16 count, U16 max) const
Log event TooManySequenceStatements.
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
void tlmWrite_STATEMENT_TIMEOUT_SECS(F32 arg, Fw::Time _tlmTime=Fw::Time())
void sequencer_sendSignal_result_timeOpFailed()
Send signal result_timeOpFailed to state machine sequencer.
void log_WARNING_HI_FileOpenError(const Fw::StringBase &filePath, I32 errorCode) const
Log event FileOpenError.
void init(FpySequencerComponentBase::SmId smId)
Initialize the state machine.
void set_prmSet_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSet[portNum].
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Command had execution error.
Important informational events.
void sequencer_sendSignal_cmd_CANCEL()
Send signal cmd_CANCEL to state machine sequencer.
void sequencer_sendSignal_result_checkStatementTimeout_statementTimeout()
Send signal result_checkStatementTimeout_statementTimeout to state machine sequencer.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
void init()
Initialization function.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
void log_WARNING_HI_InvalidCommand(I32 state) const
Log event InvalidCommand.
void log_ACTIVITY_HI_SequenceCancelled(const Fw::StringBase &filePath) const
Log event SequenceCancelled.
virtual void RUN_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RUN.
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
void log_WARNING_LO_CmdResponseFromOldSequence(U32 opcode, Fw::CmdResponse response, U16 oldSequenceIdx, U16 currentSequenceIdx) const
Log event CmdResponseFromOldSequence.
bool isConnected_cmdOut_OutputPort(FwIndexType portNum)
A message was sent requesting an exit of the loop.
called when the expected statement response comes in, and it is not OK. only raised in the RUNNING...
FpySequencer_SequencerStateMachineStateMachineBase::State getState() const
Get the state.
void tlmWrite_SequencesFailed(U64 arg, Fw::Time _tlmTime=Fw::Time())
bool isConnected_logOut_OutputPort(FwIndexType portNum)
void tlmWrite_SeqPath(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
PlatformIndexType FwIndexType
virtual void VALIDATE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command VALIDATE.
bool isConnected_prmGet_OutputPort(FwIndexType portNum)
void log_WARNING_HI_MismatchedTimeContext(I32 internalTimeContext, I32 otherTimeContext) const
Log event MismatchedTimeContext.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:93
Svc::InputSchedPort * get_tlmWrite_InputPort(FwIndexType portNum)
void log_WARNING_HI_WrongSchemaVersion(U8 expected, U8 actual) const
Log event WrongSchemaVersion.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void cmdOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port cmdOut.
virtual void VALIDATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)=0
void init()
Initialization function.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
Command failed validation.
RateGroupDivider component implementation.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
virtual void cmdResponseIn_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port cmdResponseIn.
message sent/received okay
Definition: Queue.hpp:31
Enum representing parameter validity.
U8 BYTE
byte type
Definition: BasicTypes.h:59
void log_WARNING_HI_TooManySequenceArgs(U8 count, U8 max) const
Log event TooManySequenceArgs.
void log_WARNING_HI_MismatchedTimeBase(I32 internalTimeBase, I32 otherTimeBase) const
Log event MismatchedTimeBase.
void invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port interface.
void sequencer_sendSignal_result_failure()
Send signal result_failure to state machine sequencer.
called on CANCEL cmd. raised in all states except IDLE
virtual void checkTimers_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port checkTimers.
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
void sequencer_sendSignal_entered()
Send signal entered to state machine sequencer.
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:142
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
FpySequencerComponentBase::SmId getId() const
Get the state machine id.
void log_ACTIVITY_HI_SequenceDone(const Fw::StringBase &filePath) const
Log event SequenceDone.
void directive_waitRel_internalInterfaceInvoke(const Svc::FpySequencer_WaitRelDirective &directive)
Internal interface base-class function for directive_waitRel.
Message will return with status when space is unavailable.
Definition: Queue.hpp:47
Auto-generated base for FpySequencer component.
void sequencer_sendSignal_cmd_RUN(const Svc::FpySequencer_SequenceExecutionArgs &value)
Send signal cmd_RUN to state machine sequencer.
void init()
Initialization function.
void checkTimers_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port checkTimers.
void init()
Initialization function.
virtual void CANCEL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CANCEL.
void log_WARNING_HI_UnknownSequencerDirective(U32 opcode, U32 stmtIdx, const Fw::StringBase &filePath) const
Log event UnknownSequencerDirective.
FpySequencer_SequencerStateMachineStateMachineBase::Signal Signal
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:53
void tlmWrite_SequencesCancelled(U64 arg, Fw::Time _tlmTime=Fw::Time())
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void set_prmGet_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGet[portNum].
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:224
virtual const CHAR * toChar() const =0
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
#define U64(C)
Definition: sha.h:180