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::InputCmdResponsePort::SERIALIZED_SIZE];
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  // Connect input port cmdIn
96  for (
97  FwIndexType port = 0;
98  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
99  port++
100  ) {
101  this->m_cmdIn_InputPort[port].init();
102  this->m_cmdIn_InputPort[port].addCallComp(
103  this,
104  m_p_cmdIn_in
105  );
106  this->m_cmdIn_InputPort[port].setPortNum(port);
107 
108 #if FW_OBJECT_NAMES == 1
109  Fw::ObjectName portName;
110  portName.format(
111  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
112  this->m_objName.toChar(),
113  port
114  );
115  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
116 #endif
117  }
118 
119  // Connect input port cmdResponseIn
120  for (
121  FwIndexType port = 0;
122  port < static_cast<FwIndexType>(this->getNum_cmdResponseIn_InputPorts());
123  port++
124  ) {
125  this->m_cmdResponseIn_InputPort[port].init();
126  this->m_cmdResponseIn_InputPort[port].addCallComp(
127  this,
128  m_p_cmdResponseIn_in
129  );
130  this->m_cmdResponseIn_InputPort[port].setPortNum(port);
131 
132 #if FW_OBJECT_NAMES == 1
133  Fw::ObjectName portName;
134  portName.format(
135  "%s_cmdResponseIn_InputPort[%" PRI_FwIndexType "]",
136  this->m_objName.toChar(),
137  port
138  );
139  this->m_cmdResponseIn_InputPort[port].setObjName(portName.toChar());
140 #endif
141  }
142 
143  // Connect input port pingIn
144  for (
145  FwIndexType port = 0;
146  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
147  port++
148  ) {
149  this->m_pingIn_InputPort[port].init();
150  this->m_pingIn_InputPort[port].addCallComp(
151  this,
152  m_p_pingIn_in
153  );
154  this->m_pingIn_InputPort[port].setPortNum(port);
155 
156 #if FW_OBJECT_NAMES == 1
157  Fw::ObjectName portName;
158  portName.format(
159  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
160  this->m_objName.toChar(),
161  port
162  );
163  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
164 #endif
165  }
166 
167  // Connect input port schedIn
168  for (
169  FwIndexType port = 0;
170  port < static_cast<FwIndexType>(this->getNum_schedIn_InputPorts());
171  port++
172  ) {
173  this->m_schedIn_InputPort[port].init();
174  this->m_schedIn_InputPort[port].addCallComp(
175  this,
176  m_p_schedIn_in
177  );
178  this->m_schedIn_InputPort[port].setPortNum(port);
179 
180 #if FW_OBJECT_NAMES == 1
181  Fw::ObjectName portName;
182  portName.format(
183  "%s_schedIn_InputPort[%" PRI_FwIndexType "]",
184  this->m_objName.toChar(),
185  port
186  );
187  this->m_schedIn_InputPort[port].setObjName(portName.toChar());
188 #endif
189  }
190 
191  // Connect input port seqCancelIn
192  for (
193  FwIndexType port = 0;
194  port < static_cast<FwIndexType>(this->getNum_seqCancelIn_InputPorts());
195  port++
196  ) {
197  this->m_seqCancelIn_InputPort[port].init();
198  this->m_seqCancelIn_InputPort[port].addCallComp(
199  this,
200  m_p_seqCancelIn_in
201  );
202  this->m_seqCancelIn_InputPort[port].setPortNum(port);
203 
204 #if FW_OBJECT_NAMES == 1
205  Fw::ObjectName portName;
206  portName.format(
207  "%s_seqCancelIn_InputPort[%" PRI_FwIndexType "]",
208  this->m_objName.toChar(),
209  port
210  );
211  this->m_seqCancelIn_InputPort[port].setObjName(portName.toChar());
212 #endif
213  }
214 
215  // Connect input port seqDispatchIn
216  for (
217  FwIndexType port = 0;
218  port < static_cast<FwIndexType>(this->getNum_seqDispatchIn_InputPorts());
219  port++
220  ) {
221  this->m_seqDispatchIn_InputPort[port].init();
222  this->m_seqDispatchIn_InputPort[port].addCallComp(
223  this,
224  m_p_seqDispatchIn_in
225  );
226  this->m_seqDispatchIn_InputPort[port].setPortNum(port);
227 
228 #if FW_OBJECT_NAMES == 1
229  Fw::ObjectName portName;
230  portName.format(
231  "%s_seqDispatchIn_InputPort[%" PRI_FwIndexType "]",
232  this->m_objName.toChar(),
233  port
234  );
235  this->m_seqDispatchIn_InputPort[port].setObjName(portName.toChar());
236 #endif
237  }
238 
239  // Connect input port seqRunIn
240  for (
241  FwIndexType port = 0;
242  port < static_cast<FwIndexType>(this->getNum_seqRunIn_InputPorts());
243  port++
244  ) {
245  this->m_seqRunIn_InputPort[port].init();
246  this->m_seqRunIn_InputPort[port].addCallComp(
247  this,
248  m_p_seqRunIn_in
249  );
250  this->m_seqRunIn_InputPort[port].setPortNum(port);
251 
252 #if FW_OBJECT_NAMES == 1
253  Fw::ObjectName portName;
254  portName.format(
255  "%s_seqRunIn_InputPort[%" PRI_FwIndexType "]",
256  this->m_objName.toChar(),
257  port
258  );
259  this->m_seqRunIn_InputPort[port].setObjName(portName.toChar());
260 #endif
261  }
262 
263 #if FW_ENABLE_TEXT_LOGGING == 1
264  // Connect output port LogText
265  for (
266  FwIndexType port = 0;
267  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
268  port++
269  ) {
270  this->m_LogText_OutputPort[port].init();
271 
272 #if FW_OBJECT_NAMES == 1
273  Fw::ObjectName portName;
274  portName.format(
275  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
276  this->m_objName.toChar(),
277  port
278  );
279  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
280 #endif
281  }
282 #endif
283 
284  // Connect output port cmdRegOut
285  for (
286  FwIndexType port = 0;
287  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
288  port++
289  ) {
290  this->m_cmdRegOut_OutputPort[port].init();
291 
292 #if FW_OBJECT_NAMES == 1
293  Fw::ObjectName portName;
294  portName.format(
295  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
296  this->m_objName.toChar(),
297  port
298  );
299  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
300 #endif
301  }
302 
303  // Connect output port cmdResponseOut
304  for (
305  FwIndexType port = 0;
306  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
307  port++
308  ) {
309  this->m_cmdResponseOut_OutputPort[port].init();
310 
311 #if FW_OBJECT_NAMES == 1
312  Fw::ObjectName portName;
313  portName.format(
314  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
315  this->m_objName.toChar(),
316  port
317  );
318  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
319 #endif
320  }
321 
322  // Connect output port logOut
323  for (
324  FwIndexType port = 0;
325  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
326  port++
327  ) {
328  this->m_logOut_OutputPort[port].init();
329 
330 #if FW_OBJECT_NAMES == 1
331  Fw::ObjectName portName;
332  portName.format(
333  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
334  this->m_objName.toChar(),
335  port
336  );
337  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
338 #endif
339  }
340 
341  // Connect output port timeCaller
342  for (
343  FwIndexType port = 0;
344  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
345  port++
346  ) {
347  this->m_timeCaller_OutputPort[port].init();
348 
349 #if FW_OBJECT_NAMES == 1
350  Fw::ObjectName portName;
351  portName.format(
352  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
353  this->m_objName.toChar(),
354  port
355  );
356  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
357 #endif
358  }
359 
360  // Connect output port tlmOut
361  for (
362  FwIndexType port = 0;
363  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
364  port++
365  ) {
366  this->m_tlmOut_OutputPort[port].init();
367 
368 #if FW_OBJECT_NAMES == 1
369  Fw::ObjectName portName;
370  portName.format(
371  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
372  this->m_objName.toChar(),
373  port
374  );
375  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
376 #endif
377  }
378 
379  // Connect output port comCmdOut
380  for (
381  FwIndexType port = 0;
382  port < static_cast<FwIndexType>(this->getNum_comCmdOut_OutputPorts());
383  port++
384  ) {
385  this->m_comCmdOut_OutputPort[port].init();
386 
387 #if FW_OBJECT_NAMES == 1
388  Fw::ObjectName portName;
389  portName.format(
390  "%s_comCmdOut_OutputPort[%" PRI_FwIndexType "]",
391  this->m_objName.toChar(),
392  port
393  );
394  this->m_comCmdOut_OutputPort[port].setObjName(portName.toChar());
395 #endif
396  }
397 
398  // Connect output port pingOut
399  for (
400  FwIndexType port = 0;
401  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
402  port++
403  ) {
404  this->m_pingOut_OutputPort[port].init();
405 
406 #if FW_OBJECT_NAMES == 1
407  Fw::ObjectName portName;
408  portName.format(
409  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
410  this->m_objName.toChar(),
411  port
412  );
413  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
414 #endif
415  }
416 
417  // Connect output port seqDone
418  for (
419  FwIndexType port = 0;
420  port < static_cast<FwIndexType>(this->getNum_seqDone_OutputPorts());
421  port++
422  ) {
423  this->m_seqDone_OutputPort[port].init();
424 
425 #if FW_OBJECT_NAMES == 1
426  Fw::ObjectName portName;
427  portName.format(
428  "%s_seqDone_OutputPort[%" PRI_FwIndexType "]",
429  this->m_objName.toChar(),
430  port
431  );
432  this->m_seqDone_OutputPort[port].setObjName(portName.toChar());
433 #endif
434  }
435 
436  // Connect output port seqStartOut
437  for (
438  FwIndexType port = 0;
439  port < static_cast<FwIndexType>(this->getNum_seqStartOut_OutputPorts());
440  port++
441  ) {
442  this->m_seqStartOut_OutputPort[port].init();
443 
444 #if FW_OBJECT_NAMES == 1
445  Fw::ObjectName portName;
446  portName.format(
447  "%s_seqStartOut_OutputPort[%" PRI_FwIndexType "]",
448  this->m_objName.toChar(),
449  port
450  );
451  this->m_seqStartOut_OutputPort[port].setObjName(portName.toChar());
452 #endif
453  }
454 
455  // Create the queue
456  Os::Queue::Status qStat = this->createQueue(
457  queueDepth,
458  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
459  );
460  FW_ASSERT(
461  Os::Queue::Status::OP_OK == qStat,
462  static_cast<FwAssertArgType>(qStat)
463  );
464  }
465 
466  // ----------------------------------------------------------------------
467  // Getters for special input ports
468  // ----------------------------------------------------------------------
469 
472  {
473  FW_ASSERT(
474  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
475  static_cast<FwAssertArgType>(portNum)
476  );
477 
478  return &this->m_cmdIn_InputPort[portNum];
479  }
480 
481  // ----------------------------------------------------------------------
482  // Getters for typed input ports
483  // ----------------------------------------------------------------------
484 
487  {
488  FW_ASSERT(
489  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
490  static_cast<FwAssertArgType>(portNum)
491  );
492 
493  return &this->m_cmdResponseIn_InputPort[portNum];
494  }
495 
498  {
499  FW_ASSERT(
500  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
501  static_cast<FwAssertArgType>(portNum)
502  );
503 
504  return &this->m_pingIn_InputPort[portNum];
505  }
506 
509  {
510  FW_ASSERT(
511  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
512  static_cast<FwAssertArgType>(portNum)
513  );
514 
515  return &this->m_schedIn_InputPort[portNum];
516  }
517 
520  {
521  FW_ASSERT(
522  (0 <= portNum) && (portNum < this->getNum_seqCancelIn_InputPorts()),
523  static_cast<FwAssertArgType>(portNum)
524  );
525 
526  return &this->m_seqCancelIn_InputPort[portNum];
527  }
528 
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_seqDispatchIn_InputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  return &this->m_seqDispatchIn_InputPort[portNum];
538  }
539 
542  {
543  FW_ASSERT(
544  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
545  static_cast<FwAssertArgType>(portNum)
546  );
547 
548  return &this->m_seqRunIn_InputPort[portNum];
549  }
550 
551  // ----------------------------------------------------------------------
552  // Connect input ports to special output ports
553  // ----------------------------------------------------------------------
554 
555 #if FW_ENABLE_TEXT_LOGGING == 1
556 
557  void CmdSequencerComponentBase ::
558  set_LogText_OutputPort(
559  FwIndexType portNum,
561  )
562  {
563  FW_ASSERT(
564  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
565  static_cast<FwAssertArgType>(portNum)
566  );
567 
568  this->m_LogText_OutputPort[portNum].addCallPort(port);
569  }
570 
571 #endif
572 
575  FwIndexType portNum,
576  Fw::InputCmdRegPort* port
577  )
578  {
579  FW_ASSERT(
580  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
581  static_cast<FwAssertArgType>(portNum)
582  );
583 
584  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
585  }
586 
589  FwIndexType portNum,
591  )
592  {
593  FW_ASSERT(
594  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
595  static_cast<FwAssertArgType>(portNum)
596  );
597 
598  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
599  }
600 
603  FwIndexType portNum,
604  Fw::InputLogPort* port
605  )
606  {
607  FW_ASSERT(
608  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
609  static_cast<FwAssertArgType>(portNum)
610  );
611 
612  this->m_logOut_OutputPort[portNum].addCallPort(port);
613  }
614 
617  FwIndexType portNum,
618  Fw::InputTimePort* port
619  )
620  {
621  FW_ASSERT(
622  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
623  static_cast<FwAssertArgType>(portNum)
624  );
625 
626  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
627  }
628 
631  FwIndexType portNum,
632  Fw::InputTlmPort* port
633  )
634  {
635  FW_ASSERT(
636  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
637  static_cast<FwAssertArgType>(portNum)
638  );
639 
640  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
641  }
642 
643  // ----------------------------------------------------------------------
644  // Connect typed input ports to typed output ports
645  // ----------------------------------------------------------------------
646 
649  FwIndexType portNum,
650  Fw::InputComPort* port
651  )
652  {
653  FW_ASSERT(
654  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
655  static_cast<FwAssertArgType>(portNum)
656  );
657 
658  this->m_comCmdOut_OutputPort[portNum].addCallPort(port);
659  }
660 
663  FwIndexType portNum,
664  Svc::InputPingPort* port
665  )
666  {
667  FW_ASSERT(
668  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
669  static_cast<FwAssertArgType>(portNum)
670  );
671 
672  this->m_pingOut_OutputPort[portNum].addCallPort(port);
673  }
674 
677  FwIndexType portNum,
679  )
680  {
681  FW_ASSERT(
682  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
683  static_cast<FwAssertArgType>(portNum)
684  );
685 
686  this->m_seqDone_OutputPort[portNum].addCallPort(port);
687  }
688 
691  FwIndexType portNum,
693  )
694  {
695  FW_ASSERT(
696  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
697  static_cast<FwAssertArgType>(portNum)
698  );
699 
700  this->m_seqStartOut_OutputPort[portNum].addCallPort(port);
701  }
702 
703 #if FW_PORT_SERIALIZATION
704 
705  // ----------------------------------------------------------------------
706  // Connect serial input ports to special output ports
707  // ----------------------------------------------------------------------
708 
709 #if FW_ENABLE_TEXT_LOGGING == 1
710 
711  void CmdSequencerComponentBase ::
712  set_LogText_OutputPort(
713  FwIndexType portNum,
714  Fw::InputSerializePort* port
715  )
716  {
717  FW_ASSERT(
718  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
719  static_cast<FwAssertArgType>(portNum)
720  );
721 
722  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
723  }
724 
725 #endif
726 
729  FwIndexType portNum,
730  Fw::InputSerializePort* port
731  )
732  {
733  FW_ASSERT(
734  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
735  static_cast<FwAssertArgType>(portNum)
736  );
737 
738  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
739  }
740 
743  FwIndexType portNum,
744  Fw::InputSerializePort* port
745  )
746  {
747  FW_ASSERT(
748  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
749  static_cast<FwAssertArgType>(portNum)
750  );
751 
752  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
753  }
754 
757  FwIndexType portNum,
758  Fw::InputSerializePort* port
759  )
760  {
761  FW_ASSERT(
762  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
763  static_cast<FwAssertArgType>(portNum)
764  );
765 
766  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
767  }
768 
771  FwIndexType portNum,
772  Fw::InputSerializePort* port
773  )
774  {
775  FW_ASSERT(
776  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
777  static_cast<FwAssertArgType>(portNum)
778  );
779 
780  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
781  }
782 
785  FwIndexType portNum,
786  Fw::InputSerializePort* port
787  )
788  {
789  FW_ASSERT(
790  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
791  static_cast<FwAssertArgType>(portNum)
792  );
793 
794  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
795  }
796 
797 #endif
798 
799 #if FW_PORT_SERIALIZATION
800 
801  // ----------------------------------------------------------------------
802  // Connect serial input ports to typed output ports
803  // ----------------------------------------------------------------------
804 
807  FwIndexType portNum,
808  Fw::InputSerializePort* port
809  )
810  {
811  FW_ASSERT(
812  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
813  static_cast<FwAssertArgType>(portNum)
814  );
815 
816  this->m_comCmdOut_OutputPort[portNum].registerSerialPort(port);
817  }
818 
821  FwIndexType portNum,
822  Fw::InputSerializePort* port
823  )
824  {
825  FW_ASSERT(
826  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
827  static_cast<FwAssertArgType>(portNum)
828  );
829 
830  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
831  }
832 
835  FwIndexType portNum,
836  Fw::InputSerializePort* port
837  )
838  {
839  FW_ASSERT(
840  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
841  static_cast<FwAssertArgType>(portNum)
842  );
843 
844  this->m_seqDone_OutputPort[portNum].registerSerialPort(port);
845  }
846 
849  FwIndexType portNum,
850  Fw::InputSerializePort* port
851  )
852  {
853  FW_ASSERT(
854  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
855  static_cast<FwAssertArgType>(portNum)
856  );
857 
858  this->m_seqStartOut_OutputPort[portNum].registerSerialPort(port);
859  }
860 
861 #endif
862 
863  // ----------------------------------------------------------------------
864  // Command registration
865  // ----------------------------------------------------------------------
866 
869  {
870  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
871 
872  this->m_cmdRegOut_OutputPort[0].invoke(
873  this->getIdBase() + OPCODE_CS_RUN
874  );
875 
876  this->m_cmdRegOut_OutputPort[0].invoke(
877  this->getIdBase() + OPCODE_CS_VALIDATE
878  );
879 
880  this->m_cmdRegOut_OutputPort[0].invoke(
881  this->getIdBase() + OPCODE_CS_CANCEL
882  );
883 
884  this->m_cmdRegOut_OutputPort[0].invoke(
885  this->getIdBase() + OPCODE_CS_START
886  );
887 
888  this->m_cmdRegOut_OutputPort[0].invoke(
889  this->getIdBase() + OPCODE_CS_STEP
890  );
891 
892  this->m_cmdRegOut_OutputPort[0].invoke(
893  this->getIdBase() + OPCODE_CS_AUTO
894  );
895 
896  this->m_cmdRegOut_OutputPort[0].invoke(
897  this->getIdBase() + OPCODE_CS_MANUAL
898  );
899 
900  this->m_cmdRegOut_OutputPort[0].invoke(
902  );
903  }
904 
905  // ----------------------------------------------------------------------
906  // Component construction and destruction
907  // ----------------------------------------------------------------------
908 
910  CmdSequencerComponentBase(const char* compName) :
911  Fw::ActiveComponentBase(compName)
912  {
913 
914  }
915 
918  {
919 
920  }
921 
922  // ----------------------------------------------------------------------
923  // Connection status queries for special output ports
924  // ----------------------------------------------------------------------
925 
926 #if FW_ENABLE_TEXT_LOGGING == 1
927 
928  bool CmdSequencerComponentBase ::
929  isConnected_LogText_OutputPort(FwIndexType portNum)
930  {
931  FW_ASSERT(
932  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
933  static_cast<FwAssertArgType>(portNum)
934  );
935 
936  return this->m_LogText_OutputPort[portNum].isConnected();
937  }
938 
939 #endif
940 
943  {
944  FW_ASSERT(
945  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
946  static_cast<FwAssertArgType>(portNum)
947  );
948 
949  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
950  }
951 
954  {
955  FW_ASSERT(
956  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
957  static_cast<FwAssertArgType>(portNum)
958  );
959 
960  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
961  }
962 
965  {
966  FW_ASSERT(
967  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
968  static_cast<FwAssertArgType>(portNum)
969  );
970 
971  return this->m_logOut_OutputPort[portNum].isConnected();
972  }
973 
976  {
977  FW_ASSERT(
978  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
979  static_cast<FwAssertArgType>(portNum)
980  );
981 
982  return this->m_timeCaller_OutputPort[portNum].isConnected();
983  }
984 
987  {
988  FW_ASSERT(
989  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
990  static_cast<FwAssertArgType>(portNum)
991  );
992 
993  return this->m_tlmOut_OutputPort[portNum].isConnected();
994  }
995 
996  // ----------------------------------------------------------------------
997  // Connection status queries for typed output ports
998  // ----------------------------------------------------------------------
999 
1002  {
1003  FW_ASSERT(
1004  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
1005  static_cast<FwAssertArgType>(portNum)
1006  );
1007 
1008  return this->m_comCmdOut_OutputPort[portNum].isConnected();
1009  }
1010 
1013  {
1014  FW_ASSERT(
1015  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1016  static_cast<FwAssertArgType>(portNum)
1017  );
1018 
1019  return this->m_pingOut_OutputPort[portNum].isConnected();
1020  }
1021 
1024  {
1025  FW_ASSERT(
1026  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
1027  static_cast<FwAssertArgType>(portNum)
1028  );
1029 
1030  return this->m_seqDone_OutputPort[portNum].isConnected();
1031  }
1032 
1035  {
1036  FW_ASSERT(
1037  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1038  static_cast<FwAssertArgType>(portNum)
1039  );
1040 
1041  return this->m_seqStartOut_OutputPort[portNum].isConnected();
1042  }
1043 
1044  // ----------------------------------------------------------------------
1045  // Port handler base-class functions for typed input ports
1046  //
1047  // Call these functions directly to bypass the corresponding ports
1048  // ----------------------------------------------------------------------
1049 
1052  FwIndexType portNum,
1053  FwOpcodeType opCode,
1054  U32 cmdSeq,
1055  const Fw::CmdResponse& response
1056  )
1057  {
1058  // Make sure port number is valid
1059  FW_ASSERT(
1060  (0 <= portNum) && (portNum < this->getNum_cmdResponseIn_InputPorts()),
1061  static_cast<FwAssertArgType>(portNum)
1062  );
1063 
1064  // Call pre-message hook
1066  portNum,
1067  opCode,
1068  cmdSeq,
1069  response
1070  );
1071  ComponentIpcSerializableBuffer msg;
1073 
1074  // Serialize message ID
1075  _status = msg.serializeFrom(
1076  static_cast<FwEnumStoreType>(CMDRESPONSEIN_CMDRESPONSE)
1077  );
1078  FW_ASSERT(
1079  _status == Fw::FW_SERIALIZE_OK,
1080  static_cast<FwAssertArgType>(_status)
1081  );
1082 
1083  // Serialize port number
1084  _status = msg.serializeFrom(portNum);
1085  FW_ASSERT(
1086  _status == Fw::FW_SERIALIZE_OK,
1087  static_cast<FwAssertArgType>(_status)
1088  );
1089 
1090  // Serialize argument opCode
1091  _status = msg.serializeFrom(opCode);
1092  FW_ASSERT(
1093  _status == Fw::FW_SERIALIZE_OK,
1094  static_cast<FwAssertArgType>(_status)
1095  );
1096 
1097  // Serialize argument cmdSeq
1098  _status = msg.serializeFrom(cmdSeq);
1099  FW_ASSERT(
1100  _status == Fw::FW_SERIALIZE_OK,
1101  static_cast<FwAssertArgType>(_status)
1102  );
1103 
1104  // Serialize argument response
1105  _status = msg.serializeFrom(response);
1106  FW_ASSERT(
1107  _status == Fw::FW_SERIALIZE_OK,
1108  static_cast<FwAssertArgType>(_status)
1109  );
1110 
1111  // Send message
1113  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1114 
1115  FW_ASSERT(
1116  qStatus == Os::Queue::OP_OK,
1117  static_cast<FwAssertArgType>(qStatus)
1118  );
1119  }
1120 
1123  FwIndexType portNum,
1124  U32 key
1125  )
1126  {
1127  // Make sure port number is valid
1128  FW_ASSERT(
1129  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1130  static_cast<FwAssertArgType>(portNum)
1131  );
1132 
1133  // Call pre-message hook
1135  portNum,
1136  key
1137  );
1138  ComponentIpcSerializableBuffer msg;
1140 
1141  // Serialize message ID
1142  _status = msg.serializeFrom(
1143  static_cast<FwEnumStoreType>(PINGIN_PING)
1144  );
1145  FW_ASSERT(
1146  _status == Fw::FW_SERIALIZE_OK,
1147  static_cast<FwAssertArgType>(_status)
1148  );
1149 
1150  // Serialize port number
1151  _status = msg.serializeFrom(portNum);
1152  FW_ASSERT(
1153  _status == Fw::FW_SERIALIZE_OK,
1154  static_cast<FwAssertArgType>(_status)
1155  );
1156 
1157  // Serialize argument key
1158  _status = msg.serializeFrom(key);
1159  FW_ASSERT(
1160  _status == Fw::FW_SERIALIZE_OK,
1161  static_cast<FwAssertArgType>(_status)
1162  );
1163 
1164  // Send message
1166  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1167 
1168  FW_ASSERT(
1169  qStatus == Os::Queue::OP_OK,
1170  static_cast<FwAssertArgType>(qStatus)
1171  );
1172  }
1173 
1176  FwIndexType portNum,
1177  U32 context
1178  )
1179  {
1180  // Make sure port number is valid
1181  FW_ASSERT(
1182  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
1183  static_cast<FwAssertArgType>(portNum)
1184  );
1185 
1186  // Call pre-message hook
1188  portNum,
1189  context
1190  );
1191  ComponentIpcSerializableBuffer msg;
1193 
1194  // Serialize message ID
1195  _status = msg.serializeFrom(
1196  static_cast<FwEnumStoreType>(SCHEDIN_SCHED)
1197  );
1198  FW_ASSERT(
1199  _status == Fw::FW_SERIALIZE_OK,
1200  static_cast<FwAssertArgType>(_status)
1201  );
1202 
1203  // Serialize port number
1204  _status = msg.serializeFrom(portNum);
1205  FW_ASSERT(
1206  _status == Fw::FW_SERIALIZE_OK,
1207  static_cast<FwAssertArgType>(_status)
1208  );
1209 
1210  // Serialize argument context
1211  _status = msg.serializeFrom(context);
1212  FW_ASSERT(
1213  _status == Fw::FW_SERIALIZE_OK,
1214  static_cast<FwAssertArgType>(_status)
1215  );
1216 
1217  // Send message
1219  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1220 
1221  FW_ASSERT(
1222  qStatus == Os::Queue::OP_OK,
1223  static_cast<FwAssertArgType>(qStatus)
1224  );
1225  }
1226 
1229  {
1230  // Make sure port number is valid
1231  FW_ASSERT(
1232  (0 <= portNum) && (portNum < this->getNum_seqCancelIn_InputPorts()),
1233  static_cast<FwAssertArgType>(portNum)
1234  );
1235 
1236  // Call pre-message hook
1237  seqCancelIn_preMsgHook(portNum);
1238  ComponentIpcSerializableBuffer msg;
1240 
1241  // Serialize message ID
1242  _status = msg.serializeFrom(
1243  static_cast<FwEnumStoreType>(SEQCANCELIN_CMDSEQCANCEL)
1244  );
1245  FW_ASSERT(
1246  _status == Fw::FW_SERIALIZE_OK,
1247  static_cast<FwAssertArgType>(_status)
1248  );
1249 
1250  // Serialize port number
1251  _status = msg.serializeFrom(portNum);
1252  FW_ASSERT(
1253  _status == Fw::FW_SERIALIZE_OK,
1254  static_cast<FwAssertArgType>(_status)
1255  );
1256 
1257  // Send message
1259  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1260 
1261  FW_ASSERT(
1262  qStatus == Os::Queue::OP_OK,
1263  static_cast<FwAssertArgType>(qStatus)
1264  );
1265  }
1266 
1269  FwIndexType portNum,
1270  Fw::StringBase& file_name
1271  )
1272  {
1273  // Make sure port number is valid
1274  FW_ASSERT(
1275  (0 <= portNum) && (portNum < this->getNum_seqDispatchIn_InputPorts()),
1276  static_cast<FwAssertArgType>(portNum)
1277  );
1278 
1279  // Call pre-message hook
1281  portNum,
1282  file_name
1283  );
1284  ComponentIpcSerializableBuffer msg;
1286 
1287  // Serialize message ID
1288  _status = msg.serializeFrom(
1289  static_cast<FwEnumStoreType>(SEQDISPATCHIN_FILEDISPATCH)
1290  );
1291  FW_ASSERT(
1292  _status == Fw::FW_SERIALIZE_OK,
1293  static_cast<FwAssertArgType>(_status)
1294  );
1295 
1296  // Serialize port number
1297  _status = msg.serializeFrom(portNum);
1298  FW_ASSERT(
1299  _status == Fw::FW_SERIALIZE_OK,
1300  static_cast<FwAssertArgType>(_status)
1301  );
1302 
1303  // Serialize argument file_name
1304  _status = file_name.serializeTo(msg, 80);
1305  FW_ASSERT(
1306  _status == Fw::FW_SERIALIZE_OK,
1307  static_cast<FwAssertArgType>(_status)
1308  );
1309 
1310  // Send message
1312  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1313 
1314  FW_ASSERT(
1315  qStatus == Os::Queue::OP_OK,
1316  static_cast<FwAssertArgType>(qStatus)
1317  );
1318  }
1319 
1322  FwIndexType portNum,
1323  const Fw::StringBase& filename
1324  )
1325  {
1326  // Make sure port number is valid
1327  FW_ASSERT(
1328  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
1329  static_cast<FwAssertArgType>(portNum)
1330  );
1331 
1332  // Call pre-message hook
1334  portNum,
1335  filename
1336  );
1337  ComponentIpcSerializableBuffer msg;
1339 
1340  // Serialize message ID
1341  _status = msg.serializeFrom(
1342  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
1343  );
1344  FW_ASSERT(
1345  _status == Fw::FW_SERIALIZE_OK,
1346  static_cast<FwAssertArgType>(_status)
1347  );
1348 
1349  // Serialize port number
1350  _status = msg.serializeFrom(portNum);
1351  FW_ASSERT(
1352  _status == Fw::FW_SERIALIZE_OK,
1353  static_cast<FwAssertArgType>(_status)
1354  );
1355 
1356  // Serialize argument filename
1357  _status = filename.serializeTo(msg, 240);
1358  FW_ASSERT(
1359  _status == Fw::FW_SERIALIZE_OK,
1360  static_cast<FwAssertArgType>(_status)
1361  );
1362 
1363  // Send message
1365  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1366 
1367  FW_ASSERT(
1368  qStatus == Os::Queue::OP_OK,
1369  static_cast<FwAssertArgType>(qStatus)
1370  );
1371  }
1372 
1373  // ----------------------------------------------------------------------
1374  // Pre-message hooks for typed async input ports
1375  //
1376  // Each of these functions is invoked just before processing a message
1377  // on the corresponding port. By default, they do nothing. You can
1378  // override them to provide specific pre-message behavior.
1379  // ----------------------------------------------------------------------
1380 
1383  FwIndexType portNum,
1384  FwOpcodeType opCode,
1385  U32 cmdSeq,
1386  const Fw::CmdResponse& response
1387  )
1388  {
1389  // Default: no-op
1390  }
1391 
1394  FwIndexType portNum,
1395  U32 key
1396  )
1397  {
1398  // Default: no-op
1399  }
1400 
1403  FwIndexType portNum,
1404  U32 context
1405  )
1406  {
1407  // Default: no-op
1408  }
1409 
1412  {
1413  // Default: no-op
1414  }
1415 
1418  FwIndexType portNum,
1419  Fw::StringBase& file_name
1420  )
1421  {
1422  // Default: no-op
1423  }
1424 
1427  FwIndexType portNum,
1428  const Fw::StringBase& filename
1429  )
1430  {
1431  // Default: no-op
1432  }
1433 
1434  // ----------------------------------------------------------------------
1435  // Invocation functions for typed output ports
1436  // ----------------------------------------------------------------------
1437 
1440  FwIndexType portNum,
1441  Fw::ComBuffer& data,
1442  U32 context
1443  )
1444  {
1445  FW_ASSERT(
1446  (0 <= portNum) && (portNum < this->getNum_comCmdOut_OutputPorts()),
1447  static_cast<FwAssertArgType>(portNum)
1448  );
1449 
1450  FW_ASSERT(
1451  this->m_comCmdOut_OutputPort[portNum].isConnected(),
1452  static_cast<FwAssertArgType>(portNum)
1453  );
1454  this->m_comCmdOut_OutputPort[portNum].invoke(
1455  data,
1456  context
1457  );
1458  }
1459 
1462  FwIndexType portNum,
1463  U32 key
1464  )
1465  {
1466  FW_ASSERT(
1467  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1468  static_cast<FwAssertArgType>(portNum)
1469  );
1470 
1471  FW_ASSERT(
1472  this->m_pingOut_OutputPort[portNum].isConnected(),
1473  static_cast<FwAssertArgType>(portNum)
1474  );
1475  this->m_pingOut_OutputPort[portNum].invoke(
1476  key
1477  );
1478  }
1479 
1482  FwIndexType portNum,
1483  FwOpcodeType opCode,
1484  U32 cmdSeq,
1485  const Fw::CmdResponse& response
1486  )
1487  {
1488  FW_ASSERT(
1489  (0 <= portNum) && (portNum < this->getNum_seqDone_OutputPorts()),
1490  static_cast<FwAssertArgType>(portNum)
1491  );
1492 
1493  FW_ASSERT(
1494  this->m_seqDone_OutputPort[portNum].isConnected(),
1495  static_cast<FwAssertArgType>(portNum)
1496  );
1497  this->m_seqDone_OutputPort[portNum].invoke(
1498  opCode,
1499  cmdSeq,
1500  response
1501  );
1502  }
1503 
1506  FwIndexType portNum,
1507  const Fw::StringBase& filename
1508  )
1509  {
1510  FW_ASSERT(
1511  (0 <= portNum) && (portNum < this->getNum_seqStartOut_OutputPorts()),
1512  static_cast<FwAssertArgType>(portNum)
1513  );
1514 
1515  FW_ASSERT(
1516  this->m_seqStartOut_OutputPort[portNum].isConnected(),
1517  static_cast<FwAssertArgType>(portNum)
1518  );
1519  this->m_seqStartOut_OutputPort[portNum].invoke(
1520  filename
1521  );
1522  }
1523 
1524  // ----------------------------------------------------------------------
1525  // Command response
1526  // ----------------------------------------------------------------------
1527 
1530  FwOpcodeType opCode,
1531  U32 cmdSeq,
1532  Fw::CmdResponse response
1533  )
1534  {
1535  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1536  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1537  }
1538 
1539  // ----------------------------------------------------------------------
1540  // Command handler base-class functions
1541  //
1542  // Call these functions directly to bypass the command input port
1543  // ----------------------------------------------------------------------
1544 
1547  FwOpcodeType opCode,
1548  U32 cmdSeq,
1549  Fw::CmdArgBuffer& args
1550  )
1551  {
1552  // Call pre-message hook
1553  this->CS_RUN_preMsgHook(opCode,cmdSeq);
1554 
1555  // Defer deserializing arguments to the message dispatcher
1556  // to avoid deserializing and reserializing just for IPC
1557  ComponentIpcSerializableBuffer msg;
1559 
1560  // Serialize for IPC
1561  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_RUN));
1562  FW_ASSERT (
1563  _status == Fw::FW_SERIALIZE_OK,
1564  static_cast<FwAssertArgType>(_status)
1565  );
1566 
1567  // Fake port number to make message dequeue work
1568  FwIndexType port = 0;
1569 
1570  _status = msg.serializeFrom(port);
1571  FW_ASSERT (
1572  _status == Fw::FW_SERIALIZE_OK,
1573  static_cast<FwAssertArgType>(_status)
1574  );
1575 
1576  _status = msg.serializeFrom(opCode);
1577  FW_ASSERT (
1578  _status == Fw::FW_SERIALIZE_OK,
1579  static_cast<FwAssertArgType>(_status)
1580  );
1581 
1582  _status = msg.serializeFrom(cmdSeq);
1583  FW_ASSERT (
1584  _status == Fw::FW_SERIALIZE_OK,
1585  static_cast<FwAssertArgType>(_status)
1586  );
1587 
1588  _status = msg.serializeFrom(args);
1589  FW_ASSERT (
1590  _status == Fw::FW_SERIALIZE_OK,
1591  static_cast<FwAssertArgType>(_status)
1592  );
1593 
1594  // Send message
1596  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1597 
1598  FW_ASSERT(
1599  qStatus == Os::Queue::OP_OK,
1600  static_cast<FwAssertArgType>(qStatus)
1601  );
1602  }
1603 
1606  FwOpcodeType opCode,
1607  U32 cmdSeq,
1608  Fw::CmdArgBuffer& args
1609  )
1610  {
1611  // Call pre-message hook
1612  this->CS_VALIDATE_preMsgHook(opCode,cmdSeq);
1613 
1614  // Defer deserializing arguments to the message dispatcher
1615  // to avoid deserializing and reserializing just for IPC
1616  ComponentIpcSerializableBuffer msg;
1618 
1619  // Serialize for IPC
1620  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_VALIDATE));
1621  FW_ASSERT (
1622  _status == Fw::FW_SERIALIZE_OK,
1623  static_cast<FwAssertArgType>(_status)
1624  );
1625 
1626  // Fake port number to make message dequeue work
1627  FwIndexType port = 0;
1628 
1629  _status = msg.serializeFrom(port);
1630  FW_ASSERT (
1631  _status == Fw::FW_SERIALIZE_OK,
1632  static_cast<FwAssertArgType>(_status)
1633  );
1634 
1635  _status = msg.serializeFrom(opCode);
1636  FW_ASSERT (
1637  _status == Fw::FW_SERIALIZE_OK,
1638  static_cast<FwAssertArgType>(_status)
1639  );
1640 
1641  _status = msg.serializeFrom(cmdSeq);
1642  FW_ASSERT (
1643  _status == Fw::FW_SERIALIZE_OK,
1644  static_cast<FwAssertArgType>(_status)
1645  );
1646 
1647  _status = msg.serializeFrom(args);
1648  FW_ASSERT (
1649  _status == Fw::FW_SERIALIZE_OK,
1650  static_cast<FwAssertArgType>(_status)
1651  );
1652 
1653  // Send message
1655  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1656 
1657  FW_ASSERT(
1658  qStatus == Os::Queue::OP_OK,
1659  static_cast<FwAssertArgType>(qStatus)
1660  );
1661  }
1662 
1665  FwOpcodeType opCode,
1666  U32 cmdSeq,
1667  Fw::CmdArgBuffer& args
1668  )
1669  {
1670  // Call pre-message hook
1671  this->CS_CANCEL_preMsgHook(opCode,cmdSeq);
1672 
1673  // Defer deserializing arguments to the message dispatcher
1674  // to avoid deserializing and reserializing just for IPC
1675  ComponentIpcSerializableBuffer msg;
1677 
1678  // Serialize for IPC
1679  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CS_CANCEL));
1680  FW_ASSERT (
1681  _status == Fw::FW_SERIALIZE_OK,
1682  static_cast<FwAssertArgType>(_status)
1683  );
1684 
1685  // Fake port number to make message dequeue work
1686  FwIndexType port = 0;
1687 
1688  _status = msg.serializeFrom(port);
1689  FW_ASSERT (
1690  _status == Fw::FW_SERIALIZE_OK,
1691  static_cast<FwAssertArgType>(_status)
1692  );
1693 
1694  _status = msg.serializeFrom(opCode);
1695  FW_ASSERT (
1696  _status == Fw::FW_SERIALIZE_OK,
1697  static_cast<FwAssertArgType>(_status)
1698  );
1699 
1700  _status = msg.serializeFrom(cmdSeq);
1701  FW_ASSERT (
1702  _status == Fw::FW_SERIALIZE_OK,
1703  static_cast<FwAssertArgType>(_status)
1704  );
1705 
1706  _status = msg.serializeFrom(args);
1707  FW_ASSERT (
1708  _status == Fw::FW_SERIALIZE_OK,
1709  static_cast<FwAssertArgType>(_status)
1710  );
1711 
1712  // Send message
1714  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1715 
1716  FW_ASSERT(
1717  qStatus == Os::Queue::OP_OK,
1718  static_cast<FwAssertArgType>(qStatus)
1719  );
1720  }
1721 
1724  FwOpcodeType opCode,
1725  U32 cmdSeq,
1726  Fw::CmdArgBuffer& args
1727  )
1728  {
1729  // Call pre-message hook
1730  this->CS_START_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_START));
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_STEP_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_STEP));
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_AUTO_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_AUTO));
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_MANUAL_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_MANUAL));
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_JOIN_WAIT_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_JOIN_WAIT));
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 
2017  // ----------------------------------------------------------------------
2018  // Pre-message hooks for async commands
2019  //
2020  // Each of these functions is invoked just before processing the
2021  // corresponding command. By default they do nothing. You can
2022  // override them to provide specific pre-command behavior.
2023  // ----------------------------------------------------------------------
2024 
2027  FwOpcodeType opCode,
2028  U32 cmdSeq
2029  )
2030  {
2031  // Defaults to no-op; can be overridden
2032  (void) opCode;
2033  (void) cmdSeq;
2034  }
2035 
2038  FwOpcodeType opCode,
2039  U32 cmdSeq
2040  )
2041  {
2042  // Defaults to no-op; can be overridden
2043  (void) opCode;
2044  (void) cmdSeq;
2045  }
2046 
2049  FwOpcodeType opCode,
2050  U32 cmdSeq
2051  )
2052  {
2053  // Defaults to no-op; can be overridden
2054  (void) opCode;
2055  (void) cmdSeq;
2056  }
2057 
2060  FwOpcodeType opCode,
2061  U32 cmdSeq
2062  )
2063  {
2064  // Defaults to no-op; can be overridden
2065  (void) opCode;
2066  (void) cmdSeq;
2067  }
2068 
2071  FwOpcodeType opCode,
2072  U32 cmdSeq
2073  )
2074  {
2075  // Defaults to no-op; can be overridden
2076  (void) opCode;
2077  (void) cmdSeq;
2078  }
2079 
2082  FwOpcodeType opCode,
2083  U32 cmdSeq
2084  )
2085  {
2086  // Defaults to no-op; can be overridden
2087  (void) opCode;
2088  (void) cmdSeq;
2089  }
2090 
2093  FwOpcodeType opCode,
2094  U32 cmdSeq
2095  )
2096  {
2097  // Defaults to no-op; can be overridden
2098  (void) opCode;
2099  (void) cmdSeq;
2100  }
2101 
2104  FwOpcodeType opCode,
2105  U32 cmdSeq
2106  )
2107  {
2108  // Defaults to no-op; can be overridden
2109  (void) opCode;
2110  (void) cmdSeq;
2111  }
2112 
2113  // ----------------------------------------------------------------------
2114  // Event logging functions
2115  // ----------------------------------------------------------------------
2116 
2119  {
2120  // Get the time
2121  Fw::Time _logTime;
2122  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2123  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2124  }
2125 
2126  FwEventIdType _id = static_cast<FwEventIdType>(0);
2127 
2128  _id = this->getIdBase() + EVENTID_CS_SEQUENCELOADED;
2129 
2130  // Emit the event on the log port
2131  if (this->m_logOut_OutputPort[0].isConnected()) {
2132  Fw::LogBuffer _logBuff;
2134 
2135 #if FW_AMPCS_COMPATIBLE
2136  // Serialize the number of arguments
2137  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2138  FW_ASSERT(
2139  _status == Fw::FW_SERIALIZE_OK,
2140  static_cast<FwAssertArgType>(_status)
2141  );
2142 #endif
2143 
2144  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2145  FW_ASSERT(
2146  _status == Fw::FW_SERIALIZE_OK,
2147  static_cast<FwAssertArgType>(_status)
2148  );
2149 
2150  this->m_logOut_OutputPort[0].invoke(
2151  _id,
2152  _logTime,
2154  _logBuff
2155  );
2156  }
2157 
2158  // Emit the event on the text log port
2159 #if FW_ENABLE_TEXT_LOGGING
2160  if (this->m_LogText_OutputPort[0].isConnected()) {
2161 #if FW_OBJECT_NAMES == 1
2162  const char* _formatString =
2163  "(%s) %s: Loaded sequence %s";
2164 #else
2165  const char* _formatString =
2166  "%s: Loaded sequence %s";
2167 #endif
2168 
2169  Fw::TextLogString _logString;
2170  _logString.format(
2171  _formatString,
2172 #if FW_OBJECT_NAMES == 1
2173  this->m_objName.toChar(),
2174 #endif
2175  "CS_SequenceLoaded ",
2176  fileName.toChar()
2177  );
2178 
2179  this->m_LogText_OutputPort[0].invoke(
2180  _id,
2181  _logTime,
2183  _logString
2184  );
2185  }
2186 #endif
2187  }
2188 
2191  {
2192  // Get the time
2193  Fw::Time _logTime;
2194  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2195  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2196  }
2197 
2198  FwEventIdType _id = static_cast<FwEventIdType>(0);
2199 
2200  _id = this->getIdBase() + EVENTID_CS_SEQUENCECANCELED;
2201 
2202  // Emit the event on the log port
2203  if (this->m_logOut_OutputPort[0].isConnected()) {
2204  Fw::LogBuffer _logBuff;
2206 
2207 #if FW_AMPCS_COMPATIBLE
2208  // Serialize the number of arguments
2209  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2210  FW_ASSERT(
2211  _status == Fw::FW_SERIALIZE_OK,
2212  static_cast<FwAssertArgType>(_status)
2213  );
2214 #endif
2215 
2216  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2217  FW_ASSERT(
2218  _status == Fw::FW_SERIALIZE_OK,
2219  static_cast<FwAssertArgType>(_status)
2220  );
2221 
2222  this->m_logOut_OutputPort[0].invoke(
2223  _id,
2224  _logTime,
2226  _logBuff
2227  );
2228  }
2229 
2230  // Emit the event on the text log port
2231 #if FW_ENABLE_TEXT_LOGGING
2232  if (this->m_LogText_OutputPort[0].isConnected()) {
2233 #if FW_OBJECT_NAMES == 1
2234  const char* _formatString =
2235  "(%s) %s: Sequence file %s canceled";
2236 #else
2237  const char* _formatString =
2238  "%s: Sequence file %s canceled";
2239 #endif
2240 
2241  Fw::TextLogString _logString;
2242  _logString.format(
2243  _formatString,
2244 #if FW_OBJECT_NAMES == 1
2245  this->m_objName.toChar(),
2246 #endif
2247  "CS_SequenceCanceled ",
2248  fileName.toChar()
2249  );
2250 
2251  this->m_LogText_OutputPort[0].invoke(
2252  _id,
2253  _logTime,
2255  _logString
2256  );
2257  }
2258 #endif
2259  }
2260 
2263  {
2264  // Get the time
2265  Fw::Time _logTime;
2266  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2267  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2268  }
2269 
2270  FwEventIdType _id = static_cast<FwEventIdType>(0);
2271 
2272  _id = this->getIdBase() + EVENTID_CS_FILEREADERROR;
2273 
2274  // Emit the event on the log port
2275  if (this->m_logOut_OutputPort[0].isConnected()) {
2276  Fw::LogBuffer _logBuff;
2278 
2279 #if FW_AMPCS_COMPATIBLE
2280  // Serialize the number of arguments
2281  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2282  FW_ASSERT(
2283  _status == Fw::FW_SERIALIZE_OK,
2284  static_cast<FwAssertArgType>(_status)
2285  );
2286 #endif
2287 
2288  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2289  FW_ASSERT(
2290  _status == Fw::FW_SERIALIZE_OK,
2291  static_cast<FwAssertArgType>(_status)
2292  );
2293 
2294  this->m_logOut_OutputPort[0].invoke(
2295  _id,
2296  _logTime,
2298  _logBuff
2299  );
2300  }
2301 
2302  // Emit the event on the text log port
2303 #if FW_ENABLE_TEXT_LOGGING
2304  if (this->m_LogText_OutputPort[0].isConnected()) {
2305 #if FW_OBJECT_NAMES == 1
2306  const char* _formatString =
2307  "(%s) %s: Error reading sequence file %s";
2308 #else
2309  const char* _formatString =
2310  "%s: Error reading sequence file %s";
2311 #endif
2312 
2313  Fw::TextLogString _logString;
2314  _logString.format(
2315  _formatString,
2316 #if FW_OBJECT_NAMES == 1
2317  this->m_objName.toChar(),
2318 #endif
2319  "CS_FileReadError ",
2320  fileName.toChar()
2321  );
2322 
2323  this->m_LogText_OutputPort[0].invoke(
2324  _id,
2325  _logTime,
2327  _logString
2328  );
2329  }
2330 #endif
2331  }
2332 
2335  const Fw::StringBase& fileName,
2337  I32 error
2338  ) const
2339  {
2340  // Get the time
2341  Fw::Time _logTime;
2342  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2343  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2344  }
2345 
2346  FwEventIdType _id = static_cast<FwEventIdType>(0);
2347 
2348  _id = this->getIdBase() + EVENTID_CS_FILEINVALID;
2349 
2350  // Emit the event on the log port
2351  if (this->m_logOut_OutputPort[0].isConnected()) {
2352  Fw::LogBuffer _logBuff;
2354 
2355 #if FW_AMPCS_COMPATIBLE
2356  // Serialize the number of arguments
2357  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2358  FW_ASSERT(
2359  _status == Fw::FW_SERIALIZE_OK,
2360  static_cast<FwAssertArgType>(_status)
2361  );
2362 #endif
2363 
2364  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2365  FW_ASSERT(
2366  _status == Fw::FW_SERIALIZE_OK,
2367  static_cast<FwAssertArgType>(_status)
2368  );
2369 
2370 #if FW_AMPCS_COMPATIBLE
2371  // Serialize the argument size
2372  _status = _logBuff.serializeFrom(
2374  );
2375  FW_ASSERT(
2376  _status == Fw::FW_SERIALIZE_OK,
2377  static_cast<FwAssertArgType>(_status)
2378  );
2379 #endif
2380  _status = _logBuff.serializeFrom(stage);
2381  FW_ASSERT(
2382  _status == Fw::FW_SERIALIZE_OK,
2383  static_cast<FwAssertArgType>(_status)
2384  );
2385 
2386 #if FW_AMPCS_COMPATIBLE
2387  // Serialize the argument size
2388  _status = _logBuff.serializeFrom(
2389  static_cast<U8>(sizeof(I32))
2390  );
2391  FW_ASSERT(
2392  _status == Fw::FW_SERIALIZE_OK,
2393  static_cast<FwAssertArgType>(_status)
2394  );
2395 #endif
2396  _status = _logBuff.serializeFrom(error);
2397  FW_ASSERT(
2398  _status == Fw::FW_SERIALIZE_OK,
2399  static_cast<FwAssertArgType>(_status)
2400  );
2401 
2402  this->m_logOut_OutputPort[0].invoke(
2403  _id,
2404  _logTime,
2406  _logBuff
2407  );
2408  }
2409 
2410  // Emit the event on the text log port
2411 #if FW_ENABLE_TEXT_LOGGING
2412  if (this->m_LogText_OutputPort[0].isConnected()) {
2413 #if FW_OBJECT_NAMES == 1
2414  const char* _formatString =
2415  "(%s) %s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2416 #else
2417  const char* _formatString =
2418  "%s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2419 #endif
2420 
2421  Fw::String stageStr;
2422  stage.toString(stageStr);
2423 
2424  Fw::TextLogString _logString;
2425  _logString.format(
2426  _formatString,
2427 #if FW_OBJECT_NAMES == 1
2428  this->m_objName.toChar(),
2429 #endif
2430  "CS_FileInvalid ",
2431  fileName.toChar(),
2432  stageStr.toChar(),
2433  error
2434  );
2435 
2436  this->m_LogText_OutputPort[0].invoke(
2437  _id,
2438  _logTime,
2440  _logString
2441  );
2442  }
2443 #endif
2444  }
2445 
2448  const Fw::StringBase& fileName,
2449  U32 recordNumber,
2450  I32 error
2451  ) const
2452  {
2453  // Get the time
2454  Fw::Time _logTime;
2455  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2456  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2457  }
2458 
2459  FwEventIdType _id = static_cast<FwEventIdType>(0);
2460 
2461  _id = this->getIdBase() + EVENTID_CS_RECORDINVALID;
2462 
2463  // Emit the event on the log port
2464  if (this->m_logOut_OutputPort[0].isConnected()) {
2465  Fw::LogBuffer _logBuff;
2467 
2468 #if FW_AMPCS_COMPATIBLE
2469  // Serialize the number of arguments
2470  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2471  FW_ASSERT(
2472  _status == Fw::FW_SERIALIZE_OK,
2473  static_cast<FwAssertArgType>(_status)
2474  );
2475 #endif
2476 
2477  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2478  FW_ASSERT(
2479  _status == Fw::FW_SERIALIZE_OK,
2480  static_cast<FwAssertArgType>(_status)
2481  );
2482 
2483 #if FW_AMPCS_COMPATIBLE
2484  // Serialize the argument size
2485  _status = _logBuff.serializeFrom(
2486  static_cast<U8>(sizeof(U32))
2487  );
2488  FW_ASSERT(
2489  _status == Fw::FW_SERIALIZE_OK,
2490  static_cast<FwAssertArgType>(_status)
2491  );
2492 #endif
2493  _status = _logBuff.serializeFrom(recordNumber);
2494  FW_ASSERT(
2495  _status == Fw::FW_SERIALIZE_OK,
2496  static_cast<FwAssertArgType>(_status)
2497  );
2498 
2499 #if FW_AMPCS_COMPATIBLE
2500  // Serialize the argument size
2501  _status = _logBuff.serializeFrom(
2502  static_cast<U8>(sizeof(I32))
2503  );
2504  FW_ASSERT(
2505  _status == Fw::FW_SERIALIZE_OK,
2506  static_cast<FwAssertArgType>(_status)
2507  );
2508 #endif
2509  _status = _logBuff.serializeFrom(error);
2510  FW_ASSERT(
2511  _status == Fw::FW_SERIALIZE_OK,
2512  static_cast<FwAssertArgType>(_status)
2513  );
2514 
2515  this->m_logOut_OutputPort[0].invoke(
2516  _id,
2517  _logTime,
2519  _logBuff
2520  );
2521  }
2522 
2523  // Emit the event on the text log port
2524 #if FW_ENABLE_TEXT_LOGGING
2525  if (this->m_LogText_OutputPort[0].isConnected()) {
2526 #if FW_OBJECT_NAMES == 1
2527  const char* _formatString =
2528  "(%s) %s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2529 #else
2530  const char* _formatString =
2531  "%s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2532 #endif
2533 
2534  Fw::TextLogString _logString;
2535  _logString.format(
2536  _formatString,
2537 #if FW_OBJECT_NAMES == 1
2538  this->m_objName.toChar(),
2539 #endif
2540  "CS_RecordInvalid ",
2541  fileName.toChar(),
2542  recordNumber,
2543  error
2544  );
2545 
2546  this->m_LogText_OutputPort[0].invoke(
2547  _id,
2548  _logTime,
2550  _logString
2551  );
2552  }
2553 #endif
2554  }
2555 
2558  const Fw::StringBase& fileName,
2559  U32 size
2560  ) const
2561  {
2562  // Get the time
2563  Fw::Time _logTime;
2564  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2565  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2566  }
2567 
2568  FwEventIdType _id = static_cast<FwEventIdType>(0);
2569 
2570  _id = this->getIdBase() + EVENTID_CS_FILESIZEERROR;
2571 
2572  // Emit the event on the log port
2573  if (this->m_logOut_OutputPort[0].isConnected()) {
2574  Fw::LogBuffer _logBuff;
2576 
2577 #if FW_AMPCS_COMPATIBLE
2578  // Serialize the number of arguments
2579  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2580  FW_ASSERT(
2581  _status == Fw::FW_SERIALIZE_OK,
2582  static_cast<FwAssertArgType>(_status)
2583  );
2584 #endif
2585 
2586  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2587  FW_ASSERT(
2588  _status == Fw::FW_SERIALIZE_OK,
2589  static_cast<FwAssertArgType>(_status)
2590  );
2591 
2592 #if FW_AMPCS_COMPATIBLE
2593  // Serialize the argument size
2594  _status = _logBuff.serializeFrom(
2595  static_cast<U8>(sizeof(U32))
2596  );
2597  FW_ASSERT(
2598  _status == Fw::FW_SERIALIZE_OK,
2599  static_cast<FwAssertArgType>(_status)
2600  );
2601 #endif
2602  _status = _logBuff.serializeFrom(size);
2603  FW_ASSERT(
2604  _status == Fw::FW_SERIALIZE_OK,
2605  static_cast<FwAssertArgType>(_status)
2606  );
2607 
2608  this->m_logOut_OutputPort[0].invoke(
2609  _id,
2610  _logTime,
2612  _logBuff
2613  );
2614  }
2615 
2616  // Emit the event on the text log port
2617 #if FW_ENABLE_TEXT_LOGGING
2618  if (this->m_LogText_OutputPort[0].isConnected()) {
2619 #if FW_OBJECT_NAMES == 1
2620  const char* _formatString =
2621  "(%s) %s: Sequence file %s too large. Size: %" PRIu32 "";
2622 #else
2623  const char* _formatString =
2624  "%s: Sequence file %s too large. Size: %" PRIu32 "";
2625 #endif
2626 
2627  Fw::TextLogString _logString;
2628  _logString.format(
2629  _formatString,
2630 #if FW_OBJECT_NAMES == 1
2631  this->m_objName.toChar(),
2632 #endif
2633  "CS_FileSizeError ",
2634  fileName.toChar(),
2635  size
2636  );
2637 
2638  this->m_LogText_OutputPort[0].invoke(
2639  _id,
2640  _logTime,
2642  _logString
2643  );
2644  }
2645 #endif
2646  }
2647 
2650  {
2651  // Get the time
2652  Fw::Time _logTime;
2653  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2654  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2655  }
2656 
2657  FwEventIdType _id = static_cast<FwEventIdType>(0);
2658 
2659  _id = this->getIdBase() + EVENTID_CS_FILENOTFOUND;
2660 
2661  // Emit the event on the log port
2662  if (this->m_logOut_OutputPort[0].isConnected()) {
2663  Fw::LogBuffer _logBuff;
2665 
2666 #if FW_AMPCS_COMPATIBLE
2667  // Serialize the number of arguments
2668  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2669  FW_ASSERT(
2670  _status == Fw::FW_SERIALIZE_OK,
2671  static_cast<FwAssertArgType>(_status)
2672  );
2673 #endif
2674 
2675  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2676  FW_ASSERT(
2677  _status == Fw::FW_SERIALIZE_OK,
2678  static_cast<FwAssertArgType>(_status)
2679  );
2680 
2681  this->m_logOut_OutputPort[0].invoke(
2682  _id,
2683  _logTime,
2685  _logBuff
2686  );
2687  }
2688 
2689  // Emit the event on the text log port
2690 #if FW_ENABLE_TEXT_LOGGING
2691  if (this->m_LogText_OutputPort[0].isConnected()) {
2692 #if FW_OBJECT_NAMES == 1
2693  const char* _formatString =
2694  "(%s) %s: Sequence file %s not found.";
2695 #else
2696  const char* _formatString =
2697  "%s: Sequence file %s not found.";
2698 #endif
2699 
2700  Fw::TextLogString _logString;
2701  _logString.format(
2702  _formatString,
2703 #if FW_OBJECT_NAMES == 1
2704  this->m_objName.toChar(),
2705 #endif
2706  "CS_FileNotFound ",
2707  fileName.toChar()
2708  );
2709 
2710  this->m_LogText_OutputPort[0].invoke(
2711  _id,
2712  _logTime,
2714  _logString
2715  );
2716  }
2717 #endif
2718  }
2719 
2722  const Fw::StringBase& fileName,
2723  U32 storedCRC,
2724  U32 computedCRC
2725  ) const
2726  {
2727  // Get the time
2728  Fw::Time _logTime;
2729  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2730  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2731  }
2732 
2733  FwEventIdType _id = static_cast<FwEventIdType>(0);
2734 
2735  _id = this->getIdBase() + EVENTID_CS_FILECRCFAILURE;
2736 
2737  // Emit the event on the log port
2738  if (this->m_logOut_OutputPort[0].isConnected()) {
2739  Fw::LogBuffer _logBuff;
2741 
2742 #if FW_AMPCS_COMPATIBLE
2743  // Serialize the number of arguments
2744  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2745  FW_ASSERT(
2746  _status == Fw::FW_SERIALIZE_OK,
2747  static_cast<FwAssertArgType>(_status)
2748  );
2749 #endif
2750 
2751  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2752  FW_ASSERT(
2753  _status == Fw::FW_SERIALIZE_OK,
2754  static_cast<FwAssertArgType>(_status)
2755  );
2756 
2757 #if FW_AMPCS_COMPATIBLE
2758  // Serialize the argument size
2759  _status = _logBuff.serializeFrom(
2760  static_cast<U8>(sizeof(U32))
2761  );
2762  FW_ASSERT(
2763  _status == Fw::FW_SERIALIZE_OK,
2764  static_cast<FwAssertArgType>(_status)
2765  );
2766 #endif
2767  _status = _logBuff.serializeFrom(storedCRC);
2768  FW_ASSERT(
2769  _status == Fw::FW_SERIALIZE_OK,
2770  static_cast<FwAssertArgType>(_status)
2771  );
2772 
2773 #if FW_AMPCS_COMPATIBLE
2774  // Serialize the argument size
2775  _status = _logBuff.serializeFrom(
2776  static_cast<U8>(sizeof(U32))
2777  );
2778  FW_ASSERT(
2779  _status == Fw::FW_SERIALIZE_OK,
2780  static_cast<FwAssertArgType>(_status)
2781  );
2782 #endif
2783  _status = _logBuff.serializeFrom(computedCRC);
2784  FW_ASSERT(
2785  _status == Fw::FW_SERIALIZE_OK,
2786  static_cast<FwAssertArgType>(_status)
2787  );
2788 
2789  this->m_logOut_OutputPort[0].invoke(
2790  _id,
2791  _logTime,
2793  _logBuff
2794  );
2795  }
2796 
2797  // Emit the event on the text log port
2798 #if FW_ENABLE_TEXT_LOGGING
2799  if (this->m_LogText_OutputPort[0].isConnected()) {
2800 #if FW_OBJECT_NAMES == 1
2801  const char* _formatString =
2802  "(%s) %s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2803 #else
2804  const char* _formatString =
2805  "%s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2806 #endif
2807 
2808  Fw::TextLogString _logString;
2809  _logString.format(
2810  _formatString,
2811 #if FW_OBJECT_NAMES == 1
2812  this->m_objName.toChar(),
2813 #endif
2814  "CS_FileCrcFailure ",
2815  fileName.toChar(),
2816  storedCRC,
2817  computedCRC
2818  );
2819 
2820  this->m_LogText_OutputPort[0].invoke(
2821  _id,
2822  _logTime,
2824  _logString
2825  );
2826  }
2827 #endif
2828  }
2829 
2832  const Fw::StringBase& fileName,
2833  U32 recordNumber,
2834  FwOpcodeType opCode
2835  ) const
2836  {
2837  // Get the time
2838  Fw::Time _logTime;
2839  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2840  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2841  }
2842 
2843  FwEventIdType _id = static_cast<FwEventIdType>(0);
2844 
2845  _id = this->getIdBase() + EVENTID_CS_COMMANDCOMPLETE;
2846 
2847  // Emit the event on the log port
2848  if (this->m_logOut_OutputPort[0].isConnected()) {
2849  Fw::LogBuffer _logBuff;
2851 
2852 #if FW_AMPCS_COMPATIBLE
2853  // Serialize the number of arguments
2854  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2855  FW_ASSERT(
2856  _status == Fw::FW_SERIALIZE_OK,
2857  static_cast<FwAssertArgType>(_status)
2858  );
2859 #endif
2860 
2861  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2862  FW_ASSERT(
2863  _status == Fw::FW_SERIALIZE_OK,
2864  static_cast<FwAssertArgType>(_status)
2865  );
2866 
2867 #if FW_AMPCS_COMPATIBLE
2868  // Serialize the argument size
2869  _status = _logBuff.serializeFrom(
2870  static_cast<U8>(sizeof(U32))
2871  );
2872  FW_ASSERT(
2873  _status == Fw::FW_SERIALIZE_OK,
2874  static_cast<FwAssertArgType>(_status)
2875  );
2876 #endif
2877  _status = _logBuff.serializeFrom(recordNumber);
2878  FW_ASSERT(
2879  _status == Fw::FW_SERIALIZE_OK,
2880  static_cast<FwAssertArgType>(_status)
2881  );
2882 
2883 #if FW_AMPCS_COMPATIBLE
2884  // Serialize the argument size
2885  _status = _logBuff.serializeFrom(
2886  static_cast<U8>(sizeof(FwOpcodeType))
2887  );
2888  FW_ASSERT(
2889  _status == Fw::FW_SERIALIZE_OK,
2890  static_cast<FwAssertArgType>(_status)
2891  );
2892 #endif
2893  _status = _logBuff.serializeFrom(opCode);
2894  FW_ASSERT(
2895  _status == Fw::FW_SERIALIZE_OK,
2896  static_cast<FwAssertArgType>(_status)
2897  );
2898 
2899  this->m_logOut_OutputPort[0].invoke(
2900  _id,
2901  _logTime,
2903  _logBuff
2904  );
2905  }
2906 
2907  // Emit the event on the text log port
2908 #if FW_ENABLE_TEXT_LOGGING
2909  if (this->m_LogText_OutputPort[0].isConnected()) {
2910 #if FW_OBJECT_NAMES == 1
2911  const char* _formatString =
2912  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
2913 #else
2914  const char* _formatString =
2915  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
2916 #endif
2917 
2918  Fw::TextLogString _logString;
2919  _logString.format(
2920  _formatString,
2921 #if FW_OBJECT_NAMES == 1
2922  this->m_objName.toChar(),
2923 #endif
2924  "CS_CommandComplete ",
2925  fileName.toChar(),
2926  recordNumber,
2927  opCode
2928  );
2929 
2930  this->m_LogText_OutputPort[0].invoke(
2931  _id,
2932  _logTime,
2934  _logString
2935  );
2936  }
2937 #endif
2938  }
2939 
2942  {
2943  // Get the time
2944  Fw::Time _logTime;
2945  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2946  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2947  }
2948 
2949  FwEventIdType _id = static_cast<FwEventIdType>(0);
2950 
2951  _id = this->getIdBase() + EVENTID_CS_SEQUENCECOMPLETE;
2952 
2953  // Emit the event on the log port
2954  if (this->m_logOut_OutputPort[0].isConnected()) {
2955  Fw::LogBuffer _logBuff;
2957 
2958 #if FW_AMPCS_COMPATIBLE
2959  // Serialize the number of arguments
2960  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2961  FW_ASSERT(
2962  _status == Fw::FW_SERIALIZE_OK,
2963  static_cast<FwAssertArgType>(_status)
2964  );
2965 #endif
2966 
2967  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2968  FW_ASSERT(
2969  _status == Fw::FW_SERIALIZE_OK,
2970  static_cast<FwAssertArgType>(_status)
2971  );
2972 
2973  this->m_logOut_OutputPort[0].invoke(
2974  _id,
2975  _logTime,
2977  _logBuff
2978  );
2979  }
2980 
2981  // Emit the event on the text log port
2982 #if FW_ENABLE_TEXT_LOGGING
2983  if (this->m_LogText_OutputPort[0].isConnected()) {
2984 #if FW_OBJECT_NAMES == 1
2985  const char* _formatString =
2986  "(%s) %s: Sequence file %s complete";
2987 #else
2988  const char* _formatString =
2989  "%s: Sequence file %s complete";
2990 #endif
2991 
2992  Fw::TextLogString _logString;
2993  _logString.format(
2994  _formatString,
2995 #if FW_OBJECT_NAMES == 1
2996  this->m_objName.toChar(),
2997 #endif
2998  "CS_SequenceComplete ",
2999  fileName.toChar()
3000  );
3001 
3002  this->m_LogText_OutputPort[0].invoke(
3003  _id,
3004  _logTime,
3006  _logString
3007  );
3008  }
3009 #endif
3010  }
3011 
3014  const Fw::StringBase& fileName,
3015  U32 recordNumber,
3016  FwOpcodeType opCode,
3017  U32 errorStatus
3018  ) const
3019  {
3020  // Get the time
3021  Fw::Time _logTime;
3022  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3023  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3024  }
3025 
3026  FwEventIdType _id = static_cast<FwEventIdType>(0);
3027 
3028  _id = this->getIdBase() + EVENTID_CS_COMMANDERROR;
3029 
3030  // Emit the event on the log port
3031  if (this->m_logOut_OutputPort[0].isConnected()) {
3032  Fw::LogBuffer _logBuff;
3034 
3035 #if FW_AMPCS_COMPATIBLE
3036  // Serialize the number of arguments
3037  _status = _logBuff.serializeFrom(static_cast<U8>(4));
3038  FW_ASSERT(
3039  _status == Fw::FW_SERIALIZE_OK,
3040  static_cast<FwAssertArgType>(_status)
3041  );
3042 #endif
3043 
3044  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3045  FW_ASSERT(
3046  _status == Fw::FW_SERIALIZE_OK,
3047  static_cast<FwAssertArgType>(_status)
3048  );
3049 
3050 #if FW_AMPCS_COMPATIBLE
3051  // Serialize the argument size
3052  _status = _logBuff.serializeFrom(
3053  static_cast<U8>(sizeof(U32))
3054  );
3055  FW_ASSERT(
3056  _status == Fw::FW_SERIALIZE_OK,
3057  static_cast<FwAssertArgType>(_status)
3058  );
3059 #endif
3060  _status = _logBuff.serializeFrom(recordNumber);
3061  FW_ASSERT(
3062  _status == Fw::FW_SERIALIZE_OK,
3063  static_cast<FwAssertArgType>(_status)
3064  );
3065 
3066 #if FW_AMPCS_COMPATIBLE
3067  // Serialize the argument size
3068  _status = _logBuff.serializeFrom(
3069  static_cast<U8>(sizeof(FwOpcodeType))
3070  );
3071  FW_ASSERT(
3072  _status == Fw::FW_SERIALIZE_OK,
3073  static_cast<FwAssertArgType>(_status)
3074  );
3075 #endif
3076  _status = _logBuff.serializeFrom(opCode);
3077  FW_ASSERT(
3078  _status == Fw::FW_SERIALIZE_OK,
3079  static_cast<FwAssertArgType>(_status)
3080  );
3081 
3082 #if FW_AMPCS_COMPATIBLE
3083  // Serialize the argument size
3084  _status = _logBuff.serializeFrom(
3085  static_cast<U8>(sizeof(U32))
3086  );
3087  FW_ASSERT(
3088  _status == Fw::FW_SERIALIZE_OK,
3089  static_cast<FwAssertArgType>(_status)
3090  );
3091 #endif
3092  _status = _logBuff.serializeFrom(errorStatus);
3093  FW_ASSERT(
3094  _status == Fw::FW_SERIALIZE_OK,
3095  static_cast<FwAssertArgType>(_status)
3096  );
3097 
3098  this->m_logOut_OutputPort[0].invoke(
3099  _id,
3100  _logTime,
3102  _logBuff
3103  );
3104  }
3105 
3106  // Emit the event on the text log port
3107 #if FW_ENABLE_TEXT_LOGGING
3108  if (this->m_LogText_OutputPort[0].isConnected()) {
3109 #if FW_OBJECT_NAMES == 1
3110  const char* _formatString =
3111  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3112 #else
3113  const char* _formatString =
3114  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3115 #endif
3116 
3117  Fw::TextLogString _logString;
3118  _logString.format(
3119  _formatString,
3120 #if FW_OBJECT_NAMES == 1
3121  this->m_objName.toChar(),
3122 #endif
3123  "CS_CommandError ",
3124  fileName.toChar(),
3125  recordNumber,
3126  opCode,
3127  errorStatus
3128  );
3129 
3130  this->m_LogText_OutputPort[0].invoke(
3131  _id,
3132  _logTime,
3134  _logString
3135  );
3136  }
3137 #endif
3138  }
3139 
3142  {
3143  // Get the time
3144  Fw::Time _logTime;
3145  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3146  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3147  }
3148 
3149  FwEventIdType _id = static_cast<FwEventIdType>(0);
3150 
3151  _id = this->getIdBase() + EVENTID_CS_INVALIDMODE;
3152 
3153  // Emit the event on the log port
3154  if (this->m_logOut_OutputPort[0].isConnected()) {
3155  Fw::LogBuffer _logBuff;
3156 
3157 #if FW_AMPCS_COMPATIBLE
3159  // Serialize the number of arguments
3160  _status = _logBuff.serializeFrom(static_cast<U8>(0));
3161  FW_ASSERT(
3162  _status == Fw::FW_SERIALIZE_OK,
3163  static_cast<FwAssertArgType>(_status)
3164  );
3165 #endif
3166 
3167  this->m_logOut_OutputPort[0].invoke(
3168  _id,
3169  _logTime,
3171  _logBuff
3172  );
3173  }
3174 
3175  // Emit the event on the text log port
3176 #if FW_ENABLE_TEXT_LOGGING
3177  if (this->m_LogText_OutputPort[0].isConnected()) {
3178 #if FW_OBJECT_NAMES == 1
3179  const char* _formatString =
3180  "(%s) %s: Invalid mode";
3181 #else
3182  const char* _formatString =
3183  "%s: Invalid mode";
3184 #endif
3185 
3186  Fw::TextLogString _logString;
3187  _logString.format(
3188  _formatString,
3189 #if FW_OBJECT_NAMES == 1
3190  this->m_objName.toChar(),
3191 #endif
3192  "CS_InvalidMode "
3193  );
3194 
3195  this->m_LogText_OutputPort[0].invoke(
3196  _id,
3197  _logTime,
3199  _logString
3200  );
3201  }
3202 #endif
3203  }
3204 
3207  const Fw::StringBase& fileName,
3208  U32 header_records,
3209  U32 extra_bytes
3210  ) const
3211  {
3212  // Get the time
3213  Fw::Time _logTime;
3214  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3215  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3216  }
3217 
3218  FwEventIdType _id = static_cast<FwEventIdType>(0);
3219 
3220  _id = this->getIdBase() + EVENTID_CS_RECORDMISMATCH;
3221 
3222  // Emit the event on the log port
3223  if (this->m_logOut_OutputPort[0].isConnected()) {
3224  Fw::LogBuffer _logBuff;
3226 
3227 #if FW_AMPCS_COMPATIBLE
3228  // Serialize the number of arguments
3229  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3230  FW_ASSERT(
3231  _status == Fw::FW_SERIALIZE_OK,
3232  static_cast<FwAssertArgType>(_status)
3233  );
3234 #endif
3235 
3236  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3237  FW_ASSERT(
3238  _status == Fw::FW_SERIALIZE_OK,
3239  static_cast<FwAssertArgType>(_status)
3240  );
3241 
3242 #if FW_AMPCS_COMPATIBLE
3243  // Serialize the argument size
3244  _status = _logBuff.serializeFrom(
3245  static_cast<U8>(sizeof(U32))
3246  );
3247  FW_ASSERT(
3248  _status == Fw::FW_SERIALIZE_OK,
3249  static_cast<FwAssertArgType>(_status)
3250  );
3251 #endif
3252  _status = _logBuff.serializeFrom(header_records);
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(extra_bytes);
3269  FW_ASSERT(
3270  _status == Fw::FW_SERIALIZE_OK,
3271  static_cast<FwAssertArgType>(_status)
3272  );
3273 
3274  this->m_logOut_OutputPort[0].invoke(
3275  _id,
3276  _logTime,
3278  _logBuff
3279  );
3280  }
3281 
3282  // Emit the event on the text log port
3283 #if FW_ENABLE_TEXT_LOGGING
3284  if (this->m_LogText_OutputPort[0].isConnected()) {
3285 #if FW_OBJECT_NAMES == 1
3286  const char* _formatString =
3287  "(%s) %s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3288 #else
3289  const char* _formatString =
3290  "%s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3291 #endif
3292 
3293  Fw::TextLogString _logString;
3294  _logString.format(
3295  _formatString,
3296 #if FW_OBJECT_NAMES == 1
3297  this->m_objName.toChar(),
3298 #endif
3299  "CS_RecordMismatch ",
3300  fileName.toChar(),
3301  header_records,
3302  extra_bytes
3303  );
3304 
3305  this->m_LogText_OutputPort[0].invoke(
3306  _id,
3307  _logTime,
3309  _logString
3310  );
3311  }
3312 #endif
3313  }
3314 
3317  const Fw::StringBase& fileName,
3318  U16 time_base,
3319  U16 seq_time_base
3320  ) const
3321  {
3322  // Get the time
3323  Fw::Time _logTime;
3324  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3325  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3326  }
3327 
3328  FwEventIdType _id = static_cast<FwEventIdType>(0);
3329 
3330  _id = this->getIdBase() + EVENTID_CS_TIMEBASEMISMATCH;
3331 
3332  // Emit the event on the log port
3333  if (this->m_logOut_OutputPort[0].isConnected()) {
3334  Fw::LogBuffer _logBuff;
3336 
3337 #if FW_AMPCS_COMPATIBLE
3338  // Serialize the number of arguments
3339  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3340  FW_ASSERT(
3341  _status == Fw::FW_SERIALIZE_OK,
3342  static_cast<FwAssertArgType>(_status)
3343  );
3344 #endif
3345 
3346  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3347  FW_ASSERT(
3348  _status == Fw::FW_SERIALIZE_OK,
3349  static_cast<FwAssertArgType>(_status)
3350  );
3351 
3352 #if FW_AMPCS_COMPATIBLE
3353  // Serialize the argument size
3354  _status = _logBuff.serializeFrom(
3355  static_cast<U8>(sizeof(U16))
3356  );
3357  FW_ASSERT(
3358  _status == Fw::FW_SERIALIZE_OK,
3359  static_cast<FwAssertArgType>(_status)
3360  );
3361 #endif
3362  _status = _logBuff.serializeFrom(time_base);
3363  FW_ASSERT(
3364  _status == Fw::FW_SERIALIZE_OK,
3365  static_cast<FwAssertArgType>(_status)
3366  );
3367 
3368 #if FW_AMPCS_COMPATIBLE
3369  // Serialize the argument size
3370  _status = _logBuff.serializeFrom(
3371  static_cast<U8>(sizeof(U16))
3372  );
3373  FW_ASSERT(
3374  _status == Fw::FW_SERIALIZE_OK,
3375  static_cast<FwAssertArgType>(_status)
3376  );
3377 #endif
3378  _status = _logBuff.serializeFrom(seq_time_base);
3379  FW_ASSERT(
3380  _status == Fw::FW_SERIALIZE_OK,
3381  static_cast<FwAssertArgType>(_status)
3382  );
3383 
3384  this->m_logOut_OutputPort[0].invoke(
3385  _id,
3386  _logTime,
3388  _logBuff
3389  );
3390  }
3391 
3392  // Emit the event on the text log port
3393 #if FW_ENABLE_TEXT_LOGGING
3394  if (this->m_LogText_OutputPort[0].isConnected()) {
3395 #if FW_OBJECT_NAMES == 1
3396  const char* _formatString =
3397  "(%s) %s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3398 #else
3399  const char* _formatString =
3400  "%s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3401 #endif
3402 
3403  Fw::TextLogString _logString;
3404  _logString.format(
3405  _formatString,
3406 #if FW_OBJECT_NAMES == 1
3407  this->m_objName.toChar(),
3408 #endif
3409  "CS_TimeBaseMismatch ",
3410  fileName.toChar(),
3411  time_base,
3412  seq_time_base
3413  );
3414 
3415  this->m_LogText_OutputPort[0].invoke(
3416  _id,
3417  _logTime,
3419  _logString
3420  );
3421  }
3422 #endif
3423  }
3424 
3427  const Fw::StringBase& fileName,
3428  U8 currTimeBase,
3429  U8 seqTimeBase
3430  ) const
3431  {
3432  // Get the time
3433  Fw::Time _logTime;
3434  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3435  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3436  }
3437 
3438  FwEventIdType _id = static_cast<FwEventIdType>(0);
3439 
3440  _id = this->getIdBase() + EVENTID_CS_TIMECONTEXTMISMATCH;
3441 
3442  // Emit the event on the log port
3443  if (this->m_logOut_OutputPort[0].isConnected()) {
3444  Fw::LogBuffer _logBuff;
3446 
3447 #if FW_AMPCS_COMPATIBLE
3448  // Serialize the number of arguments
3449  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3450  FW_ASSERT(
3451  _status == Fw::FW_SERIALIZE_OK,
3452  static_cast<FwAssertArgType>(_status)
3453  );
3454 #endif
3455 
3456  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3457  FW_ASSERT(
3458  _status == Fw::FW_SERIALIZE_OK,
3459  static_cast<FwAssertArgType>(_status)
3460  );
3461 
3462 #if FW_AMPCS_COMPATIBLE
3463  // Serialize the argument size
3464  _status = _logBuff.serializeFrom(
3465  static_cast<U8>(sizeof(U8))
3466  );
3467  FW_ASSERT(
3468  _status == Fw::FW_SERIALIZE_OK,
3469  static_cast<FwAssertArgType>(_status)
3470  );
3471 #endif
3472  _status = _logBuff.serializeFrom(currTimeBase);
3473  FW_ASSERT(
3474  _status == Fw::FW_SERIALIZE_OK,
3475  static_cast<FwAssertArgType>(_status)
3476  );
3477 
3478 #if FW_AMPCS_COMPATIBLE
3479  // Serialize the argument size
3480  _status = _logBuff.serializeFrom(
3481  static_cast<U8>(sizeof(U8))
3482  );
3483  FW_ASSERT(
3484  _status == Fw::FW_SERIALIZE_OK,
3485  static_cast<FwAssertArgType>(_status)
3486  );
3487 #endif
3488  _status = _logBuff.serializeFrom(seqTimeBase);
3489  FW_ASSERT(
3490  _status == Fw::FW_SERIALIZE_OK,
3491  static_cast<FwAssertArgType>(_status)
3492  );
3493 
3494  this->m_logOut_OutputPort[0].invoke(
3495  _id,
3496  _logTime,
3498  _logBuff
3499  );
3500  }
3501 
3502  // Emit the event on the text log port
3503 #if FW_ENABLE_TEXT_LOGGING
3504  if (this->m_LogText_OutputPort[0].isConnected()) {
3505 #if FW_OBJECT_NAMES == 1
3506  const char* _formatString =
3507  "(%s) %s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3508 #else
3509  const char* _formatString =
3510  "%s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3511 #endif
3512 
3513  Fw::TextLogString _logString;
3514  _logString.format(
3515  _formatString,
3516 #if FW_OBJECT_NAMES == 1
3517  this->m_objName.toChar(),
3518 #endif
3519  "CS_TimeContextMismatch ",
3520  fileName.toChar(),
3521  currTimeBase,
3522  seqTimeBase
3523  );
3524 
3525  this->m_LogText_OutputPort[0].invoke(
3526  _id,
3527  _logTime,
3529  _logString
3530  );
3531  }
3532 #endif
3533  }
3534 
3537  {
3538  // Get the time
3539  Fw::Time _logTime;
3540  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3541  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3542  }
3543 
3544  FwEventIdType _id = static_cast<FwEventIdType>(0);
3545 
3546  _id = this->getIdBase() + EVENTID_CS_PORTSEQUENCESTARTED;
3547 
3548  // Emit the event on the log port
3549  if (this->m_logOut_OutputPort[0].isConnected()) {
3550  Fw::LogBuffer _logBuff;
3552 
3553 #if FW_AMPCS_COMPATIBLE
3554  // Serialize the number of arguments
3555  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3556  FW_ASSERT(
3557  _status == Fw::FW_SERIALIZE_OK,
3558  static_cast<FwAssertArgType>(_status)
3559  );
3560 #endif
3561 
3562  _status = filename.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3563  FW_ASSERT(
3564  _status == Fw::FW_SERIALIZE_OK,
3565  static_cast<FwAssertArgType>(_status)
3566  );
3567 
3568  this->m_logOut_OutputPort[0].invoke(
3569  _id,
3570  _logTime,
3572  _logBuff
3573  );
3574  }
3575 
3576  // Emit the event on the text log port
3577 #if FW_ENABLE_TEXT_LOGGING
3578  if (this->m_LogText_OutputPort[0].isConnected()) {
3579 #if FW_OBJECT_NAMES == 1
3580  const char* _formatString =
3581  "(%s) %s: Local request for sequence %s started.";
3582 #else
3583  const char* _formatString =
3584  "%s: Local request for sequence %s started.";
3585 #endif
3586 
3587  Fw::TextLogString _logString;
3588  _logString.format(
3589  _formatString,
3590 #if FW_OBJECT_NAMES == 1
3591  this->m_objName.toChar(),
3592 #endif
3593  "CS_PortSequenceStarted ",
3594  filename.toChar()
3595  );
3596 
3597  this->m_LogText_OutputPort[0].invoke(
3598  _id,
3599  _logTime,
3601  _logString
3602  );
3603  }
3604 #endif
3605  }
3606 
3609  {
3610  // Get the time
3611  Fw::Time _logTime;
3612  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3613  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3614  }
3615 
3616  FwEventIdType _id = static_cast<FwEventIdType>(0);
3617 
3619 
3620  // Emit the event on the log port
3621  if (this->m_logOut_OutputPort[0].isConnected()) {
3622  Fw::LogBuffer _logBuff;
3624 
3625 #if FW_AMPCS_COMPATIBLE
3626  // Serialize the number of arguments
3627  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3628  FW_ASSERT(
3629  _status == Fw::FW_SERIALIZE_OK,
3630  static_cast<FwAssertArgType>(_status)
3631  );
3632 #endif
3633 
3634 #if FW_AMPCS_COMPATIBLE
3635  // Serialize the argument size
3636  _status = _logBuff.serializeFrom(
3637  static_cast<U8>(sizeof(FwOpcodeType))
3638  );
3639  FW_ASSERT(
3640  _status == Fw::FW_SERIALIZE_OK,
3641  static_cast<FwAssertArgType>(_status)
3642  );
3643 #endif
3644  _status = _logBuff.serializeFrom(opcode);
3645  FW_ASSERT(
3646  _status == Fw::FW_SERIALIZE_OK,
3647  static_cast<FwAssertArgType>(_status)
3648  );
3649 
3650  this->m_logOut_OutputPort[0].invoke(
3651  _id,
3652  _logTime,
3654  _logBuff
3655  );
3656  }
3657 
3658  // Emit the event on the text log port
3659 #if FW_ENABLE_TEXT_LOGGING
3660  if (this->m_LogText_OutputPort[0].isConnected()) {
3661 #if FW_OBJECT_NAMES == 1
3662  const char* _formatString =
3663  "(%s) %s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3664 #else
3665  const char* _formatString =
3666  "%s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3667 #endif
3668 
3669  Fw::TextLogString _logString;
3670  _logString.format(
3671  _formatString,
3672 #if FW_OBJECT_NAMES == 1
3673  this->m_objName.toChar(),
3674 #endif
3675  "CS_UnexpectedCompletion ",
3676  opcode
3677  );
3678 
3679  this->m_LogText_OutputPort[0].invoke(
3680  _id,
3681  _logTime,
3683  _logString
3684  );
3685  }
3686 #endif
3687  }
3688 
3691  {
3692  // Get the time
3693  Fw::Time _logTime;
3694  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3695  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3696  }
3697 
3698  FwEventIdType _id = static_cast<FwEventIdType>(0);
3699 
3700  _id = this->getIdBase() + EVENTID_CS_MODESWITCHED;
3701 
3702  // Emit the event on the log port
3703  if (this->m_logOut_OutputPort[0].isConnected()) {
3704  Fw::LogBuffer _logBuff;
3706 
3707 #if FW_AMPCS_COMPATIBLE
3708  // Serialize the number of arguments
3709  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3710  FW_ASSERT(
3711  _status == Fw::FW_SERIALIZE_OK,
3712  static_cast<FwAssertArgType>(_status)
3713  );
3714 #endif
3715 
3716 #if FW_AMPCS_COMPATIBLE
3717  // Serialize the argument size
3718  _status = _logBuff.serializeFrom(
3720  );
3721  FW_ASSERT(
3722  _status == Fw::FW_SERIALIZE_OK,
3723  static_cast<FwAssertArgType>(_status)
3724  );
3725 #endif
3726  _status = _logBuff.serializeFrom(mode);
3727  FW_ASSERT(
3728  _status == Fw::FW_SERIALIZE_OK,
3729  static_cast<FwAssertArgType>(_status)
3730  );
3731 
3732  this->m_logOut_OutputPort[0].invoke(
3733  _id,
3734  _logTime,
3736  _logBuff
3737  );
3738  }
3739 
3740  // Emit the event on the text log port
3741 #if FW_ENABLE_TEXT_LOGGING
3742  if (this->m_LogText_OutputPort[0].isConnected()) {
3743 #if FW_OBJECT_NAMES == 1
3744  const char* _formatString =
3745  "(%s) %s: Sequencer switched to %s step mode";
3746 #else
3747  const char* _formatString =
3748  "%s: Sequencer switched to %s step mode";
3749 #endif
3750 
3751  Fw::String modeStr;
3752  mode.toString(modeStr);
3753 
3754  Fw::TextLogString _logString;
3755  _logString.format(
3756  _formatString,
3757 #if FW_OBJECT_NAMES == 1
3758  this->m_objName.toChar(),
3759 #endif
3760  "CS_ModeSwitched ",
3761  modeStr.toChar()
3762  );
3763 
3764  this->m_LogText_OutputPort[0].invoke(
3765  _id,
3766  _logTime,
3768  _logString
3769  );
3770  }
3771 #endif
3772  }
3773 
3776  {
3777  // Get the time
3778  Fw::Time _logTime;
3779  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3780  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3781  }
3782 
3783  FwEventIdType _id = static_cast<FwEventIdType>(0);
3784 
3785  _id = this->getIdBase() + EVENTID_CS_NOSEQUENCEACTIVE;
3786 
3787  // Emit the event on the log port
3788  if (this->m_logOut_OutputPort[0].isConnected()) {
3789  Fw::LogBuffer _logBuff;
3790 
3791 #if FW_AMPCS_COMPATIBLE
3793  // Serialize the number of arguments
3794  _status = _logBuff.serializeFrom(static_cast<U8>(0));
3795  FW_ASSERT(
3796  _status == Fw::FW_SERIALIZE_OK,
3797  static_cast<FwAssertArgType>(_status)
3798  );
3799 #endif
3800 
3801  this->m_logOut_OutputPort[0].invoke(
3802  _id,
3803  _logTime,
3805  _logBuff
3806  );
3807  }
3808 
3809  // Emit the event on the text log port
3810 #if FW_ENABLE_TEXT_LOGGING
3811  if (this->m_LogText_OutputPort[0].isConnected()) {
3812 #if FW_OBJECT_NAMES == 1
3813  const char* _formatString =
3814  "(%s) %s: No sequence active.";
3815 #else
3816  const char* _formatString =
3817  "%s: No sequence active.";
3818 #endif
3819 
3820  Fw::TextLogString _logString;
3821  _logString.format(
3822  _formatString,
3823 #if FW_OBJECT_NAMES == 1
3824  this->m_objName.toChar(),
3825 #endif
3826  "CS_NoSequenceActive "
3827  );
3828 
3829  this->m_LogText_OutputPort[0].invoke(
3830  _id,
3831  _logTime,
3833  _logString
3834  );
3835  }
3836 #endif
3837  }
3838 
3841  {
3842  // Get the time
3843  Fw::Time _logTime;
3844  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3845  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3846  }
3847 
3848  FwEventIdType _id = static_cast<FwEventIdType>(0);
3849 
3850  _id = this->getIdBase() + EVENTID_CS_SEQUENCEVALID;
3851 
3852  // Emit the event on the log port
3853  if (this->m_logOut_OutputPort[0].isConnected()) {
3854  Fw::LogBuffer _logBuff;
3856 
3857 #if FW_AMPCS_COMPATIBLE
3858  // Serialize the number of arguments
3859  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3860  FW_ASSERT(
3861  _status == Fw::FW_SERIALIZE_OK,
3862  static_cast<FwAssertArgType>(_status)
3863  );
3864 #endif
3865 
3866  _status = filename.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3867  FW_ASSERT(
3868  _status == Fw::FW_SERIALIZE_OK,
3869  static_cast<FwAssertArgType>(_status)
3870  );
3871 
3872  this->m_logOut_OutputPort[0].invoke(
3873  _id,
3874  _logTime,
3876  _logBuff
3877  );
3878  }
3879 
3880  // Emit the event on the text log port
3881 #if FW_ENABLE_TEXT_LOGGING
3882  if (this->m_LogText_OutputPort[0].isConnected()) {
3883 #if FW_OBJECT_NAMES == 1
3884  const char* _formatString =
3885  "(%s) %s: Sequence %s is valid.";
3886 #else
3887  const char* _formatString =
3888  "%s: Sequence %s is valid.";
3889 #endif
3890 
3891  Fw::TextLogString _logString;
3892  _logString.format(
3893  _formatString,
3894 #if FW_OBJECT_NAMES == 1
3895  this->m_objName.toChar(),
3896 #endif
3897  "CS_SequenceValid ",
3898  filename.toChar()
3899  );
3900 
3901  this->m_LogText_OutputPort[0].invoke(
3902  _id,
3903  _logTime,
3905  _logString
3906  );
3907  }
3908 #endif
3909  }
3910 
3913  const Fw::StringBase& filename,
3914  U32 command
3915  ) const
3916  {
3917  // Get the time
3918  Fw::Time _logTime;
3919  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3920  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3921  }
3922 
3923  FwEventIdType _id = static_cast<FwEventIdType>(0);
3924 
3925  _id = this->getIdBase() + EVENTID_CS_SEQUENCETIMEOUT;
3926 
3927  // Emit the event on the log port
3928  if (this->m_logOut_OutputPort[0].isConnected()) {
3929  Fw::LogBuffer _logBuff;
3931 
3932 #if FW_AMPCS_COMPATIBLE
3933  // Serialize the number of arguments
3934  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3935  FW_ASSERT(
3936  _status == Fw::FW_SERIALIZE_OK,
3937  static_cast<FwAssertArgType>(_status)
3938  );
3939 #endif
3940 
3941  _status = filename.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3942  FW_ASSERT(
3943  _status == Fw::FW_SERIALIZE_OK,
3944  static_cast<FwAssertArgType>(_status)
3945  );
3946 
3947 #if FW_AMPCS_COMPATIBLE
3948  // Serialize the argument size
3949  _status = _logBuff.serializeFrom(
3950  static_cast<U8>(sizeof(U32))
3951  );
3952  FW_ASSERT(
3953  _status == Fw::FW_SERIALIZE_OK,
3954  static_cast<FwAssertArgType>(_status)
3955  );
3956 #endif
3957  _status = _logBuff.serializeFrom(command);
3958  FW_ASSERT(
3959  _status == Fw::FW_SERIALIZE_OK,
3960  static_cast<FwAssertArgType>(_status)
3961  );
3962 
3963  this->m_logOut_OutputPort[0].invoke(
3964  _id,
3965  _logTime,
3967  _logBuff
3968  );
3969  }
3970 
3971  // Emit the event on the text log port
3972 #if FW_ENABLE_TEXT_LOGGING
3973  if (this->m_LogText_OutputPort[0].isConnected()) {
3974 #if FW_OBJECT_NAMES == 1
3975  const char* _formatString =
3976  "(%s) %s: Sequence %s timed out on command %" PRIu32 "";
3977 #else
3978  const char* _formatString =
3979  "%s: Sequence %s timed out on command %" PRIu32 "";
3980 #endif
3981 
3982  Fw::TextLogString _logString;
3983  _logString.format(
3984  _formatString,
3985 #if FW_OBJECT_NAMES == 1
3986  this->m_objName.toChar(),
3987 #endif
3988  "CS_SequenceTimeout ",
3989  filename.toChar(),
3990  command
3991  );
3992 
3993  this->m_LogText_OutputPort[0].invoke(
3994  _id,
3995  _logTime,
3997  _logString
3998  );
3999  }
4000 #endif
4001  }
4002 
4005  const Fw::StringBase& filename,
4006  U32 command
4007  ) const
4008  {
4009  // Get the time
4010  Fw::Time _logTime;
4011  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4012  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4013  }
4014 
4015  FwEventIdType _id = static_cast<FwEventIdType>(0);
4016 
4017  _id = this->getIdBase() + EVENTID_CS_CMDSTEPPED;
4018 
4019  // Emit the event on the log port
4020  if (this->m_logOut_OutputPort[0].isConnected()) {
4021  Fw::LogBuffer _logBuff;
4023 
4024 #if FW_AMPCS_COMPATIBLE
4025  // Serialize the number of arguments
4026  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4027  FW_ASSERT(
4028  _status == Fw::FW_SERIALIZE_OK,
4029  static_cast<FwAssertArgType>(_status)
4030  );
4031 #endif
4032 
4033  _status = filename.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4034  FW_ASSERT(
4035  _status == Fw::FW_SERIALIZE_OK,
4036  static_cast<FwAssertArgType>(_status)
4037  );
4038 
4039 #if FW_AMPCS_COMPATIBLE
4040  // Serialize the argument size
4041  _status = _logBuff.serializeFrom(
4042  static_cast<U8>(sizeof(U32))
4043  );
4044  FW_ASSERT(
4045  _status == Fw::FW_SERIALIZE_OK,
4046  static_cast<FwAssertArgType>(_status)
4047  );
4048 #endif
4049  _status = _logBuff.serializeFrom(command);
4050  FW_ASSERT(
4051  _status == Fw::FW_SERIALIZE_OK,
4052  static_cast<FwAssertArgType>(_status)
4053  );
4054 
4055  this->m_logOut_OutputPort[0].invoke(
4056  _id,
4057  _logTime,
4059  _logBuff
4060  );
4061  }
4062 
4063  // Emit the event on the text log port
4064 #if FW_ENABLE_TEXT_LOGGING
4065  if (this->m_LogText_OutputPort[0].isConnected()) {
4066 #if FW_OBJECT_NAMES == 1
4067  const char* _formatString =
4068  "(%s) %s: Sequence %s command %" PRIu32 " stepped";
4069 #else
4070  const char* _formatString =
4071  "%s: Sequence %s command %" PRIu32 " stepped";
4072 #endif
4073 
4074  Fw::TextLogString _logString;
4075  _logString.format(
4076  _formatString,
4077 #if FW_OBJECT_NAMES == 1
4078  this->m_objName.toChar(),
4079 #endif
4080  "CS_CmdStepped ",
4081  filename.toChar(),
4082  command
4083  );
4084 
4085  this->m_LogText_OutputPort[0].invoke(
4086  _id,
4087  _logTime,
4089  _logString
4090  );
4091  }
4092 #endif
4093  }
4094 
4097  {
4098  // Get the time
4099  Fw::Time _logTime;
4100  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4101  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4102  }
4103 
4104  FwEventIdType _id = static_cast<FwEventIdType>(0);
4105 
4106  _id = this->getIdBase() + EVENTID_CS_CMDSTARTED;
4107 
4108  // Emit the event on the log port
4109  if (this->m_logOut_OutputPort[0].isConnected()) {
4110  Fw::LogBuffer _logBuff;
4112 
4113 #if FW_AMPCS_COMPATIBLE
4114  // Serialize the number of arguments
4115  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4116  FW_ASSERT(
4117  _status == Fw::FW_SERIALIZE_OK,
4118  static_cast<FwAssertArgType>(_status)
4119  );
4120 #endif
4121 
4122  _status = filename.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4123  FW_ASSERT(
4124  _status == Fw::FW_SERIALIZE_OK,
4125  static_cast<FwAssertArgType>(_status)
4126  );
4127 
4128  this->m_logOut_OutputPort[0].invoke(
4129  _id,
4130  _logTime,
4132  _logBuff
4133  );
4134  }
4135 
4136  // Emit the event on the text log port
4137 #if FW_ENABLE_TEXT_LOGGING
4138  if (this->m_LogText_OutputPort[0].isConnected()) {
4139 #if FW_OBJECT_NAMES == 1
4140  const char* _formatString =
4141  "(%s) %s: Sequence %s started";
4142 #else
4143  const char* _formatString =
4144  "%s: Sequence %s started";
4145 #endif
4146 
4147  Fw::TextLogString _logString;
4148  _logString.format(
4149  _formatString,
4150 #if FW_OBJECT_NAMES == 1
4151  this->m_objName.toChar(),
4152 #endif
4153  "CS_CmdStarted ",
4154  filename.toChar()
4155  );
4156 
4157  this->m_LogText_OutputPort[0].invoke(
4158  _id,
4159  _logTime,
4161  _logString
4162  );
4163  }
4164 #endif
4165  }
4166 
4169  const Fw::StringBase& filename,
4170  U32 recordNumber,
4171  FwOpcodeType opCode
4172  ) const
4173  {
4174  // Get the time
4175  Fw::Time _logTime;
4176  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4177  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4178  }
4179 
4180  FwEventIdType _id = static_cast<FwEventIdType>(0);
4181 
4182  _id = this->getIdBase() + EVENTID_CS_JOINWAITING;
4183 
4184  // Emit the event on the log port
4185  if (this->m_logOut_OutputPort[0].isConnected()) {
4186  Fw::LogBuffer _logBuff;
4188 
4189 #if FW_AMPCS_COMPATIBLE
4190  // Serialize the number of arguments
4191  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4192  FW_ASSERT(
4193  _status == Fw::FW_SERIALIZE_OK,
4194  static_cast<FwAssertArgType>(_status)
4195  );
4196 #endif
4197 
4198  _status = filename.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4199  FW_ASSERT(
4200  _status == Fw::FW_SERIALIZE_OK,
4201  static_cast<FwAssertArgType>(_status)
4202  );
4203 
4204 #if FW_AMPCS_COMPATIBLE
4205  // Serialize the argument size
4206  _status = _logBuff.serializeFrom(
4207  static_cast<U8>(sizeof(U32))
4208  );
4209  FW_ASSERT(
4210  _status == Fw::FW_SERIALIZE_OK,
4211  static_cast<FwAssertArgType>(_status)
4212  );
4213 #endif
4214  _status = _logBuff.serializeFrom(recordNumber);
4215  FW_ASSERT(
4216  _status == Fw::FW_SERIALIZE_OK,
4217  static_cast<FwAssertArgType>(_status)
4218  );
4219 
4220 #if FW_AMPCS_COMPATIBLE
4221  // Serialize the argument size
4222  _status = _logBuff.serializeFrom(
4223  static_cast<U8>(sizeof(FwOpcodeType))
4224  );
4225  FW_ASSERT(
4226  _status == Fw::FW_SERIALIZE_OK,
4227  static_cast<FwAssertArgType>(_status)
4228  );
4229 #endif
4230  _status = _logBuff.serializeFrom(opCode);
4231  FW_ASSERT(
4232  _status == Fw::FW_SERIALIZE_OK,
4233  static_cast<FwAssertArgType>(_status)
4234  );
4235 
4236  this->m_logOut_OutputPort[0].invoke(
4237  _id,
4238  _logTime,
4240  _logBuff
4241  );
4242  }
4243 
4244  // Emit the event on the text log port
4245 #if FW_ENABLE_TEXT_LOGGING
4246  if (this->m_LogText_OutputPort[0].isConnected()) {
4247 #if FW_OBJECT_NAMES == 1
4248  const char* _formatString =
4249  "(%s) %s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4250 #else
4251  const char* _formatString =
4252  "%s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4253 #endif
4254 
4255  Fw::TextLogString _logString;
4256  _logString.format(
4257  _formatString,
4258 #if FW_OBJECT_NAMES == 1
4259  this->m_objName.toChar(),
4260 #endif
4261  "CS_JoinWaiting ",
4262  filename.toChar(),
4263  recordNumber,
4264  opCode
4265  );
4266 
4267  this->m_LogText_OutputPort[0].invoke(
4268  _id,
4269  _logTime,
4271  _logString
4272  );
4273  }
4274 #endif
4275  }
4276 
4279  {
4280  // Get the time
4281  Fw::Time _logTime;
4282  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4283  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4284  }
4285 
4286  FwEventIdType _id = static_cast<FwEventIdType>(0);
4287 
4289 
4290  // Emit the event on the log port
4291  if (this->m_logOut_OutputPort[0].isConnected()) {
4292  Fw::LogBuffer _logBuff;
4293 
4294 #if FW_AMPCS_COMPATIBLE
4296  // Serialize the number of arguments
4297  _status = _logBuff.serializeFrom(static_cast<U8>(0));
4298  FW_ASSERT(
4299  _status == Fw::FW_SERIALIZE_OK,
4300  static_cast<FwAssertArgType>(_status)
4301  );
4302 #endif
4303 
4304  this->m_logOut_OutputPort[0].invoke(
4305  _id,
4306  _logTime,
4308  _logBuff
4309  );
4310  }
4311 
4312  // Emit the event on the text log port
4313 #if FW_ENABLE_TEXT_LOGGING
4314  if (this->m_LogText_OutputPort[0].isConnected()) {
4315 #if FW_OBJECT_NAMES == 1
4316  const char* _formatString =
4317  "(%s) %s: Still waiting for sequence file to complete";
4318 #else
4319  const char* _formatString =
4320  "%s: Still waiting for sequence file to complete";
4321 #endif
4322 
4323  Fw::TextLogString _logString;
4324  _logString.format(
4325  _formatString,
4326 #if FW_OBJECT_NAMES == 1
4327  this->m_objName.toChar(),
4328 #endif
4329  "CS_JoinWaitingNotComplete "
4330  );
4331 
4332  this->m_LogText_OutputPort[0].invoke(
4333  _id,
4334  _logTime,
4336  _logString
4337  );
4338  }
4339 #endif
4340  }
4341 
4344  {
4345  // Get the time
4346  Fw::Time _logTime;
4347  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4348  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4349  }
4350 
4351  FwEventIdType _id = static_cast<FwEventIdType>(0);
4352 
4353  _id = this->getIdBase() + EVENTID_CS_NORECORDS;
4354 
4355  // Emit the event on the log port
4356  if (this->m_logOut_OutputPort[0].isConnected()) {
4357  Fw::LogBuffer _logBuff;
4359 
4360 #if FW_AMPCS_COMPATIBLE
4361  // Serialize the number of arguments
4362  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4363  FW_ASSERT(
4364  _status == Fw::FW_SERIALIZE_OK,
4365  static_cast<FwAssertArgType>(_status)
4366  );
4367 #endif
4368 
4369  _status = fileName.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4370  FW_ASSERT(
4371  _status == Fw::FW_SERIALIZE_OK,
4372  static_cast<FwAssertArgType>(_status)
4373  );
4374 
4375  this->m_logOut_OutputPort[0].invoke(
4376  _id,
4377  _logTime,
4379  _logBuff
4380  );
4381  }
4382 
4383  // Emit the event on the text log port
4384 #if FW_ENABLE_TEXT_LOGGING
4385  if (this->m_LogText_OutputPort[0].isConnected()) {
4386 #if FW_OBJECT_NAMES == 1
4387  const char* _formatString =
4388  "(%s) %s: Sequence file %s has no records. Ignoring.";
4389 #else
4390  const char* _formatString =
4391  "%s: Sequence file %s has no records. Ignoring.";
4392 #endif
4393 
4394  Fw::TextLogString _logString;
4395  _logString.format(
4396  _formatString,
4397 #if FW_OBJECT_NAMES == 1
4398  this->m_objName.toChar(),
4399 #endif
4400  "CS_NoRecords ",
4401  fileName.toChar()
4402  );
4403 
4404  this->m_LogText_OutputPort[0].invoke(
4405  _id,
4406  _logTime,
4408  _logString
4409  );
4410  }
4411 #endif
4412  }
4413 
4414  // ----------------------------------------------------------------------
4415  // Telemetry write functions
4416  // ----------------------------------------------------------------------
4417 
4420  U32 arg,
4421  Fw::Time _tlmTime
4422  ) const
4423  {
4424  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4425  if (
4426  this->m_timeCaller_OutputPort[0].isConnected() &&
4427  (_tlmTime == Fw::ZERO_TIME)
4428  ) {
4429  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4430  }
4431 
4432  Fw::TlmBuffer _tlmBuff;
4433  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4434  FW_ASSERT(
4435  _stat == Fw::FW_SERIALIZE_OK,
4436  static_cast<FwAssertArgType>(_stat)
4437  );
4438 
4439  FwChanIdType _id;
4440 
4441  _id = this->getIdBase() + CHANNELID_CS_LOADCOMMANDS;
4442 
4443  this->m_tlmOut_OutputPort[0].invoke(
4444  _id,
4445  _tlmTime,
4446  _tlmBuff
4447  );
4448  }
4449  }
4450 
4453  U32 arg,
4454  Fw::Time _tlmTime
4455  ) const
4456  {
4457  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4458  if (
4459  this->m_timeCaller_OutputPort[0].isConnected() &&
4460  (_tlmTime == Fw::ZERO_TIME)
4461  ) {
4462  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4463  }
4464 
4465  Fw::TlmBuffer _tlmBuff;
4466  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4467  FW_ASSERT(
4468  _stat == Fw::FW_SERIALIZE_OK,
4469  static_cast<FwAssertArgType>(_stat)
4470  );
4471 
4472  FwChanIdType _id;
4473 
4474  _id = this->getIdBase() + CHANNELID_CS_CANCELCOMMANDS;
4475 
4476  this->m_tlmOut_OutputPort[0].invoke(
4477  _id,
4478  _tlmTime,
4479  _tlmBuff
4480  );
4481  }
4482  }
4483 
4486  U32 arg,
4487  Fw::Time _tlmTime
4488  ) const
4489  {
4490  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4491  if (
4492  this->m_timeCaller_OutputPort[0].isConnected() &&
4493  (_tlmTime == Fw::ZERO_TIME)
4494  ) {
4495  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4496  }
4497 
4498  Fw::TlmBuffer _tlmBuff;
4499  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4500  FW_ASSERT(
4501  _stat == Fw::FW_SERIALIZE_OK,
4502  static_cast<FwAssertArgType>(_stat)
4503  );
4504 
4505  FwChanIdType _id;
4506 
4507  _id = this->getIdBase() + CHANNELID_CS_ERRORS;
4508 
4509  this->m_tlmOut_OutputPort[0].invoke(
4510  _id,
4511  _tlmTime,
4512  _tlmBuff
4513  );
4514  }
4515  }
4516 
4519  U32 arg,
4520  Fw::Time _tlmTime
4521  ) const
4522  {
4523  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4524  if (
4525  this->m_timeCaller_OutputPort[0].isConnected() &&
4526  (_tlmTime == Fw::ZERO_TIME)
4527  ) {
4528  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4529  }
4530 
4531  Fw::TlmBuffer _tlmBuff;
4532  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4533  FW_ASSERT(
4534  _stat == Fw::FW_SERIALIZE_OK,
4535  static_cast<FwAssertArgType>(_stat)
4536  );
4537 
4538  FwChanIdType _id;
4539 
4540  _id = this->getIdBase() + CHANNELID_CS_COMMANDSEXECUTED;
4541 
4542  this->m_tlmOut_OutputPort[0].invoke(
4543  _id,
4544  _tlmTime,
4545  _tlmBuff
4546  );
4547  }
4548  }
4549 
4552  U32 arg,
4553  Fw::Time _tlmTime
4554  ) const
4555  {
4556  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4557  if (
4558  this->m_timeCaller_OutputPort[0].isConnected() &&
4559  (_tlmTime == Fw::ZERO_TIME)
4560  ) {
4561  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4562  }
4563 
4564  Fw::TlmBuffer _tlmBuff;
4565  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4566  FW_ASSERT(
4567  _stat == Fw::FW_SERIALIZE_OK,
4568  static_cast<FwAssertArgType>(_stat)
4569  );
4570 
4571  FwChanIdType _id;
4572 
4574 
4575  this->m_tlmOut_OutputPort[0].invoke(
4576  _id,
4577  _tlmTime,
4578  _tlmBuff
4579  );
4580  }
4581  }
4582 
4583  // ----------------------------------------------------------------------
4584  // Time
4585  // ----------------------------------------------------------------------
4586 
4588  getTime() const
4589  {
4590  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4591  Fw::Time _time;
4592  this->m_timeCaller_OutputPort[0].invoke(_time);
4593  return _time;
4594  }
4595  else {
4596  return Fw::Time(TimeBase::TB_NONE, 0, 0);
4597  }
4598  }
4599 
4600  // ----------------------------------------------------------------------
4601  // Message dispatch functions
4602  // ----------------------------------------------------------------------
4603 
4604  Fw::QueuedComponentBase::MsgDispatchStatus CmdSequencerComponentBase ::
4605  doDispatch()
4606  {
4607  ComponentIpcSerializableBuffer _msg;
4608  FwQueuePriorityType _priority = 0;
4609 
4610  Os::Queue::Status _msgStatus = this->m_queue.receive(
4611  _msg,
4613  _priority
4614  );
4615  FW_ASSERT(
4616  _msgStatus == Os::Queue::OP_OK,
4617  static_cast<FwAssertArgType>(_msgStatus)
4618  );
4619 
4620  // Reset to beginning of buffer
4621  _msg.resetDeser();
4622 
4623  FwEnumStoreType _desMsg = 0;
4624  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
4625  FW_ASSERT(
4626  _deserStatus == Fw::FW_SERIALIZE_OK,
4627  static_cast<FwAssertArgType>(_deserStatus)
4628  );
4629 
4630  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
4631 
4632  if (_msgType == CMDSEQUENCER_COMPONENT_EXIT) {
4633  return MSG_DISPATCH_EXIT;
4634  }
4635 
4636  FwIndexType portNum = 0;
4637  _deserStatus = _msg.deserializeTo(portNum);
4638  FW_ASSERT(
4639  _deserStatus == Fw::FW_SERIALIZE_OK,
4640  static_cast<FwAssertArgType>(_deserStatus)
4641  );
4642 
4643  switch (_msgType) {
4644  // Handle async input port cmdResponseIn
4645  case CMDRESPONSEIN_CMDRESPONSE: {
4646  // Deserialize argument opCode
4647  FwOpcodeType opCode;
4648  _deserStatus = _msg.deserializeTo(opCode);
4649  FW_ASSERT(
4650  _deserStatus == Fw::FW_SERIALIZE_OK,
4651  static_cast<FwAssertArgType>(_deserStatus)
4652  );
4653 
4654  // Deserialize argument cmdSeq
4655  U32 cmdSeq;
4656  _deserStatus = _msg.deserializeTo(cmdSeq);
4657  FW_ASSERT(
4658  _deserStatus == Fw::FW_SERIALIZE_OK,
4659  static_cast<FwAssertArgType>(_deserStatus)
4660  );
4661 
4662  // Deserialize argument response
4663  Fw::CmdResponse response;
4664  _deserStatus = _msg.deserializeTo(response);
4665  FW_ASSERT(
4666  _deserStatus == Fw::FW_SERIALIZE_OK,
4667  static_cast<FwAssertArgType>(_deserStatus)
4668  );
4669  // Call handler function
4670  this->cmdResponseIn_handler(
4671  portNum,
4672  opCode,
4673  cmdSeq,
4674  response
4675  );
4676 
4677  break;
4678  }
4679 
4680  // Handle async input port pingIn
4681  case PINGIN_PING: {
4682  // Deserialize argument key
4683  U32 key;
4684  _deserStatus = _msg.deserializeTo(key);
4685  FW_ASSERT(
4686  _deserStatus == Fw::FW_SERIALIZE_OK,
4687  static_cast<FwAssertArgType>(_deserStatus)
4688  );
4689  // Call handler function
4690  this->pingIn_handler(
4691  portNum,
4692  key
4693  );
4694 
4695  break;
4696  }
4697 
4698  // Handle async input port schedIn
4699  case SCHEDIN_SCHED: {
4700  // Deserialize argument context
4701  U32 context;
4702  _deserStatus = _msg.deserializeTo(context);
4703  FW_ASSERT(
4704  _deserStatus == Fw::FW_SERIALIZE_OK,
4705  static_cast<FwAssertArgType>(_deserStatus)
4706  );
4707  // Call handler function
4708  this->schedIn_handler(
4709  portNum,
4710  context
4711  );
4712 
4713  break;
4714  }
4715 
4716  // Handle async input port seqCancelIn
4717  case SEQCANCELIN_CMDSEQCANCEL: {
4718  // Call handler function
4719  this->seqCancelIn_handler(portNum);
4720 
4721  break;
4722  }
4723 
4724  // Handle async input port seqDispatchIn
4725  case SEQDISPATCHIN_FILEDISPATCH: {
4726  // Deserialize argument file_name
4727  char __fprime_ac_file_name_buffer[Fw::StringBase::BUFFER_SIZE(80)];
4728  Fw::ExternalString file_name(__fprime_ac_file_name_buffer, sizeof __fprime_ac_file_name_buffer);
4729  _deserStatus = _msg.deserializeTo(file_name);
4730  FW_ASSERT(
4731  _deserStatus == Fw::FW_SERIALIZE_OK,
4732  static_cast<FwAssertArgType>(_deserStatus)
4733  );
4734  // Call handler function
4735  this->seqDispatchIn_handler(
4736  portNum,
4737  file_name
4738  );
4739 
4740  break;
4741  }
4742 
4743  // Handle async input port seqRunIn
4744  case SEQRUNIN_CMDSEQIN: {
4745  // Deserialize argument filename
4746  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
4747  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
4748  _deserStatus = _msg.deserializeTo(filename);
4749  FW_ASSERT(
4750  _deserStatus == Fw::FW_SERIALIZE_OK,
4751  static_cast<FwAssertArgType>(_deserStatus)
4752  );
4753  // Call handler function
4754  this->seqRunIn_handler(
4755  portNum,
4756  filename
4757  );
4758 
4759  break;
4760  }
4761 
4762  // Handle command CS_RUN
4763  case CMD_CS_RUN: {
4764  // Deserialize opcode
4765  FwOpcodeType _opCode = 0;
4766  _deserStatus = _msg.deserializeTo(_opCode);
4767  FW_ASSERT (
4768  _deserStatus == Fw::FW_SERIALIZE_OK,
4769  static_cast<FwAssertArgType>(_deserStatus)
4770  );
4771 
4772  // Deserialize command sequence
4773  U32 _cmdSeq = 0;
4774  _deserStatus = _msg.deserializeTo(_cmdSeq);
4775  FW_ASSERT (
4776  _deserStatus == Fw::FW_SERIALIZE_OK,
4777  static_cast<FwAssertArgType>(_deserStatus)
4778  );
4779 
4780  // Deserialize command argument buffer
4781  Fw::CmdArgBuffer args;
4782  _deserStatus = _msg.deserializeTo(args);
4783  FW_ASSERT (
4784  _deserStatus == Fw::FW_SERIALIZE_OK,
4785  static_cast<FwAssertArgType>(_deserStatus)
4786  );
4787 
4788  // Reset buffer
4789  args.resetDeser();
4790 
4791  // Deserialize argument fileName
4792  Fw::CmdStringArg fileName;
4793  _deserStatus = args.deserializeTo(fileName);
4794  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4795  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4796  this->cmdResponse_out(
4797  _opCode,
4798  _cmdSeq,
4800  );
4801  }
4802  // Don't crash the task if bad arguments were passed from the ground
4803  break;
4804  }
4805 
4806  // Deserialize argument block
4808  _deserStatus = args.deserializeTo(block);
4809  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4810  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4811  this->cmdResponse_out(
4812  _opCode,
4813  _cmdSeq,
4815  );
4816  }
4817  // Don't crash the task if bad arguments were passed from the ground
4818  break;
4819  }
4820 
4821  // Make sure there was no data left over.
4822  // That means the argument buffer size was incorrect.
4823 #if FW_CMD_CHECK_RESIDUAL
4824  if (args.getDeserializeSizeLeft() != 0) {
4825  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4826  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4827  }
4828  // Don't crash the task if bad arguments were passed from the ground
4829  break;
4830  }
4831 #endif
4832 
4833  // Call handler function
4834  this->CS_RUN_cmdHandler(
4835  _opCode, _cmdSeq,
4836  fileName,
4837  block
4838  );
4839 
4840  break;
4841  }
4842 
4843  // Handle command CS_VALIDATE
4844  case CMD_CS_VALIDATE: {
4845  // Deserialize opcode
4846  FwOpcodeType _opCode = 0;
4847  _deserStatus = _msg.deserializeTo(_opCode);
4848  FW_ASSERT (
4849  _deserStatus == Fw::FW_SERIALIZE_OK,
4850  static_cast<FwAssertArgType>(_deserStatus)
4851  );
4852 
4853  // Deserialize command sequence
4854  U32 _cmdSeq = 0;
4855  _deserStatus = _msg.deserializeTo(_cmdSeq);
4856  FW_ASSERT (
4857  _deserStatus == Fw::FW_SERIALIZE_OK,
4858  static_cast<FwAssertArgType>(_deserStatus)
4859  );
4860 
4861  // Deserialize command argument buffer
4862  Fw::CmdArgBuffer args;
4863  _deserStatus = _msg.deserializeTo(args);
4864  FW_ASSERT (
4865  _deserStatus == Fw::FW_SERIALIZE_OK,
4866  static_cast<FwAssertArgType>(_deserStatus)
4867  );
4868 
4869  // Reset buffer
4870  args.resetDeser();
4871 
4872  // Deserialize argument fileName
4873  Fw::CmdStringArg fileName;
4874  _deserStatus = args.deserializeTo(fileName);
4875  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4876  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4877  this->cmdResponse_out(
4878  _opCode,
4879  _cmdSeq,
4881  );
4882  }
4883  // Don't crash the task if bad arguments were passed from the ground
4884  break;
4885  }
4886 
4887  // Make sure there was no data left over.
4888  // That means the argument buffer size was incorrect.
4889 #if FW_CMD_CHECK_RESIDUAL
4890  if (args.getDeserializeSizeLeft() != 0) {
4891  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4892  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4893  }
4894  // Don't crash the task if bad arguments were passed from the ground
4895  break;
4896  }
4897 #endif
4898 
4899  // Call handler function
4900  this->CS_VALIDATE_cmdHandler(
4901  _opCode, _cmdSeq,
4902  fileName
4903  );
4904 
4905  break;
4906  }
4907 
4908  // Handle command CS_CANCEL
4909  case CMD_CS_CANCEL: {
4910  // Deserialize opcode
4911  FwOpcodeType _opCode = 0;
4912  _deserStatus = _msg.deserializeTo(_opCode);
4913  FW_ASSERT (
4914  _deserStatus == Fw::FW_SERIALIZE_OK,
4915  static_cast<FwAssertArgType>(_deserStatus)
4916  );
4917 
4918  // Deserialize command sequence
4919  U32 _cmdSeq = 0;
4920  _deserStatus = _msg.deserializeTo(_cmdSeq);
4921  FW_ASSERT (
4922  _deserStatus == Fw::FW_SERIALIZE_OK,
4923  static_cast<FwAssertArgType>(_deserStatus)
4924  );
4925 
4926  // Deserialize command argument buffer
4927  Fw::CmdArgBuffer args;
4928  _deserStatus = _msg.deserializeTo(args);
4929  FW_ASSERT (
4930  _deserStatus == Fw::FW_SERIALIZE_OK,
4931  static_cast<FwAssertArgType>(_deserStatus)
4932  );
4933 
4934  // Reset buffer
4935  args.resetDeser();
4936 
4937  // Make sure there was no data left over.
4938  // That means the argument buffer size was incorrect.
4939 #if FW_CMD_CHECK_RESIDUAL
4940  if (args.getDeserializeSizeLeft() != 0) {
4941  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4942  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4943  }
4944  // Don't crash the task if bad arguments were passed from the ground
4945  break;
4946  }
4947 #endif
4948 
4949  // Call handler function
4950  this->CS_CANCEL_cmdHandler(_opCode, _cmdSeq);
4951 
4952  break;
4953  }
4954 
4955  // Handle command CS_START
4956  case CMD_CS_START: {
4957  // Deserialize opcode
4958  FwOpcodeType _opCode = 0;
4959  _deserStatus = _msg.deserializeTo(_opCode);
4960  FW_ASSERT (
4961  _deserStatus == Fw::FW_SERIALIZE_OK,
4962  static_cast<FwAssertArgType>(_deserStatus)
4963  );
4964 
4965  // Deserialize command sequence
4966  U32 _cmdSeq = 0;
4967  _deserStatus = _msg.deserializeTo(_cmdSeq);
4968  FW_ASSERT (
4969  _deserStatus == Fw::FW_SERIALIZE_OK,
4970  static_cast<FwAssertArgType>(_deserStatus)
4971  );
4972 
4973  // Deserialize command argument buffer
4974  Fw::CmdArgBuffer args;
4975  _deserStatus = _msg.deserializeTo(args);
4976  FW_ASSERT (
4977  _deserStatus == Fw::FW_SERIALIZE_OK,
4978  static_cast<FwAssertArgType>(_deserStatus)
4979  );
4980 
4981  // Reset buffer
4982  args.resetDeser();
4983 
4984  // Make sure there was no data left over.
4985  // That means the argument buffer size was incorrect.
4986 #if FW_CMD_CHECK_RESIDUAL
4987  if (args.getDeserializeSizeLeft() != 0) {
4988  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4989  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4990  }
4991  // Don't crash the task if bad arguments were passed from the ground
4992  break;
4993  }
4994 #endif
4995 
4996  // Call handler function
4997  this->CS_START_cmdHandler(_opCode, _cmdSeq);
4998 
4999  break;
5000  }
5001 
5002  // Handle command CS_STEP
5003  case CMD_CS_STEP: {
5004  // Deserialize opcode
5005  FwOpcodeType _opCode = 0;
5006  _deserStatus = _msg.deserializeTo(_opCode);
5007  FW_ASSERT (
5008  _deserStatus == Fw::FW_SERIALIZE_OK,
5009  static_cast<FwAssertArgType>(_deserStatus)
5010  );
5011 
5012  // Deserialize command sequence
5013  U32 _cmdSeq = 0;
5014  _deserStatus = _msg.deserializeTo(_cmdSeq);
5015  FW_ASSERT (
5016  _deserStatus == Fw::FW_SERIALIZE_OK,
5017  static_cast<FwAssertArgType>(_deserStatus)
5018  );
5019 
5020  // Deserialize command argument buffer
5021  Fw::CmdArgBuffer args;
5022  _deserStatus = _msg.deserializeTo(args);
5023  FW_ASSERT (
5024  _deserStatus == Fw::FW_SERIALIZE_OK,
5025  static_cast<FwAssertArgType>(_deserStatus)
5026  );
5027 
5028  // Reset buffer
5029  args.resetDeser();
5030 
5031  // Make sure there was no data left over.
5032  // That means the argument buffer size was incorrect.
5033 #if FW_CMD_CHECK_RESIDUAL
5034  if (args.getDeserializeSizeLeft() != 0) {
5035  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5036  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5037  }
5038  // Don't crash the task if bad arguments were passed from the ground
5039  break;
5040  }
5041 #endif
5042 
5043  // Call handler function
5044  this->CS_STEP_cmdHandler(_opCode, _cmdSeq);
5045 
5046  break;
5047  }
5048 
5049  // Handle command CS_AUTO
5050  case CMD_CS_AUTO: {
5051  // Deserialize opcode
5052  FwOpcodeType _opCode = 0;
5053  _deserStatus = _msg.deserializeTo(_opCode);
5054  FW_ASSERT (
5055  _deserStatus == Fw::FW_SERIALIZE_OK,
5056  static_cast<FwAssertArgType>(_deserStatus)
5057  );
5058 
5059  // Deserialize command sequence
5060  U32 _cmdSeq = 0;
5061  _deserStatus = _msg.deserializeTo(_cmdSeq);
5062  FW_ASSERT (
5063  _deserStatus == Fw::FW_SERIALIZE_OK,
5064  static_cast<FwAssertArgType>(_deserStatus)
5065  );
5066 
5067  // Deserialize command argument buffer
5068  Fw::CmdArgBuffer args;
5069  _deserStatus = _msg.deserializeTo(args);
5070  FW_ASSERT (
5071  _deserStatus == Fw::FW_SERIALIZE_OK,
5072  static_cast<FwAssertArgType>(_deserStatus)
5073  );
5074 
5075  // Reset buffer
5076  args.resetDeser();
5077 
5078  // Make sure there was no data left over.
5079  // That means the argument buffer size was incorrect.
5080 #if FW_CMD_CHECK_RESIDUAL
5081  if (args.getDeserializeSizeLeft() != 0) {
5082  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5083  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5084  }
5085  // Don't crash the task if bad arguments were passed from the ground
5086  break;
5087  }
5088 #endif
5089 
5090  // Call handler function
5091  this->CS_AUTO_cmdHandler(_opCode, _cmdSeq);
5092 
5093  break;
5094  }
5095 
5096  // Handle command CS_MANUAL
5097  case CMD_CS_MANUAL: {
5098  // Deserialize opcode
5099  FwOpcodeType _opCode = 0;
5100  _deserStatus = _msg.deserializeTo(_opCode);
5101  FW_ASSERT (
5102  _deserStatus == Fw::FW_SERIALIZE_OK,
5103  static_cast<FwAssertArgType>(_deserStatus)
5104  );
5105 
5106  // Deserialize command sequence
5107  U32 _cmdSeq = 0;
5108  _deserStatus = _msg.deserializeTo(_cmdSeq);
5109  FW_ASSERT (
5110  _deserStatus == Fw::FW_SERIALIZE_OK,
5111  static_cast<FwAssertArgType>(_deserStatus)
5112  );
5113 
5114  // Deserialize command argument buffer
5115  Fw::CmdArgBuffer args;
5116  _deserStatus = _msg.deserializeTo(args);
5117  FW_ASSERT (
5118  _deserStatus == Fw::FW_SERIALIZE_OK,
5119  static_cast<FwAssertArgType>(_deserStatus)
5120  );
5121 
5122  // Reset buffer
5123  args.resetDeser();
5124 
5125  // Make sure there was no data left over.
5126  // That means the argument buffer size was incorrect.
5127 #if FW_CMD_CHECK_RESIDUAL
5128  if (args.getDeserializeSizeLeft() != 0) {
5129  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5130  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5131  }
5132  // Don't crash the task if bad arguments were passed from the ground
5133  break;
5134  }
5135 #endif
5136 
5137  // Call handler function
5138  this->CS_MANUAL_cmdHandler(_opCode, _cmdSeq);
5139 
5140  break;
5141  }
5142 
5143  // Handle command CS_JOIN_WAIT
5144  case CMD_CS_JOIN_WAIT: {
5145  // Deserialize opcode
5146  FwOpcodeType _opCode = 0;
5147  _deserStatus = _msg.deserializeTo(_opCode);
5148  FW_ASSERT (
5149  _deserStatus == Fw::FW_SERIALIZE_OK,
5150  static_cast<FwAssertArgType>(_deserStatus)
5151  );
5152 
5153  // Deserialize command sequence
5154  U32 _cmdSeq = 0;
5155  _deserStatus = _msg.deserializeTo(_cmdSeq);
5156  FW_ASSERT (
5157  _deserStatus == Fw::FW_SERIALIZE_OK,
5158  static_cast<FwAssertArgType>(_deserStatus)
5159  );
5160 
5161  // Deserialize command argument buffer
5162  Fw::CmdArgBuffer args;
5163  _deserStatus = _msg.deserializeTo(args);
5164  FW_ASSERT (
5165  _deserStatus == Fw::FW_SERIALIZE_OK,
5166  static_cast<FwAssertArgType>(_deserStatus)
5167  );
5168 
5169  // Reset buffer
5170  args.resetDeser();
5171 
5172  // Make sure there was no data left over.
5173  // That means the argument buffer size was incorrect.
5174 #if FW_CMD_CHECK_RESIDUAL
5175  if (args.getDeserializeSizeLeft() != 0) {
5176  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5177  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5178  }
5179  // Don't crash the task if bad arguments were passed from the ground
5180  break;
5181  }
5182 #endif
5183 
5184  // Call handler function
5185  this->CS_JOIN_WAIT_cmdHandler(_opCode, _cmdSeq);
5186 
5187  break;
5188  }
5189 
5190  default:
5191  return MSG_DISPATCH_ERROR;
5192  }
5193 
5194  return MSG_DISPATCH_OK;
5195  }
5196 
5197  // ----------------------------------------------------------------------
5198  // Calls for messages received on special input ports
5199  // ----------------------------------------------------------------------
5200 
5201  void CmdSequencerComponentBase ::
5202  m_p_cmdIn_in(
5203  Fw::PassiveComponentBase* callComp,
5204  FwIndexType portNum,
5205  FwOpcodeType opCode,
5206  U32 cmdSeq,
5207  Fw::CmdArgBuffer& args
5208  )
5209  {
5210  FW_ASSERT(callComp);
5211  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5212 
5213  const U32 idBase = callComp->getIdBase();
5214  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
5215 
5216  // Select base class function based on opcode
5217  switch (opCode - idBase) {
5218  case OPCODE_CS_RUN: {
5219  compPtr->CS_RUN_cmdHandlerBase(
5220  opCode,
5221  cmdSeq,
5222  args
5223  );
5224  break;
5225  }
5226 
5227  case OPCODE_CS_VALIDATE: {
5228  compPtr->CS_VALIDATE_cmdHandlerBase(
5229  opCode,
5230  cmdSeq,
5231  args
5232  );
5233  break;
5234  }
5235 
5236  case OPCODE_CS_CANCEL: {
5237  compPtr->CS_CANCEL_cmdHandlerBase(
5238  opCode,
5239  cmdSeq,
5240  args
5241  );
5242  break;
5243  }
5244 
5245  case OPCODE_CS_START: {
5246  compPtr->CS_START_cmdHandlerBase(
5247  opCode,
5248  cmdSeq,
5249  args
5250  );
5251  break;
5252  }
5253 
5254  case OPCODE_CS_STEP: {
5255  compPtr->CS_STEP_cmdHandlerBase(
5256  opCode,
5257  cmdSeq,
5258  args
5259  );
5260  break;
5261  }
5262 
5263  case OPCODE_CS_AUTO: {
5264  compPtr->CS_AUTO_cmdHandlerBase(
5265  opCode,
5266  cmdSeq,
5267  args
5268  );
5269  break;
5270  }
5271 
5272  case OPCODE_CS_MANUAL: {
5273  compPtr->CS_MANUAL_cmdHandlerBase(
5274  opCode,
5275  cmdSeq,
5276  args
5277  );
5278  break;
5279  }
5280 
5281  case OPCODE_CS_JOIN_WAIT: {
5282  compPtr->CS_JOIN_WAIT_cmdHandlerBase(
5283  opCode,
5284  cmdSeq,
5285  args
5286  );
5287  break;
5288  }
5289  }
5290  }
5291 
5292  // ----------------------------------------------------------------------
5293  // Calls for messages received on typed input ports
5294  // ----------------------------------------------------------------------
5295 
5296  void CmdSequencerComponentBase ::
5297  m_p_cmdResponseIn_in(
5298  Fw::PassiveComponentBase* callComp,
5299  FwIndexType portNum,
5300  FwOpcodeType opCode,
5301  U32 cmdSeq,
5302  const Fw::CmdResponse& response
5303  )
5304  {
5305  FW_ASSERT(callComp);
5306  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5307  compPtr->cmdResponseIn_handlerBase(
5308  portNum,
5309  opCode,
5310  cmdSeq,
5311  response
5312  );
5313  }
5314 
5315  void CmdSequencerComponentBase ::
5316  m_p_pingIn_in(
5317  Fw::PassiveComponentBase* callComp,
5318  FwIndexType portNum,
5319  U32 key
5320  )
5321  {
5322  FW_ASSERT(callComp);
5323  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5324  compPtr->pingIn_handlerBase(
5325  portNum,
5326  key
5327  );
5328  }
5329 
5330  void CmdSequencerComponentBase ::
5331  m_p_schedIn_in(
5332  Fw::PassiveComponentBase* callComp,
5333  FwIndexType portNum,
5334  U32 context
5335  )
5336  {
5337  FW_ASSERT(callComp);
5338  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5339  compPtr->schedIn_handlerBase(
5340  portNum,
5341  context
5342  );
5343  }
5344 
5345  void CmdSequencerComponentBase ::
5346  m_p_seqCancelIn_in(
5347  Fw::PassiveComponentBase* callComp,
5348  FwIndexType portNum
5349  )
5350  {
5351  FW_ASSERT(callComp);
5352  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5353  compPtr->seqCancelIn_handlerBase(portNum);
5354  }
5355 
5356  void CmdSequencerComponentBase ::
5357  m_p_seqDispatchIn_in(
5358  Fw::PassiveComponentBase* callComp,
5359  FwIndexType portNum,
5360  Fw::StringBase& file_name
5361  )
5362  {
5363  FW_ASSERT(callComp);
5364  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5365  compPtr->seqDispatchIn_handlerBase(
5366  portNum,
5367  file_name
5368  );
5369  }
5370 
5371  void CmdSequencerComponentBase ::
5372  m_p_seqRunIn_in(
5373  Fw::PassiveComponentBase* callComp,
5374  FwIndexType portNum,
5375  const Fw::StringBase& filename
5376  )
5377  {
5378  FW_ASSERT(callComp);
5379  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5380  compPtr->seqRunIn_handlerBase(
5381  portNum,
5382  filename
5383  );
5384  }
5385 
5386 }
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
A command status came back when no sequence was running.
static constexpr FwIndexType getNum_cmdIn_InputPorts()
Serialization/Deserialization operation was successful.
void log_WARNING_HI_CS_TimeContextMismatch(const Fw::StringBase &fileName, U8 currTimeBase, U8 seqTimeBase) const
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void log_WARNING_HI_CS_FileInvalid(const Fw::StringBase &fileName, Svc::CmdSequencer_FileReadStage stage, I32 error) const
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void tlmWrite_CS_LoadCommands(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port interface.
Definition: ComPortAc.cpp:156
void init()
Initialization function.
Definition: ComPortAc.cpp:137
The Command Sequencer issued a command and received a success status in return.
static constexpr FwIndexType getNum_cmdResponseIn_InputPorts()
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:26
static constexpr FwIndexType getNum_logOut_OutputPorts()
virtual void seqDispatchIn_handler(FwIndexType portNum, Fw::StringBase &file_name)=0
Handler for input port seqDispatchIn.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void log_WARNING_HI_CS_FileSizeError(const Fw::StringBase &fileName, U32 size) const
void log_ACTIVITY_HI_CS_ModeSwitched(Svc::CmdSequencer_SeqMode mode) const
bool isConnected_comCmdOut_OutputPort(FwIndexType portNum)
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
A sequence related command came with no active sequence.
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
The Command Sequencer issued a command and received an error status in return.
void init()
Initialization function.
void CS_MANUAL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
void regCommands()
Register commands with the Command Dispatcher.
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
void init()
Initialization function.
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
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 interface.
Definition: PingPortAc.cpp:147
static constexpr FwIndexType getNum_seqRunIn_InputPorts()
The size of the serial representations of the port arguments.
Number of records in header doesn&#39;t match number in file.
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
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
static constexpr FwIndexType getNum_schedIn_InputPorts()
void log_ACTIVITY_HI_CS_CmdStarted(const Fw::StringBase &filename) const
virtual void CS_VALIDATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)=0
Fw::InputCmdResponsePort * get_cmdResponseIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_seqDone_OutputPorts()
void comCmdOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comCmdOut.
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:144
void seqDone_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke output port seqDone.
Enum representing a command response.
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
No time base has been established (Required)
void seqRunIn_handlerBase(FwIndexType portNum, const Fw::StringBase &filename)
Handler base-class function for input port seqRunIn.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void CS_START_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Wait for sequences that are running to finish. Allow user to run multiple seq files in SEQ_NO_BLOCK m...
void log_WARNING_HI_CS_SequenceTimeout(const Fw::StringBase &filename, U32 command) 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
The size of the serial representations of the port arguments.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:24
void seqStartOut_out(FwIndexType portNum, const Fw::StringBase &filename)
Invoke output port seqStartOut.
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:62
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
The Command Sequencer received a command that was invalid for its current mode.
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 interface.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
virtual void seqRunIn_preMsgHook(FwIndexType portNum, const Fw::StringBase &filename)
Pre-message hook for async input port seqRunIn.
void log_ACTIVITY_HI_CS_PortSequenceStarted(const Fw::StringBase &filename) const
void log_WARNING_HI_CS_RecordInvalid(const Fw::StringBase &fileName, U32 recordNumber, I32 error) const
void log_ACTIVITY_HI_CS_SequenceCanceled(const Fw::StringBase &fileName) const
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:26
virtual void CS_RUN_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, Svc::CmdSequencer_BlockState block)=0
void init()
Initialization function.
Definition: TimePortAc.cpp:128
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
void init()
Initialization function.
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:92
A less serious but recoverable event.
void init()
Initialization function.
Definition: PingPortAc.cpp:128
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
virtual void cmdResponseIn_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port cmdResponseIn.
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
bool isConnected_seqStartOut_OutputPort(FwIndexType portNum)
void CS_JOIN_WAIT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Svc::InputCmdSeqInPort * get_seqRunIn_InputPort(FwIndexType portNum)
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
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:134
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
virtual void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename)=0
Handler for input port seqRunIn.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
A string backed by an external buffer.
A serious but recoverable event.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:38
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
void CS_AUTO_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void invoke(const Fw::StringBase &filename) const
Invoke a port interface.
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:151
bool isConnected_seqDone_OutputPort(FwIndexType portNum)
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void set_comCmdOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comCmdOut[portNum].
static constexpr FwIndexType getNum_seqStartOut_OutputPorts()
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
BlockingType
message type
Definition: Queue.hpp:46
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
virtual void CS_AUTO_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Command failed to deserialize.
The Sequence File Loader could not read the sequence file.
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.
A local port request to run a sequence was started.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
The size of the serial representation.
void init()
Initialization function.
virtual void CS_MANUAL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_MANUAL.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void CS_CANCEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Cannot run new sequence when current sequence file is still running.
Perform one step in a command sequence. Valid only if CmdSequencer is in MANUAL run mode...
Wait for the current running sequence file complete.
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.
message to exit active component task
virtual void CS_STEP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_STEP.
PlatformIndexType FwIndexType
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void seqCancelIn_handlerBase(FwIndexType portNum)
Handler base-class function for input port seqCancelIn.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputCmdSeqInPort *callPort)
Register an input port.
The running time base doesn&#39;t match the time base in the sequence files.
void init()
Initialization function.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
void CS_RUN_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Svc::InputFileDispatchPort * get_seqDispatchIn_InputPort(FwIndexType portNum)
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 log_ACTIVITY_LO_CS_CommandComplete(const Fw::StringBase &fileName, U32 recordNumber, FwOpcodeType opCode) const
message sent/received okay
Definition: Queue.hpp:31
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
U8 BYTE
byte type
Definition: BasicTypes.h:56
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
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:62
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
The size of the serial representations of the port arguments.
Implementation of malloc based allocator.
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.
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
void log_WARNING_HI_CS_CommandError(const Fw::StringBase &fileName, U32 recordNumber, FwOpcodeType opCode, U32 errorStatus) const
void init()
Initialization function.
virtual void CS_CANCEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
The running time base doesn&#39;t match the time base in the sequence files.
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
virtual void seqDispatchIn_preMsgHook(FwIndexType portNum, Fw::StringBase &file_name)
Pre-message hook for async input port seqDispatchIn.
void log_ACTIVITY_HI_CS_SequenceValid(const Fw::StringBase &filename) const
bool isConnected_logOut_OutputPort(FwIndexType portNum)
void log_WARNING_HI_CS_FileReadError(const Fw::StringBase &fileName) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
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.