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  const Svc::SeqArgs& args
1486  )
1487  {
1488  // Make sure port number is valid
1489  FW_ASSERT(
1490  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
1491  static_cast<FwAssertArgType>(portNum)
1492  );
1493 
1494  // Call pre-message hook
1496  portNum,
1497  filename,
1498  args
1499  );
1500  ComponentIpcSerializableBuffer msg;
1502 
1503  // Serialize message ID
1504  _status = msg.serializeFrom(
1505  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
1506  );
1507  FW_ASSERT(
1508  _status == Fw::FW_SERIALIZE_OK,
1509  static_cast<FwAssertArgType>(_status)
1510  );
1511 
1512  // Serialize port number
1513  _status = msg.serializeFrom(portNum);
1514  FW_ASSERT(
1515  _status == Fw::FW_SERIALIZE_OK,
1516  static_cast<FwAssertArgType>(_status)
1517  );
1518 
1519  // Serialize argument filename
1520  _status = filename.serializeTo(msg, 240);
1521  FW_ASSERT(
1522  _status == Fw::FW_SERIALIZE_OK,
1523  static_cast<FwAssertArgType>(_status)
1524  );
1525 
1526  // Serialize argument args
1527  _status = msg.serializeFrom(args);
1528  FW_ASSERT(
1529  _status == Fw::FW_SERIALIZE_OK,
1530  static_cast<FwAssertArgType>(_status)
1531  );
1532 
1533  // Send message
1535  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1536 
1537  FW_ASSERT(
1538  qStatus == Os::Queue::OP_OK,
1539  static_cast<FwAssertArgType>(qStatus)
1540  );
1541  }
1542 
1543  // ----------------------------------------------------------------------
1544  // Pre-message hooks for typed async input ports
1545  //
1546  // Each of these functions is invoked just before processing a message
1547  // on the corresponding port. By default, they do nothing. You can
1548  // override them to provide specific pre-message behavior.
1549  // ----------------------------------------------------------------------
1550 
1553  FwIndexType portNum,
1554  FwOpcodeType opCode,
1555  U32 cmdSeq,
1556  const Fw::CmdResponse& response
1557  )
1558  {
1559  // Default: no-op
1560  }
1561 
1564  FwIndexType portNum,
1565  U32 key
1566  )
1567  {
1568  // Default: no-op
1569  }
1570 
1573  FwIndexType portNum,
1574  U32 context
1575  )
1576  {
1577  // Default: no-op
1578  }
1579 
1582  {
1583  // Default: no-op
1584  }
1585 
1588  FwIndexType portNum,
1589  Fw::StringBase& file_name
1590  )
1591  {
1592  // Default: no-op
1593  }
1594 
1597  FwIndexType portNum,
1598  const Fw::StringBase& filename,
1599  const Svc::SeqArgs& args
1600  )
1601  {
1602  // Default: no-op
1603  }
1604 
1605 #if !FW_DIRECT_PORT_CALLS
1606 
1607  // ----------------------------------------------------------------------
1608  // Invocation functions for typed output ports
1609  // ----------------------------------------------------------------------
1610 
1613  FwIndexType portNum,
1614  Fw::ComBuffer& data,
1615  U32 context
1616  ) const
1617  {
1618  FW_ASSERT(
1619  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
1620  static_cast<FwAssertArgType>(portNum)
1621  );
1622 
1623  FW_ASSERT(
1624  this->m_comCmdOut_OutputPort[portNum].isConnected(),
1625  static_cast<FwAssertArgType>(portNum)
1626  );
1627  this->m_comCmdOut_OutputPort[portNum].invoke(
1628  data,
1629  context
1630  );
1631  }
1632 
1635  FwIndexType portNum,
1636  U32 key
1637  ) const
1638  {
1639  FW_ASSERT(
1640  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1641  static_cast<FwAssertArgType>(portNum)
1642  );
1643 
1644  FW_ASSERT(
1645  this->m_pingOut_OutputPort[portNum].isConnected(),
1646  static_cast<FwAssertArgType>(portNum)
1647  );
1648  this->m_pingOut_OutputPort[portNum].invoke(
1649  key
1650  );
1651  }
1652 
1655  FwIndexType portNum,
1656  FwOpcodeType opCode,
1657  U32 cmdSeq,
1658  const Fw::CmdResponse& response
1659  ) const
1660  {
1661  FW_ASSERT(
1662  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
1663  static_cast<FwAssertArgType>(portNum)
1664  );
1665 
1666  FW_ASSERT(
1667  this->m_seqDone_OutputPort[portNum].isConnected(),
1668  static_cast<FwAssertArgType>(portNum)
1669  );
1670  this->m_seqDone_OutputPort[portNum].invoke(
1671  opCode,
1672  cmdSeq,
1673  response
1674  );
1675  }
1676 
1679  FwIndexType portNum,
1680  const Fw::StringBase& filename,
1681  const Svc::SeqArgs& args
1682  ) const
1683  {
1684  FW_ASSERT(
1685  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1686  static_cast<FwAssertArgType>(portNum)
1687  );
1688 
1689  FW_ASSERT(
1690  this->m_seqStartOut_OutputPort[portNum].isConnected(),
1691  static_cast<FwAssertArgType>(portNum)
1692  );
1693  this->m_seqStartOut_OutputPort[portNum].invoke(
1694  filename,
1695  args
1696  );
1697  }
1698 
1699 #endif
1700 
1701  // ----------------------------------------------------------------------
1702  // Command response
1703  // ----------------------------------------------------------------------
1704 
1707  FwOpcodeType opCode,
1708  U32 cmdSeq,
1709  Fw::CmdResponse response
1710  )
1711  {
1713  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1714  }
1715 
1716  // ----------------------------------------------------------------------
1717  // Command handler base-class functions
1718  //
1719  // Call these functions directly to bypass the command input port
1720  // ----------------------------------------------------------------------
1721 
1724  FwOpcodeType opCode,
1725  U32 cmdSeq,
1726  Fw::CmdArgBuffer& args
1727  )
1728  {
1729  // Call pre-message hook
1730  this->CS_RUN_preMsgHook(opCode,cmdSeq);
1731 
1732  // Defer deserializing arguments to the message dispatcher
1733  // to avoid deserializing and reserializing just for IPC
1734  ComponentIpcSerializableBuffer msg;
1736 
1737  // Serialize for IPC
1738  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_RUN));
1739  FW_ASSERT (
1740  _status == Fw::FW_SERIALIZE_OK,
1741  static_cast<FwAssertArgType>(_status)
1742  );
1743 
1744  // Fake port number to make message dequeue work
1745  FwIndexType port = 0;
1746 
1747  _status = msg.serializeFrom(port);
1748  FW_ASSERT (
1749  _status == Fw::FW_SERIALIZE_OK,
1750  static_cast<FwAssertArgType>(_status)
1751  );
1752 
1753  _status = msg.serializeFrom(opCode);
1754  FW_ASSERT (
1755  _status == Fw::FW_SERIALIZE_OK,
1756  static_cast<FwAssertArgType>(_status)
1757  );
1758 
1759  _status = msg.serializeFrom(cmdSeq);
1760  FW_ASSERT (
1761  _status == Fw::FW_SERIALIZE_OK,
1762  static_cast<FwAssertArgType>(_status)
1763  );
1764 
1765  _status = msg.serializeFrom(args);
1766  FW_ASSERT (
1767  _status == Fw::FW_SERIALIZE_OK,
1768  static_cast<FwAssertArgType>(_status)
1769  );
1770 
1771  // Send message
1773  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1774 
1775  FW_ASSERT(
1776  qStatus == Os::Queue::OP_OK,
1777  static_cast<FwAssertArgType>(qStatus)
1778  );
1779  }
1780 
1783  FwOpcodeType opCode,
1784  U32 cmdSeq,
1785  Fw::CmdArgBuffer& args
1786  )
1787  {
1788  // Call pre-message hook
1789  this->CS_VALIDATE_preMsgHook(opCode,cmdSeq);
1790 
1791  // Defer deserializing arguments to the message dispatcher
1792  // to avoid deserializing and reserializing just for IPC
1793  ComponentIpcSerializableBuffer msg;
1795 
1796  // Serialize for IPC
1797  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_VALIDATE));
1798  FW_ASSERT (
1799  _status == Fw::FW_SERIALIZE_OK,
1800  static_cast<FwAssertArgType>(_status)
1801  );
1802 
1803  // Fake port number to make message dequeue work
1804  FwIndexType port = 0;
1805 
1806  _status = msg.serializeFrom(port);
1807  FW_ASSERT (
1808  _status == Fw::FW_SERIALIZE_OK,
1809  static_cast<FwAssertArgType>(_status)
1810  );
1811 
1812  _status = msg.serializeFrom(opCode);
1813  FW_ASSERT (
1814  _status == Fw::FW_SERIALIZE_OK,
1815  static_cast<FwAssertArgType>(_status)
1816  );
1817 
1818  _status = msg.serializeFrom(cmdSeq);
1819  FW_ASSERT (
1820  _status == Fw::FW_SERIALIZE_OK,
1821  static_cast<FwAssertArgType>(_status)
1822  );
1823 
1824  _status = msg.serializeFrom(args);
1825  FW_ASSERT (
1826  _status == Fw::FW_SERIALIZE_OK,
1827  static_cast<FwAssertArgType>(_status)
1828  );
1829 
1830  // Send message
1832  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1833 
1834  FW_ASSERT(
1835  qStatus == Os::Queue::OP_OK,
1836  static_cast<FwAssertArgType>(qStatus)
1837  );
1838  }
1839 
1842  FwOpcodeType opCode,
1843  U32 cmdSeq,
1844  Fw::CmdArgBuffer& args
1845  )
1846  {
1847  // Call pre-message hook
1848  this->CS_CANCEL_preMsgHook(opCode,cmdSeq);
1849 
1850  // Defer deserializing arguments to the message dispatcher
1851  // to avoid deserializing and reserializing just for IPC
1852  ComponentIpcSerializableBuffer msg;
1854 
1855  // Serialize for IPC
1856  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_CANCEL));
1857  FW_ASSERT (
1858  _status == Fw::FW_SERIALIZE_OK,
1859  static_cast<FwAssertArgType>(_status)
1860  );
1861 
1862  // Fake port number to make message dequeue work
1863  FwIndexType port = 0;
1864 
1865  _status = msg.serializeFrom(port);
1866  FW_ASSERT (
1867  _status == Fw::FW_SERIALIZE_OK,
1868  static_cast<FwAssertArgType>(_status)
1869  );
1870 
1871  _status = msg.serializeFrom(opCode);
1872  FW_ASSERT (
1873  _status == Fw::FW_SERIALIZE_OK,
1874  static_cast<FwAssertArgType>(_status)
1875  );
1876 
1877  _status = msg.serializeFrom(cmdSeq);
1878  FW_ASSERT (
1879  _status == Fw::FW_SERIALIZE_OK,
1880  static_cast<FwAssertArgType>(_status)
1881  );
1882 
1883  _status = msg.serializeFrom(args);
1884  FW_ASSERT (
1885  _status == Fw::FW_SERIALIZE_OK,
1886  static_cast<FwAssertArgType>(_status)
1887  );
1888 
1889  // Send message
1891  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1892 
1893  FW_ASSERT(
1894  qStatus == Os::Queue::OP_OK,
1895  static_cast<FwAssertArgType>(qStatus)
1896  );
1897  }
1898 
1901  FwOpcodeType opCode,
1902  U32 cmdSeq,
1903  Fw::CmdArgBuffer& args
1904  )
1905  {
1906  // Call pre-message hook
1907  this->CS_START_preMsgHook(opCode,cmdSeq);
1908 
1909  // Defer deserializing arguments to the message dispatcher
1910  // to avoid deserializing and reserializing just for IPC
1911  ComponentIpcSerializableBuffer msg;
1913 
1914  // Serialize for IPC
1915  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_START));
1916  FW_ASSERT (
1917  _status == Fw::FW_SERIALIZE_OK,
1918  static_cast<FwAssertArgType>(_status)
1919  );
1920 
1921  // Fake port number to make message dequeue work
1922  FwIndexType port = 0;
1923 
1924  _status = msg.serializeFrom(port);
1925  FW_ASSERT (
1926  _status == Fw::FW_SERIALIZE_OK,
1927  static_cast<FwAssertArgType>(_status)
1928  );
1929 
1930  _status = msg.serializeFrom(opCode);
1931  FW_ASSERT (
1932  _status == Fw::FW_SERIALIZE_OK,
1933  static_cast<FwAssertArgType>(_status)
1934  );
1935 
1936  _status = msg.serializeFrom(cmdSeq);
1937  FW_ASSERT (
1938  _status == Fw::FW_SERIALIZE_OK,
1939  static_cast<FwAssertArgType>(_status)
1940  );
1941 
1942  _status = msg.serializeFrom(args);
1943  FW_ASSERT (
1944  _status == Fw::FW_SERIALIZE_OK,
1945  static_cast<FwAssertArgType>(_status)
1946  );
1947 
1948  // Send message
1950  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1951 
1952  FW_ASSERT(
1953  qStatus == Os::Queue::OP_OK,
1954  static_cast<FwAssertArgType>(qStatus)
1955  );
1956  }
1957 
1960  FwOpcodeType opCode,
1961  U32 cmdSeq,
1962  Fw::CmdArgBuffer& args
1963  )
1964  {
1965  // Call pre-message hook
1966  this->CS_STEP_preMsgHook(opCode,cmdSeq);
1967 
1968  // Defer deserializing arguments to the message dispatcher
1969  // to avoid deserializing and reserializing just for IPC
1970  ComponentIpcSerializableBuffer msg;
1972 
1973  // Serialize for IPC
1974  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_STEP));
1975  FW_ASSERT (
1976  _status == Fw::FW_SERIALIZE_OK,
1977  static_cast<FwAssertArgType>(_status)
1978  );
1979 
1980  // Fake port number to make message dequeue work
1981  FwIndexType port = 0;
1982 
1983  _status = msg.serializeFrom(port);
1984  FW_ASSERT (
1985  _status == Fw::FW_SERIALIZE_OK,
1986  static_cast<FwAssertArgType>(_status)
1987  );
1988 
1989  _status = msg.serializeFrom(opCode);
1990  FW_ASSERT (
1991  _status == Fw::FW_SERIALIZE_OK,
1992  static_cast<FwAssertArgType>(_status)
1993  );
1994 
1995  _status = msg.serializeFrom(cmdSeq);
1996  FW_ASSERT (
1997  _status == Fw::FW_SERIALIZE_OK,
1998  static_cast<FwAssertArgType>(_status)
1999  );
2000 
2001  _status = msg.serializeFrom(args);
2002  FW_ASSERT (
2003  _status == Fw::FW_SERIALIZE_OK,
2004  static_cast<FwAssertArgType>(_status)
2005  );
2006 
2007  // Send message
2009  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2010 
2011  FW_ASSERT(
2012  qStatus == Os::Queue::OP_OK,
2013  static_cast<FwAssertArgType>(qStatus)
2014  );
2015  }
2016 
2019  FwOpcodeType opCode,
2020  U32 cmdSeq,
2021  Fw::CmdArgBuffer& args
2022  )
2023  {
2024  // Call pre-message hook
2025  this->CS_AUTO_preMsgHook(opCode,cmdSeq);
2026 
2027  // Defer deserializing arguments to the message dispatcher
2028  // to avoid deserializing and reserializing just for IPC
2029  ComponentIpcSerializableBuffer msg;
2031 
2032  // Serialize for IPC
2033  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_AUTO));
2034  FW_ASSERT (
2035  _status == Fw::FW_SERIALIZE_OK,
2036  static_cast<FwAssertArgType>(_status)
2037  );
2038 
2039  // Fake port number to make message dequeue work
2040  FwIndexType port = 0;
2041 
2042  _status = msg.serializeFrom(port);
2043  FW_ASSERT (
2044  _status == Fw::FW_SERIALIZE_OK,
2045  static_cast<FwAssertArgType>(_status)
2046  );
2047 
2048  _status = msg.serializeFrom(opCode);
2049  FW_ASSERT (
2050  _status == Fw::FW_SERIALIZE_OK,
2051  static_cast<FwAssertArgType>(_status)
2052  );
2053 
2054  _status = msg.serializeFrom(cmdSeq);
2055  FW_ASSERT (
2056  _status == Fw::FW_SERIALIZE_OK,
2057  static_cast<FwAssertArgType>(_status)
2058  );
2059 
2060  _status = msg.serializeFrom(args);
2061  FW_ASSERT (
2062  _status == Fw::FW_SERIALIZE_OK,
2063  static_cast<FwAssertArgType>(_status)
2064  );
2065 
2066  // Send message
2068  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2069 
2070  FW_ASSERT(
2071  qStatus == Os::Queue::OP_OK,
2072  static_cast<FwAssertArgType>(qStatus)
2073  );
2074  }
2075 
2078  FwOpcodeType opCode,
2079  U32 cmdSeq,
2080  Fw::CmdArgBuffer& args
2081  )
2082  {
2083  // Call pre-message hook
2084  this->CS_MANUAL_preMsgHook(opCode,cmdSeq);
2085 
2086  // Defer deserializing arguments to the message dispatcher
2087  // to avoid deserializing and reserializing just for IPC
2088  ComponentIpcSerializableBuffer msg;
2090 
2091  // Serialize for IPC
2092  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_MANUAL));
2093  FW_ASSERT (
2094  _status == Fw::FW_SERIALIZE_OK,
2095  static_cast<FwAssertArgType>(_status)
2096  );
2097 
2098  // Fake port number to make message dequeue work
2099  FwIndexType port = 0;
2100 
2101  _status = msg.serializeFrom(port);
2102  FW_ASSERT (
2103  _status == Fw::FW_SERIALIZE_OK,
2104  static_cast<FwAssertArgType>(_status)
2105  );
2106 
2107  _status = msg.serializeFrom(opCode);
2108  FW_ASSERT (
2109  _status == Fw::FW_SERIALIZE_OK,
2110  static_cast<FwAssertArgType>(_status)
2111  );
2112 
2113  _status = msg.serializeFrom(cmdSeq);
2114  FW_ASSERT (
2115  _status == Fw::FW_SERIALIZE_OK,
2116  static_cast<FwAssertArgType>(_status)
2117  );
2118 
2119  _status = msg.serializeFrom(args);
2120  FW_ASSERT (
2121  _status == Fw::FW_SERIALIZE_OK,
2122  static_cast<FwAssertArgType>(_status)
2123  );
2124 
2125  // Send message
2127  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2128 
2129  FW_ASSERT(
2130  qStatus == Os::Queue::OP_OK,
2131  static_cast<FwAssertArgType>(qStatus)
2132  );
2133  }
2134 
2137  FwOpcodeType opCode,
2138  U32 cmdSeq,
2139  Fw::CmdArgBuffer& args
2140  )
2141  {
2142  // Call pre-message hook
2143  this->CS_JOIN_WAIT_preMsgHook(opCode,cmdSeq);
2144 
2145  // Defer deserializing arguments to the message dispatcher
2146  // to avoid deserializing and reserializing just for IPC
2147  ComponentIpcSerializableBuffer msg;
2149 
2150  // Serialize for IPC
2151  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_JOIN_WAIT));
2152  FW_ASSERT (
2153  _status == Fw::FW_SERIALIZE_OK,
2154  static_cast<FwAssertArgType>(_status)
2155  );
2156 
2157  // Fake port number to make message dequeue work
2158  FwIndexType port = 0;
2159 
2160  _status = msg.serializeFrom(port);
2161  FW_ASSERT (
2162  _status == Fw::FW_SERIALIZE_OK,
2163  static_cast<FwAssertArgType>(_status)
2164  );
2165 
2166  _status = msg.serializeFrom(opCode);
2167  FW_ASSERT (
2168  _status == Fw::FW_SERIALIZE_OK,
2169  static_cast<FwAssertArgType>(_status)
2170  );
2171 
2172  _status = msg.serializeFrom(cmdSeq);
2173  FW_ASSERT (
2174  _status == Fw::FW_SERIALIZE_OK,
2175  static_cast<FwAssertArgType>(_status)
2176  );
2177 
2178  _status = msg.serializeFrom(args);
2179  FW_ASSERT (
2180  _status == Fw::FW_SERIALIZE_OK,
2181  static_cast<FwAssertArgType>(_status)
2182  );
2183 
2184  // Send message
2186  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2187 
2188  FW_ASSERT(
2189  qStatus == Os::Queue::OP_OK,
2190  static_cast<FwAssertArgType>(qStatus)
2191  );
2192  }
2193 
2194  // ----------------------------------------------------------------------
2195  // Pre-message hooks for async commands
2196  //
2197  // Each of these functions is invoked just before processing the
2198  // corresponding command. By default they do nothing. You can
2199  // override them to provide specific pre-command behavior.
2200  // ----------------------------------------------------------------------
2201 
2204  FwOpcodeType opCode,
2205  U32 cmdSeq
2206  )
2207  {
2208  // Defaults to no-op; can be overridden
2209  (void) opCode;
2210  (void) cmdSeq;
2211  }
2212 
2215  FwOpcodeType opCode,
2216  U32 cmdSeq
2217  )
2218  {
2219  // Defaults to no-op; can be overridden
2220  (void) opCode;
2221  (void) cmdSeq;
2222  }
2223 
2226  FwOpcodeType opCode,
2227  U32 cmdSeq
2228  )
2229  {
2230  // Defaults to no-op; can be overridden
2231  (void) opCode;
2232  (void) cmdSeq;
2233  }
2234 
2237  FwOpcodeType opCode,
2238  U32 cmdSeq
2239  )
2240  {
2241  // Defaults to no-op; can be overridden
2242  (void) opCode;
2243  (void) cmdSeq;
2244  }
2245 
2248  FwOpcodeType opCode,
2249  U32 cmdSeq
2250  )
2251  {
2252  // Defaults to no-op; can be overridden
2253  (void) opCode;
2254  (void) cmdSeq;
2255  }
2256 
2259  FwOpcodeType opCode,
2260  U32 cmdSeq
2261  )
2262  {
2263  // Defaults to no-op; can be overridden
2264  (void) opCode;
2265  (void) cmdSeq;
2266  }
2267 
2270  FwOpcodeType opCode,
2271  U32 cmdSeq
2272  )
2273  {
2274  // Defaults to no-op; can be overridden
2275  (void) opCode;
2276  (void) cmdSeq;
2277  }
2278 
2281  FwOpcodeType opCode,
2282  U32 cmdSeq
2283  )
2284  {
2285  // Defaults to no-op; can be overridden
2286  (void) opCode;
2287  (void) cmdSeq;
2288  }
2289 
2290  // ----------------------------------------------------------------------
2291  // Event logging functions
2292  // ----------------------------------------------------------------------
2293 
2296  {
2297  // Get the time
2298  Fw::Time _logTime;
2299  if (this->isConnected_timeCaller_OutputPort(0)) {
2300  this->timeCaller_out(0, _logTime);
2301  }
2302 
2303  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCELOADED;
2304 
2305  // Emit the event on the log port
2306  if (this->isConnected_logOut_OutputPort(0)) {
2307  Fw::LogBuffer _logBuff;
2309 
2310 #if FW_AMPCS_COMPATIBLE
2311  // Serialize the number of arguments
2312  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2313  FW_ASSERT(
2314  _status == Fw::FW_SERIALIZE_OK,
2315  static_cast<FwAssertArgType>(_status)
2316  );
2317 #endif
2318 
2319  _status = fileName.serializeTo(
2320  _logBuff,
2321  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2322  );
2323  FW_ASSERT(
2324  _status == Fw::FW_SERIALIZE_OK,
2325  static_cast<FwAssertArgType>(_status)
2326  );
2327 
2328  this->logOut_out(
2329  0,
2330  _id,
2331  _logTime,
2333  _logBuff
2334  );
2335  }
2336 
2337  // Emit the event on the text log port
2338 #if FW_ENABLE_TEXT_LOGGING
2339  if (this->isConnected_LogText_OutputPort(0)) {
2340 #if FW_OBJECT_NAMES == 1
2341  const char* _formatString =
2342  "(%s) %s: Loaded sequence %s";
2343 #else
2344  const char* _formatString =
2345  "%s: Loaded sequence %s";
2346 #endif
2347 
2348  Fw::TextLogString _logString;
2349  _logString.format(
2350  _formatString,
2351 #if FW_OBJECT_NAMES == 1
2352  this->m_objName.toChar(),
2353 #endif
2354  "CS_SequenceLoaded ",
2355  fileName.toChar()
2356  );
2357 
2358  this->LogText_out(
2359  0,
2360  _id,
2361  _logTime,
2363  _logString
2364  );
2365  }
2366 #endif
2367  }
2368 
2371  {
2372  // Get the time
2373  Fw::Time _logTime;
2374  if (this->isConnected_timeCaller_OutputPort(0)) {
2375  this->timeCaller_out(0, _logTime);
2376  }
2377 
2378  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCECANCELED;
2379 
2380  // Emit the event on the log port
2381  if (this->isConnected_logOut_OutputPort(0)) {
2382  Fw::LogBuffer _logBuff;
2384 
2385 #if FW_AMPCS_COMPATIBLE
2386  // Serialize the number of arguments
2387  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2388  FW_ASSERT(
2389  _status == Fw::FW_SERIALIZE_OK,
2390  static_cast<FwAssertArgType>(_status)
2391  );
2392 #endif
2393 
2394  _status = fileName.serializeTo(
2395  _logBuff,
2396  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2397  );
2398  FW_ASSERT(
2399  _status == Fw::FW_SERIALIZE_OK,
2400  static_cast<FwAssertArgType>(_status)
2401  );
2402 
2403  this->logOut_out(
2404  0,
2405  _id,
2406  _logTime,
2408  _logBuff
2409  );
2410  }
2411 
2412  // Emit the event on the text log port
2413 #if FW_ENABLE_TEXT_LOGGING
2414  if (this->isConnected_LogText_OutputPort(0)) {
2415 #if FW_OBJECT_NAMES == 1
2416  const char* _formatString =
2417  "(%s) %s: Sequence file %s canceled";
2418 #else
2419  const char* _formatString =
2420  "%s: Sequence file %s canceled";
2421 #endif
2422 
2423  Fw::TextLogString _logString;
2424  _logString.format(
2425  _formatString,
2426 #if FW_OBJECT_NAMES == 1
2427  this->m_objName.toChar(),
2428 #endif
2429  "CS_SequenceCanceled ",
2430  fileName.toChar()
2431  );
2432 
2433  this->LogText_out(
2434  0,
2435  _id,
2436  _logTime,
2438  _logString
2439  );
2440  }
2441 #endif
2442  }
2443 
2446  {
2447  // Get the time
2448  Fw::Time _logTime;
2449  if (this->isConnected_timeCaller_OutputPort(0)) {
2450  this->timeCaller_out(0, _logTime);
2451  }
2452 
2453  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILEREADERROR;
2454 
2455  // Emit the event on the log port
2456  if (this->isConnected_logOut_OutputPort(0)) {
2457  Fw::LogBuffer _logBuff;
2459 
2460 #if FW_AMPCS_COMPATIBLE
2461  // Serialize the number of arguments
2462  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2463  FW_ASSERT(
2464  _status == Fw::FW_SERIALIZE_OK,
2465  static_cast<FwAssertArgType>(_status)
2466  );
2467 #endif
2468 
2469  _status = fileName.serializeTo(
2470  _logBuff,
2471  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2472  );
2473  FW_ASSERT(
2474  _status == Fw::FW_SERIALIZE_OK,
2475  static_cast<FwAssertArgType>(_status)
2476  );
2477 
2478  this->logOut_out(
2479  0,
2480  _id,
2481  _logTime,
2483  _logBuff
2484  );
2485  }
2486 
2487  // Emit the event on the text log port
2488 #if FW_ENABLE_TEXT_LOGGING
2489  if (this->isConnected_LogText_OutputPort(0)) {
2490 #if FW_OBJECT_NAMES == 1
2491  const char* _formatString =
2492  "(%s) %s: Error reading sequence file %s";
2493 #else
2494  const char* _formatString =
2495  "%s: Error reading sequence file %s";
2496 #endif
2497 
2498  Fw::TextLogString _logString;
2499  _logString.format(
2500  _formatString,
2501 #if FW_OBJECT_NAMES == 1
2502  this->m_objName.toChar(),
2503 #endif
2504  "CS_FileReadError ",
2505  fileName.toChar()
2506  );
2507 
2508  this->LogText_out(
2509  0,
2510  _id,
2511  _logTime,
2513  _logString
2514  );
2515  }
2516 #endif
2517  }
2518 
2521  const Fw::StringBase& fileName,
2522  const Svc::CmdSequencer_FileReadStage& stage,
2523  I32 error
2524  ) const
2525  {
2526  // Get the time
2527  Fw::Time _logTime;
2528  if (this->isConnected_timeCaller_OutputPort(0)) {
2529  this->timeCaller_out(0, _logTime);
2530  }
2531 
2532  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILEINVALID;
2533 
2534  // Emit the event on the log port
2535  if (this->isConnected_logOut_OutputPort(0)) {
2536  Fw::LogBuffer _logBuff;
2538 
2539 #if FW_AMPCS_COMPATIBLE
2540  // Serialize the number of arguments
2541  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2542  FW_ASSERT(
2543  _status == Fw::FW_SERIALIZE_OK,
2544  static_cast<FwAssertArgType>(_status)
2545  );
2546 #endif
2547 
2548  _status = fileName.serializeTo(
2549  _logBuff,
2550  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2551  );
2552  FW_ASSERT(
2553  _status == Fw::FW_SERIALIZE_OK,
2554  static_cast<FwAssertArgType>(_status)
2555  );
2556 
2557 #if FW_AMPCS_COMPATIBLE
2558  // Serialize the argument size
2559  _status = _logBuff.serializeFrom(
2561  );
2562  FW_ASSERT(
2563  _status == Fw::FW_SERIALIZE_OK,
2564  static_cast<FwAssertArgType>(_status)
2565  );
2566 #endif
2567  _status = _logBuff.serializeFrom(stage);
2568  FW_ASSERT(
2569  _status == Fw::FW_SERIALIZE_OK,
2570  static_cast<FwAssertArgType>(_status)
2571  );
2572 
2573 #if FW_AMPCS_COMPATIBLE
2574  // Serialize the argument size
2575  _status = _logBuff.serializeFrom(
2576  static_cast<U8>(sizeof(I32))
2577  );
2578  FW_ASSERT(
2579  _status == Fw::FW_SERIALIZE_OK,
2580  static_cast<FwAssertArgType>(_status)
2581  );
2582 #endif
2583  _status = _logBuff.serializeFrom(error);
2584  FW_ASSERT(
2585  _status == Fw::FW_SERIALIZE_OK,
2586  static_cast<FwAssertArgType>(_status)
2587  );
2588 
2589  this->logOut_out(
2590  0,
2591  _id,
2592  _logTime,
2594  _logBuff
2595  );
2596  }
2597 
2598  // Emit the event on the text log port
2599 #if FW_ENABLE_TEXT_LOGGING
2600  if (this->isConnected_LogText_OutputPort(0)) {
2601 #if FW_OBJECT_NAMES == 1
2602  const char* _formatString =
2603  "(%s) %s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2604 #else
2605  const char* _formatString =
2606  "%s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2607 #endif
2608 
2609  Fw::String stageStr;
2610  stage.toString(stageStr);
2611 
2612  Fw::TextLogString _logString;
2613  _logString.format(
2614  _formatString,
2615 #if FW_OBJECT_NAMES == 1
2616  this->m_objName.toChar(),
2617 #endif
2618  "CS_FileInvalid ",
2619  fileName.toChar(),
2620  stageStr.toChar(),
2621  error
2622  );
2623 
2624  this->LogText_out(
2625  0,
2626  _id,
2627  _logTime,
2629  _logString
2630  );
2631  }
2632 #endif
2633  }
2634 
2637  const Fw::StringBase& fileName,
2638  U32 recordNumber,
2639  I32 error
2640  ) const
2641  {
2642  // Get the time
2643  Fw::Time _logTime;
2644  if (this->isConnected_timeCaller_OutputPort(0)) {
2645  this->timeCaller_out(0, _logTime);
2646  }
2647 
2648  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_RECORDINVALID;
2649 
2650  // Emit the event on the log port
2651  if (this->isConnected_logOut_OutputPort(0)) {
2652  Fw::LogBuffer _logBuff;
2654 
2655 #if FW_AMPCS_COMPATIBLE
2656  // Serialize the number of arguments
2657  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2658  FW_ASSERT(
2659  _status == Fw::FW_SERIALIZE_OK,
2660  static_cast<FwAssertArgType>(_status)
2661  );
2662 #endif
2663 
2664  _status = fileName.serializeTo(
2665  _logBuff,
2666  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2667  );
2668  FW_ASSERT(
2669  _status == Fw::FW_SERIALIZE_OK,
2670  static_cast<FwAssertArgType>(_status)
2671  );
2672 
2673 #if FW_AMPCS_COMPATIBLE
2674  // Serialize the argument size
2675  _status = _logBuff.serializeFrom(
2676  static_cast<U8>(sizeof(U32))
2677  );
2678  FW_ASSERT(
2679  _status == Fw::FW_SERIALIZE_OK,
2680  static_cast<FwAssertArgType>(_status)
2681  );
2682 #endif
2683  _status = _logBuff.serializeFrom(recordNumber);
2684  FW_ASSERT(
2685  _status == Fw::FW_SERIALIZE_OK,
2686  static_cast<FwAssertArgType>(_status)
2687  );
2688 
2689 #if FW_AMPCS_COMPATIBLE
2690  // Serialize the argument size
2691  _status = _logBuff.serializeFrom(
2692  static_cast<U8>(sizeof(I32))
2693  );
2694  FW_ASSERT(
2695  _status == Fw::FW_SERIALIZE_OK,
2696  static_cast<FwAssertArgType>(_status)
2697  );
2698 #endif
2699  _status = _logBuff.serializeFrom(error);
2700  FW_ASSERT(
2701  _status == Fw::FW_SERIALIZE_OK,
2702  static_cast<FwAssertArgType>(_status)
2703  );
2704 
2705  this->logOut_out(
2706  0,
2707  _id,
2708  _logTime,
2710  _logBuff
2711  );
2712  }
2713 
2714  // Emit the event on the text log port
2715 #if FW_ENABLE_TEXT_LOGGING
2716  if (this->isConnected_LogText_OutputPort(0)) {
2717 #if FW_OBJECT_NAMES == 1
2718  const char* _formatString =
2719  "(%s) %s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2720 #else
2721  const char* _formatString =
2722  "%s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2723 #endif
2724 
2725  Fw::TextLogString _logString;
2726  _logString.format(
2727  _formatString,
2728 #if FW_OBJECT_NAMES == 1
2729  this->m_objName.toChar(),
2730 #endif
2731  "CS_RecordInvalid ",
2732  fileName.toChar(),
2733  recordNumber,
2734  error
2735  );
2736 
2737  this->LogText_out(
2738  0,
2739  _id,
2740  _logTime,
2742  _logString
2743  );
2744  }
2745 #endif
2746  }
2747 
2750  const Fw::StringBase& fileName,
2751  U32 size
2752  ) const
2753  {
2754  // Get the time
2755  Fw::Time _logTime;
2756  if (this->isConnected_timeCaller_OutputPort(0)) {
2757  this->timeCaller_out(0, _logTime);
2758  }
2759 
2760  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILESIZEERROR;
2761 
2762  // Emit the event on the log port
2763  if (this->isConnected_logOut_OutputPort(0)) {
2764  Fw::LogBuffer _logBuff;
2766 
2767 #if FW_AMPCS_COMPATIBLE
2768  // Serialize the number of arguments
2769  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2770  FW_ASSERT(
2771  _status == Fw::FW_SERIALIZE_OK,
2772  static_cast<FwAssertArgType>(_status)
2773  );
2774 #endif
2775 
2776  _status = fileName.serializeTo(
2777  _logBuff,
2778  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2779  );
2780  FW_ASSERT(
2781  _status == Fw::FW_SERIALIZE_OK,
2782  static_cast<FwAssertArgType>(_status)
2783  );
2784 
2785 #if FW_AMPCS_COMPATIBLE
2786  // Serialize the argument size
2787  _status = _logBuff.serializeFrom(
2788  static_cast<U8>(sizeof(U32))
2789  );
2790  FW_ASSERT(
2791  _status == Fw::FW_SERIALIZE_OK,
2792  static_cast<FwAssertArgType>(_status)
2793  );
2794 #endif
2795  _status = _logBuff.serializeFrom(size);
2796  FW_ASSERT(
2797  _status == Fw::FW_SERIALIZE_OK,
2798  static_cast<FwAssertArgType>(_status)
2799  );
2800 
2801  this->logOut_out(
2802  0,
2803  _id,
2804  _logTime,
2806  _logBuff
2807  );
2808  }
2809 
2810  // Emit the event on the text log port
2811 #if FW_ENABLE_TEXT_LOGGING
2812  if (this->isConnected_LogText_OutputPort(0)) {
2813 #if FW_OBJECT_NAMES == 1
2814  const char* _formatString =
2815  "(%s) %s: Sequence file %s too large. Size: %" PRIu32 "";
2816 #else
2817  const char* _formatString =
2818  "%s: Sequence file %s too large. Size: %" PRIu32 "";
2819 #endif
2820 
2821  Fw::TextLogString _logString;
2822  _logString.format(
2823  _formatString,
2824 #if FW_OBJECT_NAMES == 1
2825  this->m_objName.toChar(),
2826 #endif
2827  "CS_FileSizeError ",
2828  fileName.toChar(),
2829  size
2830  );
2831 
2832  this->LogText_out(
2833  0,
2834  _id,
2835  _logTime,
2837  _logString
2838  );
2839  }
2840 #endif
2841  }
2842 
2845  {
2846  // Get the time
2847  Fw::Time _logTime;
2848  if (this->isConnected_timeCaller_OutputPort(0)) {
2849  this->timeCaller_out(0, _logTime);
2850  }
2851 
2852  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILENOTFOUND;
2853 
2854  // Emit the event on the log port
2855  if (this->isConnected_logOut_OutputPort(0)) {
2856  Fw::LogBuffer _logBuff;
2858 
2859 #if FW_AMPCS_COMPATIBLE
2860  // Serialize the number of arguments
2861  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2862  FW_ASSERT(
2863  _status == Fw::FW_SERIALIZE_OK,
2864  static_cast<FwAssertArgType>(_status)
2865  );
2866 #endif
2867 
2868  _status = fileName.serializeTo(
2869  _logBuff,
2870  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2871  );
2872  FW_ASSERT(
2873  _status == Fw::FW_SERIALIZE_OK,
2874  static_cast<FwAssertArgType>(_status)
2875  );
2876 
2877  this->logOut_out(
2878  0,
2879  _id,
2880  _logTime,
2882  _logBuff
2883  );
2884  }
2885 
2886  // Emit the event on the text log port
2887 #if FW_ENABLE_TEXT_LOGGING
2888  if (this->isConnected_LogText_OutputPort(0)) {
2889 #if FW_OBJECT_NAMES == 1
2890  const char* _formatString =
2891  "(%s) %s: Sequence file %s not found.";
2892 #else
2893  const char* _formatString =
2894  "%s: Sequence file %s not found.";
2895 #endif
2896 
2897  Fw::TextLogString _logString;
2898  _logString.format(
2899  _formatString,
2900 #if FW_OBJECT_NAMES == 1
2901  this->m_objName.toChar(),
2902 #endif
2903  "CS_FileNotFound ",
2904  fileName.toChar()
2905  );
2906 
2907  this->LogText_out(
2908  0,
2909  _id,
2910  _logTime,
2912  _logString
2913  );
2914  }
2915 #endif
2916  }
2917 
2920  const Fw::StringBase& fileName,
2921  U32 storedCRC,
2922  U32 computedCRC
2923  ) const
2924  {
2925  // Get the time
2926  Fw::Time _logTime;
2927  if (this->isConnected_timeCaller_OutputPort(0)) {
2928  this->timeCaller_out(0, _logTime);
2929  }
2930 
2931  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_FILECRCFAILURE;
2932 
2933  // Emit the event on the log port
2934  if (this->isConnected_logOut_OutputPort(0)) {
2935  Fw::LogBuffer _logBuff;
2937 
2938 #if FW_AMPCS_COMPATIBLE
2939  // Serialize the number of arguments
2940  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2941  FW_ASSERT(
2942  _status == Fw::FW_SERIALIZE_OK,
2943  static_cast<FwAssertArgType>(_status)
2944  );
2945 #endif
2946 
2947  _status = fileName.serializeTo(
2948  _logBuff,
2949  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
2950  );
2951  FW_ASSERT(
2952  _status == Fw::FW_SERIALIZE_OK,
2953  static_cast<FwAssertArgType>(_status)
2954  );
2955 
2956 #if FW_AMPCS_COMPATIBLE
2957  // Serialize the argument size
2958  _status = _logBuff.serializeFrom(
2959  static_cast<U8>(sizeof(U32))
2960  );
2961  FW_ASSERT(
2962  _status == Fw::FW_SERIALIZE_OK,
2963  static_cast<FwAssertArgType>(_status)
2964  );
2965 #endif
2966  _status = _logBuff.serializeFrom(storedCRC);
2967  FW_ASSERT(
2968  _status == Fw::FW_SERIALIZE_OK,
2969  static_cast<FwAssertArgType>(_status)
2970  );
2971 
2972 #if FW_AMPCS_COMPATIBLE
2973  // Serialize the argument size
2974  _status = _logBuff.serializeFrom(
2975  static_cast<U8>(sizeof(U32))
2976  );
2977  FW_ASSERT(
2978  _status == Fw::FW_SERIALIZE_OK,
2979  static_cast<FwAssertArgType>(_status)
2980  );
2981 #endif
2982  _status = _logBuff.serializeFrom(computedCRC);
2983  FW_ASSERT(
2984  _status == Fw::FW_SERIALIZE_OK,
2985  static_cast<FwAssertArgType>(_status)
2986  );
2987 
2988  this->logOut_out(
2989  0,
2990  _id,
2991  _logTime,
2993  _logBuff
2994  );
2995  }
2996 
2997  // Emit the event on the text log port
2998 #if FW_ENABLE_TEXT_LOGGING
2999  if (this->isConnected_LogText_OutputPort(0)) {
3000 #if FW_OBJECT_NAMES == 1
3001  const char* _formatString =
3002  "(%s) %s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
3003 #else
3004  const char* _formatString =
3005  "%s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
3006 #endif
3007 
3008  Fw::TextLogString _logString;
3009  _logString.format(
3010  _formatString,
3011 #if FW_OBJECT_NAMES == 1
3012  this->m_objName.toChar(),
3013 #endif
3014  "CS_FileCrcFailure ",
3015  fileName.toChar(),
3016  storedCRC,
3017  computedCRC
3018  );
3019 
3020  this->LogText_out(
3021  0,
3022  _id,
3023  _logTime,
3025  _logString
3026  );
3027  }
3028 #endif
3029  }
3030 
3033  const Fw::StringBase& fileName,
3034  U32 recordNumber,
3035  FwOpcodeType opCode
3036  ) const
3037  {
3038  // Get the time
3039  Fw::Time _logTime;
3040  if (this->isConnected_timeCaller_OutputPort(0)) {
3041  this->timeCaller_out(0, _logTime);
3042  }
3043 
3044  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_COMMANDCOMPLETE;
3045 
3046  // Emit the event on the log port
3047  if (this->isConnected_logOut_OutputPort(0)) {
3048  Fw::LogBuffer _logBuff;
3050 
3051 #if FW_AMPCS_COMPATIBLE
3052  // Serialize the number of arguments
3053  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3054  FW_ASSERT(
3055  _status == Fw::FW_SERIALIZE_OK,
3056  static_cast<FwAssertArgType>(_status)
3057  );
3058 #endif
3059 
3060  _status = fileName.serializeTo(
3061  _logBuff,
3062  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3063  );
3064  FW_ASSERT(
3065  _status == Fw::FW_SERIALIZE_OK,
3066  static_cast<FwAssertArgType>(_status)
3067  );
3068 
3069 #if FW_AMPCS_COMPATIBLE
3070  // Serialize the argument size
3071  _status = _logBuff.serializeFrom(
3072  static_cast<U8>(sizeof(U32))
3073  );
3074  FW_ASSERT(
3075  _status == Fw::FW_SERIALIZE_OK,
3076  static_cast<FwAssertArgType>(_status)
3077  );
3078 #endif
3079  _status = _logBuff.serializeFrom(recordNumber);
3080  FW_ASSERT(
3081  _status == Fw::FW_SERIALIZE_OK,
3082  static_cast<FwAssertArgType>(_status)
3083  );
3084 
3085 #if FW_AMPCS_COMPATIBLE
3086  // Serialize the argument size
3087  _status = _logBuff.serializeFrom(
3088  static_cast<U8>(sizeof(FwOpcodeType))
3089  );
3090  FW_ASSERT(
3091  _status == Fw::FW_SERIALIZE_OK,
3092  static_cast<FwAssertArgType>(_status)
3093  );
3094 #endif
3095  _status = _logBuff.serializeFrom(opCode);
3096  FW_ASSERT(
3097  _status == Fw::FW_SERIALIZE_OK,
3098  static_cast<FwAssertArgType>(_status)
3099  );
3100 
3101  this->logOut_out(
3102  0,
3103  _id,
3104  _logTime,
3106  _logBuff
3107  );
3108  }
3109 
3110  // Emit the event on the text log port
3111 #if FW_ENABLE_TEXT_LOGGING
3112  if (this->isConnected_LogText_OutputPort(0)) {
3113 #if FW_OBJECT_NAMES == 1
3114  const char* _formatString =
3115  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
3116 #else
3117  const char* _formatString =
3118  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
3119 #endif
3120 
3121  Fw::TextLogString _logString;
3122  _logString.format(
3123  _formatString,
3124 #if FW_OBJECT_NAMES == 1
3125  this->m_objName.toChar(),
3126 #endif
3127  "CS_CommandComplete ",
3128  fileName.toChar(),
3129  recordNumber,
3130  opCode
3131  );
3132 
3133  this->LogText_out(
3134  0,
3135  _id,
3136  _logTime,
3138  _logString
3139  );
3140  }
3141 #endif
3142  }
3143 
3146  {
3147  // Get the time
3148  Fw::Time _logTime;
3149  if (this->isConnected_timeCaller_OutputPort(0)) {
3150  this->timeCaller_out(0, _logTime);
3151  }
3152 
3153  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCECOMPLETE;
3154 
3155  // Emit the event on the log port
3156  if (this->isConnected_logOut_OutputPort(0)) {
3157  Fw::LogBuffer _logBuff;
3159 
3160 #if FW_AMPCS_COMPATIBLE
3161  // Serialize the number of arguments
3162  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3163  FW_ASSERT(
3164  _status == Fw::FW_SERIALIZE_OK,
3165  static_cast<FwAssertArgType>(_status)
3166  );
3167 #endif
3168 
3169  _status = fileName.serializeTo(
3170  _logBuff,
3171  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3172  );
3173  FW_ASSERT(
3174  _status == Fw::FW_SERIALIZE_OK,
3175  static_cast<FwAssertArgType>(_status)
3176  );
3177 
3178  this->logOut_out(
3179  0,
3180  _id,
3181  _logTime,
3183  _logBuff
3184  );
3185  }
3186 
3187  // Emit the event on the text log port
3188 #if FW_ENABLE_TEXT_LOGGING
3189  if (this->isConnected_LogText_OutputPort(0)) {
3190 #if FW_OBJECT_NAMES == 1
3191  const char* _formatString =
3192  "(%s) %s: Sequence file %s complete";
3193 #else
3194  const char* _formatString =
3195  "%s: Sequence file %s complete";
3196 #endif
3197 
3198  Fw::TextLogString _logString;
3199  _logString.format(
3200  _formatString,
3201 #if FW_OBJECT_NAMES == 1
3202  this->m_objName.toChar(),
3203 #endif
3204  "CS_SequenceComplete ",
3205  fileName.toChar()
3206  );
3207 
3208  this->LogText_out(
3209  0,
3210  _id,
3211  _logTime,
3213  _logString
3214  );
3215  }
3216 #endif
3217  }
3218 
3221  const Fw::StringBase& fileName,
3222  U32 recordNumber,
3223  FwOpcodeType opCode,
3224  U32 errorStatus
3225  ) const
3226  {
3227  // Get the time
3228  Fw::Time _logTime;
3229  if (this->isConnected_timeCaller_OutputPort(0)) {
3230  this->timeCaller_out(0, _logTime);
3231  }
3232 
3233  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_COMMANDERROR;
3234 
3235  // Emit the event on the log port
3236  if (this->isConnected_logOut_OutputPort(0)) {
3237  Fw::LogBuffer _logBuff;
3239 
3240 #if FW_AMPCS_COMPATIBLE
3241  // Serialize the number of arguments
3242  _status = _logBuff.serializeFrom(static_cast<U8>(4));
3243  FW_ASSERT(
3244  _status == Fw::FW_SERIALIZE_OK,
3245  static_cast<FwAssertArgType>(_status)
3246  );
3247 #endif
3248 
3249  _status = fileName.serializeTo(
3250  _logBuff,
3251  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3252  );
3253  FW_ASSERT(
3254  _status == Fw::FW_SERIALIZE_OK,
3255  static_cast<FwAssertArgType>(_status)
3256  );
3257 
3258 #if FW_AMPCS_COMPATIBLE
3259  // Serialize the argument size
3260  _status = _logBuff.serializeFrom(
3261  static_cast<U8>(sizeof(U32))
3262  );
3263  FW_ASSERT(
3264  _status == Fw::FW_SERIALIZE_OK,
3265  static_cast<FwAssertArgType>(_status)
3266  );
3267 #endif
3268  _status = _logBuff.serializeFrom(recordNumber);
3269  FW_ASSERT(
3270  _status == Fw::FW_SERIALIZE_OK,
3271  static_cast<FwAssertArgType>(_status)
3272  );
3273 
3274 #if FW_AMPCS_COMPATIBLE
3275  // Serialize the argument size
3276  _status = _logBuff.serializeFrom(
3277  static_cast<U8>(sizeof(FwOpcodeType))
3278  );
3279  FW_ASSERT(
3280  _status == Fw::FW_SERIALIZE_OK,
3281  static_cast<FwAssertArgType>(_status)
3282  );
3283 #endif
3284  _status = _logBuff.serializeFrom(opCode);
3285  FW_ASSERT(
3286  _status == Fw::FW_SERIALIZE_OK,
3287  static_cast<FwAssertArgType>(_status)
3288  );
3289 
3290 #if FW_AMPCS_COMPATIBLE
3291  // Serialize the argument size
3292  _status = _logBuff.serializeFrom(
3293  static_cast<U8>(sizeof(U32))
3294  );
3295  FW_ASSERT(
3296  _status == Fw::FW_SERIALIZE_OK,
3297  static_cast<FwAssertArgType>(_status)
3298  );
3299 #endif
3300  _status = _logBuff.serializeFrom(errorStatus);
3301  FW_ASSERT(
3302  _status == Fw::FW_SERIALIZE_OK,
3303  static_cast<FwAssertArgType>(_status)
3304  );
3305 
3306  this->logOut_out(
3307  0,
3308  _id,
3309  _logTime,
3311  _logBuff
3312  );
3313  }
3314 
3315  // Emit the event on the text log port
3316 #if FW_ENABLE_TEXT_LOGGING
3317  if (this->isConnected_LogText_OutputPort(0)) {
3318 #if FW_OBJECT_NAMES == 1
3319  const char* _formatString =
3320  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3321 #else
3322  const char* _formatString =
3323  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3324 #endif
3325 
3326  Fw::TextLogString _logString;
3327  _logString.format(
3328  _formatString,
3329 #if FW_OBJECT_NAMES == 1
3330  this->m_objName.toChar(),
3331 #endif
3332  "CS_CommandError ",
3333  fileName.toChar(),
3334  recordNumber,
3335  opCode,
3336  errorStatus
3337  );
3338 
3339  this->LogText_out(
3340  0,
3341  _id,
3342  _logTime,
3344  _logString
3345  );
3346  }
3347 #endif
3348  }
3349 
3352  {
3353  // Get the time
3354  Fw::Time _logTime;
3355  if (this->isConnected_timeCaller_OutputPort(0)) {
3356  this->timeCaller_out(0, _logTime);
3357  }
3358 
3359  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_INVALIDMODE;
3360 
3361  // Emit the event on the log port
3362  if (this->isConnected_logOut_OutputPort(0)) {
3363  Fw::LogBuffer _logBuff;
3364 
3365 #if FW_AMPCS_COMPATIBLE
3367  // Serialize the number of arguments
3368  _status = _logBuff.serializeFrom(static_cast<U8>(0));
3369  FW_ASSERT(
3370  _status == Fw::FW_SERIALIZE_OK,
3371  static_cast<FwAssertArgType>(_status)
3372  );
3373 #endif
3374 
3375  this->logOut_out(
3376  0,
3377  _id,
3378  _logTime,
3380  _logBuff
3381  );
3382  }
3383 
3384  // Emit the event on the text log port
3385 #if FW_ENABLE_TEXT_LOGGING
3386  if (this->isConnected_LogText_OutputPort(0)) {
3387 #if FW_OBJECT_NAMES == 1
3388  const char* _formatString =
3389  "(%s) %s: Invalid mode";
3390 #else
3391  const char* _formatString =
3392  "%s: Invalid mode";
3393 #endif
3394 
3395  Fw::TextLogString _logString;
3396  _logString.format(
3397  _formatString,
3398 #if FW_OBJECT_NAMES == 1
3399  this->m_objName.toChar(),
3400 #endif
3401  "CS_InvalidMode "
3402  );
3403 
3404  this->LogText_out(
3405  0,
3406  _id,
3407  _logTime,
3409  _logString
3410  );
3411  }
3412 #endif
3413  }
3414 
3417  const Fw::StringBase& fileName,
3418  U32 header_records,
3419  U32 extra_bytes
3420  ) const
3421  {
3422  // Get the time
3423  Fw::Time _logTime;
3424  if (this->isConnected_timeCaller_OutputPort(0)) {
3425  this->timeCaller_out(0, _logTime);
3426  }
3427 
3428  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_RECORDMISMATCH;
3429 
3430  // Emit the event on the log port
3431  if (this->isConnected_logOut_OutputPort(0)) {
3432  Fw::LogBuffer _logBuff;
3434 
3435 #if FW_AMPCS_COMPATIBLE
3436  // Serialize the number of arguments
3437  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3438  FW_ASSERT(
3439  _status == Fw::FW_SERIALIZE_OK,
3440  static_cast<FwAssertArgType>(_status)
3441  );
3442 #endif
3443 
3444  _status = fileName.serializeTo(
3445  _logBuff,
3446  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3447  );
3448  FW_ASSERT(
3449  _status == Fw::FW_SERIALIZE_OK,
3450  static_cast<FwAssertArgType>(_status)
3451  );
3452 
3453 #if FW_AMPCS_COMPATIBLE
3454  // Serialize the argument size
3455  _status = _logBuff.serializeFrom(
3456  static_cast<U8>(sizeof(U32))
3457  );
3458  FW_ASSERT(
3459  _status == Fw::FW_SERIALIZE_OK,
3460  static_cast<FwAssertArgType>(_status)
3461  );
3462 #endif
3463  _status = _logBuff.serializeFrom(header_records);
3464  FW_ASSERT(
3465  _status == Fw::FW_SERIALIZE_OK,
3466  static_cast<FwAssertArgType>(_status)
3467  );
3468 
3469 #if FW_AMPCS_COMPATIBLE
3470  // Serialize the argument size
3471  _status = _logBuff.serializeFrom(
3472  static_cast<U8>(sizeof(U32))
3473  );
3474  FW_ASSERT(
3475  _status == Fw::FW_SERIALIZE_OK,
3476  static_cast<FwAssertArgType>(_status)
3477  );
3478 #endif
3479  _status = _logBuff.serializeFrom(extra_bytes);
3480  FW_ASSERT(
3481  _status == Fw::FW_SERIALIZE_OK,
3482  static_cast<FwAssertArgType>(_status)
3483  );
3484 
3485  this->logOut_out(
3486  0,
3487  _id,
3488  _logTime,
3490  _logBuff
3491  );
3492  }
3493 
3494  // Emit the event on the text log port
3495 #if FW_ENABLE_TEXT_LOGGING
3496  if (this->isConnected_LogText_OutputPort(0)) {
3497 #if FW_OBJECT_NAMES == 1
3498  const char* _formatString =
3499  "(%s) %s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3500 #else
3501  const char* _formatString =
3502  "%s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3503 #endif
3504 
3505  Fw::TextLogString _logString;
3506  _logString.format(
3507  _formatString,
3508 #if FW_OBJECT_NAMES == 1
3509  this->m_objName.toChar(),
3510 #endif
3511  "CS_RecordMismatch ",
3512  fileName.toChar(),
3513  header_records,
3514  extra_bytes
3515  );
3516 
3517  this->LogText_out(
3518  0,
3519  _id,
3520  _logTime,
3522  _logString
3523  );
3524  }
3525 #endif
3526  }
3527 
3530  const Fw::StringBase& fileName,
3531  U16 time_base,
3532  U16 seq_time_base
3533  ) const
3534  {
3535  // Get the time
3536  Fw::Time _logTime;
3537  if (this->isConnected_timeCaller_OutputPort(0)) {
3538  this->timeCaller_out(0, _logTime);
3539  }
3540 
3541  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_TIMEBASEMISMATCH;
3542 
3543  // Emit the event on the log port
3544  if (this->isConnected_logOut_OutputPort(0)) {
3545  Fw::LogBuffer _logBuff;
3547 
3548 #if FW_AMPCS_COMPATIBLE
3549  // Serialize the number of arguments
3550  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3551  FW_ASSERT(
3552  _status == Fw::FW_SERIALIZE_OK,
3553  static_cast<FwAssertArgType>(_status)
3554  );
3555 #endif
3556 
3557  _status = fileName.serializeTo(
3558  _logBuff,
3559  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3560  );
3561  FW_ASSERT(
3562  _status == Fw::FW_SERIALIZE_OK,
3563  static_cast<FwAssertArgType>(_status)
3564  );
3565 
3566 #if FW_AMPCS_COMPATIBLE
3567  // Serialize the argument size
3568  _status = _logBuff.serializeFrom(
3569  static_cast<U8>(sizeof(U16))
3570  );
3571  FW_ASSERT(
3572  _status == Fw::FW_SERIALIZE_OK,
3573  static_cast<FwAssertArgType>(_status)
3574  );
3575 #endif
3576  _status = _logBuff.serializeFrom(time_base);
3577  FW_ASSERT(
3578  _status == Fw::FW_SERIALIZE_OK,
3579  static_cast<FwAssertArgType>(_status)
3580  );
3581 
3582 #if FW_AMPCS_COMPATIBLE
3583  // Serialize the argument size
3584  _status = _logBuff.serializeFrom(
3585  static_cast<U8>(sizeof(U16))
3586  );
3587  FW_ASSERT(
3588  _status == Fw::FW_SERIALIZE_OK,
3589  static_cast<FwAssertArgType>(_status)
3590  );
3591 #endif
3592  _status = _logBuff.serializeFrom(seq_time_base);
3593  FW_ASSERT(
3594  _status == Fw::FW_SERIALIZE_OK,
3595  static_cast<FwAssertArgType>(_status)
3596  );
3597 
3598  this->logOut_out(
3599  0,
3600  _id,
3601  _logTime,
3603  _logBuff
3604  );
3605  }
3606 
3607  // Emit the event on the text log port
3608 #if FW_ENABLE_TEXT_LOGGING
3609  if (this->isConnected_LogText_OutputPort(0)) {
3610 #if FW_OBJECT_NAMES == 1
3611  const char* _formatString =
3612  "(%s) %s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3613 #else
3614  const char* _formatString =
3615  "%s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3616 #endif
3617 
3618  Fw::TextLogString _logString;
3619  _logString.format(
3620  _formatString,
3621 #if FW_OBJECT_NAMES == 1
3622  this->m_objName.toChar(),
3623 #endif
3624  "CS_TimeBaseMismatch ",
3625  fileName.toChar(),
3626  time_base,
3627  seq_time_base
3628  );
3629 
3630  this->LogText_out(
3631  0,
3632  _id,
3633  _logTime,
3635  _logString
3636  );
3637  }
3638 #endif
3639  }
3640 
3643  const Fw::StringBase& fileName,
3644  U8 currTimeBase,
3645  U8 seqTimeBase
3646  ) const
3647  {
3648  // Get the time
3649  Fw::Time _logTime;
3650  if (this->isConnected_timeCaller_OutputPort(0)) {
3651  this->timeCaller_out(0, _logTime);
3652  }
3653 
3655 
3656  // Emit the event on the log port
3657  if (this->isConnected_logOut_OutputPort(0)) {
3658  Fw::LogBuffer _logBuff;
3660 
3661 #if FW_AMPCS_COMPATIBLE
3662  // Serialize the number of arguments
3663  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3664  FW_ASSERT(
3665  _status == Fw::FW_SERIALIZE_OK,
3666  static_cast<FwAssertArgType>(_status)
3667  );
3668 #endif
3669 
3670  _status = fileName.serializeTo(
3671  _logBuff,
3672  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3673  );
3674  FW_ASSERT(
3675  _status == Fw::FW_SERIALIZE_OK,
3676  static_cast<FwAssertArgType>(_status)
3677  );
3678 
3679 #if FW_AMPCS_COMPATIBLE
3680  // Serialize the argument size
3681  _status = _logBuff.serializeFrom(
3682  static_cast<U8>(sizeof(U8))
3683  );
3684  FW_ASSERT(
3685  _status == Fw::FW_SERIALIZE_OK,
3686  static_cast<FwAssertArgType>(_status)
3687  );
3688 #endif
3689  _status = _logBuff.serializeFrom(currTimeBase);
3690  FW_ASSERT(
3691  _status == Fw::FW_SERIALIZE_OK,
3692  static_cast<FwAssertArgType>(_status)
3693  );
3694 
3695 #if FW_AMPCS_COMPATIBLE
3696  // Serialize the argument size
3697  _status = _logBuff.serializeFrom(
3698  static_cast<U8>(sizeof(U8))
3699  );
3700  FW_ASSERT(
3701  _status == Fw::FW_SERIALIZE_OK,
3702  static_cast<FwAssertArgType>(_status)
3703  );
3704 #endif
3705  _status = _logBuff.serializeFrom(seqTimeBase);
3706  FW_ASSERT(
3707  _status == Fw::FW_SERIALIZE_OK,
3708  static_cast<FwAssertArgType>(_status)
3709  );
3710 
3711  this->logOut_out(
3712  0,
3713  _id,
3714  _logTime,
3716  _logBuff
3717  );
3718  }
3719 
3720  // Emit the event on the text log port
3721 #if FW_ENABLE_TEXT_LOGGING
3722  if (this->isConnected_LogText_OutputPort(0)) {
3723 #if FW_OBJECT_NAMES == 1
3724  const char* _formatString =
3725  "(%s) %s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3726 #else
3727  const char* _formatString =
3728  "%s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3729 #endif
3730 
3731  Fw::TextLogString _logString;
3732  _logString.format(
3733  _formatString,
3734 #if FW_OBJECT_NAMES == 1
3735  this->m_objName.toChar(),
3736 #endif
3737  "CS_TimeContextMismatch ",
3738  fileName.toChar(),
3739  currTimeBase,
3740  seqTimeBase
3741  );
3742 
3743  this->LogText_out(
3744  0,
3745  _id,
3746  _logTime,
3748  _logString
3749  );
3750  }
3751 #endif
3752  }
3753 
3756  {
3757  // Get the time
3758  Fw::Time _logTime;
3759  if (this->isConnected_timeCaller_OutputPort(0)) {
3760  this->timeCaller_out(0, _logTime);
3761  }
3762 
3764 
3765  // Emit the event on the log port
3766  if (this->isConnected_logOut_OutputPort(0)) {
3767  Fw::LogBuffer _logBuff;
3769 
3770 #if FW_AMPCS_COMPATIBLE
3771  // Serialize the number of arguments
3772  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3773  FW_ASSERT(
3774  _status == Fw::FW_SERIALIZE_OK,
3775  static_cast<FwAssertArgType>(_status)
3776  );
3777 #endif
3778 
3779  _status = filename.serializeTo(
3780  _logBuff,
3781  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
3782  );
3783  FW_ASSERT(
3784  _status == Fw::FW_SERIALIZE_OK,
3785  static_cast<FwAssertArgType>(_status)
3786  );
3787 
3788  this->logOut_out(
3789  0,
3790  _id,
3791  _logTime,
3793  _logBuff
3794  );
3795  }
3796 
3797  // Emit the event on the text log port
3798 #if FW_ENABLE_TEXT_LOGGING
3799  if (this->isConnected_LogText_OutputPort(0)) {
3800 #if FW_OBJECT_NAMES == 1
3801  const char* _formatString =
3802  "(%s) %s: Local request for sequence %s started.";
3803 #else
3804  const char* _formatString =
3805  "%s: Local request for sequence %s started.";
3806 #endif
3807 
3808  Fw::TextLogString _logString;
3809  _logString.format(
3810  _formatString,
3811 #if FW_OBJECT_NAMES == 1
3812  this->m_objName.toChar(),
3813 #endif
3814  "CS_PortSequenceStarted ",
3815  filename.toChar()
3816  );
3817 
3818  this->LogText_out(
3819  0,
3820  _id,
3821  _logTime,
3823  _logString
3824  );
3825  }
3826 #endif
3827  }
3828 
3831  {
3832  // Get the time
3833  Fw::Time _logTime;
3834  if (this->isConnected_timeCaller_OutputPort(0)) {
3835  this->timeCaller_out(0, _logTime);
3836  }
3837 
3839 
3840  // Emit the event on the log port
3841  if (this->isConnected_logOut_OutputPort(0)) {
3842  Fw::LogBuffer _logBuff;
3844 
3845 #if FW_AMPCS_COMPATIBLE
3846  // Serialize the number of arguments
3847  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3848  FW_ASSERT(
3849  _status == Fw::FW_SERIALIZE_OK,
3850  static_cast<FwAssertArgType>(_status)
3851  );
3852 #endif
3853 
3854 #if FW_AMPCS_COMPATIBLE
3855  // Serialize the argument size
3856  _status = _logBuff.serializeFrom(
3857  static_cast<U8>(sizeof(FwOpcodeType))
3858  );
3859  FW_ASSERT(
3860  _status == Fw::FW_SERIALIZE_OK,
3861  static_cast<FwAssertArgType>(_status)
3862  );
3863 #endif
3864  _status = _logBuff.serializeFrom(opcode);
3865  FW_ASSERT(
3866  _status == Fw::FW_SERIALIZE_OK,
3867  static_cast<FwAssertArgType>(_status)
3868  );
3869 
3870  this->logOut_out(
3871  0,
3872  _id,
3873  _logTime,
3875  _logBuff
3876  );
3877  }
3878 
3879  // Emit the event on the text log port
3880 #if FW_ENABLE_TEXT_LOGGING
3881  if (this->isConnected_LogText_OutputPort(0)) {
3882 #if FW_OBJECT_NAMES == 1
3883  const char* _formatString =
3884  "(%s) %s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3885 #else
3886  const char* _formatString =
3887  "%s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3888 #endif
3889 
3890  Fw::TextLogString _logString;
3891  _logString.format(
3892  _formatString,
3893 #if FW_OBJECT_NAMES == 1
3894  this->m_objName.toChar(),
3895 #endif
3896  "CS_UnexpectedCompletion ",
3897  opcode
3898  );
3899 
3900  this->LogText_out(
3901  0,
3902  _id,
3903  _logTime,
3905  _logString
3906  );
3907  }
3908 #endif
3909  }
3910 
3913  {
3914  // Get the time
3915  Fw::Time _logTime;
3916  if (this->isConnected_timeCaller_OutputPort(0)) {
3917  this->timeCaller_out(0, _logTime);
3918  }
3919 
3920  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_MODESWITCHED;
3921 
3922  // Emit the event on the log port
3923  if (this->isConnected_logOut_OutputPort(0)) {
3924  Fw::LogBuffer _logBuff;
3926 
3927 #if FW_AMPCS_COMPATIBLE
3928  // Serialize the number of arguments
3929  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3930  FW_ASSERT(
3931  _status == Fw::FW_SERIALIZE_OK,
3932  static_cast<FwAssertArgType>(_status)
3933  );
3934 #endif
3935 
3936 #if FW_AMPCS_COMPATIBLE
3937  // Serialize the argument size
3938  _status = _logBuff.serializeFrom(
3940  );
3941  FW_ASSERT(
3942  _status == Fw::FW_SERIALIZE_OK,
3943  static_cast<FwAssertArgType>(_status)
3944  );
3945 #endif
3946  _status = _logBuff.serializeFrom(mode);
3947  FW_ASSERT(
3948  _status == Fw::FW_SERIALIZE_OK,
3949  static_cast<FwAssertArgType>(_status)
3950  );
3951 
3952  this->logOut_out(
3953  0,
3954  _id,
3955  _logTime,
3957  _logBuff
3958  );
3959  }
3960 
3961  // Emit the event on the text log port
3962 #if FW_ENABLE_TEXT_LOGGING
3963  if (this->isConnected_LogText_OutputPort(0)) {
3964 #if FW_OBJECT_NAMES == 1
3965  const char* _formatString =
3966  "(%s) %s: Sequencer switched to %s step mode";
3967 #else
3968  const char* _formatString =
3969  "%s: Sequencer switched to %s step mode";
3970 #endif
3971 
3972  Fw::String modeStr;
3973  mode.toString(modeStr);
3974 
3975  Fw::TextLogString _logString;
3976  _logString.format(
3977  _formatString,
3978 #if FW_OBJECT_NAMES == 1
3979  this->m_objName.toChar(),
3980 #endif
3981  "CS_ModeSwitched ",
3982  modeStr.toChar()
3983  );
3984 
3985  this->LogText_out(
3986  0,
3987  _id,
3988  _logTime,
3990  _logString
3991  );
3992  }
3993 #endif
3994  }
3995 
3998  {
3999  // Get the time
4000  Fw::Time _logTime;
4001  if (this->isConnected_timeCaller_OutputPort(0)) {
4002  this->timeCaller_out(0, _logTime);
4003  }
4004 
4005  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_NOSEQUENCEACTIVE;
4006 
4007  // Emit the event on the log port
4008  if (this->isConnected_logOut_OutputPort(0)) {
4009  Fw::LogBuffer _logBuff;
4010 
4011 #if FW_AMPCS_COMPATIBLE
4013  // Serialize the number of arguments
4014  _status = _logBuff.serializeFrom(static_cast<U8>(0));
4015  FW_ASSERT(
4016  _status == Fw::FW_SERIALIZE_OK,
4017  static_cast<FwAssertArgType>(_status)
4018  );
4019 #endif
4020 
4021  this->logOut_out(
4022  0,
4023  _id,
4024  _logTime,
4026  _logBuff
4027  );
4028  }
4029 
4030  // Emit the event on the text log port
4031 #if FW_ENABLE_TEXT_LOGGING
4032  if (this->isConnected_LogText_OutputPort(0)) {
4033 #if FW_OBJECT_NAMES == 1
4034  const char* _formatString =
4035  "(%s) %s: No sequence active.";
4036 #else
4037  const char* _formatString =
4038  "%s: No sequence active.";
4039 #endif
4040 
4041  Fw::TextLogString _logString;
4042  _logString.format(
4043  _formatString,
4044 #if FW_OBJECT_NAMES == 1
4045  this->m_objName.toChar(),
4046 #endif
4047  "CS_NoSequenceActive "
4048  );
4049 
4050  this->LogText_out(
4051  0,
4052  _id,
4053  _logTime,
4055  _logString
4056  );
4057  }
4058 #endif
4059  }
4060 
4063  {
4064  // Get the time
4065  Fw::Time _logTime;
4066  if (this->isConnected_timeCaller_OutputPort(0)) {
4067  this->timeCaller_out(0, _logTime);
4068  }
4069 
4070  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCEVALID;
4071 
4072  // Emit the event on the log port
4073  if (this->isConnected_logOut_OutputPort(0)) {
4074  Fw::LogBuffer _logBuff;
4076 
4077 #if FW_AMPCS_COMPATIBLE
4078  // Serialize the number of arguments
4079  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4080  FW_ASSERT(
4081  _status == Fw::FW_SERIALIZE_OK,
4082  static_cast<FwAssertArgType>(_status)
4083  );
4084 #endif
4085 
4086  _status = filename.serializeTo(
4087  _logBuff,
4088  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4089  );
4090  FW_ASSERT(
4091  _status == Fw::FW_SERIALIZE_OK,
4092  static_cast<FwAssertArgType>(_status)
4093  );
4094 
4095  this->logOut_out(
4096  0,
4097  _id,
4098  _logTime,
4100  _logBuff
4101  );
4102  }
4103 
4104  // Emit the event on the text log port
4105 #if FW_ENABLE_TEXT_LOGGING
4106  if (this->isConnected_LogText_OutputPort(0)) {
4107 #if FW_OBJECT_NAMES == 1
4108  const char* _formatString =
4109  "(%s) %s: Sequence %s is valid.";
4110 #else
4111  const char* _formatString =
4112  "%s: Sequence %s is valid.";
4113 #endif
4114 
4115  Fw::TextLogString _logString;
4116  _logString.format(
4117  _formatString,
4118 #if FW_OBJECT_NAMES == 1
4119  this->m_objName.toChar(),
4120 #endif
4121  "CS_SequenceValid ",
4122  filename.toChar()
4123  );
4124 
4125  this->LogText_out(
4126  0,
4127  _id,
4128  _logTime,
4130  _logString
4131  );
4132  }
4133 #endif
4134  }
4135 
4138  const Fw::StringBase& filename,
4139  U32 command
4140  ) const
4141  {
4142  // Get the time
4143  Fw::Time _logTime;
4144  if (this->isConnected_timeCaller_OutputPort(0)) {
4145  this->timeCaller_out(0, _logTime);
4146  }
4147 
4148  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_SEQUENCETIMEOUT;
4149 
4150  // Emit the event on the log port
4151  if (this->isConnected_logOut_OutputPort(0)) {
4152  Fw::LogBuffer _logBuff;
4154 
4155 #if FW_AMPCS_COMPATIBLE
4156  // Serialize the number of arguments
4157  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4158  FW_ASSERT(
4159  _status == Fw::FW_SERIALIZE_OK,
4160  static_cast<FwAssertArgType>(_status)
4161  );
4162 #endif
4163 
4164  _status = filename.serializeTo(
4165  _logBuff,
4166  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4167  );
4168  FW_ASSERT(
4169  _status == Fw::FW_SERIALIZE_OK,
4170  static_cast<FwAssertArgType>(_status)
4171  );
4172 
4173 #if FW_AMPCS_COMPATIBLE
4174  // Serialize the argument size
4175  _status = _logBuff.serializeFrom(
4176  static_cast<U8>(sizeof(U32))
4177  );
4178  FW_ASSERT(
4179  _status == Fw::FW_SERIALIZE_OK,
4180  static_cast<FwAssertArgType>(_status)
4181  );
4182 #endif
4183  _status = _logBuff.serializeFrom(command);
4184  FW_ASSERT(
4185  _status == Fw::FW_SERIALIZE_OK,
4186  static_cast<FwAssertArgType>(_status)
4187  );
4188 
4189  this->logOut_out(
4190  0,
4191  _id,
4192  _logTime,
4194  _logBuff
4195  );
4196  }
4197 
4198  // Emit the event on the text log port
4199 #if FW_ENABLE_TEXT_LOGGING
4200  if (this->isConnected_LogText_OutputPort(0)) {
4201 #if FW_OBJECT_NAMES == 1
4202  const char* _formatString =
4203  "(%s) %s: Sequence %s timed out on command %" PRIu32 "";
4204 #else
4205  const char* _formatString =
4206  "%s: Sequence %s timed out on command %" PRIu32 "";
4207 #endif
4208 
4209  Fw::TextLogString _logString;
4210  _logString.format(
4211  _formatString,
4212 #if FW_OBJECT_NAMES == 1
4213  this->m_objName.toChar(),
4214 #endif
4215  "CS_SequenceTimeout ",
4216  filename.toChar(),
4217  command
4218  );
4219 
4220  this->LogText_out(
4221  0,
4222  _id,
4223  _logTime,
4225  _logString
4226  );
4227  }
4228 #endif
4229  }
4230 
4233  const Fw::StringBase& filename,
4234  U32 command
4235  ) const
4236  {
4237  // Get the time
4238  Fw::Time _logTime;
4239  if (this->isConnected_timeCaller_OutputPort(0)) {
4240  this->timeCaller_out(0, _logTime);
4241  }
4242 
4243  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_CMDSTEPPED;
4244 
4245  // Emit the event on the log port
4246  if (this->isConnected_logOut_OutputPort(0)) {
4247  Fw::LogBuffer _logBuff;
4249 
4250 #if FW_AMPCS_COMPATIBLE
4251  // Serialize the number of arguments
4252  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4253  FW_ASSERT(
4254  _status == Fw::FW_SERIALIZE_OK,
4255  static_cast<FwAssertArgType>(_status)
4256  );
4257 #endif
4258 
4259  _status = filename.serializeTo(
4260  _logBuff,
4261  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4262  );
4263  FW_ASSERT(
4264  _status == Fw::FW_SERIALIZE_OK,
4265  static_cast<FwAssertArgType>(_status)
4266  );
4267 
4268 #if FW_AMPCS_COMPATIBLE
4269  // Serialize the argument size
4270  _status = _logBuff.serializeFrom(
4271  static_cast<U8>(sizeof(U32))
4272  );
4273  FW_ASSERT(
4274  _status == Fw::FW_SERIALIZE_OK,
4275  static_cast<FwAssertArgType>(_status)
4276  );
4277 #endif
4278  _status = _logBuff.serializeFrom(command);
4279  FW_ASSERT(
4280  _status == Fw::FW_SERIALIZE_OK,
4281  static_cast<FwAssertArgType>(_status)
4282  );
4283 
4284  this->logOut_out(
4285  0,
4286  _id,
4287  _logTime,
4289  _logBuff
4290  );
4291  }
4292 
4293  // Emit the event on the text log port
4294 #if FW_ENABLE_TEXT_LOGGING
4295  if (this->isConnected_LogText_OutputPort(0)) {
4296 #if FW_OBJECT_NAMES == 1
4297  const char* _formatString =
4298  "(%s) %s: Sequence %s command %" PRIu32 " stepped";
4299 #else
4300  const char* _formatString =
4301  "%s: Sequence %s command %" PRIu32 " stepped";
4302 #endif
4303 
4304  Fw::TextLogString _logString;
4305  _logString.format(
4306  _formatString,
4307 #if FW_OBJECT_NAMES == 1
4308  this->m_objName.toChar(),
4309 #endif
4310  "CS_CmdStepped ",
4311  filename.toChar(),
4312  command
4313  );
4314 
4315  this->LogText_out(
4316  0,
4317  _id,
4318  _logTime,
4320  _logString
4321  );
4322  }
4323 #endif
4324  }
4325 
4328  {
4329  // Get the time
4330  Fw::Time _logTime;
4331  if (this->isConnected_timeCaller_OutputPort(0)) {
4332  this->timeCaller_out(0, _logTime);
4333  }
4334 
4335  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_CMDSTARTED;
4336 
4337  // Emit the event on the log port
4338  if (this->isConnected_logOut_OutputPort(0)) {
4339  Fw::LogBuffer _logBuff;
4341 
4342 #if FW_AMPCS_COMPATIBLE
4343  // Serialize the number of arguments
4344  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4345  FW_ASSERT(
4346  _status == Fw::FW_SERIALIZE_OK,
4347  static_cast<FwAssertArgType>(_status)
4348  );
4349 #endif
4350 
4351  _status = filename.serializeTo(
4352  _logBuff,
4353  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4354  );
4355  FW_ASSERT(
4356  _status == Fw::FW_SERIALIZE_OK,
4357  static_cast<FwAssertArgType>(_status)
4358  );
4359 
4360  this->logOut_out(
4361  0,
4362  _id,
4363  _logTime,
4365  _logBuff
4366  );
4367  }
4368 
4369  // Emit the event on the text log port
4370 #if FW_ENABLE_TEXT_LOGGING
4371  if (this->isConnected_LogText_OutputPort(0)) {
4372 #if FW_OBJECT_NAMES == 1
4373  const char* _formatString =
4374  "(%s) %s: Sequence %s started";
4375 #else
4376  const char* _formatString =
4377  "%s: Sequence %s started";
4378 #endif
4379 
4380  Fw::TextLogString _logString;
4381  _logString.format(
4382  _formatString,
4383 #if FW_OBJECT_NAMES == 1
4384  this->m_objName.toChar(),
4385 #endif
4386  "CS_CmdStarted ",
4387  filename.toChar()
4388  );
4389 
4390  this->LogText_out(
4391  0,
4392  _id,
4393  _logTime,
4395  _logString
4396  );
4397  }
4398 #endif
4399  }
4400 
4403  const Fw::StringBase& filename,
4404  U32 recordNumber,
4405  FwOpcodeType opCode
4406  ) const
4407  {
4408  // Get the time
4409  Fw::Time _logTime;
4410  if (this->isConnected_timeCaller_OutputPort(0)) {
4411  this->timeCaller_out(0, _logTime);
4412  }
4413 
4414  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_JOINWAITING;
4415 
4416  // Emit the event on the log port
4417  if (this->isConnected_logOut_OutputPort(0)) {
4418  Fw::LogBuffer _logBuff;
4420 
4421 #if FW_AMPCS_COMPATIBLE
4422  // Serialize the number of arguments
4423  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4424  FW_ASSERT(
4425  _status == Fw::FW_SERIALIZE_OK,
4426  static_cast<FwAssertArgType>(_status)
4427  );
4428 #endif
4429 
4430  _status = filename.serializeTo(
4431  _logBuff,
4432  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4433  );
4434  FW_ASSERT(
4435  _status == Fw::FW_SERIALIZE_OK,
4436  static_cast<FwAssertArgType>(_status)
4437  );
4438 
4439 #if FW_AMPCS_COMPATIBLE
4440  // Serialize the argument size
4441  _status = _logBuff.serializeFrom(
4442  static_cast<U8>(sizeof(U32))
4443  );
4444  FW_ASSERT(
4445  _status == Fw::FW_SERIALIZE_OK,
4446  static_cast<FwAssertArgType>(_status)
4447  );
4448 #endif
4449  _status = _logBuff.serializeFrom(recordNumber);
4450  FW_ASSERT(
4451  _status == Fw::FW_SERIALIZE_OK,
4452  static_cast<FwAssertArgType>(_status)
4453  );
4454 
4455 #if FW_AMPCS_COMPATIBLE
4456  // Serialize the argument size
4457  _status = _logBuff.serializeFrom(
4458  static_cast<U8>(sizeof(FwOpcodeType))
4459  );
4460  FW_ASSERT(
4461  _status == Fw::FW_SERIALIZE_OK,
4462  static_cast<FwAssertArgType>(_status)
4463  );
4464 #endif
4465  _status = _logBuff.serializeFrom(opCode);
4466  FW_ASSERT(
4467  _status == Fw::FW_SERIALIZE_OK,
4468  static_cast<FwAssertArgType>(_status)
4469  );
4470 
4471  this->logOut_out(
4472  0,
4473  _id,
4474  _logTime,
4476  _logBuff
4477  );
4478  }
4479 
4480  // Emit the event on the text log port
4481 #if FW_ENABLE_TEXT_LOGGING
4482  if (this->isConnected_LogText_OutputPort(0)) {
4483 #if FW_OBJECT_NAMES == 1
4484  const char* _formatString =
4485  "(%s) %s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4486 #else
4487  const char* _formatString =
4488  "%s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4489 #endif
4490 
4491  Fw::TextLogString _logString;
4492  _logString.format(
4493  _formatString,
4494 #if FW_OBJECT_NAMES == 1
4495  this->m_objName.toChar(),
4496 #endif
4497  "CS_JoinWaiting ",
4498  filename.toChar(),
4499  recordNumber,
4500  opCode
4501  );
4502 
4503  this->LogText_out(
4504  0,
4505  _id,
4506  _logTime,
4508  _logString
4509  );
4510  }
4511 #endif
4512  }
4513 
4516  {
4517  // Get the time
4518  Fw::Time _logTime;
4519  if (this->isConnected_timeCaller_OutputPort(0)) {
4520  this->timeCaller_out(0, _logTime);
4521  }
4522 
4524 
4525  // Emit the event on the log port
4526  if (this->isConnected_logOut_OutputPort(0)) {
4527  Fw::LogBuffer _logBuff;
4528 
4529 #if FW_AMPCS_COMPATIBLE
4531  // Serialize the number of arguments
4532  _status = _logBuff.serializeFrom(static_cast<U8>(0));
4533  FW_ASSERT(
4534  _status == Fw::FW_SERIALIZE_OK,
4535  static_cast<FwAssertArgType>(_status)
4536  );
4537 #endif
4538 
4539  this->logOut_out(
4540  0,
4541  _id,
4542  _logTime,
4544  _logBuff
4545  );
4546  }
4547 
4548  // Emit the event on the text log port
4549 #if FW_ENABLE_TEXT_LOGGING
4550  if (this->isConnected_LogText_OutputPort(0)) {
4551 #if FW_OBJECT_NAMES == 1
4552  const char* _formatString =
4553  "(%s) %s: Still waiting for sequence file to complete";
4554 #else
4555  const char* _formatString =
4556  "%s: Still waiting for sequence file to complete";
4557 #endif
4558 
4559  Fw::TextLogString _logString;
4560  _logString.format(
4561  _formatString,
4562 #if FW_OBJECT_NAMES == 1
4563  this->m_objName.toChar(),
4564 #endif
4565  "CS_JoinWaitingNotComplete "
4566  );
4567 
4568  this->LogText_out(
4569  0,
4570  _id,
4571  _logTime,
4573  _logString
4574  );
4575  }
4576 #endif
4577  }
4578 
4581  {
4582  // Get the time
4583  Fw::Time _logTime;
4584  if (this->isConnected_timeCaller_OutputPort(0)) {
4585  this->timeCaller_out(0, _logTime);
4586  }
4587 
4588  const FwEventIdType _id = this->getIdBase() + EVENTID_CS_NORECORDS;
4589 
4590  // Emit the event on the log port
4591  if (this->isConnected_logOut_OutputPort(0)) {
4592  Fw::LogBuffer _logBuff;
4594 
4595 #if FW_AMPCS_COMPATIBLE
4596  // Serialize the number of arguments
4597  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4598  FW_ASSERT(
4599  _status == Fw::FW_SERIALIZE_OK,
4600  static_cast<FwAssertArgType>(_status)
4601  );
4602 #endif
4603 
4604  _status = fileName.serializeTo(
4605  _logBuff,
4606  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 60)
4607  );
4608  FW_ASSERT(
4609  _status == Fw::FW_SERIALIZE_OK,
4610  static_cast<FwAssertArgType>(_status)
4611  );
4612 
4613  this->logOut_out(
4614  0,
4615  _id,
4616  _logTime,
4618  _logBuff
4619  );
4620  }
4621 
4622  // Emit the event on the text log port
4623 #if FW_ENABLE_TEXT_LOGGING
4624  if (this->isConnected_LogText_OutputPort(0)) {
4625 #if FW_OBJECT_NAMES == 1
4626  const char* _formatString =
4627  "(%s) %s: Sequence file %s has no records. Ignoring.";
4628 #else
4629  const char* _formatString =
4630  "%s: Sequence file %s has no records. Ignoring.";
4631 #endif
4632 
4633  Fw::TextLogString _logString;
4634  _logString.format(
4635  _formatString,
4636 #if FW_OBJECT_NAMES == 1
4637  this->m_objName.toChar(),
4638 #endif
4639  "CS_NoRecords ",
4640  fileName.toChar()
4641  );
4642 
4643  this->LogText_out(
4644  0,
4645  _id,
4646  _logTime,
4648  _logString
4649  );
4650  }
4651 #endif
4652  }
4653 
4654  // ----------------------------------------------------------------------
4655  // Telemetry serialized write
4656  // ----------------------------------------------------------------------
4657 
4660  FwChanIdType id,
4661  Fw::TlmBuffer& _tlmBuff,
4662  Fw::Time _tlmTime
4663  ) const
4664  {
4665  if (this->isConnected_tlmOut_OutputPort(0)) {
4666  if (
4668  (_tlmTime == Fw::ZERO_TIME)
4669  ) {
4670  this->timeCaller_out(0, _tlmTime);
4671  }
4672 
4673  FwChanIdType _id;
4674  _id = this->getIdBase() + id;
4675 
4676  this->tlmOut_out(
4677  0,
4678  _id,
4679  _tlmTime,
4680  _tlmBuff
4681  );
4682  }
4683  }
4684 
4685  // ----------------------------------------------------------------------
4686  // Telemetry write functions
4687  // ----------------------------------------------------------------------
4688 
4691  U32 arg,
4692  Fw::Time _tlmTime
4693  ) const
4694  {
4695  if (this->isConnected_tlmOut_OutputPort(0)) {
4696  Fw::TlmBuffer _tlmBuff;
4697  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4698  FW_ASSERT(
4699  _stat == Fw::FW_SERIALIZE_OK,
4700  static_cast<FwAssertArgType>(_stat)
4701  );
4702 
4703  this->tlmWrite(
4705  _tlmBuff,
4706  _tlmTime
4707  );
4708  }
4709  }
4710 
4713  U32 arg,
4714  Fw::Time _tlmTime
4715  ) const
4716  {
4717  if (this->isConnected_tlmOut_OutputPort(0)) {
4718  Fw::TlmBuffer _tlmBuff;
4719  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4720  FW_ASSERT(
4721  _stat == Fw::FW_SERIALIZE_OK,
4722  static_cast<FwAssertArgType>(_stat)
4723  );
4724 
4725  this->tlmWrite(
4727  _tlmBuff,
4728  _tlmTime
4729  );
4730  }
4731  }
4732 
4735  U32 arg,
4736  Fw::Time _tlmTime
4737  ) const
4738  {
4739  if (this->isConnected_tlmOut_OutputPort(0)) {
4740  Fw::TlmBuffer _tlmBuff;
4741  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4742  FW_ASSERT(
4743  _stat == Fw::FW_SERIALIZE_OK,
4744  static_cast<FwAssertArgType>(_stat)
4745  );
4746 
4747  this->tlmWrite(
4749  _tlmBuff,
4750  _tlmTime
4751  );
4752  }
4753  }
4754 
4757  U32 arg,
4758  Fw::Time _tlmTime
4759  ) const
4760  {
4761  if (this->isConnected_tlmOut_OutputPort(0)) {
4762  Fw::TlmBuffer _tlmBuff;
4763  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4764  FW_ASSERT(
4765  _stat == Fw::FW_SERIALIZE_OK,
4766  static_cast<FwAssertArgType>(_stat)
4767  );
4768 
4769  this->tlmWrite(
4771  _tlmBuff,
4772  _tlmTime
4773  );
4774  }
4775  }
4776 
4779  U32 arg,
4780  Fw::Time _tlmTime
4781  ) const
4782  {
4783  if (this->isConnected_tlmOut_OutputPort(0)) {
4784  Fw::TlmBuffer _tlmBuff;
4785  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4786  FW_ASSERT(
4787  _stat == Fw::FW_SERIALIZE_OK,
4788  static_cast<FwAssertArgType>(_stat)
4789  );
4790 
4791  this->tlmWrite(
4793  _tlmBuff,
4794  _tlmTime
4795  );
4796  }
4797  }
4798 
4799  // ----------------------------------------------------------------------
4800  // Time
4801  // ----------------------------------------------------------------------
4802 
4804  getTime() const
4805  {
4806  if (this->isConnected_timeCaller_OutputPort(0)) {
4807  Fw::Time _time;
4808  this->timeCaller_out(0, _time);
4809  return _time;
4810  }
4811  else {
4812  return Fw::Time(TimeBase::TB_NONE, 0, 0);
4813  }
4814  }
4815 
4816  // ----------------------------------------------------------------------
4817  // Message dispatch functions
4818  // ----------------------------------------------------------------------
4819 
4820  Fw::QueuedComponentBase::MsgDispatchStatus CmdSequencerComponentBase ::
4821  doDispatch()
4822  {
4823  ComponentIpcSerializableBuffer _msg;
4824  FwQueuePriorityType _priority = 0;
4825 
4826  Os::Queue::Status _msgStatus = this->m_queue.receive(
4827  _msg,
4829  _priority
4830  );
4831  FW_ASSERT(
4832  _msgStatus == Os::Queue::OP_OK,
4833  static_cast<FwAssertArgType>(_msgStatus)
4834  );
4835 
4836  // Reset to beginning of buffer
4837  _msg.resetDeser();
4838 
4839  FwEnumStoreType _desMsg = 0;
4840  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
4841  FW_ASSERT(
4842  _deserStatus == Fw::FW_SERIALIZE_OK,
4843  static_cast<FwAssertArgType>(_deserStatus)
4844  );
4845 
4846  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
4847 
4848  if (_msgType == CMDSEQUENCER_COMPONENT_EXIT) {
4849  return MSG_DISPATCH_EXIT;
4850  }
4851 
4852  FwIndexType portNum = 0;
4853  _deserStatus = _msg.deserializeTo(portNum);
4854  FW_ASSERT(
4855  _deserStatus == Fw::FW_SERIALIZE_OK,
4856  static_cast<FwAssertArgType>(_deserStatus)
4857  );
4858 
4859  switch (_msgType) {
4860  // Handle async input port cmdResponseIn
4861  case CMDRESPONSEIN_CMDRESPONSE: {
4862  // Deserialize argument opCode
4863  FwOpcodeType opCode;
4864  _deserStatus = _msg.deserializeTo(opCode);
4865  FW_ASSERT(
4866  _deserStatus == Fw::FW_SERIALIZE_OK,
4867  static_cast<FwAssertArgType>(_deserStatus)
4868  );
4869 
4870  // Deserialize argument cmdSeq
4871  U32 cmdSeq;
4872  _deserStatus = _msg.deserializeTo(cmdSeq);
4873  FW_ASSERT(
4874  _deserStatus == Fw::FW_SERIALIZE_OK,
4875  static_cast<FwAssertArgType>(_deserStatus)
4876  );
4877 
4878  // Deserialize argument response
4879  Fw::CmdResponse response;
4880  _deserStatus = _msg.deserializeTo(response);
4881  FW_ASSERT(
4882  _deserStatus == Fw::FW_SERIALIZE_OK,
4883  static_cast<FwAssertArgType>(_deserStatus)
4884  );
4885  // Call handler function
4886  this->cmdResponseIn_handler(
4887  portNum,
4888  opCode,
4889  cmdSeq,
4890  response
4891  );
4892 
4893  break;
4894  }
4895 
4896  // Handle async input port pingIn
4897  case PINGIN_PING: {
4898  // Deserialize argument key
4899  U32 key;
4900  _deserStatus = _msg.deserializeTo(key);
4901  FW_ASSERT(
4902  _deserStatus == Fw::FW_SERIALIZE_OK,
4903  static_cast<FwAssertArgType>(_deserStatus)
4904  );
4905  // Call handler function
4906  this->pingIn_handler(
4907  portNum,
4908  key
4909  );
4910 
4911  break;
4912  }
4913 
4914  // Handle async input port schedIn
4915  case SCHEDIN_SCHED: {
4916  // Deserialize argument context
4917  U32 context;
4918  _deserStatus = _msg.deserializeTo(context);
4919  FW_ASSERT(
4920  _deserStatus == Fw::FW_SERIALIZE_OK,
4921  static_cast<FwAssertArgType>(_deserStatus)
4922  );
4923  // Call handler function
4924  this->schedIn_handler(
4925  portNum,
4926  context
4927  );
4928 
4929  break;
4930  }
4931 
4932  // Handle async input port seqCancelIn
4933  case SEQCANCELIN_CMDSEQCANCEL: {
4934  // Call handler function
4935  this->seqCancelIn_handler(portNum);
4936 
4937  break;
4938  }
4939 
4940  // Handle async input port seqDispatchIn
4941  case SEQDISPATCHIN_FILEDISPATCH: {
4942  // Deserialize argument file_name
4943  char __fprime_ac_file_name_buffer[Fw::StringBase::BUFFER_SIZE(static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))];
4944  Fw::ExternalString file_name(__fprime_ac_file_name_buffer, sizeof __fprime_ac_file_name_buffer);
4945  _deserStatus = _msg.deserializeTo(file_name);
4946  FW_ASSERT(
4947  _deserStatus == Fw::FW_SERIALIZE_OK,
4948  static_cast<FwAssertArgType>(_deserStatus)
4949  );
4950  // Call handler function
4951  this->seqDispatchIn_handler(
4952  portNum,
4953  file_name
4954  );
4955 
4956  break;
4957  }
4958 
4959  // Handle async input port seqRunIn
4960  case SEQRUNIN_CMDSEQIN: {
4961  // Deserialize argument filename
4962  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
4963  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
4964  _deserStatus = _msg.deserializeTo(filename);
4965  FW_ASSERT(
4966  _deserStatus == Fw::FW_SERIALIZE_OK,
4967  static_cast<FwAssertArgType>(_deserStatus)
4968  );
4969 
4970  // Deserialize argument args
4971  Svc::SeqArgs args;
4972  _deserStatus = _msg.deserializeTo(args);
4973  FW_ASSERT(
4974  _deserStatus == Fw::FW_SERIALIZE_OK,
4975  static_cast<FwAssertArgType>(_deserStatus)
4976  );
4977  // Call handler function
4978  this->seqRunIn_handler(
4979  portNum,
4980  filename,
4981  args
4982  );
4983 
4984  break;
4985  }
4986 
4987  // Handle command CS_RUN
4988  case CMD_CS_RUN: {
4989  // Deserialize opcode
4990  FwOpcodeType _opCode = 0;
4991  _deserStatus = _msg.deserializeTo(_opCode);
4992  FW_ASSERT (
4993  _deserStatus == Fw::FW_SERIALIZE_OK,
4994  static_cast<FwAssertArgType>(_deserStatus)
4995  );
4996 
4997  // Deserialize command sequence
4998  U32 _cmdSeq = 0;
4999  _deserStatus = _msg.deserializeTo(_cmdSeq);
5000  FW_ASSERT (
5001  _deserStatus == Fw::FW_SERIALIZE_OK,
5002  static_cast<FwAssertArgType>(_deserStatus)
5003  );
5004 
5005  // Deserialize command argument buffer
5006  Fw::CmdArgBuffer args;
5007  _deserStatus = _msg.deserializeTo(args);
5008  FW_ASSERT (
5009  _deserStatus == Fw::FW_SERIALIZE_OK,
5010  static_cast<FwAssertArgType>(_deserStatus)
5011  );
5012 
5013  // Reset buffer
5014  args.resetDeser();
5015 
5016  // Deserialize argument fileName
5017  Fw::CmdStringArg fileName;
5018  _deserStatus = args.deserializeTo(fileName);
5019  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5021  this->cmdResponse_out(
5022  _opCode,
5023  _cmdSeq,
5025  );
5026  }
5027  // Don't crash the task if bad arguments were passed from the ground
5028  break;
5029  }
5030 
5031  // Deserialize argument block
5032  Svc::BlockState block;
5033  _deserStatus = args.deserializeTo(block);
5034  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5036  this->cmdResponse_out(
5037  _opCode,
5038  _cmdSeq,
5040  );
5041  }
5042  // Don't crash the task if bad arguments were passed from the ground
5043  break;
5044  }
5045 
5046  // Make sure there was no data left over.
5047  // That means the argument buffer size was incorrect.
5048 #if FW_CMD_CHECK_RESIDUAL
5049  if (args.getDeserializeSizeLeft() != 0) {
5051  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5052  }
5053  // Don't crash the task if bad arguments were passed from the ground
5054  break;
5055  }
5056 #endif
5057 
5058  // Call handler function
5059  this->CS_RUN_cmdHandler(
5060  _opCode, _cmdSeq,
5061  fileName,
5062  block
5063  );
5064 
5065  break;
5066  }
5067 
5068  // Handle command CS_VALIDATE
5069  case CMD_CS_VALIDATE: {
5070  // Deserialize opcode
5071  FwOpcodeType _opCode = 0;
5072  _deserStatus = _msg.deserializeTo(_opCode);
5073  FW_ASSERT (
5074  _deserStatus == Fw::FW_SERIALIZE_OK,
5075  static_cast<FwAssertArgType>(_deserStatus)
5076  );
5077 
5078  // Deserialize command sequence
5079  U32 _cmdSeq = 0;
5080  _deserStatus = _msg.deserializeTo(_cmdSeq);
5081  FW_ASSERT (
5082  _deserStatus == Fw::FW_SERIALIZE_OK,
5083  static_cast<FwAssertArgType>(_deserStatus)
5084  );
5085 
5086  // Deserialize command argument buffer
5087  Fw::CmdArgBuffer args;
5088  _deserStatus = _msg.deserializeTo(args);
5089  FW_ASSERT (
5090  _deserStatus == Fw::FW_SERIALIZE_OK,
5091  static_cast<FwAssertArgType>(_deserStatus)
5092  );
5093 
5094  // Reset buffer
5095  args.resetDeser();
5096 
5097  // Deserialize argument fileName
5098  Fw::CmdStringArg fileName;
5099  _deserStatus = args.deserializeTo(fileName);
5100  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5102  this->cmdResponse_out(
5103  _opCode,
5104  _cmdSeq,
5106  );
5107  }
5108  // Don't crash the task if bad arguments were passed from the ground
5109  break;
5110  }
5111 
5112  // Make sure there was no data left over.
5113  // That means the argument buffer size was incorrect.
5114 #if FW_CMD_CHECK_RESIDUAL
5115  if (args.getDeserializeSizeLeft() != 0) {
5117  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5118  }
5119  // Don't crash the task if bad arguments were passed from the ground
5120  break;
5121  }
5122 #endif
5123 
5124  // Call handler function
5125  this->CS_VALIDATE_cmdHandler(
5126  _opCode, _cmdSeq,
5127  fileName
5128  );
5129 
5130  break;
5131  }
5132 
5133  // Handle command CS_CANCEL
5134  case CMD_CS_CANCEL: {
5135  // Deserialize opcode
5136  FwOpcodeType _opCode = 0;
5137  _deserStatus = _msg.deserializeTo(_opCode);
5138  FW_ASSERT (
5139  _deserStatus == Fw::FW_SERIALIZE_OK,
5140  static_cast<FwAssertArgType>(_deserStatus)
5141  );
5142 
5143  // Deserialize command sequence
5144  U32 _cmdSeq = 0;
5145  _deserStatus = _msg.deserializeTo(_cmdSeq);
5146  FW_ASSERT (
5147  _deserStatus == Fw::FW_SERIALIZE_OK,
5148  static_cast<FwAssertArgType>(_deserStatus)
5149  );
5150 
5151  // Deserialize command argument buffer
5152  Fw::CmdArgBuffer args;
5153  _deserStatus = _msg.deserializeTo(args);
5154  FW_ASSERT (
5155  _deserStatus == Fw::FW_SERIALIZE_OK,
5156  static_cast<FwAssertArgType>(_deserStatus)
5157  );
5158 
5159  // Reset buffer
5160  args.resetDeser();
5161 
5162  // Make sure there was no data left over.
5163  // That means the argument buffer size was incorrect.
5164 #if FW_CMD_CHECK_RESIDUAL
5165  if (args.getDeserializeSizeLeft() != 0) {
5167  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5168  }
5169  // Don't crash the task if bad arguments were passed from the ground
5170  break;
5171  }
5172 #endif
5173 
5174  // Call handler function
5175  this->CS_CANCEL_cmdHandler(_opCode, _cmdSeq);
5176 
5177  break;
5178  }
5179 
5180  // Handle command CS_START
5181  case CMD_CS_START: {
5182  // Deserialize opcode
5183  FwOpcodeType _opCode = 0;
5184  _deserStatus = _msg.deserializeTo(_opCode);
5185  FW_ASSERT (
5186  _deserStatus == Fw::FW_SERIALIZE_OK,
5187  static_cast<FwAssertArgType>(_deserStatus)
5188  );
5189 
5190  // Deserialize command sequence
5191  U32 _cmdSeq = 0;
5192  _deserStatus = _msg.deserializeTo(_cmdSeq);
5193  FW_ASSERT (
5194  _deserStatus == Fw::FW_SERIALIZE_OK,
5195  static_cast<FwAssertArgType>(_deserStatus)
5196  );
5197 
5198  // Deserialize command argument buffer
5199  Fw::CmdArgBuffer args;
5200  _deserStatus = _msg.deserializeTo(args);
5201  FW_ASSERT (
5202  _deserStatus == Fw::FW_SERIALIZE_OK,
5203  static_cast<FwAssertArgType>(_deserStatus)
5204  );
5205 
5206  // Reset buffer
5207  args.resetDeser();
5208 
5209  // Make sure there was no data left over.
5210  // That means the argument buffer size was incorrect.
5211 #if FW_CMD_CHECK_RESIDUAL
5212  if (args.getDeserializeSizeLeft() != 0) {
5214  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5215  }
5216  // Don't crash the task if bad arguments were passed from the ground
5217  break;
5218  }
5219 #endif
5220 
5221  // Call handler function
5222  this->CS_START_cmdHandler(_opCode, _cmdSeq);
5223 
5224  break;
5225  }
5226 
5227  // Handle command CS_STEP
5228  case CMD_CS_STEP: {
5229  // Deserialize opcode
5230  FwOpcodeType _opCode = 0;
5231  _deserStatus = _msg.deserializeTo(_opCode);
5232  FW_ASSERT (
5233  _deserStatus == Fw::FW_SERIALIZE_OK,
5234  static_cast<FwAssertArgType>(_deserStatus)
5235  );
5236 
5237  // Deserialize command sequence
5238  U32 _cmdSeq = 0;
5239  _deserStatus = _msg.deserializeTo(_cmdSeq);
5240  FW_ASSERT (
5241  _deserStatus == Fw::FW_SERIALIZE_OK,
5242  static_cast<FwAssertArgType>(_deserStatus)
5243  );
5244 
5245  // Deserialize command argument buffer
5246  Fw::CmdArgBuffer args;
5247  _deserStatus = _msg.deserializeTo(args);
5248  FW_ASSERT (
5249  _deserStatus == Fw::FW_SERIALIZE_OK,
5250  static_cast<FwAssertArgType>(_deserStatus)
5251  );
5252 
5253  // Reset buffer
5254  args.resetDeser();
5255 
5256  // Make sure there was no data left over.
5257  // That means the argument buffer size was incorrect.
5258 #if FW_CMD_CHECK_RESIDUAL
5259  if (args.getDeserializeSizeLeft() != 0) {
5261  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5262  }
5263  // Don't crash the task if bad arguments were passed from the ground
5264  break;
5265  }
5266 #endif
5267 
5268  // Call handler function
5269  this->CS_STEP_cmdHandler(_opCode, _cmdSeq);
5270 
5271  break;
5272  }
5273 
5274  // Handle command CS_AUTO
5275  case CMD_CS_AUTO: {
5276  // Deserialize opcode
5277  FwOpcodeType _opCode = 0;
5278  _deserStatus = _msg.deserializeTo(_opCode);
5279  FW_ASSERT (
5280  _deserStatus == Fw::FW_SERIALIZE_OK,
5281  static_cast<FwAssertArgType>(_deserStatus)
5282  );
5283 
5284  // Deserialize command sequence
5285  U32 _cmdSeq = 0;
5286  _deserStatus = _msg.deserializeTo(_cmdSeq);
5287  FW_ASSERT (
5288  _deserStatus == Fw::FW_SERIALIZE_OK,
5289  static_cast<FwAssertArgType>(_deserStatus)
5290  );
5291 
5292  // Deserialize command argument buffer
5293  Fw::CmdArgBuffer args;
5294  _deserStatus = _msg.deserializeTo(args);
5295  FW_ASSERT (
5296  _deserStatus == Fw::FW_SERIALIZE_OK,
5297  static_cast<FwAssertArgType>(_deserStatus)
5298  );
5299 
5300  // Reset buffer
5301  args.resetDeser();
5302 
5303  // Make sure there was no data left over.
5304  // That means the argument buffer size was incorrect.
5305 #if FW_CMD_CHECK_RESIDUAL
5306  if (args.getDeserializeSizeLeft() != 0) {
5308  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5309  }
5310  // Don't crash the task if bad arguments were passed from the ground
5311  break;
5312  }
5313 #endif
5314 
5315  // Call handler function
5316  this->CS_AUTO_cmdHandler(_opCode, _cmdSeq);
5317 
5318  break;
5319  }
5320 
5321  // Handle command CS_MANUAL
5322  case CMD_CS_MANUAL: {
5323  // Deserialize opcode
5324  FwOpcodeType _opCode = 0;
5325  _deserStatus = _msg.deserializeTo(_opCode);
5326  FW_ASSERT (
5327  _deserStatus == Fw::FW_SERIALIZE_OK,
5328  static_cast<FwAssertArgType>(_deserStatus)
5329  );
5330 
5331  // Deserialize command sequence
5332  U32 _cmdSeq = 0;
5333  _deserStatus = _msg.deserializeTo(_cmdSeq);
5334  FW_ASSERT (
5335  _deserStatus == Fw::FW_SERIALIZE_OK,
5336  static_cast<FwAssertArgType>(_deserStatus)
5337  );
5338 
5339  // Deserialize command argument buffer
5340  Fw::CmdArgBuffer args;
5341  _deserStatus = _msg.deserializeTo(args);
5342  FW_ASSERT (
5343  _deserStatus == Fw::FW_SERIALIZE_OK,
5344  static_cast<FwAssertArgType>(_deserStatus)
5345  );
5346 
5347  // Reset buffer
5348  args.resetDeser();
5349 
5350  // Make sure there was no data left over.
5351  // That means the argument buffer size was incorrect.
5352 #if FW_CMD_CHECK_RESIDUAL
5353  if (args.getDeserializeSizeLeft() != 0) {
5355  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5356  }
5357  // Don't crash the task if bad arguments were passed from the ground
5358  break;
5359  }
5360 #endif
5361 
5362  // Call handler function
5363  this->CS_MANUAL_cmdHandler(_opCode, _cmdSeq);
5364 
5365  break;
5366  }
5367 
5368  // Handle command CS_JOIN_WAIT
5369  case CMD_CS_JOIN_WAIT: {
5370  // Deserialize opcode
5371  FwOpcodeType _opCode = 0;
5372  _deserStatus = _msg.deserializeTo(_opCode);
5373  FW_ASSERT (
5374  _deserStatus == Fw::FW_SERIALIZE_OK,
5375  static_cast<FwAssertArgType>(_deserStatus)
5376  );
5377 
5378  // Deserialize command sequence
5379  U32 _cmdSeq = 0;
5380  _deserStatus = _msg.deserializeTo(_cmdSeq);
5381  FW_ASSERT (
5382  _deserStatus == Fw::FW_SERIALIZE_OK,
5383  static_cast<FwAssertArgType>(_deserStatus)
5384  );
5385 
5386  // Deserialize command argument buffer
5387  Fw::CmdArgBuffer args;
5388  _deserStatus = _msg.deserializeTo(args);
5389  FW_ASSERT (
5390  _deserStatus == Fw::FW_SERIALIZE_OK,
5391  static_cast<FwAssertArgType>(_deserStatus)
5392  );
5393 
5394  // Reset buffer
5395  args.resetDeser();
5396 
5397  // Make sure there was no data left over.
5398  // That means the argument buffer size was incorrect.
5399 #if FW_CMD_CHECK_RESIDUAL
5400  if (args.getDeserializeSizeLeft() != 0) {
5402  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5403  }
5404  // Don't crash the task if bad arguments were passed from the ground
5405  break;
5406  }
5407 #endif
5408 
5409  // Call handler function
5410  this->CS_JOIN_WAIT_cmdHandler(_opCode, _cmdSeq);
5411 
5412  break;
5413  }
5414 
5415  default:
5416  return MSG_DISPATCH_ERROR;
5417  }
5418 
5419  return MSG_DISPATCH_OK;
5420  }
5421 
5422  // ----------------------------------------------------------------------
5423  // Calls for messages received on special input ports
5424  // ----------------------------------------------------------------------
5425 
5426  void CmdSequencerComponentBase ::
5427  m_p_cmdIn_in(
5428  Fw::PassiveComponentBase* callComp,
5429  FwIndexType portNum,
5430  FwOpcodeType opCode,
5431  U32 cmdSeq,
5432  Fw::CmdArgBuffer& args
5433  )
5434  {
5435  FW_ASSERT(callComp);
5436  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5437  compPtr->cmdIn_handlerBase(
5438  portNum,
5439  opCode,
5440  cmdSeq,
5441  args
5442  );
5443  }
5444 
5445  // ----------------------------------------------------------------------
5446  // Calls for messages received on typed input ports
5447  // ----------------------------------------------------------------------
5448 
5449  void CmdSequencerComponentBase ::
5450  m_p_cmdResponseIn_in(
5451  Fw::PassiveComponentBase* callComp,
5452  FwIndexType portNum,
5453  FwOpcodeType opCode,
5454  U32 cmdSeq,
5455  const Fw::CmdResponse& response
5456  )
5457  {
5458  FW_ASSERT(callComp);
5459  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5460  compPtr->cmdResponseIn_handlerBase(
5461  portNum,
5462  opCode,
5463  cmdSeq,
5464  response
5465  );
5466  }
5467 
5468  void CmdSequencerComponentBase ::
5469  m_p_pingIn_in(
5470  Fw::PassiveComponentBase* callComp,
5471  FwIndexType portNum,
5472  U32 key
5473  )
5474  {
5475  FW_ASSERT(callComp);
5476  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5477  compPtr->pingIn_handlerBase(
5478  portNum,
5479  key
5480  );
5481  }
5482 
5483  void CmdSequencerComponentBase ::
5484  m_p_schedIn_in(
5485  Fw::PassiveComponentBase* callComp,
5486  FwIndexType portNum,
5487  U32 context
5488  )
5489  {
5490  FW_ASSERT(callComp);
5491  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5492  compPtr->schedIn_handlerBase(
5493  portNum,
5494  context
5495  );
5496  }
5497 
5498  void CmdSequencerComponentBase ::
5499  m_p_seqCancelIn_in(
5500  Fw::PassiveComponentBase* callComp,
5501  FwIndexType portNum
5502  )
5503  {
5504  FW_ASSERT(callComp);
5505  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5506  compPtr->seqCancelIn_handlerBase(portNum);
5507  }
5508 
5509  void CmdSequencerComponentBase ::
5510  m_p_seqDispatchIn_in(
5511  Fw::PassiveComponentBase* callComp,
5512  FwIndexType portNum,
5513  Fw::StringBase& file_name
5514  )
5515  {
5516  FW_ASSERT(callComp);
5517  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5518  compPtr->seqDispatchIn_handlerBase(
5519  portNum,
5520  file_name
5521  );
5522  }
5523 
5524  void CmdSequencerComponentBase ::
5525  m_p_seqRunIn_in(
5526  Fw::PassiveComponentBase* callComp,
5527  FwIndexType portNum,
5528  const Fw::StringBase& filename,
5529  const Svc::SeqArgs& args
5530  )
5531  {
5532  FW_ASSERT(callComp);
5533  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5534  compPtr->seqRunIn_handlerBase(
5535  portNum,
5536  filename,
5537  args
5538  );
5539  }
5540 
5541 #if !FW_DIRECT_PORT_CALLS
5542 
5543  // ----------------------------------------------------------------------
5544  // Invocation functions for special output ports
5545  // ----------------------------------------------------------------------
5546 
5547 #if FW_ENABLE_TEXT_LOGGING
5548 
5549  void CmdSequencerComponentBase ::
5550  LogText_out(
5551  FwIndexType portNum,
5552  FwEventIdType id,
5553  Fw::Time& timeTag,
5554  const Fw::LogSeverity& severity,
5555  Fw::TextLogString& text
5556  ) const
5557  {
5558  FW_ASSERT(
5559  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
5560  static_cast<FwAssertArgType>(portNum)
5561  );
5562 
5563  FW_ASSERT(
5564  this->m_LogText_OutputPort[portNum].isConnected(),
5565  static_cast<FwAssertArgType>(portNum)
5566  );
5567  this->m_LogText_OutputPort[portNum].invoke(
5568  id,
5569  timeTag,
5570  severity,
5571  text
5572  );
5573  }
5574 
5575 #endif
5576 
5577  void CmdSequencerComponentBase ::
5578  cmdRegOut_out(
5579  FwIndexType portNum,
5580  FwOpcodeType opCode
5581  ) const
5582  {
5583  FW_ASSERT(
5584  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
5585  static_cast<FwAssertArgType>(portNum)
5586  );
5587 
5588  FW_ASSERT(
5589  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
5590  static_cast<FwAssertArgType>(portNum)
5591  );
5592  this->m_cmdRegOut_OutputPort[portNum].invoke(
5593  opCode
5594  );
5595  }
5596 
5597  void CmdSequencerComponentBase ::
5598  cmdResponseOut_out(
5599  FwIndexType portNum,
5600  FwOpcodeType opCode,
5601  U32 cmdSeq,
5602  const Fw::CmdResponse& response
5603  ) const
5604  {
5605  FW_ASSERT(
5606  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
5607  static_cast<FwAssertArgType>(portNum)
5608  );
5609 
5610  FW_ASSERT(
5611  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
5612  static_cast<FwAssertArgType>(portNum)
5613  );
5614  this->m_cmdResponseOut_OutputPort[portNum].invoke(
5615  opCode,
5616  cmdSeq,
5617  response
5618  );
5619  }
5620 
5621  void CmdSequencerComponentBase ::
5622  logOut_out(
5623  FwIndexType portNum,
5624  FwEventIdType id,
5625  Fw::Time& timeTag,
5626  const Fw::LogSeverity& severity,
5627  Fw::LogBuffer& args
5628  ) const
5629  {
5630  FW_ASSERT(
5631  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
5632  static_cast<FwAssertArgType>(portNum)
5633  );
5634 
5635  FW_ASSERT(
5636  this->m_logOut_OutputPort[portNum].isConnected(),
5637  static_cast<FwAssertArgType>(portNum)
5638  );
5639  this->m_logOut_OutputPort[portNum].invoke(
5640  id,
5641  timeTag,
5642  severity,
5643  args
5644  );
5645  }
5646 
5647  void CmdSequencerComponentBase ::
5648  timeCaller_out(
5649  FwIndexType portNum,
5650  Fw::Time& time
5651  ) const
5652  {
5653  FW_ASSERT(
5654  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
5655  static_cast<FwAssertArgType>(portNum)
5656  );
5657 
5658  FW_ASSERT(
5659  this->m_timeCaller_OutputPort[portNum].isConnected(),
5660  static_cast<FwAssertArgType>(portNum)
5661  );
5662  this->m_timeCaller_OutputPort[portNum].invoke(
5663  time
5664  );
5665  }
5666 
5667  void CmdSequencerComponentBase ::
5668  tlmOut_out(
5669  FwIndexType portNum,
5670  FwChanIdType id,
5671  Fw::Time& timeTag,
5672  Fw::TlmBuffer& val
5673  ) const
5674  {
5675  FW_ASSERT(
5676  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
5677  static_cast<FwAssertArgType>(portNum)
5678  );
5679 
5680  FW_ASSERT(
5681  this->m_tlmOut_OutputPort[portNum].isConnected(),
5682  static_cast<FwAssertArgType>(portNum)
5683  );
5684  this->m_tlmOut_OutputPort[portNum].invoke(
5685  id,
5686  timeTag,
5687  val
5688  );
5689  }
5690 
5691 #endif
5692 
5693 }
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 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
The Sequence File Loader could not read the sequence file.
void invoke(const Fw::StringBase &filename, const Svc::SeqArgs &args) const
Invoke a port connection.
static constexpr FwIndexType getNum_cmdResponseIn_InputPorts()
A local port request to run a sequence was started.
virtual void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args)=0
Handler for input port seqRunIn.
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:27
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
void log_WARNING_HI_CS_FileInvalid(const Fw::StringBase &fileName, const Svc::CmdSequencer_FileReadStage &stage, I32 error) const
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
The Command Sequencer received a command that was invalid for its current mode.
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
A command status came back when no sequence was running.
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)
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.
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*.
A command in a sequence was stepped through.
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
The Command Sequencer issued a command and received an error status in return.
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 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
The size of the serial representation.
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.
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.
void tlmWrite_CS_CommandsExecuted(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
void log_ACTIVITY_HI_CS_PortSequenceStarted(const Fw::StringBase &filename) const
void seqStartOut_out(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args) const
Invoke output port seqStartOut.
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
void init()
Initialization function.
Definition: TimePortAc.cpp:151
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
void init()
Initialization function.
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:99
A less serious but recoverable event.
virtual void CS_RUN_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, const Svc::BlockState &block)=0
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)
void seqRunIn_handlerBase(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args)
Handler base-class function for input port seqRunIn.
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
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
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
Sequencer blocking state.
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
The running time base doesn&#39;t match the time base in the sequence files.
A string backed by an external buffer.
void log_ACTIVITY_HI_CS_ModeSwitched(const Svc::CmdSequencer_SeqMode &mode) const
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
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
void CS_AUTO_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
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
A sequence related command came with no active sequence.
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void set_comCmdOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comCmdOut[portNum].
static constexpr FwIndexType getNum_seqStartOut_OutputPorts()
static constexpr FwSizeType CAPACITY
Perform one step in a command sequence. Valid only if CmdSequencer is in MANUAL run mode...
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)
message to exit active component task
virtual void CS_AUTO_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Number of records in header doesn&#39;t match number in file.
The running time base doesn&#39;t match the time base in the sequence files.
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
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.
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)
Cannot run new sequence when current sequence file is still running.
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)
virtual void seqRunIn_preMsgHook(FwIndexType portNum, const Fw::StringBase &filename, const Svc::SeqArgs &args)
Pre-message hook for async input port seqRunIn.
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:57
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()
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.
Wait for the current running sequence file complete.
Wait for sequences that are running to finish. Allow user to run multiple seq files in SEQ_NO_BLOCK m...
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
The Command Sequencer issued a command and received a success status in return.
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
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.