F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CmdSequencerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CmdSequencerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for CmdSequencer component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  enum MsgTypeEnum {
18  CMDSEQUENCER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  CMDRESPONSEIN_CMDRESPONSE,
20  PINGIN_PING,
21  SCHEDIN_SCHED,
22  SEQCANCELIN_CMDSEQCANCEL,
23  SEQDISPATCHIN_FILEDISPATCH,
24  SEQRUNIN_CMDSEQIN,
25  CMD_CS_RUN,
26  CMD_CS_VALIDATE,
27  CMD_CS_CANCEL,
28  CMD_CS_START,
29  CMD_CS_STEP,
30  CMD_CS_AUTO,
31  CMD_CS_MANUAL,
32  CMD_CS_JOIN_WAIT,
33  };
34 
35  // Get the max size by constructing a union of the async input, command, and
36  // internal port serialization sizes
37  union BuffUnion {
38  BYTE cmdResponseInPortSize[Fw::CmdResponsePortBuffer::CAPACITY];
39  BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY];
40  BYTE schedInPortSize[Svc::SchedPortBuffer::CAPACITY];
41  BYTE seqDispatchInPortSize[Svc::FileDispatchPortBuffer::CAPACITY];
42  BYTE seqRunInPortSize[Svc::CmdSeqInPortBuffer::CAPACITY];
43  BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY];
44  };
45 
46  // Define a message buffer class large enough to handle all the
47  // asynchronous inputs to the component
48  class ComponentIpcSerializableBuffer :
50  {
51 
52  public:
53 
54  enum {
55  // Offset into data in buffer: Size of message ID and port number
56  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
57  // Max data size
58  MAX_DATA_SIZE = sizeof(BuffUnion),
59  // Max message size: Size of message id + size of port + max data size
60  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
61  };
62 
63  Fw::Serializable::SizeType getCapacity() const {
64  return sizeof(m_buff);
65  }
66 
67  U8* getBuffAddr() {
68  return m_buff;
69  }
70 
71  const U8* getBuffAddr() const {
72  return m_buff;
73  }
74 
75  private:
76  // Should be the max of all the input ports serialized sizes...
77  U8 m_buff[SERIALIZATION_SIZE];
78 
79  };
80  }
81 
82  // ----------------------------------------------------------------------
83  // Component initialization
84  // ----------------------------------------------------------------------
85 
88  FwSizeType queueDepth,
89  FwEnumStoreType instance
90  )
91  {
92  // Initialize base class
94 
95 #if !FW_DIRECT_PORT_CALLS
96  // Connect input port cmdIn
97  for (
98  FwIndexType port = 0;
99  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
100  port++
101  ) {
102  this->m_cmdIn_InputPort[port].init();
103  this->m_cmdIn_InputPort[port].addCallComp(
104  this,
105  m_p_cmdIn_in
106  );
107  this->m_cmdIn_InputPort[port].setPortNum(port);
108 
109 #if FW_OBJECT_NAMES == 1
110  Fw::ObjectName portName;
111  portName.format(
112  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
113  this->m_objName.toChar(),
114  port
115  );
116  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
117 #endif
118  }
119 #endif
120 
121 #if !FW_DIRECT_PORT_CALLS
122  // Connect input port cmdResponseIn
123  for (
124  FwIndexType port = 0;
125  port < static_cast<FwIndexType>(this->getNum_cmdResponseIn_InputPorts());
126  port++
127  ) {
128  this->m_cmdResponseIn_InputPort[port].init();
129  this->m_cmdResponseIn_InputPort[port].addCallComp(
130  this,
131  m_p_cmdResponseIn_in
132  );
133  this->m_cmdResponseIn_InputPort[port].setPortNum(port);
134 
135 #if FW_OBJECT_NAMES == 1
136  Fw::ObjectName portName;
137  portName.format(
138  "%s_cmdResponseIn_InputPort[%" PRI_FwIndexType "]",
139  this->m_objName.toChar(),
140  port
141  );
142  this->m_cmdResponseIn_InputPort[port].setObjName(portName.toChar());
143 #endif
144  }
145 #endif
146 
147 #if !FW_DIRECT_PORT_CALLS
148  // Connect input port pingIn
149  for (
150  FwIndexType port = 0;
151  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
152  port++
153  ) {
154  this->m_pingIn_InputPort[port].init();
155  this->m_pingIn_InputPort[port].addCallComp(
156  this,
157  m_p_pingIn_in
158  );
159  this->m_pingIn_InputPort[port].setPortNum(port);
160 
161 #if FW_OBJECT_NAMES == 1
162  Fw::ObjectName portName;
163  portName.format(
164  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
165  this->m_objName.toChar(),
166  port
167  );
168  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
169 #endif
170  }
171 #endif
172 
173 #if !FW_DIRECT_PORT_CALLS
174  // Connect input port schedIn
175  for (
176  FwIndexType port = 0;
177  port < static_cast<FwIndexType>(this->getNum_schedIn_InputPorts());
178  port++
179  ) {
180  this->m_schedIn_InputPort[port].init();
181  this->m_schedIn_InputPort[port].addCallComp(
182  this,
183  m_p_schedIn_in
184  );
185  this->m_schedIn_InputPort[port].setPortNum(port);
186 
187 #if FW_OBJECT_NAMES == 1
188  Fw::ObjectName portName;
189  portName.format(
190  "%s_schedIn_InputPort[%" PRI_FwIndexType "]",
191  this->m_objName.toChar(),
192  port
193  );
194  this->m_schedIn_InputPort[port].setObjName(portName.toChar());
195 #endif
196  }
197 #endif
198 
199 #if !FW_DIRECT_PORT_CALLS
200  // Connect input port seqCancelIn
201  for (
202  FwIndexType port = 0;
203  port < static_cast<FwIndexType>(this->getNum_seqCancelIn_InputPorts());
204  port++
205  ) {
206  this->m_seqCancelIn_InputPort[port].init();
207  this->m_seqCancelIn_InputPort[port].addCallComp(
208  this,
209  m_p_seqCancelIn_in
210  );
211  this->m_seqCancelIn_InputPort[port].setPortNum(port);
212 
213 #if FW_OBJECT_NAMES == 1
214  Fw::ObjectName portName;
215  portName.format(
216  "%s_seqCancelIn_InputPort[%" PRI_FwIndexType "]",
217  this->m_objName.toChar(),
218  port
219  );
220  this->m_seqCancelIn_InputPort[port].setObjName(portName.toChar());
221 #endif
222  }
223 #endif
224 
225 #if !FW_DIRECT_PORT_CALLS
226  // Connect input port seqDispatchIn
227  for (
228  FwIndexType port = 0;
229  port < static_cast<FwIndexType>(this->getNum_seqDispatchIn_InputPorts());
230  port++
231  ) {
232  this->m_seqDispatchIn_InputPort[port].init();
233  this->m_seqDispatchIn_InputPort[port].addCallComp(
234  this,
235  m_p_seqDispatchIn_in
236  );
237  this->m_seqDispatchIn_InputPort[port].setPortNum(port);
238 
239 #if FW_OBJECT_NAMES == 1
240  Fw::ObjectName portName;
241  portName.format(
242  "%s_seqDispatchIn_InputPort[%" PRI_FwIndexType "]",
243  this->m_objName.toChar(),
244  port
245  );
246  this->m_seqDispatchIn_InputPort[port].setObjName(portName.toChar());
247 #endif
248  }
249 #endif
250 
251 #if !FW_DIRECT_PORT_CALLS
252  // Connect input port seqRunIn
253  for (
254  FwIndexType port = 0;
255  port < static_cast<FwIndexType>(this->getNum_seqRunIn_InputPorts());
256  port++
257  ) {
258  this->m_seqRunIn_InputPort[port].init();
259  this->m_seqRunIn_InputPort[port].addCallComp(
260  this,
261  m_p_seqRunIn_in
262  );
263  this->m_seqRunIn_InputPort[port].setPortNum(port);
264 
265 #if FW_OBJECT_NAMES == 1
266  Fw::ObjectName portName;
267  portName.format(
268  "%s_seqRunIn_InputPort[%" PRI_FwIndexType "]",
269  this->m_objName.toChar(),
270  port
271  );
272  this->m_seqRunIn_InputPort[port].setObjName(portName.toChar());
273 #endif
274  }
275 #endif
276 
277 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
278  // Connect output port LogText
279  for (
280  FwIndexType port = 0;
281  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
282  port++
283  ) {
284  this->m_LogText_OutputPort[port].init();
285 
286 #if FW_OBJECT_NAMES == 1
287  Fw::ObjectName portName;
288  portName.format(
289  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
290  this->m_objName.toChar(),
291  port
292  );
293  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
294 #endif
295  }
296 #endif
297 
298 #if !FW_DIRECT_PORT_CALLS
299  // Connect output port cmdRegOut
300  for (
301  FwIndexType port = 0;
302  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
303  port++
304  ) {
305  this->m_cmdRegOut_OutputPort[port].init();
306 
307 #if FW_OBJECT_NAMES == 1
308  Fw::ObjectName portName;
309  portName.format(
310  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
311  this->m_objName.toChar(),
312  port
313  );
314  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
315 #endif
316  }
317 #endif
318 
319 #if !FW_DIRECT_PORT_CALLS
320  // Connect output port cmdResponseOut
321  for (
322  FwIndexType port = 0;
323  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
324  port++
325  ) {
326  this->m_cmdResponseOut_OutputPort[port].init();
327 
328 #if FW_OBJECT_NAMES == 1
329  Fw::ObjectName portName;
330  portName.format(
331  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
332  this->m_objName.toChar(),
333  port
334  );
335  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
336 #endif
337  }
338 #endif
339 
340 #if !FW_DIRECT_PORT_CALLS
341  // Connect output port logOut
342  for (
343  FwIndexType port = 0;
344  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
345  port++
346  ) {
347  this->m_logOut_OutputPort[port].init();
348 
349 #if FW_OBJECT_NAMES == 1
350  Fw::ObjectName portName;
351  portName.format(
352  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
353  this->m_objName.toChar(),
354  port
355  );
356  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
357 #endif
358  }
359 #endif
360 
361 #if !FW_DIRECT_PORT_CALLS
362  // Connect output port timeCaller
363  for (
364  FwIndexType port = 0;
365  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
366  port++
367  ) {
368  this->m_timeCaller_OutputPort[port].init();
369 
370 #if FW_OBJECT_NAMES == 1
371  Fw::ObjectName portName;
372  portName.format(
373  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
374  this->m_objName.toChar(),
375  port
376  );
377  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
378 #endif
379  }
380 #endif
381 
382 #if !FW_DIRECT_PORT_CALLS
383  // Connect output port tlmOut
384  for (
385  FwIndexType port = 0;
386  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
387  port++
388  ) {
389  this->m_tlmOut_OutputPort[port].init();
390 
391 #if FW_OBJECT_NAMES == 1
392  Fw::ObjectName portName;
393  portName.format(
394  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
395  this->m_objName.toChar(),
396  port
397  );
398  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
399 #endif
400  }
401 #endif
402 
403 #if !FW_DIRECT_PORT_CALLS
404  // Connect output port comCmdOut
405  for (
406  FwIndexType port = 0;
407  port < static_cast<FwIndexType>(this->getNum_comCmdOut_OutputPorts());
408  port++
409  ) {
410  this->m_comCmdOut_OutputPort[port].init();
411 
412 #if FW_OBJECT_NAMES == 1
413  Fw::ObjectName portName;
414  portName.format(
415  "%s_comCmdOut_OutputPort[%" PRI_FwIndexType "]",
416  this->m_objName.toChar(),
417  port
418  );
419  this->m_comCmdOut_OutputPort[port].setObjName(portName.toChar());
420 #endif
421  }
422 #endif
423 
424 #if !FW_DIRECT_PORT_CALLS
425  // Connect output port pingOut
426  for (
427  FwIndexType port = 0;
428  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
429  port++
430  ) {
431  this->m_pingOut_OutputPort[port].init();
432 
433 #if FW_OBJECT_NAMES == 1
434  Fw::ObjectName portName;
435  portName.format(
436  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
437  this->m_objName.toChar(),
438  port
439  );
440  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
441 #endif
442  }
443 #endif
444 
445 #if !FW_DIRECT_PORT_CALLS
446  // Connect output port seqDone
447  for (
448  FwIndexType port = 0;
449  port < static_cast<FwIndexType>(this->getNum_seqDone_OutputPorts());
450  port++
451  ) {
452  this->m_seqDone_OutputPort[port].init();
453 
454 #if FW_OBJECT_NAMES == 1
455  Fw::ObjectName portName;
456  portName.format(
457  "%s_seqDone_OutputPort[%" PRI_FwIndexType "]",
458  this->m_objName.toChar(),
459  port
460  );
461  this->m_seqDone_OutputPort[port].setObjName(portName.toChar());
462 #endif
463  }
464 #endif
465 
466 #if !FW_DIRECT_PORT_CALLS
467  // Connect output port seqStartOut
468  for (
469  FwIndexType port = 0;
470  port < static_cast<FwIndexType>(this->getNum_seqStartOut_OutputPorts());
471  port++
472  ) {
473  this->m_seqStartOut_OutputPort[port].init();
474 
475 #if FW_OBJECT_NAMES == 1
476  Fw::ObjectName portName;
477  portName.format(
478  "%s_seqStartOut_OutputPort[%" PRI_FwIndexType "]",
479  this->m_objName.toChar(),
480  port
481  );
482  this->m_seqStartOut_OutputPort[port].setObjName(portName.toChar());
483 #endif
484  }
485 #endif
486 
487  // Create the queue
488  Os::Queue::Status qStat = this->createQueue(
489  queueDepth,
490  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
491  );
492  FW_ASSERT(
493  Os::Queue::Status::OP_OK == qStat,
494  static_cast<FwAssertArgType>(qStat)
495  );
496  }
497 
498 #if !FW_DIRECT_PORT_CALLS
499 
500  // ----------------------------------------------------------------------
501  // Getters for special input ports
502  // ----------------------------------------------------------------------
503 
506  {
507  FW_ASSERT(
508  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
509  static_cast<FwAssertArgType>(portNum)
510  );
511 
512  return &this->m_cmdIn_InputPort[portNum];
513  }
514 
515 #endif
516 
517 #if !FW_DIRECT_PORT_CALLS
518 
519  // ----------------------------------------------------------------------
520  // Getters for typed input ports
521  // ----------------------------------------------------------------------
522 
525  {
526  FW_ASSERT(
527  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
528  static_cast<FwAssertArgType>(portNum)
529  );
530 
531  return &this->m_cmdResponseIn_InputPort[portNum];
532  }
533 
536  {
537  FW_ASSERT(
538  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
539  static_cast<FwAssertArgType>(portNum)
540  );
541 
542  return &this->m_pingIn_InputPort[portNum];
543  }
544 
547  {
548  FW_ASSERT(
549  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
550  static_cast<FwAssertArgType>(portNum)
551  );
552 
553  return &this->m_schedIn_InputPort[portNum];
554  }
555 
558  {
559  FW_ASSERT(
560  (0 <= portNum) && (portNum < this->getNum_seqCancelIn_InputPorts()),
561  static_cast<FwAssertArgType>(portNum)
562  );
563 
564  return &this->m_seqCancelIn_InputPort[portNum];
565  }
566 
569  {
570  FW_ASSERT(
571  (0 <= portNum) && (portNum < this->getNum_seqDispatchIn_InputPorts()),
572  static_cast<FwAssertArgType>(portNum)
573  );
574 
575  return &this->m_seqDispatchIn_InputPort[portNum];
576  }
577 
580  {
581  FW_ASSERT(
582  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
583  static_cast<FwAssertArgType>(portNum)
584  );
585 
586  return &this->m_seqRunIn_InputPort[portNum];
587  }
588 
589 #endif
590 
591 #if !FW_DIRECT_PORT_CALLS
592 
593  // ----------------------------------------------------------------------
594  // Connect input ports to special output ports
595  // ----------------------------------------------------------------------
596 
597 #if FW_ENABLE_TEXT_LOGGING == 1
598 
599  void CmdSequencerComponentBase ::
600  set_LogText_OutputPort(
601  FwIndexType portNum,
603  )
604  {
605  FW_ASSERT(
606  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
607  static_cast<FwAssertArgType>(portNum)
608  );
609 
610  this->m_LogText_OutputPort[portNum].addCallPort(port);
611  }
612 
613 #endif
614 
617  FwIndexType portNum,
618  Fw::InputCmdRegPort* port
619  )
620  {
621  FW_ASSERT(
622  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
623  static_cast<FwAssertArgType>(portNum)
624  );
625 
626  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
627  }
628 
631  FwIndexType portNum,
633  )
634  {
635  FW_ASSERT(
636  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
637  static_cast<FwAssertArgType>(portNum)
638  );
639 
640  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
641  }
642 
645  FwIndexType portNum,
646  Fw::InputLogPort* port
647  )
648  {
649  FW_ASSERT(
650  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
651  static_cast<FwAssertArgType>(portNum)
652  );
653 
654  this->m_logOut_OutputPort[portNum].addCallPort(port);
655  }
656 
659  FwIndexType portNum,
660  Fw::InputTimePort* port
661  )
662  {
663  FW_ASSERT(
664  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
665  static_cast<FwAssertArgType>(portNum)
666  );
667 
668  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
669  }
670 
673  FwIndexType portNum,
674  Fw::InputTlmPort* port
675  )
676  {
677  FW_ASSERT(
678  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
679  static_cast<FwAssertArgType>(portNum)
680  );
681 
682  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
683  }
684 
685 #endif
686 
687 #if !FW_DIRECT_PORT_CALLS
688 
689  // ----------------------------------------------------------------------
690  // Connect typed input ports to typed output ports
691  // ----------------------------------------------------------------------
692 
695  FwIndexType portNum,
696  Fw::InputComPort* port
697  )
698  {
699  FW_ASSERT(
700  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
701  static_cast<FwAssertArgType>(portNum)
702  );
703 
704  this->m_comCmdOut_OutputPort[portNum].addCallPort(port);
705  }
706 
709  FwIndexType portNum,
710  Svc::InputPingPort* port
711  )
712  {
713  FW_ASSERT(
714  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
715  static_cast<FwAssertArgType>(portNum)
716  );
717 
718  this->m_pingOut_OutputPort[portNum].addCallPort(port);
719  }
720 
723  FwIndexType portNum,
725  )
726  {
727  FW_ASSERT(
728  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
729  static_cast<FwAssertArgType>(portNum)
730  );
731 
732  this->m_seqDone_OutputPort[portNum].addCallPort(port);
733  }
734 
737  FwIndexType portNum,
739  )
740  {
741  FW_ASSERT(
742  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
743  static_cast<FwAssertArgType>(portNum)
744  );
745 
746  this->m_seqStartOut_OutputPort[portNum].addCallPort(port);
747  }
748 
749 #endif
750 
751 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
752 
753  // ----------------------------------------------------------------------
754  // Connect serial input ports to special output ports
755  // ----------------------------------------------------------------------
756 
757 #if FW_ENABLE_TEXT_LOGGING == 1
758 
759  void CmdSequencerComponentBase ::
760  set_LogText_OutputPort(
761  FwIndexType portNum,
762  Fw::InputSerializePort* port
763  )
764  {
765  FW_ASSERT(
766  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
767  static_cast<FwAssertArgType>(portNum)
768  );
769 
770  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
771  }
772 
773 #endif
774 
777  FwIndexType portNum,
778  Fw::InputSerializePort* port
779  )
780  {
781  FW_ASSERT(
782  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
783  static_cast<FwAssertArgType>(portNum)
784  );
785 
786  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
787  }
788 
791  FwIndexType portNum,
792  Fw::InputSerializePort* port
793  )
794  {
795  FW_ASSERT(
796  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
797  static_cast<FwAssertArgType>(portNum)
798  );
799 
800  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
801  }
802 
805  FwIndexType portNum,
806  Fw::InputSerializePort* port
807  )
808  {
809  FW_ASSERT(
810  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
811  static_cast<FwAssertArgType>(portNum)
812  );
813 
814  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
815  }
816 
819  FwIndexType portNum,
820  Fw::InputSerializePort* port
821  )
822  {
823  FW_ASSERT(
824  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
825  static_cast<FwAssertArgType>(portNum)
826  );
827 
828  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
829  }
830 
833  FwIndexType portNum,
834  Fw::InputSerializePort* port
835  )
836  {
837  FW_ASSERT(
838  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
839  static_cast<FwAssertArgType>(portNum)
840  );
841 
842  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
843  }
844 
845 #endif
846 
847 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
848 
849  // ----------------------------------------------------------------------
850  // Connect serial input ports to typed output ports
851  // ----------------------------------------------------------------------
852 
855  FwIndexType portNum,
856  Fw::InputSerializePort* port
857  )
858  {
859  FW_ASSERT(
860  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
861  static_cast<FwAssertArgType>(portNum)
862  );
863 
864  this->m_comCmdOut_OutputPort[portNum].registerSerialPort(port);
865  }
866 
869  FwIndexType portNum,
870  Fw::InputSerializePort* port
871  )
872  {
873  FW_ASSERT(
874  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
875  static_cast<FwAssertArgType>(portNum)
876  );
877 
878  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
879  }
880 
883  FwIndexType portNum,
884  Fw::InputSerializePort* port
885  )
886  {
887  FW_ASSERT(
888  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
889  static_cast<FwAssertArgType>(portNum)
890  );
891 
892  this->m_seqDone_OutputPort[portNum].registerSerialPort(port);
893  }
894 
897  FwIndexType portNum,
898  Fw::InputSerializePort* port
899  )
900  {
901  FW_ASSERT(
902  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
903  static_cast<FwAssertArgType>(portNum)
904  );
905 
906  this->m_seqStartOut_OutputPort[portNum].registerSerialPort(port);
907  }
908 
909 #endif
910 
911  // ----------------------------------------------------------------------
912  // Command registration
913  // ----------------------------------------------------------------------
914 
917  {
919 
920  this->cmdRegOut_out(
921  0,
922  this->getIdBase() + OPCODE_CS_RUN
923  );
924 
925  this->cmdRegOut_out(
926  0,
927  this->getIdBase() + OPCODE_CS_VALIDATE
928  );
929 
930  this->cmdRegOut_out(
931  0,
932  this->getIdBase() + OPCODE_CS_CANCEL
933  );
934 
935  this->cmdRegOut_out(
936  0,
937  this->getIdBase() + OPCODE_CS_START
938  );
939 
940  this->cmdRegOut_out(
941  0,
942  this->getIdBase() + OPCODE_CS_STEP
943  );
944 
945  this->cmdRegOut_out(
946  0,
947  this->getIdBase() + OPCODE_CS_AUTO
948  );
949 
950  this->cmdRegOut_out(
951  0,
952  this->getIdBase() + OPCODE_CS_MANUAL
953  );
954 
955  this->cmdRegOut_out(
956  0,
958  );
959  }
960 
961  // ----------------------------------------------------------------------
962  // Component construction and destruction
963  // ----------------------------------------------------------------------
964 
966  CmdSequencerComponentBase(const char* compName) :
967  Fw::ActiveComponentBase(compName)
968  {
969 
970  }
971 
974  {
975 
976  }
977 
978 #if !FW_DIRECT_PORT_CALLS
979 
980  // ----------------------------------------------------------------------
981  // Connection status queries for special output ports
982  // ----------------------------------------------------------------------
983 
984 #if FW_ENABLE_TEXT_LOGGING == 1
985 
986  bool CmdSequencerComponentBase ::
987  isConnected_LogText_OutputPort(FwIndexType portNum) const
988  {
989  FW_ASSERT(
990  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
991  static_cast<FwAssertArgType>(portNum)
992  );
993 
994  return this->m_LogText_OutputPort[portNum].isConnected();
995  }
996 
997 #endif
998 
1001  {
1002  FW_ASSERT(
1003  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1004  static_cast<FwAssertArgType>(portNum)
1005  );
1006 
1007  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1008  }
1009 
1012  {
1013  FW_ASSERT(
1014  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1015  static_cast<FwAssertArgType>(portNum)
1016  );
1017 
1018  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1019  }
1020 
1023  {
1024  FW_ASSERT(
1025  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1026  static_cast<FwAssertArgType>(portNum)
1027  );
1028 
1029  return this->m_logOut_OutputPort[portNum].isConnected();
1030  }
1031 
1034  {
1035  FW_ASSERT(
1036  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1037  static_cast<FwAssertArgType>(portNum)
1038  );
1039 
1040  return this->m_timeCaller_OutputPort[portNum].isConnected();
1041  }
1042 
1045  {
1046  FW_ASSERT(
1047  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1048  static_cast<FwAssertArgType>(portNum)
1049  );
1050 
1051  return this->m_tlmOut_OutputPort[portNum].isConnected();
1052  }
1053 
1054 #endif
1055 
1056 #if !FW_DIRECT_PORT_CALLS
1057 
1058  // ----------------------------------------------------------------------
1059  // Connection status queries for typed output ports
1060  // ----------------------------------------------------------------------
1061 
1064  {
1065  FW_ASSERT(
1066  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
1067  static_cast<FwAssertArgType>(portNum)
1068  );
1069 
1070  return this->m_comCmdOut_OutputPort[portNum].isConnected();
1071  }
1072 
1075  {
1076  FW_ASSERT(
1077  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1078  static_cast<FwAssertArgType>(portNum)
1079  );
1080 
1081  return this->m_pingOut_OutputPort[portNum].isConnected();
1082  }
1083 
1086  {
1087  FW_ASSERT(
1088  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
1089  static_cast<FwAssertArgType>(portNum)
1090  );
1091 
1092  return this->m_seqDone_OutputPort[portNum].isConnected();
1093  }
1094 
1097  {
1098  FW_ASSERT(
1099  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1100  static_cast<FwAssertArgType>(portNum)
1101  );
1102 
1103  return this->m_seqStartOut_OutputPort[portNum].isConnected();
1104  }
1105 
1106 #endif
1107 
1108  // ----------------------------------------------------------------------
1109  // Port handler base-class functions for special input ports
1110  //
1111  // Call these functions directly to bypass the corresponding ports
1112  // ----------------------------------------------------------------------
1113 
1116  FwIndexType portNum,
1117  FwOpcodeType opCode,
1118  U32 cmdSeq,
1119  Fw::CmdArgBuffer& args
1120  )
1121  {
1122 
1123  const U32 idBase = this->getIdBase();
1124  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1125 
1126  // Select base class function based on opcode
1127  switch (opCode - idBase) {
1128  case OPCODE_CS_RUN: {
1129  this->CS_RUN_cmdHandlerBase(
1130  opCode,
1131  cmdSeq,
1132  args
1133  );
1134  break;
1135  }
1136 
1137  case OPCODE_CS_VALIDATE: {
1139  opCode,
1140  cmdSeq,
1141  args
1142  );
1143  break;
1144  }
1145 
1146  case OPCODE_CS_CANCEL: {
1148  opCode,
1149  cmdSeq,
1150  args
1151  );
1152  break;
1153  }
1154 
1155  case OPCODE_CS_START: {
1157  opCode,
1158  cmdSeq,
1159  args
1160  );
1161  break;
1162  }
1163 
1164  case OPCODE_CS_STEP: {
1165  this->CS_STEP_cmdHandlerBase(
1166  opCode,
1167  cmdSeq,
1168  args
1169  );
1170  break;
1171  }
1172 
1173  case OPCODE_CS_AUTO: {
1174  this->CS_AUTO_cmdHandlerBase(
1175  opCode,
1176  cmdSeq,
1177  args
1178  );
1179  break;
1180  }
1181 
1182  case OPCODE_CS_MANUAL: {
1184  opCode,
1185  cmdSeq,
1186  args
1187  );
1188  break;
1189  }
1190 
1191  case OPCODE_CS_JOIN_WAIT: {
1193  opCode,
1194  cmdSeq,
1195  args
1196  );
1197  break;
1198  }
1199  default:
1200  // Unknown opcode: ignore it
1201  break;
1202  }
1203  }
1204 
1205  // ----------------------------------------------------------------------
1206  // Port handler base-class functions for typed input ports
1207  //
1208  // Call these functions directly to bypass the corresponding ports
1209  // ----------------------------------------------------------------------
1210 
1213  FwIndexType portNum,
1214  FwOpcodeType opCode,
1215  U32 cmdSeq,
1216  const Fw::CmdResponse& response
1217  )
1218  {
1219  // Make sure port number is valid
1220  FW_ASSERT(
1221  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
1222  static_cast<FwAssertArgType>(portNum)
1223  );
1224 
1225  // Call pre-message hook
1227  portNum,
1228  opCode,
1229  cmdSeq,
1230  response
1231  );
1232  ComponentIpcSerializableBuffer msg;
1234 
1235  // Serialize message ID
1236  _status = msg.serializeFrom(
1237  static_cast<FwEnumStoreType>(CMDRESPONSEIN_CMDRESPONSE)
1238  );
1239  FW_ASSERT(
1240  _status == Fw::FW_SERIALIZE_OK,
1241  static_cast<FwAssertArgType>(_status)
1242  );
1243 
1244  // Serialize port number
1245  _status = msg.serializeFrom(portNum);
1246  FW_ASSERT(
1247  _status == Fw::FW_SERIALIZE_OK,
1248  static_cast<FwAssertArgType>(_status)
1249  );
1250 
1251  // Serialize argument opCode
1252  _status = msg.serializeFrom(opCode);
1253  FW_ASSERT(
1254  _status == Fw::FW_SERIALIZE_OK,
1255  static_cast<FwAssertArgType>(_status)
1256  );
1257 
1258  // Serialize argument cmdSeq
1259  _status = msg.serializeFrom(cmdSeq);
1260  FW_ASSERT(
1261  _status == Fw::FW_SERIALIZE_OK,
1262  static_cast<FwAssertArgType>(_status)
1263  );
1264 
1265  // Serialize argument response
1266  _status = msg.serializeFrom(response);
1267  FW_ASSERT(
1268  _status == Fw::FW_SERIALIZE_OK,
1269  static_cast<FwAssertArgType>(_status)
1270  );
1271 
1272  // Send message
1274  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1275 
1276  FW_ASSERT(
1277  qStatus == Os::Queue::OP_OK,
1278  static_cast<FwAssertArgType>(qStatus)
1279  );
1280  }
1281 
1284  FwIndexType portNum,
1285  U32 key
1286  )
1287  {
1288  // Make sure port number is valid
1289  FW_ASSERT(
1290  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1291  static_cast<FwAssertArgType>(portNum)
1292  );
1293 
1294  // Call pre-message hook
1296  portNum,
1297  key
1298  );
1299  ComponentIpcSerializableBuffer msg;
1301 
1302  // Serialize message ID
1303  _status = msg.serializeFrom(
1304  static_cast<FwEnumStoreType>(PINGIN_PING)
1305  );
1306  FW_ASSERT(
1307  _status == Fw::FW_SERIALIZE_OK,
1308  static_cast<FwAssertArgType>(_status)
1309  );
1310 
1311  // Serialize port number
1312  _status = msg.serializeFrom(portNum);
1313  FW_ASSERT(
1314  _status == Fw::FW_SERIALIZE_OK,
1315  static_cast<FwAssertArgType>(_status)
1316  );
1317 
1318  // Serialize argument key
1319  _status = msg.serializeFrom(key);
1320  FW_ASSERT(
1321  _status == Fw::FW_SERIALIZE_OK,
1322  static_cast<FwAssertArgType>(_status)
1323  );
1324 
1325  // Send message
1327  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1328 
1329  FW_ASSERT(
1330  qStatus == Os::Queue::OP_OK,
1331  static_cast<FwAssertArgType>(qStatus)
1332  );
1333  }
1334 
1337  FwIndexType portNum,
1338  U32 context
1339  )
1340  {
1341  // Make sure port number is valid
1342  FW_ASSERT(
1343  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
1344  static_cast<FwAssertArgType>(portNum)
1345  );
1346 
1347  // Call pre-message hook
1349  portNum,
1350  context
1351  );
1352  ComponentIpcSerializableBuffer msg;
1354 
1355  // Serialize message ID
1356  _status = msg.serializeFrom(
1357  static_cast<FwEnumStoreType>(SCHEDIN_SCHED)
1358  );
1359  FW_ASSERT(
1360  _status == Fw::FW_SERIALIZE_OK,
1361  static_cast<FwAssertArgType>(_status)
1362  );
1363 
1364  // Serialize port number
1365  _status = msg.serializeFrom(portNum);
1366  FW_ASSERT(
1367  _status == Fw::FW_SERIALIZE_OK,
1368  static_cast<FwAssertArgType>(_status)
1369  );
1370 
1371  // Serialize argument context
1372  _status = msg.serializeFrom(context);
1373  FW_ASSERT(
1374  _status == Fw::FW_SERIALIZE_OK,
1375  static_cast<FwAssertArgType>(_status)
1376  );
1377 
1378  // Send message
1380  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1381 
1382  FW_ASSERT(
1383  qStatus == Os::Queue::OP_OK,
1384  static_cast<FwAssertArgType>(qStatus)
1385  );
1386  }
1387 
1390  {
1391  // Make sure port number is valid
1392  FW_ASSERT(
1393  (0 <= portNum) && (portNum < this->getNum_seqCancelIn_InputPorts()),
1394  static_cast<FwAssertArgType>(portNum)
1395  );
1396 
1397  // Call pre-message hook
1398  seqCancelIn_preMsgHook(portNum);
1399  ComponentIpcSerializableBuffer msg;
1401 
1402  // Serialize message ID
1403  _status = msg.serializeFrom(
1404  static_cast<FwEnumStoreType>(SEQCANCELIN_CMDSEQCANCEL)
1405  );
1406  FW_ASSERT(
1407  _status == Fw::FW_SERIALIZE_OK,
1408  static_cast<FwAssertArgType>(_status)
1409  );
1410 
1411  // Serialize port number
1412  _status = msg.serializeFrom(portNum);
1413  FW_ASSERT(
1414  _status == Fw::FW_SERIALIZE_OK,
1415  static_cast<FwAssertArgType>(_status)
1416  );
1417 
1418  // Send message
1420  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1421 
1422  FW_ASSERT(
1423  qStatus == Os::Queue::OP_OK,
1424  static_cast<FwAssertArgType>(qStatus)
1425  );
1426  }
1427 
1430  FwIndexType portNum,
1431  Fw::StringBase& file_name
1432  )
1433  {
1434  // Make sure port number is valid
1435  FW_ASSERT(
1436  (0 <= portNum) && (portNum < this->getNum_seqDispatchIn_InputPorts()),
1437  static_cast<FwAssertArgType>(portNum)
1438  );
1439 
1440  // Call pre-message hook
1442  portNum,
1443  file_name
1444  );
1445  ComponentIpcSerializableBuffer msg;
1447 
1448  // Serialize message ID
1449  _status = msg.serializeFrom(
1450  static_cast<FwEnumStoreType>(SEQDISPATCHIN_FILEDISPATCH)
1451  );
1452  FW_ASSERT(
1453  _status == Fw::FW_SERIALIZE_OK,
1454  static_cast<FwAssertArgType>(_status)
1455  );
1456 
1457  // Serialize port number
1458  _status = msg.serializeFrom(portNum);
1459  FW_ASSERT(
1460  _status == Fw::FW_SERIALIZE_OK,
1461  static_cast<FwAssertArgType>(_status)
1462  );
1463 
1464  // Serialize argument file_name
1465  _status = file_name.serializeTo(msg, static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE));
1466  FW_ASSERT(
1467  _status == Fw::FW_SERIALIZE_OK,
1468  static_cast<FwAssertArgType>(_status)
1469  );
1470 
1471  // Send message
1473  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1474 
1475  FW_ASSERT(
1476  qStatus == Os::Queue::OP_OK,
1477  static_cast<FwAssertArgType>(qStatus)
1478  );
1479  }
1480 
1483  FwIndexType portNum,
1484  const Fw::StringBase& filename
1485  )
1486  {
1487  // Make sure port number is valid
1488  FW_ASSERT(
1489  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
1490  static_cast<FwAssertArgType>(portNum)
1491  );
1492 
1493  // Call pre-message hook
1495  portNum,
1496  filename
1497  );
1498  ComponentIpcSerializableBuffer msg;
1500 
1501  // Serialize message ID
1502  _status = msg.serializeFrom(
1503  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
1504  );
1505  FW_ASSERT(
1506  _status == Fw::FW_SERIALIZE_OK,
1507  static_cast<FwAssertArgType>(_status)
1508  );
1509 
1510  // Serialize port number
1511  _status = msg.serializeFrom(portNum);
1512  FW_ASSERT(
1513  _status == Fw::FW_SERIALIZE_OK,
1514  static_cast<FwAssertArgType>(_status)
1515  );
1516 
1517  // Serialize argument filename
1518  _status = filename.serializeTo(msg, 240);
1519  FW_ASSERT(
1520  _status == Fw::FW_SERIALIZE_OK,
1521  static_cast<FwAssertArgType>(_status)
1522  );
1523 
1524  // Send message
1526  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1527 
1528  FW_ASSERT(
1529  qStatus == Os::Queue::OP_OK,
1530  static_cast<FwAssertArgType>(qStatus)
1531  );
1532  }
1533 
1534  // ----------------------------------------------------------------------
1535  // Pre-message hooks for typed async input ports
1536  //
1537  // Each of these functions is invoked just before processing a message
1538  // on the corresponding port. By default, they do nothing. You can
1539  // override them to provide specific pre-message behavior.
1540  // ----------------------------------------------------------------------
1541 
1544  FwIndexType portNum,
1545  FwOpcodeType opCode,
1546  U32 cmdSeq,
1547  const Fw::CmdResponse& response
1548  )
1549  {
1550  // Default: no-op
1551  }
1552 
1555  FwIndexType portNum,
1556  U32 key
1557  )
1558  {
1559  // Default: no-op
1560  }
1561 
1564  FwIndexType portNum,
1565  U32 context
1566  )
1567  {
1568  // Default: no-op
1569  }
1570 
1573  {
1574  // Default: no-op
1575  }
1576 
1579  FwIndexType portNum,
1580  Fw::StringBase& file_name
1581  )
1582  {
1583  // Default: no-op
1584  }
1585 
1588  FwIndexType portNum,
1589  const Fw::StringBase& filename
1590  )
1591  {
1592  // Default: no-op
1593  }
1594 
1595 #if !FW_DIRECT_PORT_CALLS
1596 
1597  // ----------------------------------------------------------------------
1598  // Invocation functions for typed output ports
1599  // ----------------------------------------------------------------------
1600 
1603  FwIndexType portNum,
1604  Fw::ComBuffer& data,
1605  U32 context
1606  ) const
1607  {
1608  FW_ASSERT(
1609  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
1610  static_cast<FwAssertArgType>(portNum)
1611  );
1612 
1613  FW_ASSERT(
1614  this->m_comCmdOut_OutputPort[portNum].isConnected(),
1615  static_cast<FwAssertArgType>(portNum)
1616  );
1617  this->m_comCmdOut_OutputPort[portNum].invoke(
1618  data,
1619  context
1620  );
1621  }
1622 
1625  FwIndexType portNum,
1626  U32 key
1627  ) const
1628  {
1629  FW_ASSERT(
1630  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1631  static_cast<FwAssertArgType>(portNum)
1632  );
1633 
1634  FW_ASSERT(
1635  this->m_pingOut_OutputPort[portNum].isConnected(),
1636  static_cast<FwAssertArgType>(portNum)
1637  );
1638  this->m_pingOut_OutputPort[portNum].invoke(
1639  key
1640  );
1641  }
1642 
1645  FwIndexType portNum,
1646  FwOpcodeType opCode,
1647  U32 cmdSeq,
1648  const Fw::CmdResponse& response
1649  ) const
1650  {
1651  FW_ASSERT(
1652  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
1653  static_cast<FwAssertArgType>(portNum)
1654  );
1655 
1656  FW_ASSERT(
1657  this->m_seqDone_OutputPort[portNum].isConnected(),
1658  static_cast<FwAssertArgType>(portNum)
1659  );
1660  this->m_seqDone_OutputPort[portNum].invoke(
1661  opCode,
1662  cmdSeq,
1663  response
1664  );
1665  }
1666 
1669  FwIndexType portNum,
1670  const Fw::StringBase& filename
1671  ) const
1672  {
1673  FW_ASSERT(
1674  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1675  static_cast<FwAssertArgType>(portNum)
1676  );
1677 
1678  FW_ASSERT(
1679  this->m_seqStartOut_OutputPort[portNum].isConnected(),
1680  static_cast<FwAssertArgType>(portNum)
1681  );
1682  this->m_seqStartOut_OutputPort[portNum].invoke(
1683  filename
1684  );
1685  }
1686 
1687 #endif
1688 
1689  // ----------------------------------------------------------------------
1690  // Command response
1691  // ----------------------------------------------------------------------
1692 
1695  FwOpcodeType opCode,
1696  U32 cmdSeq,
1697  Fw::CmdResponse response
1698  )
1699  {
1701  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1702  }
1703 
1704  // ----------------------------------------------------------------------
1705  // Command handler base-class functions
1706  //
1707  // Call these functions directly to bypass the command input port
1708  // ----------------------------------------------------------------------
1709 
1712  FwOpcodeType opCode,
1713  U32 cmdSeq,
1714  Fw::CmdArgBuffer& args
1715  )
1716  {
1717  // Call pre-message hook
1718  this->CS_RUN_preMsgHook(opCode,cmdSeq);
1719 
1720  // Defer deserializing arguments to the message dispatcher
1721  // to avoid deserializing and reserializing just for IPC
1722  ComponentIpcSerializableBuffer msg;
1724 
1725  // Serialize for IPC
1726  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_RUN));
1727  FW_ASSERT (
1728  _status == Fw::FW_SERIALIZE_OK,
1729  static_cast<FwAssertArgType>(_status)
1730  );
1731 
1732  // Fake port number to make message dequeue work
1733  FwIndexType port = 0;
1734 
1735  _status = msg.serializeFrom(port);
1736  FW_ASSERT (
1737  _status == Fw::FW_SERIALIZE_OK,
1738  static_cast<FwAssertArgType>(_status)
1739  );
1740 
1741  _status = msg.serializeFrom(opCode);
1742  FW_ASSERT (
1743  _status == Fw::FW_SERIALIZE_OK,
1744  static_cast<FwAssertArgType>(_status)
1745  );
1746 
1747  _status = msg.serializeFrom(cmdSeq);
1748  FW_ASSERT (
1749  _status == Fw::FW_SERIALIZE_OK,
1750  static_cast<FwAssertArgType>(_status)
1751  );
1752 
1753  _status = msg.serializeFrom(args);
1754  FW_ASSERT (
1755  _status == Fw::FW_SERIALIZE_OK,
1756  static_cast<FwAssertArgType>(_status)
1757  );
1758 
1759  // Send message
1761  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1762 
1763  FW_ASSERT(
1764  qStatus == Os::Queue::OP_OK,
1765  static_cast<FwAssertArgType>(qStatus)
1766  );
1767  }
1768 
1771  FwOpcodeType opCode,
1772  U32 cmdSeq,
1773  Fw::CmdArgBuffer& args
1774  )
1775  {
1776  // Call pre-message hook
1777  this->CS_VALIDATE_preMsgHook(opCode,cmdSeq);
1778 
1779  // Defer deserializing arguments to the message dispatcher
1780  // to avoid deserializing and reserializing just for IPC
1781  ComponentIpcSerializableBuffer msg;
1783 
1784  // Serialize for IPC
1785  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_VALIDATE));
1786  FW_ASSERT (
1787  _status == Fw::FW_SERIALIZE_OK,
1788  static_cast<FwAssertArgType>(_status)
1789  );
1790 
1791  // Fake port number to make message dequeue work
1792  FwIndexType port = 0;
1793 
1794  _status = msg.serializeFrom(port);
1795  FW_ASSERT (
1796  _status == Fw::FW_SERIALIZE_OK,
1797  static_cast<FwAssertArgType>(_status)
1798  );
1799 
1800  _status = msg.serializeFrom(opCode);
1801  FW_ASSERT (
1802  _status == Fw::FW_SERIALIZE_OK,
1803  static_cast<FwAssertArgType>(_status)
1804  );
1805 
1806  _status = msg.serializeFrom(cmdSeq);
1807  FW_ASSERT (
1808  _status == Fw::FW_SERIALIZE_OK,
1809  static_cast<FwAssertArgType>(_status)
1810  );
1811 
1812  _status = msg.serializeFrom(args);
1813  FW_ASSERT (
1814  _status == Fw::FW_SERIALIZE_OK,
1815  static_cast<FwAssertArgType>(_status)
1816  );
1817 
1818  // Send message
1820  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1821 
1822  FW_ASSERT(
1823  qStatus == Os::Queue::OP_OK,
1824  static_cast<FwAssertArgType>(qStatus)
1825  );
1826  }
1827 
1830  FwOpcodeType opCode,
1831  U32 cmdSeq,
1832  Fw::CmdArgBuffer& args
1833  )
1834  {
1835  // Call pre-message hook
1836  this->CS_CANCEL_preMsgHook(opCode,cmdSeq);
1837 
1838  // Defer deserializing arguments to the message dispatcher
1839  // to avoid deserializing and reserializing just for IPC
1840  ComponentIpcSerializableBuffer msg;
1842 
1843  // Serialize for IPC
1844  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_CANCEL));
1845  FW_ASSERT (
1846  _status == Fw::FW_SERIALIZE_OK,
1847  static_cast<FwAssertArgType>(_status)
1848  );
1849 
1850  // Fake port number to make message dequeue work
1851  FwIndexType port = 0;
1852 
1853  _status = msg.serializeFrom(port);
1854  FW_ASSERT (
1855  _status == Fw::FW_SERIALIZE_OK,
1856  static_cast<FwAssertArgType>(_status)
1857  );
1858 
1859  _status = msg.serializeFrom(opCode);
1860  FW_ASSERT (
1861  _status == Fw::FW_SERIALIZE_OK,
1862  static_cast<FwAssertArgType>(_status)
1863  );
1864 
1865  _status = msg.serializeFrom(cmdSeq);
1866  FW_ASSERT (
1867  _status == Fw::FW_SERIALIZE_OK,
1868  static_cast<FwAssertArgType>(_status)
1869  );
1870 
1871  _status = msg.serializeFrom(args);
1872  FW_ASSERT (
1873  _status == Fw::FW_SERIALIZE_OK,
1874  static_cast<FwAssertArgType>(_status)
1875  );
1876 
1877  // Send message
1879  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1880 
1881  FW_ASSERT(
1882  qStatus == Os::Queue::OP_OK,
1883  static_cast<FwAssertArgType>(qStatus)
1884  );
1885  }
1886 
1889  FwOpcodeType opCode,
1890  U32 cmdSeq,
1891  Fw::CmdArgBuffer& args
1892  )
1893  {
1894  // Call pre-message hook
1895  this->CS_START_preMsgHook(opCode,cmdSeq);
1896 
1897  // Defer deserializing arguments to the message dispatcher
1898  // to avoid deserializing and reserializing just for IPC
1899  ComponentIpcSerializableBuffer msg;
1901 
1902  // Serialize for IPC
1903  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_START));
1904  FW_ASSERT (
1905  _status == Fw::FW_SERIALIZE_OK,
1906  static_cast<FwAssertArgType>(_status)
1907  );
1908 
1909  // Fake port number to make message dequeue work
1910  FwIndexType port = 0;
1911 
1912  _status = msg.serializeFrom(port);
1913  FW_ASSERT (
1914  _status == Fw::FW_SERIALIZE_OK,
1915  static_cast<FwAssertArgType>(_status)
1916  );
1917 
1918  _status = msg.serializeFrom(opCode);
1919  FW_ASSERT (
1920  _status == Fw::FW_SERIALIZE_OK,
1921  static_cast<FwAssertArgType>(_status)
1922  );
1923 
1924  _status = msg.serializeFrom(cmdSeq);
1925  FW_ASSERT (
1926  _status == Fw::FW_SERIALIZE_OK,
1927  static_cast<FwAssertArgType>(_status)
1928  );
1929 
1930  _status = msg.serializeFrom(args);
1931  FW_ASSERT (
1932  _status == Fw::FW_SERIALIZE_OK,
1933  static_cast<FwAssertArgType>(_status)
1934  );
1935 
1936  // Send message
1938  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1939 
1940  FW_ASSERT(
1941  qStatus == Os::Queue::OP_OK,
1942  static_cast<FwAssertArgType>(qStatus)
1943  );
1944  }
1945 
1948  FwOpcodeType opCode,
1949  U32 cmdSeq,
1950  Fw::CmdArgBuffer& args
1951  )
1952  {
1953  // Call pre-message hook
1954  this->CS_STEP_preMsgHook(opCode,cmdSeq);
1955 
1956  // Defer deserializing arguments to the message dispatcher
1957  // to avoid deserializing and reserializing just for IPC
1958  ComponentIpcSerializableBuffer msg;
1960 
1961  // Serialize for IPC
1962  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_STEP));
1963  FW_ASSERT (
1964  _status == Fw::FW_SERIALIZE_OK,
1965  static_cast<FwAssertArgType>(_status)
1966  );
1967 
1968  // Fake port number to make message dequeue work
1969  FwIndexType port = 0;
1970 
1971  _status = msg.serializeFrom(port);
1972  FW_ASSERT (
1973  _status == Fw::FW_SERIALIZE_OK,
1974  static_cast<FwAssertArgType>(_status)
1975  );
1976 
1977  _status = msg.serializeFrom(opCode);
1978  FW_ASSERT (
1979  _status == Fw::FW_SERIALIZE_OK,
1980  static_cast<FwAssertArgType>(_status)
1981  );
1982 
1983  _status = msg.serializeFrom(cmdSeq);
1984  FW_ASSERT (
1985  _status == Fw::FW_SERIALIZE_OK,
1986  static_cast<FwAssertArgType>(_status)
1987  );
1988 
1989  _status = msg.serializeFrom(args);
1990  FW_ASSERT (
1991  _status == Fw::FW_SERIALIZE_OK,
1992  static_cast<FwAssertArgType>(_status)
1993  );
1994 
1995  // Send message
1997  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1998 
1999  FW_ASSERT(
2000  qStatus == Os::Queue::OP_OK,
2001  static_cast<FwAssertArgType>(qStatus)
2002  );
2003  }
2004 
2007  FwOpcodeType opCode,
2008  U32 cmdSeq,
2009  Fw::CmdArgBuffer& args
2010  )
2011  {
2012  // Call pre-message hook
2013  this->CS_AUTO_preMsgHook(opCode,cmdSeq);
2014 
2015  // Defer deserializing arguments to the message dispatcher
2016  // to avoid deserializing and reserializing just for IPC
2017  ComponentIpcSerializableBuffer msg;
2019 
2020  // Serialize for IPC
2021  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_AUTO));
2022  FW_ASSERT (
2023  _status == Fw::FW_SERIALIZE_OK,
2024  static_cast<FwAssertArgType>(_status)
2025  );
2026 
2027  // Fake port number to make message dequeue work
2028  FwIndexType port = 0;
2029 
2030  _status = msg.serializeFrom(port);
2031  FW_ASSERT (
2032  _status == Fw::FW_SERIALIZE_OK,
2033  static_cast<FwAssertArgType>(_status)
2034  );
2035 
2036  _status = msg.serializeFrom(opCode);
2037  FW_ASSERT (
2038  _status == Fw::FW_SERIALIZE_OK,
2039  static_cast<FwAssertArgType>(_status)
2040  );
2041 
2042  _status = msg.serializeFrom(cmdSeq);
2043  FW_ASSERT (
2044  _status == Fw::FW_SERIALIZE_OK,
2045  static_cast<FwAssertArgType>(_status)
2046  );
2047 
2048  _status = msg.serializeFrom(args);
2049  FW_ASSERT (
2050  _status == Fw::FW_SERIALIZE_OK,
2051  static_cast<FwAssertArgType>(_status)
2052  );
2053 
2054  // Send message
2056  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2057 
2058  FW_ASSERT(
2059  qStatus == Os::Queue::OP_OK,
2060  static_cast<FwAssertArgType>(qStatus)
2061  );
2062  }
2063 
2066  FwOpcodeType opCode,
2067  U32 cmdSeq,
2068  Fw::CmdArgBuffer& args
2069  )
2070  {
2071  // Call pre-message hook
2072  this->CS_MANUAL_preMsgHook(opCode,cmdSeq);
2073 
2074  // Defer deserializing arguments to the message dispatcher
2075  // to avoid deserializing and reserializing just for IPC
2076  ComponentIpcSerializableBuffer msg;
2078 
2079  // Serialize for IPC
2080  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_MANUAL));
2081  FW_ASSERT (
2082  _status == Fw::FW_SERIALIZE_OK,
2083  static_cast<FwAssertArgType>(_status)
2084  );
2085 
2086  // Fake port number to make message dequeue work
2087  FwIndexType port = 0;
2088 
2089  _status = msg.serializeFrom(port);
2090  FW_ASSERT (
2091  _status == Fw::FW_SERIALIZE_OK,
2092  static_cast<FwAssertArgType>(_status)
2093  );
2094 
2095  _status = msg.serializeFrom(opCode);
2096  FW_ASSERT (
2097  _status == Fw::FW_SERIALIZE_OK,
2098  static_cast<FwAssertArgType>(_status)
2099  );
2100 
2101  _status = msg.serializeFrom(cmdSeq);
2102  FW_ASSERT (
2103  _status == Fw::FW_SERIALIZE_OK,
2104  static_cast<FwAssertArgType>(_status)
2105  );
2106 
2107  _status = msg.serializeFrom(args);
2108  FW_ASSERT (
2109  _status == Fw::FW_SERIALIZE_OK,
2110  static_cast<FwAssertArgType>(_status)
2111  );
2112 
2113  // Send message
2115  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2116 
2117  FW_ASSERT(
2118  qStatus == Os::Queue::OP_OK,
2119  static_cast<FwAssertArgType>(qStatus)
2120  );
2121  }
2122 
2125  FwOpcodeType opCode,
2126  U32 cmdSeq,
2127  Fw::CmdArgBuffer& args
2128  )
2129  {
2130  // Call pre-message hook
2131  this->CS_JOIN_WAIT_preMsgHook(opCode,cmdSeq);
2132 
2133  // Defer deserializing arguments to the message dispatcher
2134  // to avoid deserializing and reserializing just for IPC
2135  ComponentIpcSerializableBuffer msg;
2137 
2138  // Serialize for IPC
2139  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_JOIN_WAIT));
2140  FW_ASSERT (
2141  _status == Fw::FW_SERIALIZE_OK,
2142  static_cast<FwAssertArgType>(_status)
2143  );
2144 
2145  // Fake port number to make message dequeue work
2146  FwIndexType port = 0;
2147 
2148  _status = msg.serializeFrom(port);
2149  FW_ASSERT (
2150  _status == Fw::FW_SERIALIZE_OK,
2151  static_cast<FwAssertArgType>(_status)
2152  );
2153 
2154  _status = msg.serializeFrom(opCode);
2155  FW_ASSERT (
2156  _status == Fw::FW_SERIALIZE_OK,
2157  static_cast<FwAssertArgType>(_status)
2158  );
2159 
2160  _status = msg.serializeFrom(cmdSeq);
2161  FW_ASSERT (
2162  _status == Fw::FW_SERIALIZE_OK,
2163  static_cast<FwAssertArgType>(_status)
2164  );
2165 
2166  _status = msg.serializeFrom(args);
2167  FW_ASSERT (
2168  _status == Fw::FW_SERIALIZE_OK,
2169  static_cast<FwAssertArgType>(_status)
2170  );
2171 
2172  // Send message
2174  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2175 
2176  FW_ASSERT(
2177  qStatus == Os::Queue::OP_OK,
2178  static_cast<FwAssertArgType>(qStatus)
2179  );
2180  }
2181 
2182  // ----------------------------------------------------------------------
2183  // Pre-message hooks for async commands
2184  //
2185  // Each of these functions is invoked just before processing the
2186  // corresponding command. By default they do nothing. You can
2187  // override them to provide specific pre-command behavior.
2188  // ----------------------------------------------------------------------
2189 
2192  FwOpcodeType opCode,
2193  U32 cmdSeq
2194  )
2195  {
2196  // Defaults to no-op; can be overridden
2197  (void) opCode;
2198  (void) cmdSeq;
2199  }
2200 
2203  FwOpcodeType opCode,
2204  U32 cmdSeq
2205  )
2206  {
2207  // Defaults to no-op; can be overridden
2208  (void) opCode;
2209  (void) cmdSeq;
2210  }
2211 
2214  FwOpcodeType opCode,
2215  U32 cmdSeq
2216  )
2217  {
2218  // Defaults to no-op; can be overridden
2219  (void) opCode;
2220  (void) cmdSeq;
2221  }
2222 
2225  FwOpcodeType opCode,
2226  U32 cmdSeq
2227  )
2228  {
2229  // Defaults to no-op; can be overridden
2230  (void) opCode;
2231  (void) cmdSeq;
2232  }
2233 
2236  FwOpcodeType opCode,
2237  U32 cmdSeq
2238  )
2239  {
2240  // Defaults to no-op; can be overridden
2241  (void) opCode;
2242  (void) cmdSeq;
2243  }
2244 
2247  FwOpcodeType opCode,
2248  U32 cmdSeq
2249  )
2250  {
2251  // Defaults to no-op; can be overridden
2252  (void) opCode;
2253  (void) cmdSeq;
2254  }
2255 
2258  FwOpcodeType opCode,
2259  U32 cmdSeq
2260  )
2261  {
2262  // Defaults to no-op; can be overridden
2263  (void) opCode;
2264  (void) cmdSeq;
2265  }
2266 
2269  FwOpcodeType opCode,
2270  U32 cmdSeq
2271  )
2272  {
2273  // Defaults to no-op; can be overridden
2274  (void) opCode;
2275  (void) cmdSeq;
2276  }
2277 
2278  // ----------------------------------------------------------------------
2279  // Event logging functions
2280  // ----------------------------------------------------------------------
2281 
2284  {
2285  // Get the time
2286  Fw::Time _logTime;
2287  if (this->isConnected_timeCaller_OutputPort(0)) {
2288  this->timeCaller_out(0, _logTime);
2289  }
2290 
2291  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCELOADED;
2292 
2293  // Emit the event on the log port
2294  if (this->isConnected_logOut_OutputPort(0)) {
2295  Fw::LogBuffer _logBuff;
2297 
2298 #if FW_AMPCS_COMPATIBLE
2299  // Serialize the number of arguments
2300  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2301  FW_ASSERT(
2302  _status == Fw::FW_SERIALIZE_OK,
2303  static_cast<FwAssertArgType>(_status)
2304  );
2305 #endif
2306 
2307  _status = fileName.serializeTo(
2308  _logBuff,
2309  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2310  );
2311  FW_ASSERT(
2312  _status == Fw::FW_SERIALIZE_OK,
2313  static_cast<FwAssertArgType>(_status)
2314  );
2315 
2316  this->logOut_out(
2317  0,
2318  _id,
2319  _logTime,
2321  _logBuff
2322  );
2323  }
2324 
2325  // Emit the event on the text log port
2326 #if FW_ENABLE_TEXT_LOGGING
2327  if (this->isConnected_LogText_OutputPort(0)) {
2328 #if FW_OBJECT_NAMES == 1
2329  const char* _formatString =
2330  "(%s) %s: Loaded sequence %s";
2331 #else
2332  const char* _formatString =
2333  "%s: Loaded sequence %s";
2334 #endif
2335 
2336  Fw::TextLogString _logString;
2337  _logString.format(
2338  _formatString,
2339 #if FW_OBJECT_NAMES == 1
2340  this->m_objName.toChar(),
2341 #endif
2342  "CS_SequenceLoaded ",
2343  fileName.toChar()
2344  );
2345 
2346  this->LogText_out(
2347  0,
2348  _id,
2349  _logTime,
2351  _logString
2352  );
2353  }
2354 #endif
2355  }
2356 
2359  {
2360  // Get the time
2361  Fw::Time _logTime;
2362  if (this->isConnected_timeCaller_OutputPort(0)) {
2363  this->timeCaller_out(0, _logTime);
2364  }
2365 
2366  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCECANCELED;
2367 
2368  // Emit the event on the log port
2369  if (this->isConnected_logOut_OutputPort(0)) {
2370  Fw::LogBuffer _logBuff;
2372 
2373 #if FW_AMPCS_COMPATIBLE
2374  // Serialize the number of arguments
2375  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2376  FW_ASSERT(
2377  _status == Fw::FW_SERIALIZE_OK,
2378  static_cast<FwAssertArgType>(_status)
2379  );
2380 #endif
2381 
2382  _status = fileName.serializeTo(
2383  _logBuff,
2384  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2385  );
2386  FW_ASSERT(
2387  _status == Fw::FW_SERIALIZE_OK,
2388  static_cast<FwAssertArgType>(_status)
2389  );
2390 
2391  this->logOut_out(
2392  0,
2393  _id,
2394  _logTime,
2396  _logBuff
2397  );
2398  }
2399 
2400  // Emit the event on the text log port
2401 #if FW_ENABLE_TEXT_LOGGING
2402  if (this->isConnected_LogText_OutputPort(0)) {
2403 #if FW_OBJECT_NAMES == 1
2404  const char* _formatString =
2405  "(%s) %s: Sequence file %s canceled";
2406 #else
2407  const char* _formatString =
2408  "%s: Sequence file %s canceled";
2409 #endif
2410 
2411  Fw::TextLogString _logString;
2412  _logString.format(
2413  _formatString,
2414 #if FW_OBJECT_NAMES == 1
2415  this->m_objName.toChar(),
2416 #endif
2417  "CS_SequenceCanceled ",
2418  fileName.toChar()
2419  );
2420 
2421  this->LogText_out(
2422  0,
2423  _id,
2424  _logTime,
2426  _logString
2427  );
2428  }
2429 #endif
2430  }
2431 
2434  {
2435  // Get the time
2436  Fw::Time _logTime;
2437  if (this->isConnected_timeCaller_OutputPort(0)) {
2438  this->timeCaller_out(0, _logTime);
2439  }
2440 
2441  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILEREADERROR;
2442 
2443  // Emit the event on the log port
2444  if (this->isConnected_logOut_OutputPort(0)) {
2445  Fw::LogBuffer _logBuff;
2447 
2448 #if FW_AMPCS_COMPATIBLE
2449  // Serialize the number of arguments
2450  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2451  FW_ASSERT(
2452  _status == Fw::FW_SERIALIZE_OK,
2453  static_cast<FwAssertArgType>(_status)
2454  );
2455 #endif
2456 
2457  _status = fileName.serializeTo(
2458  _logBuff,
2459  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2460  );
2461  FW_ASSERT(
2462  _status == Fw::FW_SERIALIZE_OK,
2463  static_cast<FwAssertArgType>(_status)
2464  );
2465 
2466  this->logOut_out(
2467  0,
2468  _id,
2469  _logTime,
2471  _logBuff
2472  );
2473  }
2474 
2475  // Emit the event on the text log port
2476 #if FW_ENABLE_TEXT_LOGGING
2477  if (this->isConnected_LogText_OutputPort(0)) {
2478 #if FW_OBJECT_NAMES == 1
2479  const char* _formatString =
2480  "(%s) %s: Error reading sequence file %s";
2481 #else
2482  const char* _formatString =
2483  "%s: Error reading sequence file %s";
2484 #endif
2485 
2486  Fw::TextLogString _logString;
2487  _logString.format(
2488  _formatString,
2489 #if FW_OBJECT_NAMES == 1
2490  this->m_objName.toChar(),
2491 #endif
2492  "CS_FileReadError ",
2493  fileName.toChar()
2494  );
2495 
2496  this->LogText_out(
2497  0,
2498  _id,
2499  _logTime,
2501  _logString
2502  );
2503  }
2504 #endif
2505  }
2506 
2509  const Fw::StringBase& fileName,
2511  I32 error
2512  ) const
2513  {
2514  // Get the time
2515  Fw::Time _logTime;
2516  if (this->isConnected_timeCaller_OutputPort(0)) {
2517  this->timeCaller_out(0, _logTime);
2518  }
2519 
2520  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILEINVALID;
2521 
2522  // Emit the event on the log port
2523  if (this->isConnected_logOut_OutputPort(0)) {
2524  Fw::LogBuffer _logBuff;
2526 
2527 #if FW_AMPCS_COMPATIBLE
2528  // Serialize the number of arguments
2529  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2530  FW_ASSERT(
2531  _status == Fw::FW_SERIALIZE_OK,
2532  static_cast<FwAssertArgType>(_status)
2533  );
2534 #endif
2535 
2536  _status = fileName.serializeTo(
2537  _logBuff,
2538  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2539  );
2540  FW_ASSERT(
2541  _status == Fw::FW_SERIALIZE_OK,
2542  static_cast<FwAssertArgType>(_status)
2543  );
2544 
2545 #if FW_AMPCS_COMPATIBLE
2546  // Serialize the argument size
2547  _status = _logBuff.serializeFrom(
2549  );
2550  FW_ASSERT(
2551  _status == Fw::FW_SERIALIZE_OK,
2552  static_cast<FwAssertArgType>(_status)
2553  );
2554 #endif
2555  _status = _logBuff.serializeFrom(stage);
2556  FW_ASSERT(
2557  _status == Fw::FW_SERIALIZE_OK,
2558  static_cast<FwAssertArgType>(_status)
2559  );
2560 
2561 #if FW_AMPCS_COMPATIBLE
2562  // Serialize the argument size
2563  _status = _logBuff.serializeFrom(
2564  static_cast<U8>(sizeof(I32))
2565  );
2566  FW_ASSERT(
2567  _status == Fw::FW_SERIALIZE_OK,
2568  static_cast<FwAssertArgType>(_status)
2569  );
2570 #endif
2571  _status = _logBuff.serializeFrom(error);
2572  FW_ASSERT(
2573  _status == Fw::FW_SERIALIZE_OK,
2574  static_cast<FwAssertArgType>(_status)
2575  );
2576 
2577  this->logOut_out(
2578  0,
2579  _id,
2580  _logTime,
2582  _logBuff
2583  );
2584  }
2585 
2586  // Emit the event on the text log port
2587 #if FW_ENABLE_TEXT_LOGGING
2588  if (this->isConnected_LogText_OutputPort(0)) {
2589 #if FW_OBJECT_NAMES == 1
2590  const char* _formatString =
2591  "(%s) %s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2592 #else
2593  const char* _formatString =
2594  "%s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2595 #endif
2596 
2597  Fw::String stageStr;
2598  stage.toString(stageStr);
2599 
2600  Fw::TextLogString _logString;
2601  _logString.format(
2602  _formatString,
2603 #if FW_OBJECT_NAMES == 1
2604  this->m_objName.toChar(),
2605 #endif
2606  "CS_FileInvalid ",
2607  fileName.toChar(),
2608  stageStr.toChar(),
2609  error
2610  );
2611 
2612  this->LogText_out(
2613  0,
2614  _id,
2615  _logTime,
2617  _logString
2618  );
2619  }
2620 #endif
2621  }
2622 
2625  const Fw::StringBase& fileName,
2626  U32 recordNumber,
2627  I32 error
2628  ) const
2629  {
2630  // Get the time
2631  Fw::Time _logTime;
2632  if (this->isConnected_timeCaller_OutputPort(0)) {
2633  this->timeCaller_out(0, _logTime);
2634  }
2635 
2636  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_RECORDINVALID;
2637 
2638  // Emit the event on the log port
2639  if (this->isConnected_logOut_OutputPort(0)) {
2640  Fw::LogBuffer _logBuff;
2642 
2643 #if FW_AMPCS_COMPATIBLE
2644  // Serialize the number of arguments
2645  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2646  FW_ASSERT(
2647  _status == Fw::FW_SERIALIZE_OK,
2648  static_cast<FwAssertArgType>(_status)
2649  );
2650 #endif
2651 
2652  _status = fileName.serializeTo(
2653  _logBuff,
2654  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2655  );
2656  FW_ASSERT(
2657  _status == Fw::FW_SERIALIZE_OK,
2658  static_cast<FwAssertArgType>(_status)
2659  );
2660 
2661 #if FW_AMPCS_COMPATIBLE
2662  // Serialize the argument size
2663  _status = _logBuff.serializeFrom(
2664  static_cast<U8>(sizeof(U32))
2665  );
2666  FW_ASSERT(
2667  _status == Fw::FW_SERIALIZE_OK,
2668  static_cast<FwAssertArgType>(_status)
2669  );
2670 #endif
2671  _status = _logBuff.serializeFrom(recordNumber);
2672  FW_ASSERT(
2673  _status == Fw::FW_SERIALIZE_OK,
2674  static_cast<FwAssertArgType>(_status)
2675  );
2676 
2677 #if FW_AMPCS_COMPATIBLE
2678  // Serialize the argument size
2679  _status = _logBuff.serializeFrom(
2680  static_cast<U8>(sizeof(I32))
2681  );
2682  FW_ASSERT(
2683  _status == Fw::FW_SERIALIZE_OK,
2684  static_cast<FwAssertArgType>(_status)
2685  );
2686 #endif
2687  _status = _logBuff.serializeFrom(error);
2688  FW_ASSERT(
2689  _status == Fw::FW_SERIALIZE_OK,
2690  static_cast<FwAssertArgType>(_status)
2691  );
2692 
2693  this->logOut_out(
2694  0,
2695  _id,
2696  _logTime,
2698  _logBuff
2699  );
2700  }
2701 
2702  // Emit the event on the text log port
2703 #if FW_ENABLE_TEXT_LOGGING
2704  if (this->isConnected_LogText_OutputPort(0)) {
2705 #if FW_OBJECT_NAMES == 1
2706  const char* _formatString =
2707  "(%s) %s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2708 #else
2709  const char* _formatString =
2710  "%s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2711 #endif
2712 
2713  Fw::TextLogString _logString;
2714  _logString.format(
2715  _formatString,
2716 #if FW_OBJECT_NAMES == 1
2717  this->m_objName.toChar(),
2718 #endif
2719  "CS_RecordInvalid ",
2720  fileName.toChar(),
2721  recordNumber,
2722  error
2723  );
2724 
2725  this->LogText_out(
2726  0,
2727  _id,
2728  _logTime,
2730  _logString
2731  );
2732  }
2733 #endif
2734  }
2735 
2738  const Fw::StringBase& fileName,
2739  U32 size
2740  ) const
2741  {
2742  // Get the time
2743  Fw::Time _logTime;
2744  if (this->isConnected_timeCaller_OutputPort(0)) {
2745  this->timeCaller_out(0, _logTime);
2746  }
2747 
2748  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILESIZEERROR;
2749 
2750  // Emit the event on the log port
2751  if (this->isConnected_logOut_OutputPort(0)) {
2752  Fw::LogBuffer _logBuff;
2754 
2755 #if FW_AMPCS_COMPATIBLE
2756  // Serialize the number of arguments
2757  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2758  FW_ASSERT(
2759  _status == Fw::FW_SERIALIZE_OK,
2760  static_cast<FwAssertArgType>(_status)
2761  );
2762 #endif
2763 
2764  _status = fileName.serializeTo(
2765  _logBuff,
2766  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2767  );
2768  FW_ASSERT(
2769  _status == Fw::FW_SERIALIZE_OK,
2770  static_cast<FwAssertArgType>(_status)
2771  );
2772 
2773 #if FW_AMPCS_COMPATIBLE
2774  // Serialize the argument size
2775  _status = _logBuff.serializeFrom(
2776  static_cast<U8>(sizeof(U32))
2777  );
2778  FW_ASSERT(
2779  _status == Fw::FW_SERIALIZE_OK,
2780  static_cast<FwAssertArgType>(_status)
2781  );
2782 #endif
2783  _status = _logBuff.serializeFrom(size);
2784  FW_ASSERT(
2785  _status == Fw::FW_SERIALIZE_OK,
2786  static_cast<FwAssertArgType>(_status)
2787  );
2788 
2789  this->logOut_out(
2790  0,
2791  _id,
2792  _logTime,
2794  _logBuff
2795  );
2796  }
2797 
2798  // Emit the event on the text log port
2799 #if FW_ENABLE_TEXT_LOGGING
2800  if (this->isConnected_LogText_OutputPort(0)) {
2801 #if FW_OBJECT_NAMES == 1
2802  const char* _formatString =
2803  "(%s) %s: Sequence file %s too large. Size: %" PRIu32 "";
2804 #else
2805  const char* _formatString =
2806  "%s: Sequence file %s too large. Size: %" PRIu32 "";
2807 #endif
2808 
2809  Fw::TextLogString _logString;
2810  _logString.format(
2811  _formatString,
2812 #if FW_OBJECT_NAMES == 1
2813  this->m_objName.toChar(),
2814 #endif
2815  "CS_FileSizeError ",
2816  fileName.toChar(),
2817  size
2818  );
2819 
2820  this->LogText_out(
2821  0,
2822  _id,
2823  _logTime,
2825  _logString
2826  );
2827  }
2828 #endif
2829  }
2830 
2833  {
2834  // Get the time
2835  Fw::Time _logTime;
2836  if (this->isConnected_timeCaller_OutputPort(0)) {
2837  this->timeCaller_out(0, _logTime);
2838  }
2839 
2840  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILENOTFOUND;
2841 
2842  // Emit the event on the log port
2843  if (this->isConnected_logOut_OutputPort(0)) {
2844  Fw::LogBuffer _logBuff;
2846 
2847 #if FW_AMPCS_COMPATIBLE
2848  // Serialize the number of arguments
2849  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2850  FW_ASSERT(
2851  _status == Fw::FW_SERIALIZE_OK,
2852  static_cast<FwAssertArgType>(_status)
2853  );
2854 #endif
2855 
2856  _status = fileName.serializeTo(
2857  _logBuff,
2858  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2859  );
2860  FW_ASSERT(
2861  _status == Fw::FW_SERIALIZE_OK,
2862  static_cast<FwAssertArgType>(_status)
2863  );
2864 
2865  this->logOut_out(
2866  0,
2867  _id,
2868  _logTime,
2870  _logBuff
2871  );
2872  }
2873 
2874  // Emit the event on the text log port
2875 #if FW_ENABLE_TEXT_LOGGING
2876  if (this->isConnected_LogText_OutputPort(0)) {
2877 #if FW_OBJECT_NAMES == 1
2878  const char* _formatString =
2879  "(%s) %s: Sequence file %s not found.";
2880 #else
2881  const char* _formatString =
2882  "%s: Sequence file %s not found.";
2883 #endif
2884 
2885  Fw::TextLogString _logString;
2886  _logString.format(
2887  _formatString,
2888 #if FW_OBJECT_NAMES == 1
2889  this->m_objName.toChar(),
2890 #endif
2891  "CS_FileNotFound ",
2892  fileName.toChar()
2893  );
2894 
2895  this->LogText_out(
2896  0,
2897  _id,
2898  _logTime,
2900  _logString
2901  );
2902  }
2903 #endif
2904  }
2905 
2908  const Fw::StringBase& fileName,
2909  U32 storedCRC,
2910  U32 computedCRC
2911  ) const
2912  {
2913  // Get the time
2914  Fw::Time _logTime;
2915  if (this->isConnected_timeCaller_OutputPort(0)) {
2916  this->timeCaller_out(0, _logTime);
2917  }
2918 
2919  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILECRCFAILURE;
2920 
2921  // Emit the event on the log port
2922  if (this->isConnected_logOut_OutputPort(0)) {
2923  Fw::LogBuffer _logBuff;
2925 
2926 #if FW_AMPCS_COMPATIBLE
2927  // Serialize the number of arguments
2928  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2929  FW_ASSERT(
2930  _status == Fw::FW_SERIALIZE_OK,
2931  static_cast<FwAssertArgType>(_status)
2932  );
2933 #endif
2934 
2935  _status = fileName.serializeTo(
2936  _logBuff,
2937  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2938  );
2939  FW_ASSERT(
2940  _status == Fw::FW_SERIALIZE_OK,
2941  static_cast<FwAssertArgType>(_status)
2942  );
2943 
2944 #if FW_AMPCS_COMPATIBLE
2945  // Serialize the argument size
2946  _status = _logBuff.serializeFrom(
2947  static_cast<U8>(sizeof(U32))
2948  );
2949  FW_ASSERT(
2950  _status == Fw::FW_SERIALIZE_OK,
2951  static_cast<FwAssertArgType>(_status)
2952  );
2953 #endif
2954  _status = _logBuff.serializeFrom(storedCRC);
2955  FW_ASSERT(
2956  _status == Fw::FW_SERIALIZE_OK,
2957  static_cast<FwAssertArgType>(_status)
2958  );
2959 
2960 #if FW_AMPCS_COMPATIBLE
2961  // Serialize the argument size
2962  _status = _logBuff.serializeFrom(
2963  static_cast<U8>(sizeof(U32))
2964  );
2965  FW_ASSERT(
2966  _status == Fw::FW_SERIALIZE_OK,
2967  static_cast<FwAssertArgType>(_status)
2968  );
2969 #endif
2970  _status = _logBuff.serializeFrom(computedCRC);
2971  FW_ASSERT(
2972  _status == Fw::FW_SERIALIZE_OK,
2973  static_cast<FwAssertArgType>(_status)
2974  );
2975 
2976  this->logOut_out(
2977  0,
2978  _id,
2979  _logTime,
2981  _logBuff
2982  );
2983  }
2984 
2985  // Emit the event on the text log port
2986 #if FW_ENABLE_TEXT_LOGGING
2987  if (this->isConnected_LogText_OutputPort(0)) {
2988 #if FW_OBJECT_NAMES == 1
2989  const char* _formatString =
2990  "(%s) %s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2991 #else
2992  const char* _formatString =
2993  "%s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2994 #endif
2995 
2996  Fw::TextLogString _logString;
2997  _logString.format(
2998  _formatString,
2999 #if FW_OBJECT_NAMES == 1
3000  this->m_objName.toChar(),
3001 #endif
3002  "CS_FileCrcFailure ",
3003  fileName.toChar(),
3004  storedCRC,
3005  computedCRC
3006  );
3007 
3008  this->LogText_out(
3009  0,
3010  _id,
3011  _logTime,
3013  _logString
3014  );
3015  }
3016 #endif
3017  }
3018 
3021  const Fw::StringBase& fileName,
3022  U32 recordNumber,
3023  FwOpcodeType opCode
3024  ) const
3025  {
3026  // Get the time
3027  Fw::Time _logTime;
3028  if (this->isConnected_timeCaller_OutputPort(0)) {
3029  this->timeCaller_out(0, _logTime);
3030  }
3031 
3032  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_COMMANDCOMPLETE;
3033 
3034  // Emit the event on the log port
3035  if (this->isConnected_logOut_OutputPort(0)) {
3036  Fw::LogBuffer _logBuff;
3038 
3039 #if FW_AMPCS_COMPATIBLE
3040  // Serialize the number of arguments
3041  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3042  FW_ASSERT(
3043  _status == Fw::FW_SERIALIZE_OK,
3044  static_cast<FwAssertArgType>(_status)
3045  );
3046 #endif
3047 
3048  _status = fileName.serializeTo(
3049  _logBuff,
3050  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3051  );
3052  FW_ASSERT(
3053  _status == Fw::FW_SERIALIZE_OK,
3054  static_cast<FwAssertArgType>(_status)
3055  );
3056 
3057 #if FW_AMPCS_COMPATIBLE
3058  // Serialize the argument size
3059  _status = _logBuff.serializeFrom(
3060  static_cast<U8>(sizeof(U32))
3061  );
3062  FW_ASSERT(
3063  _status == Fw::FW_SERIALIZE_OK,
3064  static_cast<FwAssertArgType>(_status)
3065  );
3066 #endif
3067  _status = _logBuff.serializeFrom(recordNumber);
3068  FW_ASSERT(
3069  _status == Fw::FW_SERIALIZE_OK,
3070  static_cast<FwAssertArgType>(_status)
3071  );
3072 
3073 #if FW_AMPCS_COMPATIBLE
3074  // Serialize the argument size
3075  _status = _logBuff.serializeFrom(
3076  static_cast<U8>(sizeof(FwOpcodeType))
3077  );
3078  FW_ASSERT(
3079  _status == Fw::FW_SERIALIZE_OK,
3080  static_cast<FwAssertArgType>(_status)
3081  );
3082 #endif
3083  _status = _logBuff.serializeFrom(opCode);
3084  FW_ASSERT(
3085  _status == Fw::FW_SERIALIZE_OK,
3086  static_cast<FwAssertArgType>(_status)
3087  );
3088 
3089  this->logOut_out(
3090  0,
3091  _id,
3092  _logTime,
3094  _logBuff
3095  );
3096  }
3097 
3098  // Emit the event on the text log port
3099 #if FW_ENABLE_TEXT_LOGGING
3100  if (this->isConnected_LogText_OutputPort(0)) {
3101 #if FW_OBJECT_NAMES == 1
3102  const char* _formatString =
3103  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
3104 #else
3105  const char* _formatString =
3106  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
3107 #endif
3108 
3109  Fw::TextLogString _logString;
3110  _logString.format(
3111  _formatString,
3112 #if FW_OBJECT_NAMES == 1
3113  this->m_objName.toChar(),
3114 #endif
3115  "CS_CommandComplete ",
3116  fileName.toChar(),
3117  recordNumber,
3118  opCode
3119  );
3120 
3121  this->LogText_out(
3122  0,
3123  _id,
3124  _logTime,
3126  _logString
3127  );
3128  }
3129 #endif
3130  }
3131 
3134  {
3135  // Get the time
3136  Fw::Time _logTime;
3137  if (this->isConnected_timeCaller_OutputPort(0)) {
3138  this->timeCaller_out(0, _logTime);
3139  }
3140 
3141  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCECOMPLETE;
3142 
3143  // Emit the event on the log port
3144  if (this->isConnected_logOut_OutputPort(0)) {
3145  Fw::LogBuffer _logBuff;
3147 
3148 #if FW_AMPCS_COMPATIBLE
3149  // Serialize the number of arguments
3150  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3151  FW_ASSERT(
3152  _status == Fw::FW_SERIALIZE_OK,
3153  static_cast<FwAssertArgType>(_status)
3154  );
3155 #endif
3156 
3157  _status = fileName.serializeTo(
3158  _logBuff,
3159  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3160  );
3161  FW_ASSERT(
3162  _status == Fw::FW_SERIALIZE_OK,
3163  static_cast<FwAssertArgType>(_status)
3164  );
3165 
3166  this->logOut_out(
3167  0,
3168  _id,
3169  _logTime,
3171  _logBuff
3172  );
3173  }
3174 
3175  // Emit the event on the text log port
3176 #if FW_ENABLE_TEXT_LOGGING
3177  if (this->isConnected_LogText_OutputPort(0)) {
3178 #if FW_OBJECT_NAMES == 1
3179  const char* _formatString =
3180  "(%s) %s: Sequence file %s complete";
3181 #else
3182  const char* _formatString =
3183  "%s: Sequence file %s complete";
3184 #endif
3185 
3186  Fw::TextLogString _logString;
3187  _logString.format(
3188  _formatString,
3189 #if FW_OBJECT_NAMES == 1
3190  this->m_objName.toChar(),
3191 #endif
3192  "CS_SequenceComplete ",
3193  fileName.toChar()
3194  );
3195 
3196  this->LogText_out(
3197  0,
3198  _id,
3199  _logTime,
3201  _logString
3202  );
3203  }
3204 #endif
3205  }
3206 
3209  const Fw::StringBase& fileName,
3210  U32 recordNumber,
3211  FwOpcodeType opCode,
3212  U32 errorStatus
3213  ) const
3214  {
3215  // Get the time
3216  Fw::Time _logTime;
3217  if (this->isConnected_timeCaller_OutputPort(0)) {
3218  this->timeCaller_out(0, _logTime);
3219  }
3220 
3221  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_COMMANDERROR;
3222 
3223  // Emit the event on the log port
3224  if (this->isConnected_logOut_OutputPort(0)) {
3225  Fw::LogBuffer _logBuff;
3227 
3228 #if FW_AMPCS_COMPATIBLE
3229  // Serialize the number of arguments
3230  _status = _logBuff.serializeFrom(static_cast<U8>(4));
3231  FW_ASSERT(
3232  _status == Fw::FW_SERIALIZE_OK,
3233  static_cast<FwAssertArgType>(_status)
3234  );
3235 #endif
3236 
3237  _status = fileName.serializeTo(
3238  _logBuff,
3239  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3240  );
3241  FW_ASSERT(
3242  _status == Fw::FW_SERIALIZE_OK,
3243  static_cast<FwAssertArgType>(_status)
3244  );
3245 
3246 #if FW_AMPCS_COMPATIBLE
3247  // Serialize the argument size
3248  _status = _logBuff.serializeFrom(
3249  static_cast<U8>(sizeof(U32))
3250  );
3251  FW_ASSERT(
3252  _status == Fw::FW_SERIALIZE_OK,
3253  static_cast<FwAssertArgType>(_status)
3254  );
3255 #endif
3256  _status = _logBuff.serializeFrom(recordNumber);
3257  FW_ASSERT(
3258  _status == Fw::FW_SERIALIZE_OK,
3259  static_cast<FwAssertArgType>(_status)
3260  );
3261 
3262 #if FW_AMPCS_COMPATIBLE
3263  // Serialize the argument size
3264  _status = _logBuff.serializeFrom(
3265  static_cast<U8>(sizeof(FwOpcodeType))
3266  );
3267  FW_ASSERT(
3268  _status == Fw::FW_SERIALIZE_OK,
3269  static_cast<FwAssertArgType>(_status)
3270  );
3271 #endif
3272  _status = _logBuff.serializeFrom(opCode);
3273  FW_ASSERT(
3274  _status == Fw::FW_SERIALIZE_OK,
3275  static_cast<FwAssertArgType>(_status)
3276  );
3277 
3278 #if FW_AMPCS_COMPATIBLE
3279  // Serialize the argument size
3280  _status = _logBuff.serializeFrom(
3281  static_cast<U8>(sizeof(U32))
3282  );
3283  FW_ASSERT(
3284  _status == Fw::FW_SERIALIZE_OK,
3285  static_cast<FwAssertArgType>(_status)
3286  );
3287 #endif
3288  _status = _logBuff.serializeFrom(errorStatus);
3289  FW_ASSERT(
3290  _status == Fw::FW_SERIALIZE_OK,
3291  static_cast<FwAssertArgType>(_status)
3292  );
3293 
3294  this->logOut_out(
3295  0,
3296  _id,
3297  _logTime,
3299  _logBuff
3300  );
3301  }
3302 
3303  // Emit the event on the text log port
3304 #if FW_ENABLE_TEXT_LOGGING
3305  if (this->isConnected_LogText_OutputPort(0)) {
3306 #if FW_OBJECT_NAMES == 1
3307  const char* _formatString =
3308  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3309 #else
3310  const char* _formatString =
3311  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3312 #endif
3313 
3314  Fw::TextLogString _logString;
3315  _logString.format(
3316  _formatString,
3317 #if FW_OBJECT_NAMES == 1
3318  this->m_objName.toChar(),
3319 #endif
3320  "CS_CommandError ",
3321  fileName.toChar(),
3322  recordNumber,
3323  opCode,
3324  errorStatus
3325  );
3326 
3327  this->LogText_out(
3328  0,
3329  _id,
3330  _logTime,
3332  _logString
3333  );
3334  }
3335 #endif
3336  }
3337 
3340  {
3341  // Get the time
3342  Fw::Time _logTime;
3343  if (this->isConnected_timeCaller_OutputPort(0)) {
3344  this->timeCaller_out(0, _logTime);
3345  }
3346 
3347  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_INVALIDMODE;
3348 
3349  // Emit the event on the log port
3350  if (this->isConnected_logOut_OutputPort(0)) {
3351  Fw::LogBuffer _logBuff;
3352 
3353 #if FW_AMPCS_COMPATIBLE
3355  // Serialize the number of arguments
3356  _status = _logBuff.serializeFrom(static_cast<U8>(0));
3357  FW_ASSERT(
3358  _status == Fw::FW_SERIALIZE_OK,
3359  static_cast<FwAssertArgType>(_status)
3360  );
3361 #endif
3362 
3363  this->logOut_out(
3364  0,
3365  _id,
3366  _logTime,
3368  _logBuff
3369  );
3370  }
3371 
3372  // Emit the event on the text log port
3373 #if FW_ENABLE_TEXT_LOGGING
3374  if (this->isConnected_LogText_OutputPort(0)) {
3375 #if FW_OBJECT_NAMES == 1
3376  const char* _formatString =
3377  "(%s) %s: Invalid mode";
3378 #else
3379  const char* _formatString =
3380  "%s: Invalid mode";
3381 #endif
3382 
3383  Fw::TextLogString _logString;
3384  _logString.format(
3385  _formatString,
3386 #if FW_OBJECT_NAMES == 1
3387  this->m_objName.toChar(),
3388 #endif
3389  "CS_InvalidMode "
3390  );
3391 
3392  this->LogText_out(
3393  0,
3394  _id,
3395  _logTime,
3397  _logString
3398  );
3399  }
3400 #endif
3401  }
3402 
3405  const Fw::StringBase& fileName,
3406  U32 header_records,
3407  U32 extra_bytes
3408  ) const
3409  {
3410  // Get the time
3411  Fw::Time _logTime;
3412  if (this->isConnected_timeCaller_OutputPort(0)) {
3413  this->timeCaller_out(0, _logTime);
3414  }
3415 
3416  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_RECORDMISMATCH;
3417 
3418  // Emit the event on the log port
3419  if (this->isConnected_logOut_OutputPort(0)) {
3420  Fw::LogBuffer _logBuff;
3422 
3423 #if FW_AMPCS_COMPATIBLE
3424  // Serialize the number of arguments
3425  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3426  FW_ASSERT(
3427  _status == Fw::FW_SERIALIZE_OK,
3428  static_cast<FwAssertArgType>(_status)
3429  );
3430 #endif
3431 
3432  _status = fileName.serializeTo(
3433  _logBuff,
3434  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3435  );
3436  FW_ASSERT(
3437  _status == Fw::FW_SERIALIZE_OK,
3438  static_cast<FwAssertArgType>(_status)
3439  );
3440 
3441 #if FW_AMPCS_COMPATIBLE
3442  // Serialize the argument size
3443  _status = _logBuff.serializeFrom(
3444  static_cast<U8>(sizeof(U32))
3445  );
3446  FW_ASSERT(
3447  _status == Fw::FW_SERIALIZE_OK,
3448  static_cast<FwAssertArgType>(_status)
3449  );
3450 #endif
3451  _status = _logBuff.serializeFrom(header_records);
3452  FW_ASSERT(
3453  _status == Fw::FW_SERIALIZE_OK,
3454  static_cast<FwAssertArgType>(_status)
3455  );
3456 
3457 #if FW_AMPCS_COMPATIBLE
3458  // Serialize the argument size
3459  _status = _logBuff.serializeFrom(
3460  static_cast<U8>(sizeof(U32))
3461  );
3462  FW_ASSERT(
3463  _status == Fw::FW_SERIALIZE_OK,
3464  static_cast<FwAssertArgType>(_status)
3465  );
3466 #endif
3467  _status = _logBuff.serializeFrom(extra_bytes);
3468  FW_ASSERT(
3469  _status == Fw::FW_SERIALIZE_OK,
3470  static_cast<FwAssertArgType>(_status)
3471  );
3472 
3473  this->logOut_out(
3474  0,
3475  _id,
3476  _logTime,
3478  _logBuff
3479  );
3480  }
3481 
3482  // Emit the event on the text log port
3483 #if FW_ENABLE_TEXT_LOGGING
3484  if (this->isConnected_LogText_OutputPort(0)) {
3485 #if FW_OBJECT_NAMES == 1
3486  const char* _formatString =
3487  "(%s) %s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3488 #else
3489  const char* _formatString =
3490  "%s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3491 #endif
3492 
3493  Fw::TextLogString _logString;
3494  _logString.format(
3495  _formatString,
3496 #if FW_OBJECT_NAMES == 1
3497  this->m_objName.toChar(),
3498 #endif
3499  "CS_RecordMismatch ",
3500  fileName.toChar(),
3501  header_records,
3502  extra_bytes
3503  );
3504 
3505  this->LogText_out(
3506  0,
3507  _id,
3508  _logTime,
3510  _logString
3511  );
3512  }
3513 #endif
3514  }
3515 
3518  const Fw::StringBase& fileName,
3519  U16 time_base,
3520  U16 seq_time_base
3521  ) const
3522  {
3523  // Get the time
3524  Fw::Time _logTime;
3525  if (this->isConnected_timeCaller_OutputPort(0)) {
3526  this->timeCaller_out(0, _logTime);
3527  }
3528 
3529  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_TIMEBASEMISMATCH;
3530 
3531  // Emit the event on the log port
3532  if (this->isConnected_logOut_OutputPort(0)) {
3533  Fw::LogBuffer _logBuff;
3535 
3536 #if FW_AMPCS_COMPATIBLE
3537  // Serialize the number of arguments
3538  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3539  FW_ASSERT(
3540  _status == Fw::FW_SERIALIZE_OK,
3541  static_cast<FwAssertArgType>(_status)
3542  );
3543 #endif
3544 
3545  _status = fileName.serializeTo(
3546  _logBuff,
3547  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3548  );
3549  FW_ASSERT(
3550  _status == Fw::FW_SERIALIZE_OK,
3551  static_cast<FwAssertArgType>(_status)
3552  );
3553 
3554 #if FW_AMPCS_COMPATIBLE
3555  // Serialize the argument size
3556  _status = _logBuff.serializeFrom(
3557  static_cast<U8>(sizeof(U16))
3558  );
3559  FW_ASSERT(
3560  _status == Fw::FW_SERIALIZE_OK,
3561  static_cast<FwAssertArgType>(_status)
3562  );
3563 #endif
3564  _status = _logBuff.serializeFrom(time_base);
3565  FW_ASSERT(
3566  _status == Fw::FW_SERIALIZE_OK,
3567  static_cast<FwAssertArgType>(_status)
3568  );
3569 
3570 #if FW_AMPCS_COMPATIBLE
3571  // Serialize the argument size
3572  _status = _logBuff.serializeFrom(
3573  static_cast<U8>(sizeof(U16))
3574  );
3575  FW_ASSERT(
3576  _status == Fw::FW_SERIALIZE_OK,
3577  static_cast<FwAssertArgType>(_status)
3578  );
3579 #endif
3580  _status = _logBuff.serializeFrom(seq_time_base);
3581  FW_ASSERT(
3582  _status == Fw::FW_SERIALIZE_OK,
3583  static_cast<FwAssertArgType>(_status)
3584  );
3585 
3586  this->logOut_out(
3587  0,
3588  _id,
3589  _logTime,
3591  _logBuff
3592  );
3593  }
3594 
3595  // Emit the event on the text log port
3596 #if FW_ENABLE_TEXT_LOGGING
3597  if (this->isConnected_LogText_OutputPort(0)) {
3598 #if FW_OBJECT_NAMES == 1
3599  const char* _formatString =
3600  "(%s) %s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3601 #else
3602  const char* _formatString =
3603  "%s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3604 #endif
3605 
3606  Fw::TextLogString _logString;
3607  _logString.format(
3608  _formatString,
3609 #if FW_OBJECT_NAMES == 1
3610  this->m_objName.toChar(),
3611 #endif
3612  "CS_TimeBaseMismatch ",
3613  fileName.toChar(),
3614  time_base,
3615  seq_time_base
3616  );
3617 
3618  this->LogText_out(
3619  0,
3620  _id,
3621  _logTime,
3623  _logString
3624  );
3625  }
3626 #endif
3627  }
3628 
3631  const Fw::StringBase& fileName,
3632  U8 currTimeBase,
3633  U8 seqTimeBase
3634  ) const
3635  {
3636  // Get the time
3637  Fw::Time _logTime;
3638  if (this->isConnected_timeCaller_OutputPort(0)) {
3639  this->timeCaller_out(0, _logTime);
3640  }
3641 
3643 
3644  // Emit the event on the log port
3645  if (this->isConnected_logOut_OutputPort(0)) {
3646  Fw::LogBuffer _logBuff;
3648 
3649 #if FW_AMPCS_COMPATIBLE
3650  // Serialize the number of arguments
3651  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3652  FW_ASSERT(
3653  _status == Fw::FW_SERIALIZE_OK,
3654  static_cast<FwAssertArgType>(_status)
3655  );
3656 #endif
3657 
3658  _status = fileName.serializeTo(
3659  _logBuff,
3660  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3661  );
3662  FW_ASSERT(
3663  _status == Fw::FW_SERIALIZE_OK,
3664  static_cast<FwAssertArgType>(_status)
3665  );
3666 
3667 #if FW_AMPCS_COMPATIBLE
3668  // Serialize the argument size
3669  _status = _logBuff.serializeFrom(
3670  static_cast<U8>(sizeof(U8))
3671  );
3672  FW_ASSERT(
3673  _status == Fw::FW_SERIALIZE_OK,
3674  static_cast<FwAssertArgType>(_status)
3675  );
3676 #endif
3677  _status = _logBuff.serializeFrom(currTimeBase);
3678  FW_ASSERT(
3679  _status == Fw::FW_SERIALIZE_OK,
3680  static_cast<FwAssertArgType>(_status)
3681  );
3682 
3683 #if FW_AMPCS_COMPATIBLE
3684  // Serialize the argument size
3685  _status = _logBuff.serializeFrom(
3686  static_cast<U8>(sizeof(U8))
3687  );
3688  FW_ASSERT(
3689  _status == Fw::FW_SERIALIZE_OK,
3690  static_cast<FwAssertArgType>(_status)
3691  );
3692 #endif
3693  _status = _logBuff.serializeFrom(seqTimeBase);
3694  FW_ASSERT(
3695  _status == Fw::FW_SERIALIZE_OK,
3696  static_cast<FwAssertArgType>(_status)
3697  );
3698 
3699  this->logOut_out(
3700  0,
3701  _id,
3702  _logTime,
3704  _logBuff
3705  );
3706  }
3707 
3708  // Emit the event on the text log port
3709 #if FW_ENABLE_TEXT_LOGGING
3710  if (this->isConnected_LogText_OutputPort(0)) {
3711 #if FW_OBJECT_NAMES == 1
3712  const char* _formatString =
3713  "(%s) %s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3714 #else
3715  const char* _formatString =
3716  "%s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3717 #endif
3718 
3719  Fw::TextLogString _logString;
3720  _logString.format(
3721  _formatString,
3722 #if FW_OBJECT_NAMES == 1
3723  this->m_objName.toChar(),
3724 #endif
3725  "CS_TimeContextMismatch ",
3726  fileName.toChar(),
3727  currTimeBase,
3728  seqTimeBase
3729  );
3730 
3731  this->LogText_out(
3732  0,
3733  _id,
3734  _logTime,
3736  _logString
3737  );
3738  }
3739 #endif
3740  }
3741 
3744  {
3745  // Get the time
3746  Fw::Time _logTime;
3747  if (this->isConnected_timeCaller_OutputPort(0)) {
3748  this->timeCaller_out(0, _logTime);
3749  }
3750 
3752 
3753  // Emit the event on the log port
3754  if (this->isConnected_logOut_OutputPort(0)) {
3755  Fw::LogBuffer _logBuff;
3757 
3758 #if FW_AMPCS_COMPATIBLE
3759  // Serialize the number of arguments
3760  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3761  FW_ASSERT(
3762  _status == Fw::FW_SERIALIZE_OK,
3763  static_cast<FwAssertArgType>(_status)
3764  );
3765 #endif
3766 
3767  _status = filename.serializeTo(
3768  _logBuff,
3769  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3770  );
3771  FW_ASSERT(
3772  _status == Fw::FW_SERIALIZE_OK,
3773  static_cast<FwAssertArgType>(_status)
3774  );
3775 
3776  this->logOut_out(
3777  0,
3778  _id,
3779  _logTime,
3781  _logBuff
3782  );
3783  }
3784 
3785  // Emit the event on the text log port
3786 #if FW_ENABLE_TEXT_LOGGING
3787  if (this->isConnected_LogText_OutputPort(0)) {
3788 #if FW_OBJECT_NAMES == 1
3789  const char* _formatString =
3790  "(%s) %s: Local request for sequence %s started.";
3791 #else
3792  const char* _formatString =
3793  "%s: Local request for sequence %s started.";
3794 #endif
3795 
3796  Fw::TextLogString _logString;
3797  _logString.format(
3798  _formatString,
3799 #if FW_OBJECT_NAMES == 1
3800  this->m_objName.toChar(),
3801 #endif
3802  "CS_PortSequenceStarted ",
3803  filename.toChar()
3804  );
3805 
3806  this->LogText_out(
3807  0,
3808  _id,
3809  _logTime,
3811  _logString
3812  );
3813  }
3814 #endif
3815  }
3816 
3819  {
3820  // Get the time
3821  Fw::Time _logTime;
3822  if (this->isConnected_timeCaller_OutputPort(0)) {
3823  this->timeCaller_out(0, _logTime);
3824  }
3825 
3827 
3828  // Emit the event on the log port
3829  if (this->isConnected_logOut_OutputPort(0)) {
3830  Fw::LogBuffer _logBuff;
3832 
3833 #if FW_AMPCS_COMPATIBLE
3834  // Serialize the number of arguments
3835  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3836  FW_ASSERT(
3837  _status == Fw::FW_SERIALIZE_OK,
3838  static_cast<FwAssertArgType>(_status)
3839  );
3840 #endif
3841 
3842 #if FW_AMPCS_COMPATIBLE
3843  // Serialize the argument size
3844  _status = _logBuff.serializeFrom(
3845  static_cast<U8>(sizeof(FwOpcodeType))
3846  );
3847  FW_ASSERT(
3848  _status == Fw::FW_SERIALIZE_OK,
3849  static_cast<FwAssertArgType>(_status)
3850  );
3851 #endif
3852  _status = _logBuff.serializeFrom(opcode);
3853  FW_ASSERT(
3854  _status == Fw::FW_SERIALIZE_OK,
3855  static_cast<FwAssertArgType>(_status)
3856  );
3857 
3858  this->logOut_out(
3859  0,
3860  _id,
3861  _logTime,
3863  _logBuff
3864  );
3865  }
3866 
3867  // Emit the event on the text log port
3868 #if FW_ENABLE_TEXT_LOGGING
3869  if (this->isConnected_LogText_OutputPort(0)) {
3870 #if FW_OBJECT_NAMES == 1
3871  const char* _formatString =
3872  "(%s) %s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3873 #else
3874  const char* _formatString =
3875  "%s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3876 #endif
3877 
3878  Fw::TextLogString _logString;
3879  _logString.format(
3880  _formatString,
3881 #if FW_OBJECT_NAMES == 1
3882  this->m_objName.toChar(),
3883 #endif
3884  "CS_UnexpectedCompletion ",
3885  opcode
3886  );
3887 
3888  this->LogText_out(
3889  0,
3890  _id,
3891  _logTime,
3893  _logString
3894  );
3895  }
3896 #endif
3897  }
3898 
3901  {
3902  // Get the time
3903  Fw::Time _logTime;
3904  if (this->isConnected_timeCaller_OutputPort(0)) {
3905  this->timeCaller_out(0, _logTime);
3906  }
3907 
3908  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_MODESWITCHED;
3909 
3910  // Emit the event on the log port
3911  if (this->isConnected_logOut_OutputPort(0)) {
3912  Fw::LogBuffer _logBuff;
3914 
3915 #if FW_AMPCS_COMPATIBLE
3916  // Serialize the number of arguments
3917  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3918  FW_ASSERT(
3919  _status == Fw::FW_SERIALIZE_OK,
3920  static_cast<FwAssertArgType>(_status)
3921  );
3922 #endif
3923 
3924 #if FW_AMPCS_COMPATIBLE
3925  // Serialize the argument size
3926  _status = _logBuff.serializeFrom(
3928  );
3929  FW_ASSERT(
3930  _status == Fw::FW_SERIALIZE_OK,
3931  static_cast<FwAssertArgType>(_status)
3932  );
3933 #endif
3934  _status = _logBuff.serializeFrom(mode);
3935  FW_ASSERT(
3936  _status == Fw::FW_SERIALIZE_OK,
3937  static_cast<FwAssertArgType>(_status)
3938  );
3939 
3940  this->logOut_out(
3941  0,
3942  _id,
3943  _logTime,
3945  _logBuff
3946  );
3947  }
3948 
3949  // Emit the event on the text log port
3950 #if FW_ENABLE_TEXT_LOGGING
3951  if (this->isConnected_LogText_OutputPort(0)) {
3952 #if FW_OBJECT_NAMES == 1
3953  const char* _formatString =
3954  "(%s) %s: Sequencer switched to %s step mode";
3955 #else
3956  const char* _formatString =
3957  "%s: Sequencer switched to %s step mode";
3958 #endif
3959 
3960  Fw::String modeStr;
3961  mode.toString(modeStr);
3962 
3963  Fw::TextLogString _logString;
3964  _logString.format(
3965  _formatString,
3966 #if FW_OBJECT_NAMES == 1
3967  this->m_objName.toChar(),
3968 #endif
3969  "CS_ModeSwitched ",
3970  modeStr.toChar()
3971  );
3972 
3973  this->LogText_out(
3974  0,
3975  _id,
3976  _logTime,
3978  _logString
3979  );
3980  }
3981 #endif
3982  }
3983 
3986  {
3987  // Get the time
3988  Fw::Time _logTime;
3989  if (this->isConnected_timeCaller_OutputPort(0)) {
3990  this->timeCaller_out(0, _logTime);
3991  }
3992 
3993  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_NOSEQUENCEACTIVE;
3994 
3995  // Emit the event on the log port
3996  if (this->isConnected_logOut_OutputPort(0)) {
3997  Fw::LogBuffer _logBuff;
3998 
3999 #if FW_AMPCS_COMPATIBLE
4001  // Serialize the number of arguments
4002  _status = _logBuff.serializeFrom(static_cast<U8>(0));
4003  FW_ASSERT(
4004  _status == Fw::FW_SERIALIZE_OK,
4005  static_cast<FwAssertArgType>(_status)
4006  );
4007 #endif
4008 
4009  this->logOut_out(
4010  0,
4011  _id,
4012  _logTime,
4014  _logBuff
4015  );
4016  }
4017 
4018  // Emit the event on the text log port
4019 #if FW_ENABLE_TEXT_LOGGING
4020  if (this->isConnected_LogText_OutputPort(0)) {
4021 #if FW_OBJECT_NAMES == 1
4022  const char* _formatString =
4023  "(%s) %s: No sequence active.";
4024 #else
4025  const char* _formatString =
4026  "%s: No sequence active.";
4027 #endif
4028 
4029  Fw::TextLogString _logString;
4030  _logString.format(
4031  _formatString,
4032 #if FW_OBJECT_NAMES == 1
4033  this->m_objName.toChar(),
4034 #endif
4035  "CS_NoSequenceActive "
4036  );
4037 
4038  this->LogText_out(
4039  0,
4040  _id,
4041  _logTime,
4043  _logString
4044  );
4045  }
4046 #endif
4047  }
4048 
4051  {
4052  // Get the time
4053  Fw::Time _logTime;
4054  if (this->isConnected_timeCaller_OutputPort(0)) {
4055  this->timeCaller_out(0, _logTime);
4056  }
4057 
4058  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCEVALID;
4059 
4060  // Emit the event on the log port
4061  if (this->isConnected_logOut_OutputPort(0)) {
4062  Fw::LogBuffer _logBuff;
4064 
4065 #if FW_AMPCS_COMPATIBLE
4066  // Serialize the number of arguments
4067  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4068  FW_ASSERT(
4069  _status == Fw::FW_SERIALIZE_OK,
4070  static_cast<FwAssertArgType>(_status)
4071  );
4072 #endif
4073 
4074  _status = filename.serializeTo(
4075  _logBuff,
4076  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4077  );
4078  FW_ASSERT(
4079  _status == Fw::FW_SERIALIZE_OK,
4080  static_cast<FwAssertArgType>(_status)
4081  );
4082 
4083  this->logOut_out(
4084  0,
4085  _id,
4086  _logTime,
4088  _logBuff
4089  );
4090  }
4091 
4092  // Emit the event on the text log port
4093 #if FW_ENABLE_TEXT_LOGGING
4094  if (this->isConnected_LogText_OutputPort(0)) {
4095 #if FW_OBJECT_NAMES == 1
4096  const char* _formatString =
4097  "(%s) %s: Sequence %s is valid.";
4098 #else
4099  const char* _formatString =
4100  "%s: Sequence %s is valid.";
4101 #endif
4102 
4103  Fw::TextLogString _logString;
4104  _logString.format(
4105  _formatString,
4106 #if FW_OBJECT_NAMES == 1
4107  this->m_objName.toChar(),
4108 #endif
4109  "CS_SequenceValid ",
4110  filename.toChar()
4111  );
4112 
4113  this->LogText_out(
4114  0,
4115  _id,
4116  _logTime,
4118  _logString
4119  );
4120  }
4121 #endif
4122  }
4123 
4126  const Fw::StringBase& filename,
4127  U32 command
4128  ) const
4129  {
4130  // Get the time
4131  Fw::Time _logTime;
4132  if (this->isConnected_timeCaller_OutputPort(0)) {
4133  this->timeCaller_out(0, _logTime);
4134  }
4135 
4136  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCETIMEOUT;
4137 
4138  // Emit the event on the log port
4139  if (this->isConnected_logOut_OutputPort(0)) {
4140  Fw::LogBuffer _logBuff;
4142 
4143 #if FW_AMPCS_COMPATIBLE
4144  // Serialize the number of arguments
4145  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4146  FW_ASSERT(
4147  _status == Fw::FW_SERIALIZE_OK,
4148  static_cast<FwAssertArgType>(_status)
4149  );
4150 #endif
4151 
4152  _status = filename.serializeTo(
4153  _logBuff,
4154  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4155  );
4156  FW_ASSERT(
4157  _status == Fw::FW_SERIALIZE_OK,
4158  static_cast<FwAssertArgType>(_status)
4159  );
4160 
4161 #if FW_AMPCS_COMPATIBLE
4162  // Serialize the argument size
4163  _status = _logBuff.serializeFrom(
4164  static_cast<U8>(sizeof(U32))
4165  );
4166  FW_ASSERT(
4167  _status == Fw::FW_SERIALIZE_OK,
4168  static_cast<FwAssertArgType>(_status)
4169  );
4170 #endif
4171  _status = _logBuff.serializeFrom(command);
4172  FW_ASSERT(
4173  _status == Fw::FW_SERIALIZE_OK,
4174  static_cast<FwAssertArgType>(_status)
4175  );
4176 
4177  this->logOut_out(
4178  0,
4179  _id,
4180  _logTime,
4182  _logBuff
4183  );
4184  }
4185 
4186  // Emit the event on the text log port
4187 #if FW_ENABLE_TEXT_LOGGING
4188  if (this->isConnected_LogText_OutputPort(0)) {
4189 #if FW_OBJECT_NAMES == 1
4190  const char* _formatString =
4191  "(%s) %s: Sequence %s timed out on command %" PRIu32 "";
4192 #else
4193  const char* _formatString =
4194  "%s: Sequence %s timed out on command %" PRIu32 "";
4195 #endif
4196 
4197  Fw::TextLogString _logString;
4198  _logString.format(
4199  _formatString,
4200 #if FW_OBJECT_NAMES == 1
4201  this->m_objName.toChar(),
4202 #endif
4203  "CS_SequenceTimeout ",
4204  filename.toChar(),
4205  command
4206  );
4207 
4208  this->LogText_out(
4209  0,
4210  _id,
4211  _logTime,
4213  _logString
4214  );
4215  }
4216 #endif
4217  }
4218 
4221  const Fw::StringBase& filename,
4222  U32 command
4223  ) const
4224  {
4225  // Get the time
4226  Fw::Time _logTime;
4227  if (this->isConnected_timeCaller_OutputPort(0)) {
4228  this->timeCaller_out(0, _logTime);
4229  }
4230 
4231  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_CMDSTEPPED;
4232 
4233  // Emit the event on the log port
4234  if (this->isConnected_logOut_OutputPort(0)) {
4235  Fw::LogBuffer _logBuff;
4237 
4238 #if FW_AMPCS_COMPATIBLE
4239  // Serialize the number of arguments
4240  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4241  FW_ASSERT(
4242  _status == Fw::FW_SERIALIZE_OK,
4243  static_cast<FwAssertArgType>(_status)
4244  );
4245 #endif
4246 
4247  _status = filename.serializeTo(
4248  _logBuff,
4249  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4250  );
4251  FW_ASSERT(
4252  _status == Fw::FW_SERIALIZE_OK,
4253  static_cast<FwAssertArgType>(_status)
4254  );
4255 
4256 #if FW_AMPCS_COMPATIBLE
4257  // Serialize the argument size
4258  _status = _logBuff.serializeFrom(
4259  static_cast<U8>(sizeof(U32))
4260  );
4261  FW_ASSERT(
4262  _status == Fw::FW_SERIALIZE_OK,
4263  static_cast<FwAssertArgType>(_status)
4264  );
4265 #endif
4266  _status = _logBuff.serializeFrom(command);
4267  FW_ASSERT(
4268  _status == Fw::FW_SERIALIZE_OK,
4269  static_cast<FwAssertArgType>(_status)
4270  );
4271 
4272  this->logOut_out(
4273  0,
4274  _id,
4275  _logTime,
4277  _logBuff
4278  );
4279  }
4280 
4281  // Emit the event on the text log port
4282 #if FW_ENABLE_TEXT_LOGGING
4283  if (this->isConnected_LogText_OutputPort(0)) {
4284 #if FW_OBJECT_NAMES == 1
4285  const char* _formatString =
4286  "(%s) %s: Sequence %s command %" PRIu32 " stepped";
4287 #else
4288  const char* _formatString =
4289  "%s: Sequence %s command %" PRIu32 " stepped";
4290 #endif
4291 
4292  Fw::TextLogString _logString;
4293  _logString.format(
4294  _formatString,
4295 #if FW_OBJECT_NAMES == 1
4296  this->m_objName.toChar(),
4297 #endif
4298  "CS_CmdStepped ",
4299  filename.toChar(),
4300  command
4301  );
4302 
4303  this->LogText_out(
4304  0,
4305  _id,
4306  _logTime,
4308  _logString
4309  );
4310  }
4311 #endif
4312  }
4313 
4316  {
4317  // Get the time
4318  Fw::Time _logTime;
4319  if (this->isConnected_timeCaller_OutputPort(0)) {
4320  this->timeCaller_out(0, _logTime);
4321  }
4322 
4323  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_CMDSTARTED;
4324 
4325  // Emit the event on the log port
4326  if (this->isConnected_logOut_OutputPort(0)) {
4327  Fw::LogBuffer _logBuff;
4329 
4330 #if FW_AMPCS_COMPATIBLE
4331  // Serialize the number of arguments
4332  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4333  FW_ASSERT(
4334  _status == Fw::FW_SERIALIZE_OK,
4335  static_cast<FwAssertArgType>(_status)
4336  );
4337 #endif
4338 
4339  _status = filename.serializeTo(
4340  _logBuff,
4341  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4342  );
4343  FW_ASSERT(
4344  _status == Fw::FW_SERIALIZE_OK,
4345  static_cast<FwAssertArgType>(_status)
4346  );
4347 
4348  this->logOut_out(
4349  0,
4350  _id,
4351  _logTime,
4353  _logBuff
4354  );
4355  }
4356 
4357  // Emit the event on the text log port
4358 #if FW_ENABLE_TEXT_LOGGING
4359  if (this->isConnected_LogText_OutputPort(0)) {
4360 #if FW_OBJECT_NAMES == 1
4361  const char* _formatString =
4362  "(%s) %s: Sequence %s started";
4363 #else
4364  const char* _formatString =
4365  "%s: Sequence %s started";
4366 #endif
4367 
4368  Fw::TextLogString _logString;
4369  _logString.format(
4370  _formatString,
4371 #if FW_OBJECT_NAMES == 1
4372  this->m_objName.toChar(),
4373 #endif
4374  "CS_CmdStarted ",
4375  filename.toChar()
4376  );
4377 
4378  this->LogText_out(
4379  0,
4380  _id,
4381  _logTime,
4383  _logString
4384  );
4385  }
4386 #endif
4387  }
4388 
4391  const Fw::StringBase& filename,
4392  U32 recordNumber,
4393  FwOpcodeType opCode
4394  ) const
4395  {
4396  // Get the time
4397  Fw::Time _logTime;
4398  if (this->isConnected_timeCaller_OutputPort(0)) {
4399  this->timeCaller_out(0, _logTime);
4400  }
4401 
4402  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_JOINWAITING;
4403 
4404  // Emit the event on the log port
4405  if (this->isConnected_logOut_OutputPort(0)) {
4406  Fw::LogBuffer _logBuff;
4408 
4409 #if FW_AMPCS_COMPATIBLE
4410  // Serialize the number of arguments
4411  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4412  FW_ASSERT(
4413  _status == Fw::FW_SERIALIZE_OK,
4414  static_cast<FwAssertArgType>(_status)
4415  );
4416 #endif
4417 
4418  _status = filename.serializeTo(
4419  _logBuff,
4420  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4421  );
4422  FW_ASSERT(
4423  _status == Fw::FW_SERIALIZE_OK,
4424  static_cast<FwAssertArgType>(_status)
4425  );
4426 
4427 #if FW_AMPCS_COMPATIBLE
4428  // Serialize the argument size
4429  _status = _logBuff.serializeFrom(
4430  static_cast<U8>(sizeof(U32))
4431  );
4432  FW_ASSERT(
4433  _status == Fw::FW_SERIALIZE_OK,
4434  static_cast<FwAssertArgType>(_status)
4435  );
4436 #endif
4437  _status = _logBuff.serializeFrom(recordNumber);
4438  FW_ASSERT(
4439  _status == Fw::FW_SERIALIZE_OK,
4440  static_cast<FwAssertArgType>(_status)
4441  );
4442 
4443 #if FW_AMPCS_COMPATIBLE
4444  // Serialize the argument size
4445  _status = _logBuff.serializeFrom(
4446  static_cast<U8>(sizeof(FwOpcodeType))
4447  );
4448  FW_ASSERT(
4449  _status == Fw::FW_SERIALIZE_OK,
4450  static_cast<FwAssertArgType>(_status)
4451  );
4452 #endif
4453  _status = _logBuff.serializeFrom(opCode);
4454  FW_ASSERT(
4455  _status == Fw::FW_SERIALIZE_OK,
4456  static_cast<FwAssertArgType>(_status)
4457  );
4458 
4459  this->logOut_out(
4460  0,
4461  _id,
4462  _logTime,
4464  _logBuff
4465  );
4466  }
4467 
4468  // Emit the event on the text log port
4469 #if FW_ENABLE_TEXT_LOGGING
4470  if (this->isConnected_LogText_OutputPort(0)) {
4471 #if FW_OBJECT_NAMES == 1
4472  const char* _formatString =
4473  "(%s) %s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4474 #else
4475  const char* _formatString =
4476  "%s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4477 #endif
4478 
4479  Fw::TextLogString _logString;
4480  _logString.format(
4481  _formatString,
4482 #if FW_OBJECT_NAMES == 1
4483  this->m_objName.toChar(),
4484 #endif
4485  "CS_JoinWaiting ",
4486  filename.toChar(),
4487  recordNumber,
4488  opCode
4489  );
4490 
4491  this->LogText_out(
4492  0,
4493  _id,
4494  _logTime,
4496  _logString
4497  );
4498  }
4499 #endif
4500  }
4501 
4504  {
4505  // Get the time
4506  Fw::Time _logTime;
4507  if (this->isConnected_timeCaller_OutputPort(0)) {
4508  this->timeCaller_out(0, _logTime);
4509  }
4510 
4512 
4513  // Emit the event on the log port
4514  if (this->isConnected_logOut_OutputPort(0)) {
4515  Fw::LogBuffer _logBuff;
4516 
4517 #if FW_AMPCS_COMPATIBLE
4519  // Serialize the number of arguments
4520  _status = _logBuff.serializeFrom(static_cast<U8>(0));
4521  FW_ASSERT(
4522  _status == Fw::FW_SERIALIZE_OK,
4523  static_cast<FwAssertArgType>(_status)
4524  );
4525 #endif
4526 
4527  this->logOut_out(
4528  0,
4529  _id,
4530  _logTime,
4532  _logBuff
4533  );
4534  }
4535 
4536  // Emit the event on the text log port
4537 #if FW_ENABLE_TEXT_LOGGING
4538  if (this->isConnected_LogText_OutputPort(0)) {
4539 #if FW_OBJECT_NAMES == 1
4540  const char* _formatString =
4541  "(%s) %s: Still waiting for sequence file to complete";
4542 #else
4543  const char* _formatString =
4544  "%s: Still waiting for sequence file to complete";
4545 #endif
4546 
4547  Fw::TextLogString _logString;
4548  _logString.format(
4549  _formatString,
4550 #if FW_OBJECT_NAMES == 1
4551  this->m_objName.toChar(),
4552 #endif
4553  "CS_JoinWaitingNotComplete "
4554  );
4555 
4556  this->LogText_out(
4557  0,
4558  _id,
4559  _logTime,
4561  _logString
4562  );
4563  }
4564 #endif
4565  }
4566 
4569  {
4570  // Get the time
4571  Fw::Time _logTime;
4572  if (this->isConnected_timeCaller_OutputPort(0)) {
4573  this->timeCaller_out(0, _logTime);
4574  }
4575 
4576  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_NORECORDS;
4577 
4578  // Emit the event on the log port
4579  if (this->isConnected_logOut_OutputPort(0)) {
4580  Fw::LogBuffer _logBuff;
4582 
4583 #if FW_AMPCS_COMPATIBLE
4584  // Serialize the number of arguments
4585  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4586  FW_ASSERT(
4587  _status == Fw::FW_SERIALIZE_OK,
4588  static_cast<FwAssertArgType>(_status)
4589  );
4590 #endif
4591 
4592  _status = fileName.serializeTo(
4593  _logBuff,
4594  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4595  );
4596  FW_ASSERT(
4597  _status == Fw::FW_SERIALIZE_OK,
4598  static_cast<FwAssertArgType>(_status)
4599  );
4600 
4601  this->logOut_out(
4602  0,
4603  _id,
4604  _logTime,
4606  _logBuff
4607  );
4608  }
4609 
4610  // Emit the event on the text log port
4611 #if FW_ENABLE_TEXT_LOGGING
4612  if (this->isConnected_LogText_OutputPort(0)) {
4613 #if FW_OBJECT_NAMES == 1
4614  const char* _formatString =
4615  "(%s) %s: Sequence file %s has no records. Ignoring.";
4616 #else
4617  const char* _formatString =
4618  "%s: Sequence file %s has no records. Ignoring.";
4619 #endif
4620 
4621  Fw::TextLogString _logString;
4622  _logString.format(
4623  _formatString,
4624 #if FW_OBJECT_NAMES == 1
4625  this->m_objName.toChar(),
4626 #endif
4627  "CS_NoRecords ",
4628  fileName.toChar()
4629  );
4630 
4631  this->LogText_out(
4632  0,
4633  _id,
4634  _logTime,
4636  _logString
4637  );
4638  }
4639 #endif
4640  }
4641 
4642  // ----------------------------------------------------------------------
4643  // Telemetry serialized write
4644  // ----------------------------------------------------------------------
4645 
4648  FwChanIdType id,
4649  Fw::TlmBuffer& _tlmBuff,
4650  Fw::Time _tlmTime
4651  ) const
4652  {
4653  if (this->isConnected_tlmOut_OutputPort(0)) {
4654  if (
4656  (_tlmTime == Fw::ZERO_TIME)
4657  ) {
4658  this->timeCaller_out(0, _tlmTime);
4659  }
4660 
4661  FwChanIdType _id;
4662  _id = this->getIdBase() + id;
4663 
4664  this->tlmOut_out(
4665  0,
4666  _id,
4667  _tlmTime,
4668  _tlmBuff
4669  );
4670  }
4671  }
4672 
4673  // ----------------------------------------------------------------------
4674  // Telemetry write functions
4675  // ----------------------------------------------------------------------
4676 
4679  U32 arg,
4680  Fw::Time _tlmTime
4681  ) const
4682  {
4683  if (this->isConnected_tlmOut_OutputPort(0)) {
4684  Fw::TlmBuffer _tlmBuff;
4685  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4686  FW_ASSERT(
4687  _stat == Fw::FW_SERIALIZE_OK,
4688  static_cast<FwAssertArgType>(_stat)
4689  );
4690 
4691  this->tlmWrite(
4693  _tlmBuff,
4694  _tlmTime
4695  );
4696  }
4697  }
4698 
4701  U32 arg,
4702  Fw::Time _tlmTime
4703  ) const
4704  {
4705  if (this->isConnected_tlmOut_OutputPort(0)) {
4706  Fw::TlmBuffer _tlmBuff;
4707  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4708  FW_ASSERT(
4709  _stat == Fw::FW_SERIALIZE_OK,
4710  static_cast<FwAssertArgType>(_stat)
4711  );
4712 
4713  this->tlmWrite(
4715  _tlmBuff,
4716  _tlmTime
4717  );
4718  }
4719  }
4720 
4723  U32 arg,
4724  Fw::Time _tlmTime
4725  ) const
4726  {
4727  if (this->isConnected_tlmOut_OutputPort(0)) {
4728  Fw::TlmBuffer _tlmBuff;
4729  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4730  FW_ASSERT(
4731  _stat == Fw::FW_SERIALIZE_OK,
4732  static_cast<FwAssertArgType>(_stat)
4733  );
4734 
4735  this->tlmWrite(
4737  _tlmBuff,
4738  _tlmTime
4739  );
4740  }
4741  }
4742 
4745  U32 arg,
4746  Fw::Time _tlmTime
4747  ) const
4748  {
4749  if (this->isConnected_tlmOut_OutputPort(0)) {
4750  Fw::TlmBuffer _tlmBuff;
4751  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4752  FW_ASSERT(
4753  _stat == Fw::FW_SERIALIZE_OK,
4754  static_cast<FwAssertArgType>(_stat)
4755  );
4756 
4757  this->tlmWrite(
4759  _tlmBuff,
4760  _tlmTime
4761  );
4762  }
4763  }
4764 
4767  U32 arg,
4768  Fw::Time _tlmTime
4769  ) const
4770  {
4771  if (this->isConnected_tlmOut_OutputPort(0)) {
4772  Fw::TlmBuffer _tlmBuff;
4773  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4774  FW_ASSERT(
4775  _stat == Fw::FW_SERIALIZE_OK,
4776  static_cast<FwAssertArgType>(_stat)
4777  );
4778 
4779  this->tlmWrite(
4781  _tlmBuff,
4782  _tlmTime
4783  );
4784  }
4785  }
4786 
4787  // ----------------------------------------------------------------------
4788  // Time
4789  // ----------------------------------------------------------------------
4790 
4792  getTime() const
4793  {
4794  if (this->isConnected_timeCaller_OutputPort(0)) {
4795  Fw::Time _time;
4796  this->timeCaller_out(0, _time);
4797  return _time;
4798  }
4799  else {
4800  return Fw::Time(TimeBase::TB_NONE, 0, 0);
4801  }
4802  }
4803 
4804  // ----------------------------------------------------------------------
4805  // Message dispatch functions
4806  // ----------------------------------------------------------------------
4807 
4808  Fw::QueuedComponentBase::MsgDispatchStatus CmdSequencerComponentBase ::
4809  doDispatch()
4810  {
4811  ComponentIpcSerializableBuffer _msg;
4812  FwQueuePriorityType _priority = 0;
4813 
4814  Os::Queue::Status _msgStatus = this->m_queue.receive(
4815  _msg,
4817  _priority
4818  );
4819  FW_ASSERT(
4820  _msgStatus == Os::Queue::OP_OK,
4821  static_cast<FwAssertArgType>(_msgStatus)
4822  );
4823 
4824  // Reset to beginning of buffer
4825  _msg.resetDeser();
4826 
4827  FwEnumStoreType _desMsg = 0;
4828  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
4829  FW_ASSERT(
4830  _deserStatus == Fw::FW_SERIALIZE_OK,
4831  static_cast<FwAssertArgType>(_deserStatus)
4832  );
4833 
4834  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
4835 
4836  if (_msgType == CMDSEQUENCER_COMPONENT_EXIT) {
4837  return MSG_DISPATCH_EXIT;
4838  }
4839 
4840  FwIndexType portNum = 0;
4841  _deserStatus = _msg.deserializeTo(portNum);
4842  FW_ASSERT(
4843  _deserStatus == Fw::FW_SERIALIZE_OK,
4844  static_cast<FwAssertArgType>(_deserStatus)
4845  );
4846 
4847  switch (_msgType) {
4848  // Handle async input port cmdResponseIn
4849  case CMDRESPONSEIN_CMDRESPONSE: {
4850  // Deserialize argument opCode
4851  FwOpcodeType opCode;
4852  _deserStatus = _msg.deserializeTo(opCode);
4853  FW_ASSERT(
4854  _deserStatus == Fw::FW_SERIALIZE_OK,
4855  static_cast<FwAssertArgType>(_deserStatus)
4856  );
4857 
4858  // Deserialize argument cmdSeq
4859  U32 cmdSeq;
4860  _deserStatus = _msg.deserializeTo(cmdSeq);
4861  FW_ASSERT(
4862  _deserStatus == Fw::FW_SERIALIZE_OK,
4863  static_cast<FwAssertArgType>(_deserStatus)
4864  );
4865 
4866  // Deserialize argument response
4867  Fw::CmdResponse response;
4868  _deserStatus = _msg.deserializeTo(response);
4869  FW_ASSERT(
4870  _deserStatus == Fw::FW_SERIALIZE_OK,
4871  static_cast<FwAssertArgType>(_deserStatus)
4872  );
4873  // Call handler function
4874  this->cmdResponseIn_handler(
4875  portNum,
4876  opCode,
4877  cmdSeq,
4878  response
4879  );
4880 
4881  break;
4882  }
4883 
4884  // Handle async input port pingIn
4885  case PINGIN_PING: {
4886  // Deserialize argument key
4887  U32 key;
4888  _deserStatus = _msg.deserializeTo(key);
4889  FW_ASSERT(
4890  _deserStatus == Fw::FW_SERIALIZE_OK,
4891  static_cast<FwAssertArgType>(_deserStatus)
4892  );
4893  // Call handler function
4894  this->pingIn_handler(
4895  portNum,
4896  key
4897  );
4898 
4899  break;
4900  }
4901 
4902  // Handle async input port schedIn
4903  case SCHEDIN_SCHED: {
4904  // Deserialize argument context
4905  U32 context;
4906  _deserStatus = _msg.deserializeTo(context);
4907  FW_ASSERT(
4908  _deserStatus == Fw::FW_SERIALIZE_OK,
4909  static_cast<FwAssertArgType>(_deserStatus)
4910  );
4911  // Call handler function
4912  this->schedIn_handler(
4913  portNum,
4914  context
4915  );
4916 
4917  break;
4918  }
4919 
4920  // Handle async input port seqCancelIn
4921  case SEQCANCELIN_CMDSEQCANCEL: {
4922  // Call handler function
4923  this->seqCancelIn_handler(portNum);
4924 
4925  break;
4926  }
4927 
4928  // Handle async input port seqDispatchIn
4929  case SEQDISPATCHIN_FILEDISPATCH: {
4930  // Deserialize argument file_name
4931  char __fprime_ac_file_name_buffer[Fw::StringBase::BUFFER_SIZE(static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))];
4932  Fw::ExternalString file_name(__fprime_ac_file_name_buffer, sizeof __fprime_ac_file_name_buffer);
4933  _deserStatus = _msg.deserializeTo(file_name);
4934  FW_ASSERT(
4935  _deserStatus == Fw::FW_SERIALIZE_OK,
4936  static_cast<FwAssertArgType>(_deserStatus)
4937  );
4938  // Call handler function
4939  this->seqDispatchIn_handler(
4940  portNum,
4941  file_name
4942  );
4943 
4944  break;
4945  }
4946 
4947  // Handle async input port seqRunIn
4948  case SEQRUNIN_CMDSEQIN: {
4949  // Deserialize argument filename
4950  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
4951  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
4952  _deserStatus = _msg.deserializeTo(filename);
4953  FW_ASSERT(
4954  _deserStatus == Fw::FW_SERIALIZE_OK,
4955  static_cast<FwAssertArgType>(_deserStatus)
4956  );
4957  // Call handler function
4958  this->seqRunIn_handler(
4959  portNum,
4960  filename
4961  );
4962 
4963  break;
4964  }
4965 
4966  // Handle command CS_RUN
4967  case CMD_CS_RUN: {
4968  // Deserialize opcode
4969  FwOpcodeType _opCode = 0;
4970  _deserStatus = _msg.deserializeTo(_opCode);
4971  FW_ASSERT (
4972  _deserStatus == Fw::FW_SERIALIZE_OK,
4973  static_cast<FwAssertArgType>(_deserStatus)
4974  );
4975 
4976  // Deserialize command sequence
4977  U32 _cmdSeq = 0;
4978  _deserStatus = _msg.deserializeTo(_cmdSeq);
4979  FW_ASSERT (
4980  _deserStatus == Fw::FW_SERIALIZE_OK,
4981  static_cast<FwAssertArgType>(_deserStatus)
4982  );
4983 
4984  // Deserialize command argument buffer
4985  Fw::CmdArgBuffer args;
4986  _deserStatus = _msg.deserializeTo(args);
4987  FW_ASSERT (
4988  _deserStatus == Fw::FW_SERIALIZE_OK,
4989  static_cast<FwAssertArgType>(_deserStatus)
4990  );
4991 
4992  // Reset buffer
4993  args.resetDeser();
4994 
4995  // Deserialize argument fileName
4996  Fw::CmdStringArg fileName;
4997  _deserStatus = args.deserializeTo(fileName);
4998  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5000  this->cmdResponse_out(
5001  _opCode,
5002  _cmdSeq,
5004  );
5005  }
5006  // Don't crash the task if bad arguments were passed from the ground
5007  break;
5008  }
5009 
5010  // Deserialize argument block
5012  _deserStatus = args.deserializeTo(block);
5013  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5015  this->cmdResponse_out(
5016  _opCode,
5017  _cmdSeq,
5019  );
5020  }
5021  // Don't crash the task if bad arguments were passed from the ground
5022  break;
5023  }
5024 
5025  // Make sure there was no data left over.
5026  // That means the argument buffer size was incorrect.
5027 #if FW_CMD_CHECK_RESIDUAL
5028  if (args.getDeserializeSizeLeft() != 0) {
5030  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5031  }
5032  // Don't crash the task if bad arguments were passed from the ground
5033  break;
5034  }
5035 #endif
5036 
5037  // Call handler function
5038  this->CS_RUN_cmdHandler(
5039  _opCode, _cmdSeq,
5040  fileName,
5041  block
5042  );
5043 
5044  break;
5045  }
5046 
5047  // Handle command CS_VALIDATE
5048  case CMD_CS_VALIDATE: {
5049  // Deserialize opcode
5050  FwOpcodeType _opCode = 0;
5051  _deserStatus = _msg.deserializeTo(_opCode);
5052  FW_ASSERT (
5053  _deserStatus == Fw::FW_SERIALIZE_OK,
5054  static_cast<FwAssertArgType>(_deserStatus)
5055  );
5056 
5057  // Deserialize command sequence
5058  U32 _cmdSeq = 0;
5059  _deserStatus = _msg.deserializeTo(_cmdSeq);
5060  FW_ASSERT (
5061  _deserStatus == Fw::FW_SERIALIZE_OK,
5062  static_cast<FwAssertArgType>(_deserStatus)
5063  );
5064 
5065  // Deserialize command argument buffer
5066  Fw::CmdArgBuffer args;
5067  _deserStatus = _msg.deserializeTo(args);
5068  FW_ASSERT (
5069  _deserStatus == Fw::FW_SERIALIZE_OK,
5070  static_cast<FwAssertArgType>(_deserStatus)
5071  );
5072 
5073  // Reset buffer
5074  args.resetDeser();
5075 
5076  // Deserialize argument fileName
5077  Fw::CmdStringArg fileName;
5078  _deserStatus = args.deserializeTo(fileName);
5079  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5081  this->cmdResponse_out(
5082  _opCode,
5083  _cmdSeq,
5085  );
5086  }
5087  // Don't crash the task if bad arguments were passed from the ground
5088  break;
5089  }
5090 
5091  // Make sure there was no data left over.
5092  // That means the argument buffer size was incorrect.
5093 #if FW_CMD_CHECK_RESIDUAL
5094  if (args.getDeserializeSizeLeft() != 0) {
5096  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5097  }
5098  // Don't crash the task if bad arguments were passed from the ground
5099  break;
5100  }
5101 #endif
5102 
5103  // Call handler function
5104  this->CS_VALIDATE_cmdHandler(
5105  _opCode, _cmdSeq,
5106  fileName
5107  );
5108 
5109  break;
5110  }
5111 
5112  // Handle command CS_CANCEL
5113  case CMD_CS_CANCEL: {
5114  // Deserialize opcode
5115  FwOpcodeType _opCode = 0;
5116  _deserStatus = _msg.deserializeTo(_opCode);
5117  FW_ASSERT (
5118  _deserStatus == Fw::FW_SERIALIZE_OK,
5119  static_cast<FwAssertArgType>(_deserStatus)
5120  );
5121 
5122  // Deserialize command sequence
5123  U32 _cmdSeq = 0;
5124  _deserStatus = _msg.deserializeTo(_cmdSeq);
5125  FW_ASSERT (
5126  _deserStatus == Fw::FW_SERIALIZE_OK,
5127  static_cast<FwAssertArgType>(_deserStatus)
5128  );
5129 
5130  // Deserialize command argument buffer
5131  Fw::CmdArgBuffer args;
5132  _deserStatus = _msg.deserializeTo(args);
5133  FW_ASSERT (
5134  _deserStatus == Fw::FW_SERIALIZE_OK,
5135  static_cast<FwAssertArgType>(_deserStatus)
5136  );
5137 
5138  // Reset buffer
5139  args.resetDeser();
5140 
5141  // Make sure there was no data left over.
5142  // That means the argument buffer size was incorrect.
5143 #if FW_CMD_CHECK_RESIDUAL
5144  if (args.getDeserializeSizeLeft() != 0) {
5146  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5147  }
5148  // Don't crash the task if bad arguments were passed from the ground
5149  break;
5150  }
5151 #endif
5152 
5153  // Call handler function
5154  this->CS_CANCEL_cmdHandler(_opCode, _cmdSeq);
5155 
5156  break;
5157  }
5158 
5159  // Handle command CS_START
5160  case CMD_CS_START: {
5161  // Deserialize opcode
5162  FwOpcodeType _opCode = 0;
5163  _deserStatus = _msg.deserializeTo(_opCode);
5164  FW_ASSERT (
5165  _deserStatus == Fw::FW_SERIALIZE_OK,
5166  static_cast<FwAssertArgType>(_deserStatus)
5167  );
5168 
5169  // Deserialize command sequence
5170  U32 _cmdSeq = 0;
5171  _deserStatus = _msg.deserializeTo(_cmdSeq);
5172  FW_ASSERT (
5173  _deserStatus == Fw::FW_SERIALIZE_OK,
5174  static_cast<FwAssertArgType>(_deserStatus)
5175  );
5176 
5177  // Deserialize command argument buffer
5178  Fw::CmdArgBuffer args;
5179  _deserStatus = _msg.deserializeTo(args);
5180  FW_ASSERT (
5181  _deserStatus == Fw::FW_SERIALIZE_OK,
5182  static_cast<FwAssertArgType>(_deserStatus)
5183  );
5184 
5185  // Reset buffer
5186  args.resetDeser();
5187 
5188  // Make sure there was no data left over.
5189  // That means the argument buffer size was incorrect.
5190 #if FW_CMD_CHECK_RESIDUAL
5191  if (args.getDeserializeSizeLeft() != 0) {
5193  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5194  }
5195  // Don't crash the task if bad arguments were passed from the ground
5196  break;
5197  }
5198 #endif
5199 
5200  // Call handler function
5201  this->CS_START_cmdHandler(_opCode, _cmdSeq);
5202 
5203  break;
5204  }
5205 
5206  // Handle command CS_STEP
5207  case CMD_CS_STEP: {
5208  // Deserialize opcode
5209  FwOpcodeType _opCode = 0;
5210  _deserStatus = _msg.deserializeTo(_opCode);
5211  FW_ASSERT (
5212  _deserStatus == Fw::FW_SERIALIZE_OK,
5213  static_cast<FwAssertArgType>(_deserStatus)
5214  );
5215 
5216  // Deserialize command sequence
5217  U32 _cmdSeq = 0;
5218  _deserStatus = _msg.deserializeTo(_cmdSeq);
5219  FW_ASSERT (
5220  _deserStatus == Fw::FW_SERIALIZE_OK,
5221  static_cast<FwAssertArgType>(_deserStatus)
5222  );
5223 
5224  // Deserialize command argument buffer
5225  Fw::CmdArgBuffer args;
5226  _deserStatus = _msg.deserializeTo(args);
5227  FW_ASSERT (
5228  _deserStatus == Fw::FW_SERIALIZE_OK,
5229  static_cast<FwAssertArgType>(_deserStatus)
5230  );
5231 
5232  // Reset buffer
5233  args.resetDeser();
5234 
5235  // Make sure there was no data left over.
5236  // That means the argument buffer size was incorrect.
5237 #if FW_CMD_CHECK_RESIDUAL
5238  if (args.getDeserializeSizeLeft() != 0) {
5240  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5241  }
5242  // Don't crash the task if bad arguments were passed from the ground
5243  break;
5244  }
5245 #endif
5246 
5247  // Call handler function
5248  this->CS_STEP_cmdHandler(_opCode, _cmdSeq);
5249 
5250  break;
5251  }
5252 
5253  // Handle command CS_AUTO
5254  case CMD_CS_AUTO: {
5255  // Deserialize opcode
5256  FwOpcodeType _opCode = 0;
5257  _deserStatus = _msg.deserializeTo(_opCode);
5258  FW_ASSERT (
5259  _deserStatus == Fw::FW_SERIALIZE_OK,
5260  static_cast<FwAssertArgType>(_deserStatus)
5261  );
5262 
5263  // Deserialize command sequence
5264  U32 _cmdSeq = 0;
5265  _deserStatus = _msg.deserializeTo(_cmdSeq);
5266  FW_ASSERT (
5267  _deserStatus == Fw::FW_SERIALIZE_OK,
5268  static_cast<FwAssertArgType>(_deserStatus)
5269  );
5270 
5271  // Deserialize command argument buffer
5272  Fw::CmdArgBuffer args;
5273  _deserStatus = _msg.deserializeTo(args);
5274  FW_ASSERT (
5275  _deserStatus == Fw::FW_SERIALIZE_OK,
5276  static_cast<FwAssertArgType>(_deserStatus)
5277  );
5278 
5279  // Reset buffer
5280  args.resetDeser();
5281 
5282  // Make sure there was no data left over.
5283  // That means the argument buffer size was incorrect.
5284 #if FW_CMD_CHECK_RESIDUAL
5285  if (args.getDeserializeSizeLeft() != 0) {
5287  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5288  }
5289  // Don't crash the task if bad arguments were passed from the ground
5290  break;
5291  }
5292 #endif
5293 
5294  // Call handler function
5295  this->CS_AUTO_cmdHandler(_opCode, _cmdSeq);
5296 
5297  break;
5298  }
5299 
5300  // Handle command CS_MANUAL
5301  case CMD_CS_MANUAL: {
5302  // Deserialize opcode
5303  FwOpcodeType _opCode = 0;
5304  _deserStatus = _msg.deserializeTo(_opCode);
5305  FW_ASSERT (
5306  _deserStatus == Fw::FW_SERIALIZE_OK,
5307  static_cast<FwAssertArgType>(_deserStatus)
5308  );
5309 
5310  // Deserialize command sequence
5311  U32 _cmdSeq = 0;
5312  _deserStatus = _msg.deserializeTo(_cmdSeq);
5313  FW_ASSERT (
5314  _deserStatus == Fw::FW_SERIALIZE_OK,
5315  static_cast<FwAssertArgType>(_deserStatus)
5316  );
5317 
5318  // Deserialize command argument buffer
5319  Fw::CmdArgBuffer args;
5320  _deserStatus = _msg.deserializeTo(args);
5321  FW_ASSERT (
5322  _deserStatus == Fw::FW_SERIALIZE_OK,
5323  static_cast<FwAssertArgType>(_deserStatus)
5324  );
5325 
5326  // Reset buffer
5327  args.resetDeser();
5328 
5329  // Make sure there was no data left over.
5330  // That means the argument buffer size was incorrect.
5331 #if FW_CMD_CHECK_RESIDUAL
5332  if (args.getDeserializeSizeLeft() != 0) {
5334  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5335  }
5336  // Don't crash the task if bad arguments were passed from the ground
5337  break;
5338  }
5339 #endif
5340 
5341  // Call handler function
5342  this->CS_MANUAL_cmdHandler(_opCode, _cmdSeq);
5343 
5344  break;
5345  }
5346 
5347  // Handle command CS_JOIN_WAIT
5348  case CMD_CS_JOIN_WAIT: {
5349  // Deserialize opcode
5350  FwOpcodeType _opCode = 0;
5351  _deserStatus = _msg.deserializeTo(_opCode);
5352  FW_ASSERT (
5353  _deserStatus == Fw::FW_SERIALIZE_OK,
5354  static_cast<FwAssertArgType>(_deserStatus)
5355  );
5356 
5357  // Deserialize command sequence
5358  U32 _cmdSeq = 0;
5359  _deserStatus = _msg.deserializeTo(_cmdSeq);
5360  FW_ASSERT (
5361  _deserStatus == Fw::FW_SERIALIZE_OK,
5362  static_cast<FwAssertArgType>(_deserStatus)
5363  );
5364 
5365  // Deserialize command argument buffer
5366  Fw::CmdArgBuffer args;
5367  _deserStatus = _msg.deserializeTo(args);
5368  FW_ASSERT (
5369  _deserStatus == Fw::FW_SERIALIZE_OK,
5370  static_cast<FwAssertArgType>(_deserStatus)
5371  );
5372 
5373  // Reset buffer
5374  args.resetDeser();
5375 
5376  // Make sure there was no data left over.
5377  // That means the argument buffer size was incorrect.
5378 #if FW_CMD_CHECK_RESIDUAL
5379  if (args.getDeserializeSizeLeft() != 0) {
5381  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5382  }
5383  // Don't crash the task if bad arguments were passed from the ground
5384  break;
5385  }
5386 #endif
5387 
5388  // Call handler function
5389  this->CS_JOIN_WAIT_cmdHandler(_opCode, _cmdSeq);
5390 
5391  break;
5392  }
5393 
5394  default:
5395  return MSG_DISPATCH_ERROR;
5396  }
5397 
5398  return MSG_DISPATCH_OK;
5399  }
5400 
5401  // ----------------------------------------------------------------------
5402  // Calls for messages received on special input ports
5403  // ----------------------------------------------------------------------
5404 
5405  void CmdSequencerComponentBase ::
5406  m_p_cmdIn_in(
5407  Fw::PassiveComponentBase* callComp,
5408  FwIndexType portNum,
5409  FwOpcodeType opCode,
5410  U32 cmdSeq,
5411  Fw::CmdArgBuffer& args
5412  )
5413  {
5414  FW_ASSERT(callComp);
5415  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5416  compPtr->cmdIn_handlerBase(
5417  portNum,
5418  opCode,
5419  cmdSeq,
5420  args
5421  );
5422  }
5423 
5424  // ----------------------------------------------------------------------
5425  // Calls for messages received on typed input ports
5426  // ----------------------------------------------------------------------
5427 
5428  void CmdSequencerComponentBase ::
5429  m_p_cmdResponseIn_in(
5430  Fw::PassiveComponentBase* callComp,
5431  FwIndexType portNum,
5432  FwOpcodeType opCode,
5433  U32 cmdSeq,
5434  const Fw::CmdResponse& response
5435  )
5436  {
5437  FW_ASSERT(callComp);
5438  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5439  compPtr->cmdResponseIn_handlerBase(
5440  portNum,
5441  opCode,
5442  cmdSeq,
5443  response
5444  );
5445  }
5446 
5447  void CmdSequencerComponentBase ::
5448  m_p_pingIn_in(
5449  Fw::PassiveComponentBase* callComp,
5450  FwIndexType portNum,
5451  U32 key
5452  )
5453  {
5454  FW_ASSERT(callComp);
5455  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5456  compPtr->pingIn_handlerBase(
5457  portNum,
5458  key
5459  );
5460  }
5461 
5462  void CmdSequencerComponentBase ::
5463  m_p_schedIn_in(
5464  Fw::PassiveComponentBase* callComp,
5465  FwIndexType portNum,
5466  U32 context
5467  )
5468  {
5469  FW_ASSERT(callComp);
5470  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5471  compPtr->schedIn_handlerBase(
5472  portNum,
5473  context
5474  );
5475  }
5476 
5477  void CmdSequencerComponentBase ::
5478  m_p_seqCancelIn_in(
5479  Fw::PassiveComponentBase* callComp,
5480  FwIndexType portNum
5481  )
5482  {
5483  FW_ASSERT(callComp);
5484  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5485  compPtr->seqCancelIn_handlerBase(portNum);
5486  }
5487 
5488  void CmdSequencerComponentBase ::
5489  m_p_seqDispatchIn_in(
5490  Fw::PassiveComponentBase* callComp,
5491  FwIndexType portNum,
5492  Fw::StringBase& file_name
5493  )
5494  {
5495  FW_ASSERT(callComp);
5496  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5497  compPtr->seqDispatchIn_handlerBase(
5498  portNum,
5499  file_name
5500  );
5501  }
5502 
5503  void CmdSequencerComponentBase ::
5504  m_p_seqRunIn_in(
5505  Fw::PassiveComponentBase* callComp,
5506  FwIndexType portNum,
5507  const Fw::StringBase& filename
5508  )
5509  {
5510  FW_ASSERT(callComp);
5511  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5512  compPtr->seqRunIn_handlerBase(
5513  portNum,
5514  filename
5515  );
5516  }
5517 
5518 #if !FW_DIRECT_PORT_CALLS
5519 
5520  // ----------------------------------------------------------------------
5521  // Invocation functions for special output ports
5522  // ----------------------------------------------------------------------
5523 
5524 #if FW_ENABLE_TEXT_LOGGING
5525 
5526  void CmdSequencerComponentBase ::
5527  LogText_out(
5528  FwIndexType portNum,
5529  FwEventIdType id,
5530  Fw::Time& timeTag,
5531  const Fw::LogSeverity& severity,
5532  Fw::TextLogString& text
5533  ) const
5534  {
5535  FW_ASSERT(
5536  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
5537  static_cast<FwAssertArgType>(portNum)
5538  );
5539 
5540  FW_ASSERT(
5541  this->m_LogText_OutputPort[portNum].isConnected(),
5542  static_cast<FwAssertArgType>(portNum)
5543  );
5544  this->m_LogText_OutputPort[portNum].invoke(
5545  id,
5546  timeTag,
5547  severity,
5548  text
5549  );
5550  }
5551 
5552 #endif
5553 
5554  void CmdSequencerComponentBase ::
5555  cmdRegOut_out(
5556  FwIndexType portNum,
5557  FwOpcodeType opCode
5558  ) const
5559  {
5560  FW_ASSERT(
5561  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
5562  static_cast<FwAssertArgType>(portNum)
5563  );
5564 
5565  FW_ASSERT(
5566  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
5567  static_cast<FwAssertArgType>(portNum)
5568  );
5569  this->m_cmdRegOut_OutputPort[portNum].invoke(
5570  opCode
5571  );
5572  }
5573 
5574  void CmdSequencerComponentBase ::
5575  cmdResponseOut_out(
5576  FwIndexType portNum,
5577  FwOpcodeType opCode,
5578  U32 cmdSeq,
5579  const Fw::CmdResponse& response
5580  ) const
5581  {
5582  FW_ASSERT(
5583  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
5584  static_cast<FwAssertArgType>(portNum)
5585  );
5586 
5587  FW_ASSERT(
5588  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
5589  static_cast<FwAssertArgType>(portNum)
5590  );
5591  this->m_cmdResponseOut_OutputPort[portNum].invoke(
5592  opCode,
5593  cmdSeq,
5594  response
5595  );
5596  }
5597 
5598  void CmdSequencerComponentBase ::
5599  logOut_out(
5600  FwIndexType portNum,
5601  FwEventIdType id,
5602  Fw::Time& timeTag,
5603  const Fw::LogSeverity& severity,
5604  Fw::LogBuffer& args
5605  ) const
5606  {
5607  FW_ASSERT(
5608  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
5609  static_cast<FwAssertArgType>(portNum)
5610  );
5611 
5612  FW_ASSERT(
5613  this->m_logOut_OutputPort[portNum].isConnected(),
5614  static_cast<FwAssertArgType>(portNum)
5615  );
5616  this->m_logOut_OutputPort[portNum].invoke(
5617  id,
5618  timeTag,
5619  severity,
5620  args
5621  );
5622  }
5623 
5624  void CmdSequencerComponentBase ::
5625  timeCaller_out(
5626  FwIndexType portNum,
5627  Fw::Time& time
5628  ) const
5629  {
5630  FW_ASSERT(
5631  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
5632  static_cast<FwAssertArgType>(portNum)
5633  );
5634 
5635  FW_ASSERT(
5636  this->m_timeCaller_OutputPort[portNum].isConnected(),
5637  static_cast<FwAssertArgType>(portNum)
5638  );
5639  this->m_timeCaller_OutputPort[portNum].invoke(
5640  time
5641  );
5642  }
5643 
5644  void CmdSequencerComponentBase ::
5645  tlmOut_out(
5646  FwIndexType portNum,
5647  FwChanIdType id,
5648  Fw::Time& timeTag,
5649  Fw::TlmBuffer& val
5650  ) const
5651  {
5652  FW_ASSERT(
5653  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
5654  static_cast<FwAssertArgType>(portNum)
5655  );
5656 
5657  FW_ASSERT(
5658  this->m_tlmOut_OutputPort[portNum].isConnected(),
5659  static_cast<FwAssertArgType>(portNum)
5660  );
5661  this->m_tlmOut_OutputPort[portNum].invoke(
5662  id,
5663  timeTag,
5664  val
5665  );
5666  }
5667 
5668 #endif
5669 
5670 }
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
static constexpr FwIndexType getNum_cmdIn_InputPorts()
Serialization/Deserialization operation was successful.
void log_WARNING_HI_CS_TimeContextMismatch(const Fw::StringBase &fileName, U8 currTimeBase, U8 seqTimeBase) const
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void log_WARNING_HI_CS_FileInvalid(const Fw::StringBase &fileName, Svc::CmdSequencer_FileReadStage stage, I32 error) const
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
void tlmWrite_CS_LoadCommands(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
Definition: ComPortAc.cpp:181
void init()
Initialization function.
Definition: ComPortAc.cpp:162
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
A sequence related command came with no active sequence.
static constexpr FwIndexType getNum_cmdResponseIn_InputPorts()
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:26
static constexpr FwIndexType getNum_logOut_OutputPorts()
virtual void seqDispatchIn_handler(FwIndexType portNum, Fw::StringBase &file_name)=0
Handler for input port seqDispatchIn.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void log_WARNING_HI_CS_FileSizeError(const Fw::StringBase &fileName, U32 size) const
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
void log_ACTIVITY_HI_CS_ModeSwitched(Svc::CmdSequencer_SeqMode mode) const
static constexpr FwSizeType CAPACITY
void cmdResponseIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port cmdResponseIn.
PlatformSizeType FwSizeType
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
I32 FwEnumStoreType
void tlmWrite_CS_Errors(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void log_WARNING_HI_CS_FileNotFound(const Fw::StringBase &fileName) const
void CS_VALIDATE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
static constexpr FwIndexType getNum_seqDispatchIn_InputPorts()
void log_ACTIVITY_HI_CS_JoinWaiting(const Fw::StringBase &filename, U32 recordNumber, FwOpcodeType opCode) const
Status
status returned from the queue send function
Definition: Queue.hpp:30
void init()
Initialization function.
void CS_MANUAL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
void regCommands()
Register commands with the Command Dispatcher.
void init()
Initialization function.
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
virtual void schedIn_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port schedIn.
Wait for the current running sequence file complete.
void log_WARNING_HI_CS_UnexpectedCompletion(FwOpcodeType opcode) const
virtual void CS_AUTO_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_AUTO.
The stage of the file read operation.
void log_ACTIVITY_LO_CS_SequenceLoaded(const Fw::StringBase &fileName) const
void CS_STEP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
static constexpr FwIndexType getNum_seqRunIn_InputPorts()
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
The Command Sequencer issued a command and received an error status in return.
const Time ZERO_TIME
Definition: Time.cpp:5
static constexpr FwIndexType getNum_schedIn_InputPorts()
void log_ACTIVITY_HI_CS_CmdStarted(const Fw::StringBase &filename) const
virtual void CS_VALIDATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)=0
Fw::InputCmdResponsePort * get_cmdResponseIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_seqDone_OutputPorts()
virtual void seqCancelIn_handler(FwIndexType portNum)=0
Handler for input port seqCancelIn.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
Enum representing a command response.
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
No time base has been established (Required)
void seqRunIn_handlerBase(FwIndexType portNum, const Fw::StringBase &filename)
Handler base-class function for input port seqRunIn.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
bool isConnected_seqDone_OutputPort(FwIndexType portNum) const
void CS_START_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_WARNING_HI_CS_SequenceTimeout(const Fw::StringBase &filename, U32 command) const
bool isConnected_seqStartOut_OutputPort(FwIndexType portNum) const
virtual void CS_CANCEL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_CANCEL.
Os::Queue m_queue
queue object for active component
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void init()
Object initializer.
Definition: ObjBase.cpp:24
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
Wait for sequences that are running to finish. Allow user to run multiple seq files in SEQ_NO_BLOCK m...
SerializeStatus
forward declaration for string
void set_seqDone_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to seqDone[portNum].
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
Message will block until space is available.
Definition: Queue.hpp:47
virtual void CS_RUN_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_RUN.
void tlmWrite_CS_CancelCommands(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
FwIdType FwEventIdType
The type of an event identifier.
virtual ~CmdSequencerComponentBase()
Destroy CmdSequencerComponentBase object.
A local port request to run a sequence was started.
void tlmWrite_CS_CommandsExecuted(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
The Sequence File Loader could not read the sequence file.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
virtual void seqRunIn_preMsgHook(FwIndexType portNum, const Fw::StringBase &filename)
Pre-message hook for async input port seqRunIn.
void log_ACTIVITY_HI_CS_PortSequenceStarted(const Fw::StringBase &filename) const
void log_WARNING_HI_CS_RecordInvalid(const Fw::StringBase &fileName, U32 recordNumber, I32 error) const
void log_ACTIVITY_HI_CS_SequenceCanceled(const Fw::StringBase &fileName) const
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
virtual void CS_RUN_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, Svc::CmdSequencer_BlockState block)=0
void init()
Initialization function.
Definition: TimePortAc.cpp:151
The running time base doesn&#39;t match the time base in the sequence files.
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void log_WARNING_HI_CS_RecordMismatch(const Fw::StringBase &fileName, U32 header_records, U32 extra_bytes) const
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
A command status came back when no sequence was running.
void init()
Initialization function.
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:94
A less serious but recoverable event.
The size of the serial representation.
void init()
Initialization function.
Definition: PingPortAc.cpp:151
virtual void cmdResponseIn_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port cmdResponseIn.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
void CS_JOIN_WAIT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Svc::InputCmdSeqInPort * get_seqRunIn_InputPort(FwIndexType portNum)
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
FwIdType FwChanIdType
The type of a telemetry channel identifier.
FwSizeType SizeType
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
virtual void CS_START_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Perform one step in a command sequence. Valid only if CmdSequencer is in MANUAL run mode...
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
The running time base doesn&#39;t match the time base in the sequence files.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
virtual void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename)=0
Handler for input port seqRunIn.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
The Command Sequencer received a command that was invalid for its current mode.
A string backed by an external buffer.
A serious but recoverable event.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
void CS_AUTO_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void invoke(const Fw::StringBase &filename) const
Invoke a port connection.
virtual void CS_START_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_START.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void set_comCmdOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comCmdOut[portNum].
static constexpr FwIndexType getNum_seqStartOut_OutputPorts()
static constexpr FwSizeType CAPACITY
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
BlockingType
message type
Definition: Queue.hpp:46
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
virtual void CS_AUTO_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
The Command Sequencer issued a command and received a success status in return.
void log_WARNING_HI_CS_FileCrcFailure(const Fw::StringBase &fileName, U32 storedCRC, U32 computedCRC) const
Important informational events.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:79
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
A command in a sequence was stepped through.
virtual void CS_MANUAL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_MANUAL.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
void CS_CANCEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_seqStartOut_OutputPort(FwIndexType portNum, Svc::InputCmdSeqInPort *port)
Connect port to seqStartOut[portNum].
void log_WARNING_HI_CS_TimeBaseMismatch(const Fw::StringBase &fileName, U16 time_base, U16 seq_time_base) const
A message was sent requesting an exit of the loop.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
virtual void CS_STEP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_STEP.
PlatformIndexType FwIndexType
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void seqStartOut_out(FwIndexType portNum, const Fw::StringBase &filename) const
Invoke output port seqStartOut.
void seqCancelIn_handlerBase(FwIndexType portNum)
Handler base-class function for input port seqCancelIn.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
void addCallPort(InputCmdSeqInPort *callPort)
Register an input port.
void init()
Initialization function.
void init()
Initialization function.
Definition: PingPortAc.cpp:73
void CS_RUN_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Svc::InputFileDispatchPort * get_seqDispatchIn_InputPort(FwIndexType portNum)
void comCmdOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port comCmdOut.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
static constexpr FwIndexType getNum_seqCancelIn_InputPorts()
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
RateGroupDivider component implementation.
virtual void CS_VALIDATE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_VALIDATE.
void log_ACTIVITY_HI_CS_SequenceComplete(const Fw::StringBase &fileName) const
virtual void CS_STEP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void seqDone_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke output port seqDone.
void log_ACTIVITY_LO_CS_CommandComplete(const Fw::StringBase &fileName, U32 recordNumber, FwOpcodeType opCode) const
message sent/received okay
Definition: Queue.hpp:31
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
U8 BYTE
byte type
Definition: BasicTypes.h:56
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:168
virtual void CS_MANUAL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
CmdSequencerComponentBase(const char *compName="")
Construct CmdSequencerComponentBase object.
void seqDispatchIn_handlerBase(FwIndexType portNum, Fw::StringBase &file_name)
Handler base-class function for input port seqDispatchIn.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
static constexpr FwSizeType CAPACITY
static constexpr FwIndexType getNum_pingIn_InputPorts()
Cannot run new sequence when current sequence file is still running.
virtual void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port cmdResponseIn.
void log_WARNING_LO_CS_NoRecords(const Fw::StringBase &fileName) const
Log event CS_NoRecords.
virtual void CS_JOIN_WAIT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
virtual void seqCancelIn_preMsgHook(FwIndexType portNum)
Pre-message hook for async input port seqCancelIn.
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
void log_WARNING_HI_CS_CommandError(const Fw::StringBase &fileName, U32 recordNumber, FwOpcodeType opCode, U32 errorStatus) const
void init()
Initialization function.
virtual void CS_CANCEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
static constexpr FwIndexType getNum_comCmdOut_OutputPorts()
Svc::InputCmdSeqCancelPort * get_seqCancelIn_InputPort(FwIndexType portNum)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
virtual void seqDispatchIn_preMsgHook(FwIndexType portNum, Fw::StringBase &file_name)
Pre-message hook for async input port seqDispatchIn.
bool isConnected_comCmdOut_OutputPort(FwIndexType portNum) const
void log_ACTIVITY_HI_CS_SequenceValid(const Fw::StringBase &filename) const
void log_WARNING_HI_CS_FileReadError(const Fw::StringBase &fileName) const
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void tlmWrite_CS_SequencesCompleted(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void log_ACTIVITY_HI_CS_CmdStepped(const Fw::StringBase &filename, U32 command) const
message to exit active component task
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
virtual void CS_JOIN_WAIT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_JOIN_WAIT.
Number of records in header doesn&#39;t match number in file.