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