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 
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  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 getBuffCapacity() 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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  // Getters for numbers of special input ports
887  // ----------------------------------------------------------------------
888 
891  {
892  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
893  }
894 
895  // ----------------------------------------------------------------------
896  // Getters for numbers of typed input ports
897  // ----------------------------------------------------------------------
898 
901  {
902  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseIn_InputPort));
903  }
904 
907  {
908  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
909  }
910 
913  {
914  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_schedIn_InputPort));
915  }
916 
919  {
920  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqCancelIn_InputPort));
921  }
922 
925  {
926  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqRunIn_InputPort));
927  }
928 
929  // ----------------------------------------------------------------------
930  // Getters for numbers of special output ports
931  // ----------------------------------------------------------------------
932 
933 #if FW_ENABLE_TEXT_LOGGING == 1
934 
935  FwIndexType CmdSequencerComponentBase ::
936  getNum_LogText_OutputPorts() const
937  {
938  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
939  }
940 
941 #endif
942 
945  {
946  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
947  }
948 
951  {
952  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
953  }
954 
957  {
958  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
959  }
960 
963  {
964  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
965  }
966 
969  {
970  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
971  }
972 
973  // ----------------------------------------------------------------------
974  // Getters for numbers of typed output ports
975  // ----------------------------------------------------------------------
976 
979  {
980  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comCmdOut_OutputPort));
981  }
982 
985  {
986  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
987  }
988 
991  {
992  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqDone_OutputPort));
993  }
994 
997  {
998  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqStartOut_OutputPort));
999  }
1000 
1001  // ----------------------------------------------------------------------
1002  // Connection status queries for special output ports
1003  // ----------------------------------------------------------------------
1004 
1005 #if FW_ENABLE_TEXT_LOGGING == 1
1006 
1007  bool CmdSequencerComponentBase ::
1008  isConnected_LogText_OutputPort(FwIndexType portNum)
1009  {
1010  FW_ASSERT(
1011  portNum < this->getNum_LogText_OutputPorts(),
1012  static_cast<FwAssertArgType>(portNum)
1013  );
1014 
1015  return this->m_LogText_OutputPort[portNum].isConnected();
1016  }
1017 
1018 #endif
1019 
1022  {
1023  FW_ASSERT(
1024  portNum < this->getNum_cmdRegOut_OutputPorts(),
1025  static_cast<FwAssertArgType>(portNum)
1026  );
1027 
1028  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1029  }
1030 
1033  {
1034  FW_ASSERT(
1035  portNum < this->getNum_cmdResponseOut_OutputPorts(),
1036  static_cast<FwAssertArgType>(portNum)
1037  );
1038 
1039  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1040  }
1041 
1044  {
1045  FW_ASSERT(
1046  portNum < this->getNum_logOut_OutputPorts(),
1047  static_cast<FwAssertArgType>(portNum)
1048  );
1049 
1050  return this->m_logOut_OutputPort[portNum].isConnected();
1051  }
1052 
1055  {
1056  FW_ASSERT(
1057  portNum < this->getNum_timeCaller_OutputPorts(),
1058  static_cast<FwAssertArgType>(portNum)
1059  );
1060 
1061  return this->m_timeCaller_OutputPort[portNum].isConnected();
1062  }
1063 
1066  {
1067  FW_ASSERT(
1068  portNum < this->getNum_tlmOut_OutputPorts(),
1069  static_cast<FwAssertArgType>(portNum)
1070  );
1071 
1072  return this->m_tlmOut_OutputPort[portNum].isConnected();
1073  }
1074 
1075  // ----------------------------------------------------------------------
1076  // Connection status queries for typed output ports
1077  // ----------------------------------------------------------------------
1078 
1081  {
1082  FW_ASSERT(
1083  portNum < this->getNum_comCmdOut_OutputPorts(),
1084  static_cast<FwAssertArgType>(portNum)
1085  );
1086 
1087  return this->m_comCmdOut_OutputPort[portNum].isConnected();
1088  }
1089 
1092  {
1093  FW_ASSERT(
1094  portNum < this->getNum_pingOut_OutputPorts(),
1095  static_cast<FwAssertArgType>(portNum)
1096  );
1097 
1098  return this->m_pingOut_OutputPort[portNum].isConnected();
1099  }
1100 
1103  {
1104  FW_ASSERT(
1105  portNum < this->getNum_seqDone_OutputPorts(),
1106  static_cast<FwAssertArgType>(portNum)
1107  );
1108 
1109  return this->m_seqDone_OutputPort[portNum].isConnected();
1110  }
1111 
1114  {
1115  FW_ASSERT(
1116  portNum < this->getNum_seqStartOut_OutputPorts(),
1117  static_cast<FwAssertArgType>(portNum)
1118  );
1119 
1120  return this->m_seqStartOut_OutputPort[portNum].isConnected();
1121  }
1122 
1123  // ----------------------------------------------------------------------
1124  // Port handler base-class functions for typed input ports
1125  //
1126  // Call these functions directly to bypass the corresponding ports
1127  // ----------------------------------------------------------------------
1128 
1131  FwIndexType portNum,
1132  FwOpcodeType opCode,
1133  U32 cmdSeq,
1134  const Fw::CmdResponse& response
1135  )
1136  {
1137  // Make sure port number is valid
1138  FW_ASSERT(
1139  portNum < this->getNum_cmdResponseIn_InputPorts(),
1140  static_cast<FwAssertArgType>(portNum)
1141  );
1142 
1143  // Call pre-message hook
1145  portNum,
1146  opCode,
1147  cmdSeq,
1148  response
1149  );
1150  ComponentIpcSerializableBuffer msg;
1152 
1153  // Serialize message ID
1154  _status = msg.serialize(
1155  static_cast<FwEnumStoreType>(CMDRESPONSEIN_CMDRESPONSE)
1156  );
1157  FW_ASSERT(
1158  _status == Fw::FW_SERIALIZE_OK,
1159  static_cast<FwAssertArgType>(_status)
1160  );
1161 
1162  // Serialize port number
1163  _status = msg.serialize(portNum);
1164  FW_ASSERT(
1165  _status == Fw::FW_SERIALIZE_OK,
1166  static_cast<FwAssertArgType>(_status)
1167  );
1168 
1169  // Serialize argument opCode
1170  _status = msg.serialize(opCode);
1171  FW_ASSERT(
1172  _status == Fw::FW_SERIALIZE_OK,
1173  static_cast<FwAssertArgType>(_status)
1174  );
1175 
1176  // Serialize argument cmdSeq
1177  _status = msg.serialize(cmdSeq);
1178  FW_ASSERT(
1179  _status == Fw::FW_SERIALIZE_OK,
1180  static_cast<FwAssertArgType>(_status)
1181  );
1182 
1183  // Serialize argument response
1184  _status = msg.serialize(response);
1185  FW_ASSERT(
1186  _status == Fw::FW_SERIALIZE_OK,
1187  static_cast<FwAssertArgType>(_status)
1188  );
1189 
1190  // Send message
1192  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1193 
1194  FW_ASSERT(
1195  qStatus == Os::Queue::OP_OK,
1196  static_cast<FwAssertArgType>(qStatus)
1197  );
1198  }
1199 
1202  FwIndexType portNum,
1203  U32 key
1204  )
1205  {
1206  // Make sure port number is valid
1207  FW_ASSERT(
1208  portNum < this->getNum_pingIn_InputPorts(),
1209  static_cast<FwAssertArgType>(portNum)
1210  );
1211 
1212  // Call pre-message hook
1214  portNum,
1215  key
1216  );
1217  ComponentIpcSerializableBuffer msg;
1219 
1220  // Serialize message ID
1221  _status = msg.serialize(
1222  static_cast<FwEnumStoreType>(PINGIN_PING)
1223  );
1224  FW_ASSERT(
1225  _status == Fw::FW_SERIALIZE_OK,
1226  static_cast<FwAssertArgType>(_status)
1227  );
1228 
1229  // Serialize port number
1230  _status = msg.serialize(portNum);
1231  FW_ASSERT(
1232  _status == Fw::FW_SERIALIZE_OK,
1233  static_cast<FwAssertArgType>(_status)
1234  );
1235 
1236  // Serialize argument key
1237  _status = msg.serialize(key);
1238  FW_ASSERT(
1239  _status == Fw::FW_SERIALIZE_OK,
1240  static_cast<FwAssertArgType>(_status)
1241  );
1242 
1243  // Send message
1245  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1246 
1247  FW_ASSERT(
1248  qStatus == Os::Queue::OP_OK,
1249  static_cast<FwAssertArgType>(qStatus)
1250  );
1251  }
1252 
1255  FwIndexType portNum,
1256  U32 context
1257  )
1258  {
1259  // Make sure port number is valid
1260  FW_ASSERT(
1261  portNum < this->getNum_schedIn_InputPorts(),
1262  static_cast<FwAssertArgType>(portNum)
1263  );
1264 
1265  // Call pre-message hook
1267  portNum,
1268  context
1269  );
1270  ComponentIpcSerializableBuffer msg;
1272 
1273  // Serialize message ID
1274  _status = msg.serialize(
1275  static_cast<FwEnumStoreType>(SCHEDIN_SCHED)
1276  );
1277  FW_ASSERT(
1278  _status == Fw::FW_SERIALIZE_OK,
1279  static_cast<FwAssertArgType>(_status)
1280  );
1281 
1282  // Serialize port number
1283  _status = msg.serialize(portNum);
1284  FW_ASSERT(
1285  _status == Fw::FW_SERIALIZE_OK,
1286  static_cast<FwAssertArgType>(_status)
1287  );
1288 
1289  // Serialize argument context
1290  _status = msg.serialize(context);
1291  FW_ASSERT(
1292  _status == Fw::FW_SERIALIZE_OK,
1293  static_cast<FwAssertArgType>(_status)
1294  );
1295 
1296  // Send message
1298  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1299 
1300  FW_ASSERT(
1301  qStatus == Os::Queue::OP_OK,
1302  static_cast<FwAssertArgType>(qStatus)
1303  );
1304  }
1305 
1308  {
1309  // Make sure port number is valid
1310  FW_ASSERT(
1311  portNum < this->getNum_seqCancelIn_InputPorts(),
1312  static_cast<FwAssertArgType>(portNum)
1313  );
1314 
1315  // Call pre-message hook
1316  seqCancelIn_preMsgHook(portNum);
1317  ComponentIpcSerializableBuffer msg;
1319 
1320  // Serialize message ID
1321  _status = msg.serialize(
1322  static_cast<FwEnumStoreType>(SEQCANCELIN_CMDSEQCANCEL)
1323  );
1324  FW_ASSERT(
1325  _status == Fw::FW_SERIALIZE_OK,
1326  static_cast<FwAssertArgType>(_status)
1327  );
1328 
1329  // Serialize port number
1330  _status = msg.serialize(portNum);
1331  FW_ASSERT(
1332  _status == Fw::FW_SERIALIZE_OK,
1333  static_cast<FwAssertArgType>(_status)
1334  );
1335 
1336  // Send message
1338  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1339 
1340  FW_ASSERT(
1341  qStatus == Os::Queue::OP_OK,
1342  static_cast<FwAssertArgType>(qStatus)
1343  );
1344  }
1345 
1348  FwIndexType portNum,
1349  const Fw::StringBase& filename
1350  )
1351  {
1352  // Make sure port number is valid
1353  FW_ASSERT(
1354  portNum < this->getNum_seqRunIn_InputPorts(),
1355  static_cast<FwAssertArgType>(portNum)
1356  );
1357 
1358  // Call pre-message hook
1360  portNum,
1361  filename
1362  );
1363  ComponentIpcSerializableBuffer msg;
1365 
1366  // Serialize message ID
1367  _status = msg.serialize(
1368  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
1369  );
1370  FW_ASSERT(
1371  _status == Fw::FW_SERIALIZE_OK,
1372  static_cast<FwAssertArgType>(_status)
1373  );
1374 
1375  // Serialize port number
1376  _status = msg.serialize(portNum);
1377  FW_ASSERT(
1378  _status == Fw::FW_SERIALIZE_OK,
1379  static_cast<FwAssertArgType>(_status)
1380  );
1381 
1382  // Serialize argument filename
1383  _status = filename.serialize(msg, 240);
1384  FW_ASSERT(
1385  _status == Fw::FW_SERIALIZE_OK,
1386  static_cast<FwAssertArgType>(_status)
1387  );
1388 
1389  // Send message
1391  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1392 
1393  FW_ASSERT(
1394  qStatus == Os::Queue::OP_OK,
1395  static_cast<FwAssertArgType>(qStatus)
1396  );
1397  }
1398 
1399  // ----------------------------------------------------------------------
1400  // Pre-message hooks for typed async input ports
1401  //
1402  // Each of these functions is invoked just before processing a message
1403  // on the corresponding port. By default, they do nothing. You can
1404  // override them to provide specific pre-message behavior.
1405  // ----------------------------------------------------------------------
1406 
1409  FwIndexType portNum,
1410  FwOpcodeType opCode,
1411  U32 cmdSeq,
1412  const Fw::CmdResponse& response
1413  )
1414  {
1415  // Default: no-op
1416  }
1417 
1420  FwIndexType portNum,
1421  U32 key
1422  )
1423  {
1424  // Default: no-op
1425  }
1426 
1429  FwIndexType portNum,
1430  U32 context
1431  )
1432  {
1433  // Default: no-op
1434  }
1435 
1438  {
1439  // Default: no-op
1440  }
1441 
1444  FwIndexType portNum,
1445  const Fw::StringBase& filename
1446  )
1447  {
1448  // Default: no-op
1449  }
1450 
1451  // ----------------------------------------------------------------------
1452  // Invocation functions for typed output ports
1453  // ----------------------------------------------------------------------
1454 
1457  FwIndexType portNum,
1458  Fw::ComBuffer& data,
1459  U32 context
1460  )
1461  {
1462  FW_ASSERT(
1463  portNum < this->getNum_comCmdOut_OutputPorts(),
1464  static_cast<FwAssertArgType>(portNum)
1465  );
1466  this->m_comCmdOut_OutputPort[portNum].invoke(
1467  data,
1468  context
1469  );
1470  }
1471 
1474  FwIndexType portNum,
1475  U32 key
1476  )
1477  {
1478  FW_ASSERT(
1479  portNum < this->getNum_pingOut_OutputPorts(),
1480  static_cast<FwAssertArgType>(portNum)
1481  );
1482  this->m_pingOut_OutputPort[portNum].invoke(
1483  key
1484  );
1485  }
1486 
1489  FwIndexType portNum,
1490  FwOpcodeType opCode,
1491  U32 cmdSeq,
1492  const Fw::CmdResponse& response
1493  )
1494  {
1495  FW_ASSERT(
1496  portNum < this->getNum_seqDone_OutputPorts(),
1497  static_cast<FwAssertArgType>(portNum)
1498  );
1499  this->m_seqDone_OutputPort[portNum].invoke(
1500  opCode,
1501  cmdSeq,
1502  response
1503  );
1504  }
1505 
1508  FwIndexType portNum,
1509  const Fw::StringBase& filename
1510  )
1511  {
1512  FW_ASSERT(
1513  portNum < this->getNum_seqStartOut_OutputPorts(),
1514  static_cast<FwAssertArgType>(portNum)
1515  );
1516  this->m_seqStartOut_OutputPort[portNum].invoke(
1517  filename
1518  );
1519  }
1520 
1521  // ----------------------------------------------------------------------
1522  // Command response
1523  // ----------------------------------------------------------------------
1524 
1527  FwOpcodeType opCode,
1528  U32 cmdSeq,
1529  Fw::CmdResponse response
1530  )
1531  {
1532  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1533  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1534  }
1535 
1536  // ----------------------------------------------------------------------
1537  // Command handler base-class functions
1538  //
1539  // Call these functions directly to bypass the command input port
1540  // ----------------------------------------------------------------------
1541 
1544  FwOpcodeType opCode,
1545  U32 cmdSeq,
1546  Fw::CmdArgBuffer& args
1547  )
1548  {
1549  // Call pre-message hook
1550  this->CS_RUN_preMsgHook(opCode,cmdSeq);
1551 
1552  // Defer deserializing arguments to the message dispatcher
1553  // to avoid deserializing and reserializing just for IPC
1554  ComponentIpcSerializableBuffer msg;
1556 
1557  // Serialize for IPC
1558  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_RUN));
1559  FW_ASSERT (
1560  _status == Fw::FW_SERIALIZE_OK,
1561  static_cast<FwAssertArgType>(_status)
1562  );
1563 
1564  // Fake port number to make message dequeue work
1565  FwIndexType port = 0;
1566 
1567  _status = msg.serialize(port);
1568  FW_ASSERT (
1569  _status == Fw::FW_SERIALIZE_OK,
1570  static_cast<FwAssertArgType>(_status)
1571  );
1572 
1573  _status = msg.serialize(opCode);
1574  FW_ASSERT (
1575  _status == Fw::FW_SERIALIZE_OK,
1576  static_cast<FwAssertArgType>(_status)
1577  );
1578 
1579  _status = msg.serialize(cmdSeq);
1580  FW_ASSERT (
1581  _status == Fw::FW_SERIALIZE_OK,
1582  static_cast<FwAssertArgType>(_status)
1583  );
1584 
1585  _status = msg.serialize(args);
1586  FW_ASSERT (
1587  _status == Fw::FW_SERIALIZE_OK,
1588  static_cast<FwAssertArgType>(_status)
1589  );
1590 
1591  // Send message
1593  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1594 
1595  FW_ASSERT(
1596  qStatus == Os::Queue::OP_OK,
1597  static_cast<FwAssertArgType>(qStatus)
1598  );
1599  }
1600 
1603  FwOpcodeType opCode,
1604  U32 cmdSeq,
1605  Fw::CmdArgBuffer& args
1606  )
1607  {
1608  // Call pre-message hook
1609  this->CS_VALIDATE_preMsgHook(opCode,cmdSeq);
1610 
1611  // Defer deserializing arguments to the message dispatcher
1612  // to avoid deserializing and reserializing just for IPC
1613  ComponentIpcSerializableBuffer msg;
1615 
1616  // Serialize for IPC
1617  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_VALIDATE));
1618  FW_ASSERT (
1619  _status == Fw::FW_SERIALIZE_OK,
1620  static_cast<FwAssertArgType>(_status)
1621  );
1622 
1623  // Fake port number to make message dequeue work
1624  FwIndexType port = 0;
1625 
1626  _status = msg.serialize(port);
1627  FW_ASSERT (
1628  _status == Fw::FW_SERIALIZE_OK,
1629  static_cast<FwAssertArgType>(_status)
1630  );
1631 
1632  _status = msg.serialize(opCode);
1633  FW_ASSERT (
1634  _status == Fw::FW_SERIALIZE_OK,
1635  static_cast<FwAssertArgType>(_status)
1636  );
1637 
1638  _status = msg.serialize(cmdSeq);
1639  FW_ASSERT (
1640  _status == Fw::FW_SERIALIZE_OK,
1641  static_cast<FwAssertArgType>(_status)
1642  );
1643 
1644  _status = msg.serialize(args);
1645  FW_ASSERT (
1646  _status == Fw::FW_SERIALIZE_OK,
1647  static_cast<FwAssertArgType>(_status)
1648  );
1649 
1650  // Send message
1652  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1653 
1654  FW_ASSERT(
1655  qStatus == Os::Queue::OP_OK,
1656  static_cast<FwAssertArgType>(qStatus)
1657  );
1658  }
1659 
1662  FwOpcodeType opCode,
1663  U32 cmdSeq,
1664  Fw::CmdArgBuffer& args
1665  )
1666  {
1667  // Call pre-message hook
1668  this->CS_CANCEL_preMsgHook(opCode,cmdSeq);
1669 
1670  // Defer deserializing arguments to the message dispatcher
1671  // to avoid deserializing and reserializing just for IPC
1672  ComponentIpcSerializableBuffer msg;
1674 
1675  // Serialize for IPC
1676  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_CANCEL));
1677  FW_ASSERT (
1678  _status == Fw::FW_SERIALIZE_OK,
1679  static_cast<FwAssertArgType>(_status)
1680  );
1681 
1682  // Fake port number to make message dequeue work
1683  FwIndexType port = 0;
1684 
1685  _status = msg.serialize(port);
1686  FW_ASSERT (
1687  _status == Fw::FW_SERIALIZE_OK,
1688  static_cast<FwAssertArgType>(_status)
1689  );
1690 
1691  _status = msg.serialize(opCode);
1692  FW_ASSERT (
1693  _status == Fw::FW_SERIALIZE_OK,
1694  static_cast<FwAssertArgType>(_status)
1695  );
1696 
1697  _status = msg.serialize(cmdSeq);
1698  FW_ASSERT (
1699  _status == Fw::FW_SERIALIZE_OK,
1700  static_cast<FwAssertArgType>(_status)
1701  );
1702 
1703  _status = msg.serialize(args);
1704  FW_ASSERT (
1705  _status == Fw::FW_SERIALIZE_OK,
1706  static_cast<FwAssertArgType>(_status)
1707  );
1708 
1709  // Send message
1711  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1712 
1713  FW_ASSERT(
1714  qStatus == Os::Queue::OP_OK,
1715  static_cast<FwAssertArgType>(qStatus)
1716  );
1717  }
1718 
1721  FwOpcodeType opCode,
1722  U32 cmdSeq,
1723  Fw::CmdArgBuffer& args
1724  )
1725  {
1726  // Call pre-message hook
1727  this->CS_START_preMsgHook(opCode,cmdSeq);
1728 
1729  // Defer deserializing arguments to the message dispatcher
1730  // to avoid deserializing and reserializing just for IPC
1731  ComponentIpcSerializableBuffer msg;
1733 
1734  // Serialize for IPC
1735  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_START));
1736  FW_ASSERT (
1737  _status == Fw::FW_SERIALIZE_OK,
1738  static_cast<FwAssertArgType>(_status)
1739  );
1740 
1741  // Fake port number to make message dequeue work
1742  FwIndexType port = 0;
1743 
1744  _status = msg.serialize(port);
1745  FW_ASSERT (
1746  _status == Fw::FW_SERIALIZE_OK,
1747  static_cast<FwAssertArgType>(_status)
1748  );
1749 
1750  _status = msg.serialize(opCode);
1751  FW_ASSERT (
1752  _status == Fw::FW_SERIALIZE_OK,
1753  static_cast<FwAssertArgType>(_status)
1754  );
1755 
1756  _status = msg.serialize(cmdSeq);
1757  FW_ASSERT (
1758  _status == Fw::FW_SERIALIZE_OK,
1759  static_cast<FwAssertArgType>(_status)
1760  );
1761 
1762  _status = msg.serialize(args);
1763  FW_ASSERT (
1764  _status == Fw::FW_SERIALIZE_OK,
1765  static_cast<FwAssertArgType>(_status)
1766  );
1767 
1768  // Send message
1770  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1771 
1772  FW_ASSERT(
1773  qStatus == Os::Queue::OP_OK,
1774  static_cast<FwAssertArgType>(qStatus)
1775  );
1776  }
1777 
1780  FwOpcodeType opCode,
1781  U32 cmdSeq,
1782  Fw::CmdArgBuffer& args
1783  )
1784  {
1785  // Call pre-message hook
1786  this->CS_STEP_preMsgHook(opCode,cmdSeq);
1787 
1788  // Defer deserializing arguments to the message dispatcher
1789  // to avoid deserializing and reserializing just for IPC
1790  ComponentIpcSerializableBuffer msg;
1792 
1793  // Serialize for IPC
1794  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_STEP));
1795  FW_ASSERT (
1796  _status == Fw::FW_SERIALIZE_OK,
1797  static_cast<FwAssertArgType>(_status)
1798  );
1799 
1800  // Fake port number to make message dequeue work
1801  FwIndexType port = 0;
1802 
1803  _status = msg.serialize(port);
1804  FW_ASSERT (
1805  _status == Fw::FW_SERIALIZE_OK,
1806  static_cast<FwAssertArgType>(_status)
1807  );
1808 
1809  _status = msg.serialize(opCode);
1810  FW_ASSERT (
1811  _status == Fw::FW_SERIALIZE_OK,
1812  static_cast<FwAssertArgType>(_status)
1813  );
1814 
1815  _status = msg.serialize(cmdSeq);
1816  FW_ASSERT (
1817  _status == Fw::FW_SERIALIZE_OK,
1818  static_cast<FwAssertArgType>(_status)
1819  );
1820 
1821  _status = msg.serialize(args);
1822  FW_ASSERT (
1823  _status == Fw::FW_SERIALIZE_OK,
1824  static_cast<FwAssertArgType>(_status)
1825  );
1826 
1827  // Send message
1829  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1830 
1831  FW_ASSERT(
1832  qStatus == Os::Queue::OP_OK,
1833  static_cast<FwAssertArgType>(qStatus)
1834  );
1835  }
1836 
1839  FwOpcodeType opCode,
1840  U32 cmdSeq,
1841  Fw::CmdArgBuffer& args
1842  )
1843  {
1844  // Call pre-message hook
1845  this->CS_AUTO_preMsgHook(opCode,cmdSeq);
1846 
1847  // Defer deserializing arguments to the message dispatcher
1848  // to avoid deserializing and reserializing just for IPC
1849  ComponentIpcSerializableBuffer msg;
1851 
1852  // Serialize for IPC
1853  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_AUTO));
1854  FW_ASSERT (
1855  _status == Fw::FW_SERIALIZE_OK,
1856  static_cast<FwAssertArgType>(_status)
1857  );
1858 
1859  // Fake port number to make message dequeue work
1860  FwIndexType port = 0;
1861 
1862  _status = msg.serialize(port);
1863  FW_ASSERT (
1864  _status == Fw::FW_SERIALIZE_OK,
1865  static_cast<FwAssertArgType>(_status)
1866  );
1867 
1868  _status = msg.serialize(opCode);
1869  FW_ASSERT (
1870  _status == Fw::FW_SERIALIZE_OK,
1871  static_cast<FwAssertArgType>(_status)
1872  );
1873 
1874  _status = msg.serialize(cmdSeq);
1875  FW_ASSERT (
1876  _status == Fw::FW_SERIALIZE_OK,
1877  static_cast<FwAssertArgType>(_status)
1878  );
1879 
1880  _status = msg.serialize(args);
1881  FW_ASSERT (
1882  _status == Fw::FW_SERIALIZE_OK,
1883  static_cast<FwAssertArgType>(_status)
1884  );
1885 
1886  // Send message
1888  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1889 
1890  FW_ASSERT(
1891  qStatus == Os::Queue::OP_OK,
1892  static_cast<FwAssertArgType>(qStatus)
1893  );
1894  }
1895 
1898  FwOpcodeType opCode,
1899  U32 cmdSeq,
1900  Fw::CmdArgBuffer& args
1901  )
1902  {
1903  // Call pre-message hook
1904  this->CS_MANUAL_preMsgHook(opCode,cmdSeq);
1905 
1906  // Defer deserializing arguments to the message dispatcher
1907  // to avoid deserializing and reserializing just for IPC
1908  ComponentIpcSerializableBuffer msg;
1910 
1911  // Serialize for IPC
1912  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_MANUAL));
1913  FW_ASSERT (
1914  _status == Fw::FW_SERIALIZE_OK,
1915  static_cast<FwAssertArgType>(_status)
1916  );
1917 
1918  // Fake port number to make message dequeue work
1919  FwIndexType port = 0;
1920 
1921  _status = msg.serialize(port);
1922  FW_ASSERT (
1923  _status == Fw::FW_SERIALIZE_OK,
1924  static_cast<FwAssertArgType>(_status)
1925  );
1926 
1927  _status = msg.serialize(opCode);
1928  FW_ASSERT (
1929  _status == Fw::FW_SERIALIZE_OK,
1930  static_cast<FwAssertArgType>(_status)
1931  );
1932 
1933  _status = msg.serialize(cmdSeq);
1934  FW_ASSERT (
1935  _status == Fw::FW_SERIALIZE_OK,
1936  static_cast<FwAssertArgType>(_status)
1937  );
1938 
1939  _status = msg.serialize(args);
1940  FW_ASSERT (
1941  _status == Fw::FW_SERIALIZE_OK,
1942  static_cast<FwAssertArgType>(_status)
1943  );
1944 
1945  // Send message
1947  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1948 
1949  FW_ASSERT(
1950  qStatus == Os::Queue::OP_OK,
1951  static_cast<FwAssertArgType>(qStatus)
1952  );
1953  }
1954 
1957  FwOpcodeType opCode,
1958  U32 cmdSeq,
1959  Fw::CmdArgBuffer& args
1960  )
1961  {
1962  // Call pre-message hook
1963  this->CS_JOIN_WAIT_preMsgHook(opCode,cmdSeq);
1964 
1965  // Defer deserializing arguments to the message dispatcher
1966  // to avoid deserializing and reserializing just for IPC
1967  ComponentIpcSerializableBuffer msg;
1969 
1970  // Serialize for IPC
1971  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_JOIN_WAIT));
1972  FW_ASSERT (
1973  _status == Fw::FW_SERIALIZE_OK,
1974  static_cast<FwAssertArgType>(_status)
1975  );
1976 
1977  // Fake port number to make message dequeue work
1978  FwIndexType port = 0;
1979 
1980  _status = msg.serialize(port);
1981  FW_ASSERT (
1982  _status == Fw::FW_SERIALIZE_OK,
1983  static_cast<FwAssertArgType>(_status)
1984  );
1985 
1986  _status = msg.serialize(opCode);
1987  FW_ASSERT (
1988  _status == Fw::FW_SERIALIZE_OK,
1989  static_cast<FwAssertArgType>(_status)
1990  );
1991 
1992  _status = msg.serialize(cmdSeq);
1993  FW_ASSERT (
1994  _status == Fw::FW_SERIALIZE_OK,
1995  static_cast<FwAssertArgType>(_status)
1996  );
1997 
1998  _status = msg.serialize(args);
1999  FW_ASSERT (
2000  _status == Fw::FW_SERIALIZE_OK,
2001  static_cast<FwAssertArgType>(_status)
2002  );
2003 
2004  // Send message
2006  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2007 
2008  FW_ASSERT(
2009  qStatus == Os::Queue::OP_OK,
2010  static_cast<FwAssertArgType>(qStatus)
2011  );
2012  }
2013 
2014  // ----------------------------------------------------------------------
2015  // Pre-message hooks for async commands
2016  //
2017  // Each of these functions is invoked just before processing the
2018  // corresponding command. By default they do nothing. You can
2019  // override them to provide specific pre-command behavior.
2020  // ----------------------------------------------------------------------
2021 
2024  FwOpcodeType opCode,
2025  U32 cmdSeq
2026  )
2027  {
2028  // Defaults to no-op; can be overridden
2029  (void) opCode;
2030  (void) cmdSeq;
2031  }
2032 
2035  FwOpcodeType opCode,
2036  U32 cmdSeq
2037  )
2038  {
2039  // Defaults to no-op; can be overridden
2040  (void) opCode;
2041  (void) cmdSeq;
2042  }
2043 
2046  FwOpcodeType opCode,
2047  U32 cmdSeq
2048  )
2049  {
2050  // Defaults to no-op; can be overridden
2051  (void) opCode;
2052  (void) cmdSeq;
2053  }
2054 
2057  FwOpcodeType opCode,
2058  U32 cmdSeq
2059  )
2060  {
2061  // Defaults to no-op; can be overridden
2062  (void) opCode;
2063  (void) cmdSeq;
2064  }
2065 
2068  FwOpcodeType opCode,
2069  U32 cmdSeq
2070  )
2071  {
2072  // Defaults to no-op; can be overridden
2073  (void) opCode;
2074  (void) cmdSeq;
2075  }
2076 
2079  FwOpcodeType opCode,
2080  U32 cmdSeq
2081  )
2082  {
2083  // Defaults to no-op; can be overridden
2084  (void) opCode;
2085  (void) cmdSeq;
2086  }
2087 
2090  FwOpcodeType opCode,
2091  U32 cmdSeq
2092  )
2093  {
2094  // Defaults to no-op; can be overridden
2095  (void) opCode;
2096  (void) cmdSeq;
2097  }
2098 
2101  FwOpcodeType opCode,
2102  U32 cmdSeq
2103  )
2104  {
2105  // Defaults to no-op; can be overridden
2106  (void) opCode;
2107  (void) cmdSeq;
2108  }
2109 
2110  // ----------------------------------------------------------------------
2111  // Event logging functions
2112  // ----------------------------------------------------------------------
2113 
2116  {
2117  // Get the time
2118  Fw::Time _logTime;
2119  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2120  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2121  }
2122 
2123  FwEventIdType _id = static_cast<FwEventIdType>(0);
2124 
2125  _id = this->getIdBase() + EVENTID_CS_SEQUENCELOADED;
2126 
2127  // Emit the event on the log port
2128  if (this->m_logOut_OutputPort[0].isConnected()) {
2129  Fw::LogBuffer _logBuff;
2131 
2132 #if FW_AMPCS_COMPATIBLE
2133  // Serialize the number of arguments
2134  _status = _logBuff.serialize(static_cast<U8>(1));
2135  FW_ASSERT(
2136  _status == Fw::FW_SERIALIZE_OK,
2137  static_cast<FwAssertArgType>(_status)
2138  );
2139 #endif
2140 
2141  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2142  FW_ASSERT(
2143  _status == Fw::FW_SERIALIZE_OK,
2144  static_cast<FwAssertArgType>(_status)
2145  );
2146 
2147  this->m_logOut_OutputPort[0].invoke(
2148  _id,
2149  _logTime,
2151  _logBuff
2152  );
2153  }
2154 
2155  // Emit the event on the text log port
2156 #if FW_ENABLE_TEXT_LOGGING
2157  if (this->m_LogText_OutputPort[0].isConnected()) {
2158 #if FW_OBJECT_NAMES == 1
2159  const char* _formatString =
2160  "(%s) %s: Loaded sequence %s";
2161 #else
2162  const char* _formatString =
2163  "%s: Loaded sequence %s";
2164 #endif
2165 
2166  Fw::TextLogString _logString;
2167  _logString.format(
2168  _formatString,
2169 #if FW_OBJECT_NAMES == 1
2170  this->m_objName.toChar(),
2171 #endif
2172  "CS_SequenceLoaded ",
2173  fileName.toChar()
2174  );
2175 
2176  this->m_LogText_OutputPort[0].invoke(
2177  _id,
2178  _logTime,
2180  _logString
2181  );
2182  }
2183 #endif
2184  }
2185 
2188  {
2189  // Get the time
2190  Fw::Time _logTime;
2191  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2192  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2193  }
2194 
2195  FwEventIdType _id = static_cast<FwEventIdType>(0);
2196 
2197  _id = this->getIdBase() + EVENTID_CS_SEQUENCECANCELED;
2198 
2199  // Emit the event on the log port
2200  if (this->m_logOut_OutputPort[0].isConnected()) {
2201  Fw::LogBuffer _logBuff;
2203 
2204 #if FW_AMPCS_COMPATIBLE
2205  // Serialize the number of arguments
2206  _status = _logBuff.serialize(static_cast<U8>(1));
2207  FW_ASSERT(
2208  _status == Fw::FW_SERIALIZE_OK,
2209  static_cast<FwAssertArgType>(_status)
2210  );
2211 #endif
2212 
2213  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2214  FW_ASSERT(
2215  _status == Fw::FW_SERIALIZE_OK,
2216  static_cast<FwAssertArgType>(_status)
2217  );
2218 
2219  this->m_logOut_OutputPort[0].invoke(
2220  _id,
2221  _logTime,
2223  _logBuff
2224  );
2225  }
2226 
2227  // Emit the event on the text log port
2228 #if FW_ENABLE_TEXT_LOGGING
2229  if (this->m_LogText_OutputPort[0].isConnected()) {
2230 #if FW_OBJECT_NAMES == 1
2231  const char* _formatString =
2232  "(%s) %s: Sequence file %s canceled";
2233 #else
2234  const char* _formatString =
2235  "%s: Sequence file %s canceled";
2236 #endif
2237 
2238  Fw::TextLogString _logString;
2239  _logString.format(
2240  _formatString,
2241 #if FW_OBJECT_NAMES == 1
2242  this->m_objName.toChar(),
2243 #endif
2244  "CS_SequenceCanceled ",
2245  fileName.toChar()
2246  );
2247 
2248  this->m_LogText_OutputPort[0].invoke(
2249  _id,
2250  _logTime,
2252  _logString
2253  );
2254  }
2255 #endif
2256  }
2257 
2260  {
2261  // Get the time
2262  Fw::Time _logTime;
2263  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2264  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2265  }
2266 
2267  FwEventIdType _id = static_cast<FwEventIdType>(0);
2268 
2269  _id = this->getIdBase() + EVENTID_CS_FILEREADERROR;
2270 
2271  // Emit the event on the log port
2272  if (this->m_logOut_OutputPort[0].isConnected()) {
2273  Fw::LogBuffer _logBuff;
2275 
2276 #if FW_AMPCS_COMPATIBLE
2277  // Serialize the number of arguments
2278  _status = _logBuff.serialize(static_cast<U8>(1));
2279  FW_ASSERT(
2280  _status == Fw::FW_SERIALIZE_OK,
2281  static_cast<FwAssertArgType>(_status)
2282  );
2283 #endif
2284 
2285  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2286  FW_ASSERT(
2287  _status == Fw::FW_SERIALIZE_OK,
2288  static_cast<FwAssertArgType>(_status)
2289  );
2290 
2291  this->m_logOut_OutputPort[0].invoke(
2292  _id,
2293  _logTime,
2295  _logBuff
2296  );
2297  }
2298 
2299  // Emit the event on the text log port
2300 #if FW_ENABLE_TEXT_LOGGING
2301  if (this->m_LogText_OutputPort[0].isConnected()) {
2302 #if FW_OBJECT_NAMES == 1
2303  const char* _formatString =
2304  "(%s) %s: Error reading sequence file %s";
2305 #else
2306  const char* _formatString =
2307  "%s: Error reading sequence file %s";
2308 #endif
2309 
2310  Fw::TextLogString _logString;
2311  _logString.format(
2312  _formatString,
2313 #if FW_OBJECT_NAMES == 1
2314  this->m_objName.toChar(),
2315 #endif
2316  "CS_FileReadError ",
2317  fileName.toChar()
2318  );
2319 
2320  this->m_LogText_OutputPort[0].invoke(
2321  _id,
2322  _logTime,
2324  _logString
2325  );
2326  }
2327 #endif
2328  }
2329 
2332  const Fw::StringBase& fileName,
2334  I32 error
2335  ) const
2336  {
2337  // Get the time
2338  Fw::Time _logTime;
2339  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2340  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2341  }
2342 
2343  FwEventIdType _id = static_cast<FwEventIdType>(0);
2344 
2345  _id = this->getIdBase() + EVENTID_CS_FILEINVALID;
2346 
2347  // Emit the event on the log port
2348  if (this->m_logOut_OutputPort[0].isConnected()) {
2349  Fw::LogBuffer _logBuff;
2351 
2352 #if FW_AMPCS_COMPATIBLE
2353  // Serialize the number of arguments
2354  _status = _logBuff.serialize(static_cast<U8>(3));
2355  FW_ASSERT(
2356  _status == Fw::FW_SERIALIZE_OK,
2357  static_cast<FwAssertArgType>(_status)
2358  );
2359 #endif
2360 
2361  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2362  FW_ASSERT(
2363  _status == Fw::FW_SERIALIZE_OK,
2364  static_cast<FwAssertArgType>(_status)
2365  );
2366 
2367 #if FW_AMPCS_COMPATIBLE
2368  // Serialize the argument size
2369  _status = _logBuff.serialize(
2371  );
2372  FW_ASSERT(
2373  _status == Fw::FW_SERIALIZE_OK,
2374  static_cast<FwAssertArgType>(_status)
2375  );
2376 #endif
2377  _status = _logBuff.serialize(stage);
2378  FW_ASSERT(
2379  _status == Fw::FW_SERIALIZE_OK,
2380  static_cast<FwAssertArgType>(_status)
2381  );
2382 
2383 #if FW_AMPCS_COMPATIBLE
2384  // Serialize the argument size
2385  _status = _logBuff.serialize(
2386  static_cast<U8>(sizeof(I32))
2387  );
2388  FW_ASSERT(
2389  _status == Fw::FW_SERIALIZE_OK,
2390  static_cast<FwAssertArgType>(_status)
2391  );
2392 #endif
2393  _status = _logBuff.serialize(error);
2394  FW_ASSERT(
2395  _status == Fw::FW_SERIALIZE_OK,
2396  static_cast<FwAssertArgType>(_status)
2397  );
2398 
2399  this->m_logOut_OutputPort[0].invoke(
2400  _id,
2401  _logTime,
2403  _logBuff
2404  );
2405  }
2406 
2407  // Emit the event on the text log port
2408 #if FW_ENABLE_TEXT_LOGGING
2409  if (this->m_LogText_OutputPort[0].isConnected()) {
2410 #if FW_OBJECT_NAMES == 1
2411  const char* _formatString =
2412  "(%s) %s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2413 #else
2414  const char* _formatString =
2415  "%s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2416 #endif
2417 
2418  Fw::String stageStr;
2419  stage.toString(stageStr);
2420 
2421  Fw::TextLogString _logString;
2422  _logString.format(
2423  _formatString,
2424 #if FW_OBJECT_NAMES == 1
2425  this->m_objName.toChar(),
2426 #endif
2427  "CS_FileInvalid ",
2428  fileName.toChar(),
2429  stageStr.toChar(),
2430  error
2431  );
2432 
2433  this->m_LogText_OutputPort[0].invoke(
2434  _id,
2435  _logTime,
2437  _logString
2438  );
2439  }
2440 #endif
2441  }
2442 
2445  const Fw::StringBase& fileName,
2446  U32 recordNumber,
2447  I32 error
2448  ) const
2449  {
2450  // Get the time
2451  Fw::Time _logTime;
2452  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2453  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2454  }
2455 
2456  FwEventIdType _id = static_cast<FwEventIdType>(0);
2457 
2458  _id = this->getIdBase() + EVENTID_CS_RECORDINVALID;
2459 
2460  // Emit the event on the log port
2461  if (this->m_logOut_OutputPort[0].isConnected()) {
2462  Fw::LogBuffer _logBuff;
2464 
2465 #if FW_AMPCS_COMPATIBLE
2466  // Serialize the number of arguments
2467  _status = _logBuff.serialize(static_cast<U8>(3));
2468  FW_ASSERT(
2469  _status == Fw::FW_SERIALIZE_OK,
2470  static_cast<FwAssertArgType>(_status)
2471  );
2472 #endif
2473 
2474  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2475  FW_ASSERT(
2476  _status == Fw::FW_SERIALIZE_OK,
2477  static_cast<FwAssertArgType>(_status)
2478  );
2479 
2480 #if FW_AMPCS_COMPATIBLE
2481  // Serialize the argument size
2482  _status = _logBuff.serialize(
2483  static_cast<U8>(sizeof(U32))
2484  );
2485  FW_ASSERT(
2486  _status == Fw::FW_SERIALIZE_OK,
2487  static_cast<FwAssertArgType>(_status)
2488  );
2489 #endif
2490  _status = _logBuff.serialize(recordNumber);
2491  FW_ASSERT(
2492  _status == Fw::FW_SERIALIZE_OK,
2493  static_cast<FwAssertArgType>(_status)
2494  );
2495 
2496 #if FW_AMPCS_COMPATIBLE
2497  // Serialize the argument size
2498  _status = _logBuff.serialize(
2499  static_cast<U8>(sizeof(I32))
2500  );
2501  FW_ASSERT(
2502  _status == Fw::FW_SERIALIZE_OK,
2503  static_cast<FwAssertArgType>(_status)
2504  );
2505 #endif
2506  _status = _logBuff.serialize(error);
2507  FW_ASSERT(
2508  _status == Fw::FW_SERIALIZE_OK,
2509  static_cast<FwAssertArgType>(_status)
2510  );
2511 
2512  this->m_logOut_OutputPort[0].invoke(
2513  _id,
2514  _logTime,
2516  _logBuff
2517  );
2518  }
2519 
2520  // Emit the event on the text log port
2521 #if FW_ENABLE_TEXT_LOGGING
2522  if (this->m_LogText_OutputPort[0].isConnected()) {
2523 #if FW_OBJECT_NAMES == 1
2524  const char* _formatString =
2525  "(%s) %s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2526 #else
2527  const char* _formatString =
2528  "%s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2529 #endif
2530 
2531  Fw::TextLogString _logString;
2532  _logString.format(
2533  _formatString,
2534 #if FW_OBJECT_NAMES == 1
2535  this->m_objName.toChar(),
2536 #endif
2537  "CS_RecordInvalid ",
2538  fileName.toChar(),
2539  recordNumber,
2540  error
2541  );
2542 
2543  this->m_LogText_OutputPort[0].invoke(
2544  _id,
2545  _logTime,
2547  _logString
2548  );
2549  }
2550 #endif
2551  }
2552 
2555  const Fw::StringBase& fileName,
2556  U32 size
2557  ) const
2558  {
2559  // Get the time
2560  Fw::Time _logTime;
2561  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2562  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2563  }
2564 
2565  FwEventIdType _id = static_cast<FwEventIdType>(0);
2566 
2567  _id = this->getIdBase() + EVENTID_CS_FILESIZEERROR;
2568 
2569  // Emit the event on the log port
2570  if (this->m_logOut_OutputPort[0].isConnected()) {
2571  Fw::LogBuffer _logBuff;
2573 
2574 #if FW_AMPCS_COMPATIBLE
2575  // Serialize the number of arguments
2576  _status = _logBuff.serialize(static_cast<U8>(2));
2577  FW_ASSERT(
2578  _status == Fw::FW_SERIALIZE_OK,
2579  static_cast<FwAssertArgType>(_status)
2580  );
2581 #endif
2582 
2583  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2584  FW_ASSERT(
2585  _status == Fw::FW_SERIALIZE_OK,
2586  static_cast<FwAssertArgType>(_status)
2587  );
2588 
2589 #if FW_AMPCS_COMPATIBLE
2590  // Serialize the argument size
2591  _status = _logBuff.serialize(
2592  static_cast<U8>(sizeof(U32))
2593  );
2594  FW_ASSERT(
2595  _status == Fw::FW_SERIALIZE_OK,
2596  static_cast<FwAssertArgType>(_status)
2597  );
2598 #endif
2599  _status = _logBuff.serialize(size);
2600  FW_ASSERT(
2601  _status == Fw::FW_SERIALIZE_OK,
2602  static_cast<FwAssertArgType>(_status)
2603  );
2604 
2605  this->m_logOut_OutputPort[0].invoke(
2606  _id,
2607  _logTime,
2609  _logBuff
2610  );
2611  }
2612 
2613  // Emit the event on the text log port
2614 #if FW_ENABLE_TEXT_LOGGING
2615  if (this->m_LogText_OutputPort[0].isConnected()) {
2616 #if FW_OBJECT_NAMES == 1
2617  const char* _formatString =
2618  "(%s) %s: Sequence file %s too large. Size: %" PRIu32 "";
2619 #else
2620  const char* _formatString =
2621  "%s: Sequence file %s too large. Size: %" PRIu32 "";
2622 #endif
2623 
2624  Fw::TextLogString _logString;
2625  _logString.format(
2626  _formatString,
2627 #if FW_OBJECT_NAMES == 1
2628  this->m_objName.toChar(),
2629 #endif
2630  "CS_FileSizeError ",
2631  fileName.toChar(),
2632  size
2633  );
2634 
2635  this->m_LogText_OutputPort[0].invoke(
2636  _id,
2637  _logTime,
2639  _logString
2640  );
2641  }
2642 #endif
2643  }
2644 
2647  {
2648  // Get the time
2649  Fw::Time _logTime;
2650  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2651  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2652  }
2653 
2654  FwEventIdType _id = static_cast<FwEventIdType>(0);
2655 
2656  _id = this->getIdBase() + EVENTID_CS_FILENOTFOUND;
2657 
2658  // Emit the event on the log port
2659  if (this->m_logOut_OutputPort[0].isConnected()) {
2660  Fw::LogBuffer _logBuff;
2662 
2663 #if FW_AMPCS_COMPATIBLE
2664  // Serialize the number of arguments
2665  _status = _logBuff.serialize(static_cast<U8>(1));
2666  FW_ASSERT(
2667  _status == Fw::FW_SERIALIZE_OK,
2668  static_cast<FwAssertArgType>(_status)
2669  );
2670 #endif
2671 
2672  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2673  FW_ASSERT(
2674  _status == Fw::FW_SERIALIZE_OK,
2675  static_cast<FwAssertArgType>(_status)
2676  );
2677 
2678  this->m_logOut_OutputPort[0].invoke(
2679  _id,
2680  _logTime,
2682  _logBuff
2683  );
2684  }
2685 
2686  // Emit the event on the text log port
2687 #if FW_ENABLE_TEXT_LOGGING
2688  if (this->m_LogText_OutputPort[0].isConnected()) {
2689 #if FW_OBJECT_NAMES == 1
2690  const char* _formatString =
2691  "(%s) %s: Sequence file %s not found.";
2692 #else
2693  const char* _formatString =
2694  "%s: Sequence file %s not found.";
2695 #endif
2696 
2697  Fw::TextLogString _logString;
2698  _logString.format(
2699  _formatString,
2700 #if FW_OBJECT_NAMES == 1
2701  this->m_objName.toChar(),
2702 #endif
2703  "CS_FileNotFound ",
2704  fileName.toChar()
2705  );
2706 
2707  this->m_LogText_OutputPort[0].invoke(
2708  _id,
2709  _logTime,
2711  _logString
2712  );
2713  }
2714 #endif
2715  }
2716 
2719  const Fw::StringBase& fileName,
2720  U32 storedCRC,
2721  U32 computedCRC
2722  ) const
2723  {
2724  // Get the time
2725  Fw::Time _logTime;
2726  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2727  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2728  }
2729 
2730  FwEventIdType _id = static_cast<FwEventIdType>(0);
2731 
2732  _id = this->getIdBase() + EVENTID_CS_FILECRCFAILURE;
2733 
2734  // Emit the event on the log port
2735  if (this->m_logOut_OutputPort[0].isConnected()) {
2736  Fw::LogBuffer _logBuff;
2738 
2739 #if FW_AMPCS_COMPATIBLE
2740  // Serialize the number of arguments
2741  _status = _logBuff.serialize(static_cast<U8>(3));
2742  FW_ASSERT(
2743  _status == Fw::FW_SERIALIZE_OK,
2744  static_cast<FwAssertArgType>(_status)
2745  );
2746 #endif
2747 
2748  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2749  FW_ASSERT(
2750  _status == Fw::FW_SERIALIZE_OK,
2751  static_cast<FwAssertArgType>(_status)
2752  );
2753 
2754 #if FW_AMPCS_COMPATIBLE
2755  // Serialize the argument size
2756  _status = _logBuff.serialize(
2757  static_cast<U8>(sizeof(U32))
2758  );
2759  FW_ASSERT(
2760  _status == Fw::FW_SERIALIZE_OK,
2761  static_cast<FwAssertArgType>(_status)
2762  );
2763 #endif
2764  _status = _logBuff.serialize(storedCRC);
2765  FW_ASSERT(
2766  _status == Fw::FW_SERIALIZE_OK,
2767  static_cast<FwAssertArgType>(_status)
2768  );
2769 
2770 #if FW_AMPCS_COMPATIBLE
2771  // Serialize the argument size
2772  _status = _logBuff.serialize(
2773  static_cast<U8>(sizeof(U32))
2774  );
2775  FW_ASSERT(
2776  _status == Fw::FW_SERIALIZE_OK,
2777  static_cast<FwAssertArgType>(_status)
2778  );
2779 #endif
2780  _status = _logBuff.serialize(computedCRC);
2781  FW_ASSERT(
2782  _status == Fw::FW_SERIALIZE_OK,
2783  static_cast<FwAssertArgType>(_status)
2784  );
2785 
2786  this->m_logOut_OutputPort[0].invoke(
2787  _id,
2788  _logTime,
2790  _logBuff
2791  );
2792  }
2793 
2794  // Emit the event on the text log port
2795 #if FW_ENABLE_TEXT_LOGGING
2796  if (this->m_LogText_OutputPort[0].isConnected()) {
2797 #if FW_OBJECT_NAMES == 1
2798  const char* _formatString =
2799  "(%s) %s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2800 #else
2801  const char* _formatString =
2802  "%s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2803 #endif
2804 
2805  Fw::TextLogString _logString;
2806  _logString.format(
2807  _formatString,
2808 #if FW_OBJECT_NAMES == 1
2809  this->m_objName.toChar(),
2810 #endif
2811  "CS_FileCrcFailure ",
2812  fileName.toChar(),
2813  storedCRC,
2814  computedCRC
2815  );
2816 
2817  this->m_LogText_OutputPort[0].invoke(
2818  _id,
2819  _logTime,
2821  _logString
2822  );
2823  }
2824 #endif
2825  }
2826 
2829  const Fw::StringBase& fileName,
2830  U32 recordNumber,
2831  U32 opCode
2832  ) const
2833  {
2834  // Get the time
2835  Fw::Time _logTime;
2836  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2837  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2838  }
2839 
2840  FwEventIdType _id = static_cast<FwEventIdType>(0);
2841 
2842  _id = this->getIdBase() + EVENTID_CS_COMMANDCOMPLETE;
2843 
2844  // Emit the event on the log port
2845  if (this->m_logOut_OutputPort[0].isConnected()) {
2846  Fw::LogBuffer _logBuff;
2848 
2849 #if FW_AMPCS_COMPATIBLE
2850  // Serialize the number of arguments
2851  _status = _logBuff.serialize(static_cast<U8>(3));
2852  FW_ASSERT(
2853  _status == Fw::FW_SERIALIZE_OK,
2854  static_cast<FwAssertArgType>(_status)
2855  );
2856 #endif
2857 
2858  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2859  FW_ASSERT(
2860  _status == Fw::FW_SERIALIZE_OK,
2861  static_cast<FwAssertArgType>(_status)
2862  );
2863 
2864 #if FW_AMPCS_COMPATIBLE
2865  // Serialize the argument size
2866  _status = _logBuff.serialize(
2867  static_cast<U8>(sizeof(U32))
2868  );
2869  FW_ASSERT(
2870  _status == Fw::FW_SERIALIZE_OK,
2871  static_cast<FwAssertArgType>(_status)
2872  );
2873 #endif
2874  _status = _logBuff.serialize(recordNumber);
2875  FW_ASSERT(
2876  _status == Fw::FW_SERIALIZE_OK,
2877  static_cast<FwAssertArgType>(_status)
2878  );
2879 
2880 #if FW_AMPCS_COMPATIBLE
2881  // Serialize the argument size
2882  _status = _logBuff.serialize(
2883  static_cast<U8>(sizeof(U32))
2884  );
2885  FW_ASSERT(
2886  _status == Fw::FW_SERIALIZE_OK,
2887  static_cast<FwAssertArgType>(_status)
2888  );
2889 #endif
2890  _status = _logBuff.serialize(opCode);
2891  FW_ASSERT(
2892  _status == Fw::FW_SERIALIZE_OK,
2893  static_cast<FwAssertArgType>(_status)
2894  );
2895 
2896  this->m_logOut_OutputPort[0].invoke(
2897  _id,
2898  _logTime,
2900  _logBuff
2901  );
2902  }
2903 
2904  // Emit the event on the text log port
2905 #if FW_ENABLE_TEXT_LOGGING
2906  if (this->m_LogText_OutputPort[0].isConnected()) {
2907 #if FW_OBJECT_NAMES == 1
2908  const char* _formatString =
2909  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
2910 #else
2911  const char* _formatString =
2912  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
2913 #endif
2914 
2915  Fw::TextLogString _logString;
2916  _logString.format(
2917  _formatString,
2918 #if FW_OBJECT_NAMES == 1
2919  this->m_objName.toChar(),
2920 #endif
2921  "CS_CommandComplete ",
2922  fileName.toChar(),
2923  recordNumber,
2924  opCode
2925  );
2926 
2927  this->m_LogText_OutputPort[0].invoke(
2928  _id,
2929  _logTime,
2931  _logString
2932  );
2933  }
2934 #endif
2935  }
2936 
2939  {
2940  // Get the time
2941  Fw::Time _logTime;
2942  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2943  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2944  }
2945 
2946  FwEventIdType _id = static_cast<FwEventIdType>(0);
2947 
2948  _id = this->getIdBase() + EVENTID_CS_SEQUENCECOMPLETE;
2949 
2950  // Emit the event on the log port
2951  if (this->m_logOut_OutputPort[0].isConnected()) {
2952  Fw::LogBuffer _logBuff;
2954 
2955 #if FW_AMPCS_COMPATIBLE
2956  // Serialize the number of arguments
2957  _status = _logBuff.serialize(static_cast<U8>(1));
2958  FW_ASSERT(
2959  _status == Fw::FW_SERIALIZE_OK,
2960  static_cast<FwAssertArgType>(_status)
2961  );
2962 #endif
2963 
2964  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2965  FW_ASSERT(
2966  _status == Fw::FW_SERIALIZE_OK,
2967  static_cast<FwAssertArgType>(_status)
2968  );
2969 
2970  this->m_logOut_OutputPort[0].invoke(
2971  _id,
2972  _logTime,
2974  _logBuff
2975  );
2976  }
2977 
2978  // Emit the event on the text log port
2979 #if FW_ENABLE_TEXT_LOGGING
2980  if (this->m_LogText_OutputPort[0].isConnected()) {
2981 #if FW_OBJECT_NAMES == 1
2982  const char* _formatString =
2983  "(%s) %s: Sequence file %s complete";
2984 #else
2985  const char* _formatString =
2986  "%s: Sequence file %s complete";
2987 #endif
2988 
2989  Fw::TextLogString _logString;
2990  _logString.format(
2991  _formatString,
2992 #if FW_OBJECT_NAMES == 1
2993  this->m_objName.toChar(),
2994 #endif
2995  "CS_SequenceComplete ",
2996  fileName.toChar()
2997  );
2998 
2999  this->m_LogText_OutputPort[0].invoke(
3000  _id,
3001  _logTime,
3003  _logString
3004  );
3005  }
3006 #endif
3007  }
3008 
3011  const Fw::StringBase& fileName,
3012  U32 recordNumber,
3013  U32 opCode,
3014  U32 errorStatus
3015  ) const
3016  {
3017  // Get the time
3018  Fw::Time _logTime;
3019  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3020  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3021  }
3022 
3023  FwEventIdType _id = static_cast<FwEventIdType>(0);
3024 
3025  _id = this->getIdBase() + EVENTID_CS_COMMANDERROR;
3026 
3027  // Emit the event on the log port
3028  if (this->m_logOut_OutputPort[0].isConnected()) {
3029  Fw::LogBuffer _logBuff;
3031 
3032 #if FW_AMPCS_COMPATIBLE
3033  // Serialize the number of arguments
3034  _status = _logBuff.serialize(static_cast<U8>(4));
3035  FW_ASSERT(
3036  _status == Fw::FW_SERIALIZE_OK,
3037  static_cast<FwAssertArgType>(_status)
3038  );
3039 #endif
3040 
3041  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3042  FW_ASSERT(
3043  _status == Fw::FW_SERIALIZE_OK,
3044  static_cast<FwAssertArgType>(_status)
3045  );
3046 
3047 #if FW_AMPCS_COMPATIBLE
3048  // Serialize the argument size
3049  _status = _logBuff.serialize(
3050  static_cast<U8>(sizeof(U32))
3051  );
3052  FW_ASSERT(
3053  _status == Fw::FW_SERIALIZE_OK,
3054  static_cast<FwAssertArgType>(_status)
3055  );
3056 #endif
3057  _status = _logBuff.serialize(recordNumber);
3058  FW_ASSERT(
3059  _status == Fw::FW_SERIALIZE_OK,
3060  static_cast<FwAssertArgType>(_status)
3061  );
3062 
3063 #if FW_AMPCS_COMPATIBLE
3064  // Serialize the argument size
3065  _status = _logBuff.serialize(
3066  static_cast<U8>(sizeof(U32))
3067  );
3068  FW_ASSERT(
3069  _status == Fw::FW_SERIALIZE_OK,
3070  static_cast<FwAssertArgType>(_status)
3071  );
3072 #endif
3073  _status = _logBuff.serialize(opCode);
3074  FW_ASSERT(
3075  _status == Fw::FW_SERIALIZE_OK,
3076  static_cast<FwAssertArgType>(_status)
3077  );
3078 
3079 #if FW_AMPCS_COMPATIBLE
3080  // Serialize the argument size
3081  _status = _logBuff.serialize(
3082  static_cast<U8>(sizeof(U32))
3083  );
3084  FW_ASSERT(
3085  _status == Fw::FW_SERIALIZE_OK,
3086  static_cast<FwAssertArgType>(_status)
3087  );
3088 #endif
3089  _status = _logBuff.serialize(errorStatus);
3090  FW_ASSERT(
3091  _status == Fw::FW_SERIALIZE_OK,
3092  static_cast<FwAssertArgType>(_status)
3093  );
3094 
3095  this->m_logOut_OutputPort[0].invoke(
3096  _id,
3097  _logTime,
3099  _logBuff
3100  );
3101  }
3102 
3103  // Emit the event on the text log port
3104 #if FW_ENABLE_TEXT_LOGGING
3105  if (this->m_LogText_OutputPort[0].isConnected()) {
3106 #if FW_OBJECT_NAMES == 1
3107  const char* _formatString =
3108  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3109 #else
3110  const char* _formatString =
3111  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3112 #endif
3113 
3114  Fw::TextLogString _logString;
3115  _logString.format(
3116  _formatString,
3117 #if FW_OBJECT_NAMES == 1
3118  this->m_objName.toChar(),
3119 #endif
3120  "CS_CommandError ",
3121  fileName.toChar(),
3122  recordNumber,
3123  opCode,
3124  errorStatus
3125  );
3126 
3127  this->m_LogText_OutputPort[0].invoke(
3128  _id,
3129  _logTime,
3131  _logString
3132  );
3133  }
3134 #endif
3135  }
3136 
3139  {
3140  // Get the time
3141  Fw::Time _logTime;
3142  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3143  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3144  }
3145 
3146  FwEventIdType _id = static_cast<FwEventIdType>(0);
3147 
3148  _id = this->getIdBase() + EVENTID_CS_INVALIDMODE;
3149 
3150  // Emit the event on the log port
3151  if (this->m_logOut_OutputPort[0].isConnected()) {
3152  Fw::LogBuffer _logBuff;
3153 
3154 #if FW_AMPCS_COMPATIBLE
3156  // Serialize the number of arguments
3157  _status = _logBuff.serialize(static_cast<U8>(0));
3158  FW_ASSERT(
3159  _status == Fw::FW_SERIALIZE_OK,
3160  static_cast<FwAssertArgType>(_status)
3161  );
3162 #endif
3163 
3164  this->m_logOut_OutputPort[0].invoke(
3165  _id,
3166  _logTime,
3168  _logBuff
3169  );
3170  }
3171 
3172  // Emit the event on the text log port
3173 #if FW_ENABLE_TEXT_LOGGING
3174  if (this->m_LogText_OutputPort[0].isConnected()) {
3175 #if FW_OBJECT_NAMES == 1
3176  const char* _formatString =
3177  "(%s) %s: Invalid mode";
3178 #else
3179  const char* _formatString =
3180  "%s: Invalid mode";
3181 #endif
3182 
3183  Fw::TextLogString _logString;
3184  _logString.format(
3185  _formatString,
3186 #if FW_OBJECT_NAMES == 1
3187  this->m_objName.toChar(),
3188 #endif
3189  "CS_InvalidMode "
3190  );
3191 
3192  this->m_LogText_OutputPort[0].invoke(
3193  _id,
3194  _logTime,
3196  _logString
3197  );
3198  }
3199 #endif
3200  }
3201 
3204  const Fw::StringBase& fileName,
3205  U32 header_records,
3206  U32 extra_bytes
3207  ) const
3208  {
3209  // Get the time
3210  Fw::Time _logTime;
3211  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3212  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3213  }
3214 
3215  FwEventIdType _id = static_cast<FwEventIdType>(0);
3216 
3217  _id = this->getIdBase() + EVENTID_CS_RECORDMISMATCH;
3218 
3219  // Emit the event on the log port
3220  if (this->m_logOut_OutputPort[0].isConnected()) {
3221  Fw::LogBuffer _logBuff;
3223 
3224 #if FW_AMPCS_COMPATIBLE
3225  // Serialize the number of arguments
3226  _status = _logBuff.serialize(static_cast<U8>(3));
3227  FW_ASSERT(
3228  _status == Fw::FW_SERIALIZE_OK,
3229  static_cast<FwAssertArgType>(_status)
3230  );
3231 #endif
3232 
3233  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3234  FW_ASSERT(
3235  _status == Fw::FW_SERIALIZE_OK,
3236  static_cast<FwAssertArgType>(_status)
3237  );
3238 
3239 #if FW_AMPCS_COMPATIBLE
3240  // Serialize the argument size
3241  _status = _logBuff.serialize(
3242  static_cast<U8>(sizeof(U32))
3243  );
3244  FW_ASSERT(
3245  _status == Fw::FW_SERIALIZE_OK,
3246  static_cast<FwAssertArgType>(_status)
3247  );
3248 #endif
3249  _status = _logBuff.serialize(header_records);
3250  FW_ASSERT(
3251  _status == Fw::FW_SERIALIZE_OK,
3252  static_cast<FwAssertArgType>(_status)
3253  );
3254 
3255 #if FW_AMPCS_COMPATIBLE
3256  // Serialize the argument size
3257  _status = _logBuff.serialize(
3258  static_cast<U8>(sizeof(U32))
3259  );
3260  FW_ASSERT(
3261  _status == Fw::FW_SERIALIZE_OK,
3262  static_cast<FwAssertArgType>(_status)
3263  );
3264 #endif
3265  _status = _logBuff.serialize(extra_bytes);
3266  FW_ASSERT(
3267  _status == Fw::FW_SERIALIZE_OK,
3268  static_cast<FwAssertArgType>(_status)
3269  );
3270 
3271  this->m_logOut_OutputPort[0].invoke(
3272  _id,
3273  _logTime,
3275  _logBuff
3276  );
3277  }
3278 
3279  // Emit the event on the text log port
3280 #if FW_ENABLE_TEXT_LOGGING
3281  if (this->m_LogText_OutputPort[0].isConnected()) {
3282 #if FW_OBJECT_NAMES == 1
3283  const char* _formatString =
3284  "(%s) %s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3285 #else
3286  const char* _formatString =
3287  "%s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3288 #endif
3289 
3290  Fw::TextLogString _logString;
3291  _logString.format(
3292  _formatString,
3293 #if FW_OBJECT_NAMES == 1
3294  this->m_objName.toChar(),
3295 #endif
3296  "CS_RecordMismatch ",
3297  fileName.toChar(),
3298  header_records,
3299  extra_bytes
3300  );
3301 
3302  this->m_LogText_OutputPort[0].invoke(
3303  _id,
3304  _logTime,
3306  _logString
3307  );
3308  }
3309 #endif
3310  }
3311 
3314  const Fw::StringBase& fileName,
3315  U16 time_base,
3316  U16 seq_time_base
3317  ) const
3318  {
3319  // Get the time
3320  Fw::Time _logTime;
3321  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3322  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3323  }
3324 
3325  FwEventIdType _id = static_cast<FwEventIdType>(0);
3326 
3327  _id = this->getIdBase() + EVENTID_CS_TIMEBASEMISMATCH;
3328 
3329  // Emit the event on the log port
3330  if (this->m_logOut_OutputPort[0].isConnected()) {
3331  Fw::LogBuffer _logBuff;
3333 
3334 #if FW_AMPCS_COMPATIBLE
3335  // Serialize the number of arguments
3336  _status = _logBuff.serialize(static_cast<U8>(3));
3337  FW_ASSERT(
3338  _status == Fw::FW_SERIALIZE_OK,
3339  static_cast<FwAssertArgType>(_status)
3340  );
3341 #endif
3342 
3343  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3344  FW_ASSERT(
3345  _status == Fw::FW_SERIALIZE_OK,
3346  static_cast<FwAssertArgType>(_status)
3347  );
3348 
3349 #if FW_AMPCS_COMPATIBLE
3350  // Serialize the argument size
3351  _status = _logBuff.serialize(
3352  static_cast<U8>(sizeof(U16))
3353  );
3354  FW_ASSERT(
3355  _status == Fw::FW_SERIALIZE_OK,
3356  static_cast<FwAssertArgType>(_status)
3357  );
3358 #endif
3359  _status = _logBuff.serialize(time_base);
3360  FW_ASSERT(
3361  _status == Fw::FW_SERIALIZE_OK,
3362  static_cast<FwAssertArgType>(_status)
3363  );
3364 
3365 #if FW_AMPCS_COMPATIBLE
3366  // Serialize the argument size
3367  _status = _logBuff.serialize(
3368  static_cast<U8>(sizeof(U16))
3369  );
3370  FW_ASSERT(
3371  _status == Fw::FW_SERIALIZE_OK,
3372  static_cast<FwAssertArgType>(_status)
3373  );
3374 #endif
3375  _status = _logBuff.serialize(seq_time_base);
3376  FW_ASSERT(
3377  _status == Fw::FW_SERIALIZE_OK,
3378  static_cast<FwAssertArgType>(_status)
3379  );
3380 
3381  this->m_logOut_OutputPort[0].invoke(
3382  _id,
3383  _logTime,
3385  _logBuff
3386  );
3387  }
3388 
3389  // Emit the event on the text log port
3390 #if FW_ENABLE_TEXT_LOGGING
3391  if (this->m_LogText_OutputPort[0].isConnected()) {
3392 #if FW_OBJECT_NAMES == 1
3393  const char* _formatString =
3394  "(%s) %s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3395 #else
3396  const char* _formatString =
3397  "%s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3398 #endif
3399 
3400  Fw::TextLogString _logString;
3401  _logString.format(
3402  _formatString,
3403 #if FW_OBJECT_NAMES == 1
3404  this->m_objName.toChar(),
3405 #endif
3406  "CS_TimeBaseMismatch ",
3407  fileName.toChar(),
3408  time_base,
3409  seq_time_base
3410  );
3411 
3412  this->m_LogText_OutputPort[0].invoke(
3413  _id,
3414  _logTime,
3416  _logString
3417  );
3418  }
3419 #endif
3420  }
3421 
3424  const Fw::StringBase& fileName,
3425  U8 currTimeBase,
3426  U8 seqTimeBase
3427  ) const
3428  {
3429  // Get the time
3430  Fw::Time _logTime;
3431  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3432  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3433  }
3434 
3435  FwEventIdType _id = static_cast<FwEventIdType>(0);
3436 
3437  _id = this->getIdBase() + EVENTID_CS_TIMECONTEXTMISMATCH;
3438 
3439  // Emit the event on the log port
3440  if (this->m_logOut_OutputPort[0].isConnected()) {
3441  Fw::LogBuffer _logBuff;
3443 
3444 #if FW_AMPCS_COMPATIBLE
3445  // Serialize the number of arguments
3446  _status = _logBuff.serialize(static_cast<U8>(3));
3447  FW_ASSERT(
3448  _status == Fw::FW_SERIALIZE_OK,
3449  static_cast<FwAssertArgType>(_status)
3450  );
3451 #endif
3452 
3453  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3454  FW_ASSERT(
3455  _status == Fw::FW_SERIALIZE_OK,
3456  static_cast<FwAssertArgType>(_status)
3457  );
3458 
3459 #if FW_AMPCS_COMPATIBLE
3460  // Serialize the argument size
3461  _status = _logBuff.serialize(
3462  static_cast<U8>(sizeof(U8))
3463  );
3464  FW_ASSERT(
3465  _status == Fw::FW_SERIALIZE_OK,
3466  static_cast<FwAssertArgType>(_status)
3467  );
3468 #endif
3469  _status = _logBuff.serialize(currTimeBase);
3470  FW_ASSERT(
3471  _status == Fw::FW_SERIALIZE_OK,
3472  static_cast<FwAssertArgType>(_status)
3473  );
3474 
3475 #if FW_AMPCS_COMPATIBLE
3476  // Serialize the argument size
3477  _status = _logBuff.serialize(
3478  static_cast<U8>(sizeof(U8))
3479  );
3480  FW_ASSERT(
3481  _status == Fw::FW_SERIALIZE_OK,
3482  static_cast<FwAssertArgType>(_status)
3483  );
3484 #endif
3485  _status = _logBuff.serialize(seqTimeBase);
3486  FW_ASSERT(
3487  _status == Fw::FW_SERIALIZE_OK,
3488  static_cast<FwAssertArgType>(_status)
3489  );
3490 
3491  this->m_logOut_OutputPort[0].invoke(
3492  _id,
3493  _logTime,
3495  _logBuff
3496  );
3497  }
3498 
3499  // Emit the event on the text log port
3500 #if FW_ENABLE_TEXT_LOGGING
3501  if (this->m_LogText_OutputPort[0].isConnected()) {
3502 #if FW_OBJECT_NAMES == 1
3503  const char* _formatString =
3504  "(%s) %s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3505 #else
3506  const char* _formatString =
3507  "%s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3508 #endif
3509 
3510  Fw::TextLogString _logString;
3511  _logString.format(
3512  _formatString,
3513 #if FW_OBJECT_NAMES == 1
3514  this->m_objName.toChar(),
3515 #endif
3516  "CS_TimeContextMismatch ",
3517  fileName.toChar(),
3518  currTimeBase,
3519  seqTimeBase
3520  );
3521 
3522  this->m_LogText_OutputPort[0].invoke(
3523  _id,
3524  _logTime,
3526  _logString
3527  );
3528  }
3529 #endif
3530  }
3531 
3534  {
3535  // Get the time
3536  Fw::Time _logTime;
3537  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3538  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3539  }
3540 
3541  FwEventIdType _id = static_cast<FwEventIdType>(0);
3542 
3543  _id = this->getIdBase() + EVENTID_CS_PORTSEQUENCESTARTED;
3544 
3545  // Emit the event on the log port
3546  if (this->m_logOut_OutputPort[0].isConnected()) {
3547  Fw::LogBuffer _logBuff;
3549 
3550 #if FW_AMPCS_COMPATIBLE
3551  // Serialize the number of arguments
3552  _status = _logBuff.serialize(static_cast<U8>(1));
3553  FW_ASSERT(
3554  _status == Fw::FW_SERIALIZE_OK,
3555  static_cast<FwAssertArgType>(_status)
3556  );
3557 #endif
3558 
3559  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3560  FW_ASSERT(
3561  _status == Fw::FW_SERIALIZE_OK,
3562  static_cast<FwAssertArgType>(_status)
3563  );
3564 
3565  this->m_logOut_OutputPort[0].invoke(
3566  _id,
3567  _logTime,
3569  _logBuff
3570  );
3571  }
3572 
3573  // Emit the event on the text log port
3574 #if FW_ENABLE_TEXT_LOGGING
3575  if (this->m_LogText_OutputPort[0].isConnected()) {
3576 #if FW_OBJECT_NAMES == 1
3577  const char* _formatString =
3578  "(%s) %s: Local request for sequence %s started.";
3579 #else
3580  const char* _formatString =
3581  "%s: Local request for sequence %s started.";
3582 #endif
3583 
3584  Fw::TextLogString _logString;
3585  _logString.format(
3586  _formatString,
3587 #if FW_OBJECT_NAMES == 1
3588  this->m_objName.toChar(),
3589 #endif
3590  "CS_PortSequenceStarted ",
3591  filename.toChar()
3592  );
3593 
3594  this->m_LogText_OutputPort[0].invoke(
3595  _id,
3596  _logTime,
3598  _logString
3599  );
3600  }
3601 #endif
3602  }
3603 
3606  {
3607  // Get the time
3608  Fw::Time _logTime;
3609  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3610  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3611  }
3612 
3613  FwEventIdType _id = static_cast<FwEventIdType>(0);
3614 
3616 
3617  // Emit the event on the log port
3618  if (this->m_logOut_OutputPort[0].isConnected()) {
3619  Fw::LogBuffer _logBuff;
3621 
3622 #if FW_AMPCS_COMPATIBLE
3623  // Serialize the number of arguments
3624  _status = _logBuff.serialize(static_cast<U8>(1));
3625  FW_ASSERT(
3626  _status == Fw::FW_SERIALIZE_OK,
3627  static_cast<FwAssertArgType>(_status)
3628  );
3629 #endif
3630 
3631 #if FW_AMPCS_COMPATIBLE
3632  // Serialize the argument size
3633  _status = _logBuff.serialize(
3634  static_cast<U8>(sizeof(U32))
3635  );
3636  FW_ASSERT(
3637  _status == Fw::FW_SERIALIZE_OK,
3638  static_cast<FwAssertArgType>(_status)
3639  );
3640 #endif
3641  _status = _logBuff.serialize(opcode);
3642  FW_ASSERT(
3643  _status == Fw::FW_SERIALIZE_OK,
3644  static_cast<FwAssertArgType>(_status)
3645  );
3646 
3647  this->m_logOut_OutputPort[0].invoke(
3648  _id,
3649  _logTime,
3651  _logBuff
3652  );
3653  }
3654 
3655  // Emit the event on the text log port
3656 #if FW_ENABLE_TEXT_LOGGING
3657  if (this->m_LogText_OutputPort[0].isConnected()) {
3658 #if FW_OBJECT_NAMES == 1
3659  const char* _formatString =
3660  "(%s) %s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3661 #else
3662  const char* _formatString =
3663  "%s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3664 #endif
3665 
3666  Fw::TextLogString _logString;
3667  _logString.format(
3668  _formatString,
3669 #if FW_OBJECT_NAMES == 1
3670  this->m_objName.toChar(),
3671 #endif
3672  "CS_UnexpectedCompletion ",
3673  opcode
3674  );
3675 
3676  this->m_LogText_OutputPort[0].invoke(
3677  _id,
3678  _logTime,
3680  _logString
3681  );
3682  }
3683 #endif
3684  }
3685 
3688  {
3689  // Get the time
3690  Fw::Time _logTime;
3691  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3692  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3693  }
3694 
3695  FwEventIdType _id = static_cast<FwEventIdType>(0);
3696 
3697  _id = this->getIdBase() + EVENTID_CS_MODESWITCHED;
3698 
3699  // Emit the event on the log port
3700  if (this->m_logOut_OutputPort[0].isConnected()) {
3701  Fw::LogBuffer _logBuff;
3703 
3704 #if FW_AMPCS_COMPATIBLE
3705  // Serialize the number of arguments
3706  _status = _logBuff.serialize(static_cast<U8>(1));
3707  FW_ASSERT(
3708  _status == Fw::FW_SERIALIZE_OK,
3709  static_cast<FwAssertArgType>(_status)
3710  );
3711 #endif
3712 
3713 #if FW_AMPCS_COMPATIBLE
3714  // Serialize the argument size
3715  _status = _logBuff.serialize(
3717  );
3718  FW_ASSERT(
3719  _status == Fw::FW_SERIALIZE_OK,
3720  static_cast<FwAssertArgType>(_status)
3721  );
3722 #endif
3723  _status = _logBuff.serialize(mode);
3724  FW_ASSERT(
3725  _status == Fw::FW_SERIALIZE_OK,
3726  static_cast<FwAssertArgType>(_status)
3727  );
3728 
3729  this->m_logOut_OutputPort[0].invoke(
3730  _id,
3731  _logTime,
3733  _logBuff
3734  );
3735  }
3736 
3737  // Emit the event on the text log port
3738 #if FW_ENABLE_TEXT_LOGGING
3739  if (this->m_LogText_OutputPort[0].isConnected()) {
3740 #if FW_OBJECT_NAMES == 1
3741  const char* _formatString =
3742  "(%s) %s: Sequencer switched to %s step mode";
3743 #else
3744  const char* _formatString =
3745  "%s: Sequencer switched to %s step mode";
3746 #endif
3747 
3748  Fw::String modeStr;
3749  mode.toString(modeStr);
3750 
3751  Fw::TextLogString _logString;
3752  _logString.format(
3753  _formatString,
3754 #if FW_OBJECT_NAMES == 1
3755  this->m_objName.toChar(),
3756 #endif
3757  "CS_ModeSwitched ",
3758  modeStr.toChar()
3759  );
3760 
3761  this->m_LogText_OutputPort[0].invoke(
3762  _id,
3763  _logTime,
3765  _logString
3766  );
3767  }
3768 #endif
3769  }
3770 
3773  {
3774  // Get the time
3775  Fw::Time _logTime;
3776  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3777  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3778  }
3779 
3780  FwEventIdType _id = static_cast<FwEventIdType>(0);
3781 
3782  _id = this->getIdBase() + EVENTID_CS_NOSEQUENCEACTIVE;
3783 
3784  // Emit the event on the log port
3785  if (this->m_logOut_OutputPort[0].isConnected()) {
3786  Fw::LogBuffer _logBuff;
3787 
3788 #if FW_AMPCS_COMPATIBLE
3790  // Serialize the number of arguments
3791  _status = _logBuff.serialize(static_cast<U8>(0));
3792  FW_ASSERT(
3793  _status == Fw::FW_SERIALIZE_OK,
3794  static_cast<FwAssertArgType>(_status)
3795  );
3796 #endif
3797 
3798  this->m_logOut_OutputPort[0].invoke(
3799  _id,
3800  _logTime,
3802  _logBuff
3803  );
3804  }
3805 
3806  // Emit the event on the text log port
3807 #if FW_ENABLE_TEXT_LOGGING
3808  if (this->m_LogText_OutputPort[0].isConnected()) {
3809 #if FW_OBJECT_NAMES == 1
3810  const char* _formatString =
3811  "(%s) %s: No sequence active.";
3812 #else
3813  const char* _formatString =
3814  "%s: No sequence active.";
3815 #endif
3816 
3817  Fw::TextLogString _logString;
3818  _logString.format(
3819  _formatString,
3820 #if FW_OBJECT_NAMES == 1
3821  this->m_objName.toChar(),
3822 #endif
3823  "CS_NoSequenceActive "
3824  );
3825 
3826  this->m_LogText_OutputPort[0].invoke(
3827  _id,
3828  _logTime,
3830  _logString
3831  );
3832  }
3833 #endif
3834  }
3835 
3838  {
3839  // Get the time
3840  Fw::Time _logTime;
3841  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3842  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3843  }
3844 
3845  FwEventIdType _id = static_cast<FwEventIdType>(0);
3846 
3847  _id = this->getIdBase() + EVENTID_CS_SEQUENCEVALID;
3848 
3849  // Emit the event on the log port
3850  if (this->m_logOut_OutputPort[0].isConnected()) {
3851  Fw::LogBuffer _logBuff;
3853 
3854 #if FW_AMPCS_COMPATIBLE
3855  // Serialize the number of arguments
3856  _status = _logBuff.serialize(static_cast<U8>(1));
3857  FW_ASSERT(
3858  _status == Fw::FW_SERIALIZE_OK,
3859  static_cast<FwAssertArgType>(_status)
3860  );
3861 #endif
3862 
3863  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3864  FW_ASSERT(
3865  _status == Fw::FW_SERIALIZE_OK,
3866  static_cast<FwAssertArgType>(_status)
3867  );
3868 
3869  this->m_logOut_OutputPort[0].invoke(
3870  _id,
3871  _logTime,
3873  _logBuff
3874  );
3875  }
3876 
3877  // Emit the event on the text log port
3878 #if FW_ENABLE_TEXT_LOGGING
3879  if (this->m_LogText_OutputPort[0].isConnected()) {
3880 #if FW_OBJECT_NAMES == 1
3881  const char* _formatString =
3882  "(%s) %s: Sequence %s is valid.";
3883 #else
3884  const char* _formatString =
3885  "%s: Sequence %s is valid.";
3886 #endif
3887 
3888  Fw::TextLogString _logString;
3889  _logString.format(
3890  _formatString,
3891 #if FW_OBJECT_NAMES == 1
3892  this->m_objName.toChar(),
3893 #endif
3894  "CS_SequenceValid ",
3895  filename.toChar()
3896  );
3897 
3898  this->m_LogText_OutputPort[0].invoke(
3899  _id,
3900  _logTime,
3902  _logString
3903  );
3904  }
3905 #endif
3906  }
3907 
3910  const Fw::StringBase& filename,
3911  U32 command
3912  ) const
3913  {
3914  // Get the time
3915  Fw::Time _logTime;
3916  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3917  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3918  }
3919 
3920  FwEventIdType _id = static_cast<FwEventIdType>(0);
3921 
3922  _id = this->getIdBase() + EVENTID_CS_SEQUENCETIMEOUT;
3923 
3924  // Emit the event on the log port
3925  if (this->m_logOut_OutputPort[0].isConnected()) {
3926  Fw::LogBuffer _logBuff;
3928 
3929 #if FW_AMPCS_COMPATIBLE
3930  // Serialize the number of arguments
3931  _status = _logBuff.serialize(static_cast<U8>(2));
3932  FW_ASSERT(
3933  _status == Fw::FW_SERIALIZE_OK,
3934  static_cast<FwAssertArgType>(_status)
3935  );
3936 #endif
3937 
3938  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3939  FW_ASSERT(
3940  _status == Fw::FW_SERIALIZE_OK,
3941  static_cast<FwAssertArgType>(_status)
3942  );
3943 
3944 #if FW_AMPCS_COMPATIBLE
3945  // Serialize the argument size
3946  _status = _logBuff.serialize(
3947  static_cast<U8>(sizeof(U32))
3948  );
3949  FW_ASSERT(
3950  _status == Fw::FW_SERIALIZE_OK,
3951  static_cast<FwAssertArgType>(_status)
3952  );
3953 #endif
3954  _status = _logBuff.serialize(command);
3955  FW_ASSERT(
3956  _status == Fw::FW_SERIALIZE_OK,
3957  static_cast<FwAssertArgType>(_status)
3958  );
3959 
3960  this->m_logOut_OutputPort[0].invoke(
3961  _id,
3962  _logTime,
3964  _logBuff
3965  );
3966  }
3967 
3968  // Emit the event on the text log port
3969 #if FW_ENABLE_TEXT_LOGGING
3970  if (this->m_LogText_OutputPort[0].isConnected()) {
3971 #if FW_OBJECT_NAMES == 1
3972  const char* _formatString =
3973  "(%s) %s: Sequence %s timed out on command %" PRIu32 "";
3974 #else
3975  const char* _formatString =
3976  "%s: Sequence %s timed out on command %" PRIu32 "";
3977 #endif
3978 
3979  Fw::TextLogString _logString;
3980  _logString.format(
3981  _formatString,
3982 #if FW_OBJECT_NAMES == 1
3983  this->m_objName.toChar(),
3984 #endif
3985  "CS_SequenceTimeout ",
3986  filename.toChar(),
3987  command
3988  );
3989 
3990  this->m_LogText_OutputPort[0].invoke(
3991  _id,
3992  _logTime,
3994  _logString
3995  );
3996  }
3997 #endif
3998  }
3999 
4002  const Fw::StringBase& filename,
4003  U32 command
4004  ) const
4005  {
4006  // Get the time
4007  Fw::Time _logTime;
4008  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4009  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4010  }
4011 
4012  FwEventIdType _id = static_cast<FwEventIdType>(0);
4013 
4014  _id = this->getIdBase() + EVENTID_CS_CMDSTEPPED;
4015 
4016  // Emit the event on the log port
4017  if (this->m_logOut_OutputPort[0].isConnected()) {
4018  Fw::LogBuffer _logBuff;
4020 
4021 #if FW_AMPCS_COMPATIBLE
4022  // Serialize the number of arguments
4023  _status = _logBuff.serialize(static_cast<U8>(2));
4024  FW_ASSERT(
4025  _status == Fw::FW_SERIALIZE_OK,
4026  static_cast<FwAssertArgType>(_status)
4027  );
4028 #endif
4029 
4030  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4031  FW_ASSERT(
4032  _status == Fw::FW_SERIALIZE_OK,
4033  static_cast<FwAssertArgType>(_status)
4034  );
4035 
4036 #if FW_AMPCS_COMPATIBLE
4037  // Serialize the argument size
4038  _status = _logBuff.serialize(
4039  static_cast<U8>(sizeof(U32))
4040  );
4041  FW_ASSERT(
4042  _status == Fw::FW_SERIALIZE_OK,
4043  static_cast<FwAssertArgType>(_status)
4044  );
4045 #endif
4046  _status = _logBuff.serialize(command);
4047  FW_ASSERT(
4048  _status == Fw::FW_SERIALIZE_OK,
4049  static_cast<FwAssertArgType>(_status)
4050  );
4051 
4052  this->m_logOut_OutputPort[0].invoke(
4053  _id,
4054  _logTime,
4056  _logBuff
4057  );
4058  }
4059 
4060  // Emit the event on the text log port
4061 #if FW_ENABLE_TEXT_LOGGING
4062  if (this->m_LogText_OutputPort[0].isConnected()) {
4063 #if FW_OBJECT_NAMES == 1
4064  const char* _formatString =
4065  "(%s) %s: Sequence %s command %" PRIu32 " stepped";
4066 #else
4067  const char* _formatString =
4068  "%s: Sequence %s command %" PRIu32 " stepped";
4069 #endif
4070 
4071  Fw::TextLogString _logString;
4072  _logString.format(
4073  _formatString,
4074 #if FW_OBJECT_NAMES == 1
4075  this->m_objName.toChar(),
4076 #endif
4077  "CS_CmdStepped ",
4078  filename.toChar(),
4079  command
4080  );
4081 
4082  this->m_LogText_OutputPort[0].invoke(
4083  _id,
4084  _logTime,
4086  _logString
4087  );
4088  }
4089 #endif
4090  }
4091 
4094  {
4095  // Get the time
4096  Fw::Time _logTime;
4097  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4098  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4099  }
4100 
4101  FwEventIdType _id = static_cast<FwEventIdType>(0);
4102 
4103  _id = this->getIdBase() + EVENTID_CS_CMDSTARTED;
4104 
4105  // Emit the event on the log port
4106  if (this->m_logOut_OutputPort[0].isConnected()) {
4107  Fw::LogBuffer _logBuff;
4109 
4110 #if FW_AMPCS_COMPATIBLE
4111  // Serialize the number of arguments
4112  _status = _logBuff.serialize(static_cast<U8>(1));
4113  FW_ASSERT(
4114  _status == Fw::FW_SERIALIZE_OK,
4115  static_cast<FwAssertArgType>(_status)
4116  );
4117 #endif
4118 
4119  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4120  FW_ASSERT(
4121  _status == Fw::FW_SERIALIZE_OK,
4122  static_cast<FwAssertArgType>(_status)
4123  );
4124 
4125  this->m_logOut_OutputPort[0].invoke(
4126  _id,
4127  _logTime,
4129  _logBuff
4130  );
4131  }
4132 
4133  // Emit the event on the text log port
4134 #if FW_ENABLE_TEXT_LOGGING
4135  if (this->m_LogText_OutputPort[0].isConnected()) {
4136 #if FW_OBJECT_NAMES == 1
4137  const char* _formatString =
4138  "(%s) %s: Sequence %s started";
4139 #else
4140  const char* _formatString =
4141  "%s: Sequence %s started";
4142 #endif
4143 
4144  Fw::TextLogString _logString;
4145  _logString.format(
4146  _formatString,
4147 #if FW_OBJECT_NAMES == 1
4148  this->m_objName.toChar(),
4149 #endif
4150  "CS_CmdStarted ",
4151  filename.toChar()
4152  );
4153 
4154  this->m_LogText_OutputPort[0].invoke(
4155  _id,
4156  _logTime,
4158  _logString
4159  );
4160  }
4161 #endif
4162  }
4163 
4166  const Fw::StringBase& filename,
4167  U32 recordNumber,
4168  U32 opCode
4169  ) const
4170  {
4171  // Get the time
4172  Fw::Time _logTime;
4173  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4174  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4175  }
4176 
4177  FwEventIdType _id = static_cast<FwEventIdType>(0);
4178 
4179  _id = this->getIdBase() + EVENTID_CS_JOINWAITING;
4180 
4181  // Emit the event on the log port
4182  if (this->m_logOut_OutputPort[0].isConnected()) {
4183  Fw::LogBuffer _logBuff;
4185 
4186 #if FW_AMPCS_COMPATIBLE
4187  // Serialize the number of arguments
4188  _status = _logBuff.serialize(static_cast<U8>(3));
4189  FW_ASSERT(
4190  _status == Fw::FW_SERIALIZE_OK,
4191  static_cast<FwAssertArgType>(_status)
4192  );
4193 #endif
4194 
4195  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4196  FW_ASSERT(
4197  _status == Fw::FW_SERIALIZE_OK,
4198  static_cast<FwAssertArgType>(_status)
4199  );
4200 
4201 #if FW_AMPCS_COMPATIBLE
4202  // Serialize the argument size
4203  _status = _logBuff.serialize(
4204  static_cast<U8>(sizeof(U32))
4205  );
4206  FW_ASSERT(
4207  _status == Fw::FW_SERIALIZE_OK,
4208  static_cast<FwAssertArgType>(_status)
4209  );
4210 #endif
4211  _status = _logBuff.serialize(recordNumber);
4212  FW_ASSERT(
4213  _status == Fw::FW_SERIALIZE_OK,
4214  static_cast<FwAssertArgType>(_status)
4215  );
4216 
4217 #if FW_AMPCS_COMPATIBLE
4218  // Serialize the argument size
4219  _status = _logBuff.serialize(
4220  static_cast<U8>(sizeof(U32))
4221  );
4222  FW_ASSERT(
4223  _status == Fw::FW_SERIALIZE_OK,
4224  static_cast<FwAssertArgType>(_status)
4225  );
4226 #endif
4227  _status = _logBuff.serialize(opCode);
4228  FW_ASSERT(
4229  _status == Fw::FW_SERIALIZE_OK,
4230  static_cast<FwAssertArgType>(_status)
4231  );
4232 
4233  this->m_logOut_OutputPort[0].invoke(
4234  _id,
4235  _logTime,
4237  _logBuff
4238  );
4239  }
4240 
4241  // Emit the event on the text log port
4242 #if FW_ENABLE_TEXT_LOGGING
4243  if (this->m_LogText_OutputPort[0].isConnected()) {
4244 #if FW_OBJECT_NAMES == 1
4245  const char* _formatString =
4246  "(%s) %s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4247 #else
4248  const char* _formatString =
4249  "%s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4250 #endif
4251 
4252  Fw::TextLogString _logString;
4253  _logString.format(
4254  _formatString,
4255 #if FW_OBJECT_NAMES == 1
4256  this->m_objName.toChar(),
4257 #endif
4258  "CS_JoinWaiting ",
4259  filename.toChar(),
4260  recordNumber,
4261  opCode
4262  );
4263 
4264  this->m_LogText_OutputPort[0].invoke(
4265  _id,
4266  _logTime,
4268  _logString
4269  );
4270  }
4271 #endif
4272  }
4273 
4276  {
4277  // Get the time
4278  Fw::Time _logTime;
4279  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4280  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4281  }
4282 
4283  FwEventIdType _id = static_cast<FwEventIdType>(0);
4284 
4286 
4287  // Emit the event on the log port
4288  if (this->m_logOut_OutputPort[0].isConnected()) {
4289  Fw::LogBuffer _logBuff;
4290 
4291 #if FW_AMPCS_COMPATIBLE
4293  // Serialize the number of arguments
4294  _status = _logBuff.serialize(static_cast<U8>(0));
4295  FW_ASSERT(
4296  _status == Fw::FW_SERIALIZE_OK,
4297  static_cast<FwAssertArgType>(_status)
4298  );
4299 #endif
4300 
4301  this->m_logOut_OutputPort[0].invoke(
4302  _id,
4303  _logTime,
4305  _logBuff
4306  );
4307  }
4308 
4309  // Emit the event on the text log port
4310 #if FW_ENABLE_TEXT_LOGGING
4311  if (this->m_LogText_OutputPort[0].isConnected()) {
4312 #if FW_OBJECT_NAMES == 1
4313  const char* _formatString =
4314  "(%s) %s: Still waiting for sequence file to complete";
4315 #else
4316  const char* _formatString =
4317  "%s: Still waiting for sequence file to complete";
4318 #endif
4319 
4320  Fw::TextLogString _logString;
4321  _logString.format(
4322  _formatString,
4323 #if FW_OBJECT_NAMES == 1
4324  this->m_objName.toChar(),
4325 #endif
4326  "CS_JoinWaitingNotComplete "
4327  );
4328 
4329  this->m_LogText_OutputPort[0].invoke(
4330  _id,
4331  _logTime,
4333  _logString
4334  );
4335  }
4336 #endif
4337  }
4338 
4341  {
4342  // Get the time
4343  Fw::Time _logTime;
4344  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4345  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4346  }
4347 
4348  FwEventIdType _id = static_cast<FwEventIdType>(0);
4349 
4350  _id = this->getIdBase() + EVENTID_CS_NORECORDS;
4351 
4352  // Emit the event on the log port
4353  if (this->m_logOut_OutputPort[0].isConnected()) {
4354  Fw::LogBuffer _logBuff;
4356 
4357 #if FW_AMPCS_COMPATIBLE
4358  // Serialize the number of arguments
4359  _status = _logBuff.serialize(static_cast<U8>(1));
4360  FW_ASSERT(
4361  _status == Fw::FW_SERIALIZE_OK,
4362  static_cast<FwAssertArgType>(_status)
4363  );
4364 #endif
4365 
4366  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4367  FW_ASSERT(
4368  _status == Fw::FW_SERIALIZE_OK,
4369  static_cast<FwAssertArgType>(_status)
4370  );
4371 
4372  this->m_logOut_OutputPort[0].invoke(
4373  _id,
4374  _logTime,
4376  _logBuff
4377  );
4378  }
4379 
4380  // Emit the event on the text log port
4381 #if FW_ENABLE_TEXT_LOGGING
4382  if (this->m_LogText_OutputPort[0].isConnected()) {
4383 #if FW_OBJECT_NAMES == 1
4384  const char* _formatString =
4385  "(%s) %s: Sequence file %s has no records. Ignoring.";
4386 #else
4387  const char* _formatString =
4388  "%s: Sequence file %s has no records. Ignoring.";
4389 #endif
4390 
4391  Fw::TextLogString _logString;
4392  _logString.format(
4393  _formatString,
4394 #if FW_OBJECT_NAMES == 1
4395  this->m_objName.toChar(),
4396 #endif
4397  "CS_NoRecords ",
4398  fileName.toChar()
4399  );
4400 
4401  this->m_LogText_OutputPort[0].invoke(
4402  _id,
4403  _logTime,
4405  _logString
4406  );
4407  }
4408 #endif
4409  }
4410 
4411  // ----------------------------------------------------------------------
4412  // Telemetry write functions
4413  // ----------------------------------------------------------------------
4414 
4417  U32 arg,
4418  Fw::Time _tlmTime
4419  ) const
4420  {
4421  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4422  if (
4423  this->m_timeCaller_OutputPort[0].isConnected() &&
4424  (_tlmTime == Fw::ZERO_TIME)
4425  ) {
4426  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4427  }
4428 
4429  Fw::TlmBuffer _tlmBuff;
4430  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4431  FW_ASSERT(
4432  _stat == Fw::FW_SERIALIZE_OK,
4433  static_cast<FwAssertArgType>(_stat)
4434  );
4435 
4436  FwChanIdType _id;
4437 
4438  _id = this->getIdBase() + CHANNELID_CS_LOADCOMMANDS;
4439 
4440  this->m_tlmOut_OutputPort[0].invoke(
4441  _id,
4442  _tlmTime,
4443  _tlmBuff
4444  );
4445  }
4446  }
4447 
4450  U32 arg,
4451  Fw::Time _tlmTime
4452  ) const
4453  {
4454  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4455  if (
4456  this->m_timeCaller_OutputPort[0].isConnected() &&
4457  (_tlmTime == Fw::ZERO_TIME)
4458  ) {
4459  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4460  }
4461 
4462  Fw::TlmBuffer _tlmBuff;
4463  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4464  FW_ASSERT(
4465  _stat == Fw::FW_SERIALIZE_OK,
4466  static_cast<FwAssertArgType>(_stat)
4467  );
4468 
4469  FwChanIdType _id;
4470 
4471  _id = this->getIdBase() + CHANNELID_CS_CANCELCOMMANDS;
4472 
4473  this->m_tlmOut_OutputPort[0].invoke(
4474  _id,
4475  _tlmTime,
4476  _tlmBuff
4477  );
4478  }
4479  }
4480 
4483  U32 arg,
4484  Fw::Time _tlmTime
4485  ) const
4486  {
4487  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4488  if (
4489  this->m_timeCaller_OutputPort[0].isConnected() &&
4490  (_tlmTime == Fw::ZERO_TIME)
4491  ) {
4492  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4493  }
4494 
4495  Fw::TlmBuffer _tlmBuff;
4496  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4497  FW_ASSERT(
4498  _stat == Fw::FW_SERIALIZE_OK,
4499  static_cast<FwAssertArgType>(_stat)
4500  );
4501 
4502  FwChanIdType _id;
4503 
4504  _id = this->getIdBase() + CHANNELID_CS_ERRORS;
4505 
4506  this->m_tlmOut_OutputPort[0].invoke(
4507  _id,
4508  _tlmTime,
4509  _tlmBuff
4510  );
4511  }
4512  }
4513 
4516  U32 arg,
4517  Fw::Time _tlmTime
4518  ) const
4519  {
4520  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4521  if (
4522  this->m_timeCaller_OutputPort[0].isConnected() &&
4523  (_tlmTime == Fw::ZERO_TIME)
4524  ) {
4525  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4526  }
4527 
4528  Fw::TlmBuffer _tlmBuff;
4529  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4530  FW_ASSERT(
4531  _stat == Fw::FW_SERIALIZE_OK,
4532  static_cast<FwAssertArgType>(_stat)
4533  );
4534 
4535  FwChanIdType _id;
4536 
4537  _id = this->getIdBase() + CHANNELID_CS_COMMANDSEXECUTED;
4538 
4539  this->m_tlmOut_OutputPort[0].invoke(
4540  _id,
4541  _tlmTime,
4542  _tlmBuff
4543  );
4544  }
4545  }
4546 
4549  U32 arg,
4550  Fw::Time _tlmTime
4551  ) const
4552  {
4553  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4554  if (
4555  this->m_timeCaller_OutputPort[0].isConnected() &&
4556  (_tlmTime == Fw::ZERO_TIME)
4557  ) {
4558  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4559  }
4560 
4561  Fw::TlmBuffer _tlmBuff;
4562  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4563  FW_ASSERT(
4564  _stat == Fw::FW_SERIALIZE_OK,
4565  static_cast<FwAssertArgType>(_stat)
4566  );
4567 
4568  FwChanIdType _id;
4569 
4571 
4572  this->m_tlmOut_OutputPort[0].invoke(
4573  _id,
4574  _tlmTime,
4575  _tlmBuff
4576  );
4577  }
4578  }
4579 
4580  // ----------------------------------------------------------------------
4581  // Time
4582  // ----------------------------------------------------------------------
4583 
4586  {
4587  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4588  Fw::Time _time;
4589  this->m_timeCaller_OutputPort[0].invoke(_time);
4590  return _time;
4591  }
4592  else {
4593  return Fw::Time(TB_NONE, 0, 0);
4594  }
4595  }
4596 
4597  // ----------------------------------------------------------------------
4598  // Message dispatch functions
4599  // ----------------------------------------------------------------------
4600 
4601  Fw::QueuedComponentBase::MsgDispatchStatus CmdSequencerComponentBase ::
4602  doDispatch()
4603  {
4604  ComponentIpcSerializableBuffer msg;
4605  FwQueuePriorityType priority = 0;
4606 
4607  Os::Queue::Status msgStatus = this->m_queue.receive(
4608  msg,
4610  priority
4611  );
4612  FW_ASSERT(
4613  msgStatus == Os::Queue::OP_OK,
4614  static_cast<FwAssertArgType>(msgStatus)
4615  );
4616 
4617  // Reset to beginning of buffer
4618  msg.resetDeser();
4619 
4620  FwEnumStoreType desMsg = 0;
4621  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
4622  FW_ASSERT(
4623  deserStatus == Fw::FW_SERIALIZE_OK,
4624  static_cast<FwAssertArgType>(deserStatus)
4625  );
4626 
4627  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
4628 
4629  if (msgType == CMDSEQUENCER_COMPONENT_EXIT) {
4630  return MSG_DISPATCH_EXIT;
4631  }
4632 
4633  FwIndexType portNum = 0;
4634  deserStatus = msg.deserialize(portNum);
4635  FW_ASSERT(
4636  deserStatus == Fw::FW_SERIALIZE_OK,
4637  static_cast<FwAssertArgType>(deserStatus)
4638  );
4639 
4640  switch (msgType) {
4641  // Handle async input port cmdResponseIn
4642  case CMDRESPONSEIN_CMDRESPONSE: {
4643  // Deserialize argument opCode
4644  FwOpcodeType opCode;
4645  deserStatus = msg.deserialize(opCode);
4646  FW_ASSERT(
4647  deserStatus == Fw::FW_SERIALIZE_OK,
4648  static_cast<FwAssertArgType>(deserStatus)
4649  );
4650 
4651  // Deserialize argument cmdSeq
4652  U32 cmdSeq;
4653  deserStatus = msg.deserialize(cmdSeq);
4654  FW_ASSERT(
4655  deserStatus == Fw::FW_SERIALIZE_OK,
4656  static_cast<FwAssertArgType>(deserStatus)
4657  );
4658 
4659  // Deserialize argument response
4660  Fw::CmdResponse response;
4661  deserStatus = msg.deserialize(response);
4662  FW_ASSERT(
4663  deserStatus == Fw::FW_SERIALIZE_OK,
4664  static_cast<FwAssertArgType>(deserStatus)
4665  );
4666  // Call handler function
4667  this->cmdResponseIn_handler(
4668  portNum,
4669  opCode,
4670  cmdSeq,
4671  response
4672  );
4673 
4674  break;
4675  }
4676 
4677  // Handle async input port pingIn
4678  case PINGIN_PING: {
4679  // Deserialize argument key
4680  U32 key;
4681  deserStatus = msg.deserialize(key);
4682  FW_ASSERT(
4683  deserStatus == Fw::FW_SERIALIZE_OK,
4684  static_cast<FwAssertArgType>(deserStatus)
4685  );
4686  // Call handler function
4687  this->pingIn_handler(
4688  portNum,
4689  key
4690  );
4691 
4692  break;
4693  }
4694 
4695  // Handle async input port schedIn
4696  case SCHEDIN_SCHED: {
4697  // Deserialize argument context
4698  U32 context;
4699  deserStatus = msg.deserialize(context);
4700  FW_ASSERT(
4701  deserStatus == Fw::FW_SERIALIZE_OK,
4702  static_cast<FwAssertArgType>(deserStatus)
4703  );
4704  // Call handler function
4705  this->schedIn_handler(
4706  portNum,
4707  context
4708  );
4709 
4710  break;
4711  }
4712 
4713  // Handle async input port seqCancelIn
4714  case SEQCANCELIN_CMDSEQCANCEL: {
4715  // Call handler function
4716  this->seqCancelIn_handler(portNum);
4717 
4718  break;
4719  }
4720 
4721  // Handle async input port seqRunIn
4722  case SEQRUNIN_CMDSEQIN: {
4723  // Deserialize argument filename
4724  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
4725  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
4726  deserStatus = msg.deserialize(filename);
4727  FW_ASSERT(
4728  deserStatus == Fw::FW_SERIALIZE_OK,
4729  static_cast<FwAssertArgType>(deserStatus)
4730  );
4731  // Call handler function
4732  this->seqRunIn_handler(
4733  portNum,
4734  filename
4735  );
4736 
4737  break;
4738  }
4739 
4740  // Handle command CS_RUN
4741  case CMD_CS_RUN: {
4742  // Deserialize opcode
4743  FwOpcodeType opCode = 0;
4744  deserStatus = msg.deserialize(opCode);
4745  FW_ASSERT (
4746  deserStatus == Fw::FW_SERIALIZE_OK,
4747  static_cast<FwAssertArgType>(deserStatus)
4748  );
4749 
4750  // Deserialize command sequence
4751  U32 cmdSeq = 0;
4752  deserStatus = msg.deserialize(cmdSeq);
4753  FW_ASSERT (
4754  deserStatus == Fw::FW_SERIALIZE_OK,
4755  static_cast<FwAssertArgType>(deserStatus)
4756  );
4757 
4758  // Deserialize command argument buffer
4759  Fw::CmdArgBuffer args;
4760  deserStatus = msg.deserialize(args);
4761  FW_ASSERT (
4762  deserStatus == Fw::FW_SERIALIZE_OK,
4763  static_cast<FwAssertArgType>(deserStatus)
4764  );
4765 
4766  // Reset buffer
4767  args.resetDeser();
4768 
4769  // Deserialize argument fileName
4770  Fw::CmdStringArg fileName;
4771  deserStatus = args.deserialize(fileName);
4772  if (deserStatus != Fw::FW_SERIALIZE_OK) {
4773  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4774  this->cmdResponse_out(
4775  opCode,
4776  cmdSeq,
4778  );
4779  }
4780  // Don't crash the task if bad arguments were passed from the ground
4781  break;
4782  }
4783 
4784  // Deserialize argument block
4786  deserStatus = args.deserialize(block);
4787  if (deserStatus != Fw::FW_SERIALIZE_OK) {
4788  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4789  this->cmdResponse_out(
4790  opCode,
4791  cmdSeq,
4793  );
4794  }
4795  // Don't crash the task if bad arguments were passed from the ground
4796  break;
4797  }
4798 
4799  // Make sure there was no data left over.
4800  // That means the argument buffer size was incorrect.
4801 #if FW_CMD_CHECK_RESIDUAL
4802  if (args.getBuffLeft() != 0) {
4803  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4804  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4805  }
4806  // Don't crash the task if bad arguments were passed from the ground
4807  break;
4808  }
4809 #endif
4810 
4811  // Call handler function
4812  this->CS_RUN_cmdHandler(
4813  opCode, cmdSeq,
4814  fileName,
4815  block
4816  );
4817 
4818  break;
4819  }
4820 
4821  // Handle command CS_VALIDATE
4822  case CMD_CS_VALIDATE: {
4823  // Deserialize opcode
4824  FwOpcodeType opCode = 0;
4825  deserStatus = msg.deserialize(opCode);
4826  FW_ASSERT (
4827  deserStatus == Fw::FW_SERIALIZE_OK,
4828  static_cast<FwAssertArgType>(deserStatus)
4829  );
4830 
4831  // Deserialize command sequence
4832  U32 cmdSeq = 0;
4833  deserStatus = msg.deserialize(cmdSeq);
4834  FW_ASSERT (
4835  deserStatus == Fw::FW_SERIALIZE_OK,
4836  static_cast<FwAssertArgType>(deserStatus)
4837  );
4838 
4839  // Deserialize command argument buffer
4840  Fw::CmdArgBuffer args;
4841  deserStatus = msg.deserialize(args);
4842  FW_ASSERT (
4843  deserStatus == Fw::FW_SERIALIZE_OK,
4844  static_cast<FwAssertArgType>(deserStatus)
4845  );
4846 
4847  // Reset buffer
4848  args.resetDeser();
4849 
4850  // Deserialize argument fileName
4851  Fw::CmdStringArg fileName;
4852  deserStatus = args.deserialize(fileName);
4853  if (deserStatus != Fw::FW_SERIALIZE_OK) {
4854  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4855  this->cmdResponse_out(
4856  opCode,
4857  cmdSeq,
4859  );
4860  }
4861  // Don't crash the task if bad arguments were passed from the ground
4862  break;
4863  }
4864 
4865  // Make sure there was no data left over.
4866  // That means the argument buffer size was incorrect.
4867 #if FW_CMD_CHECK_RESIDUAL
4868  if (args.getBuffLeft() != 0) {
4869  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4870  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4871  }
4872  // Don't crash the task if bad arguments were passed from the ground
4873  break;
4874  }
4875 #endif
4876 
4877  // Call handler function
4878  this->CS_VALIDATE_cmdHandler(
4879  opCode, cmdSeq,
4880  fileName
4881  );
4882 
4883  break;
4884  }
4885 
4886  // Handle command CS_CANCEL
4887  case CMD_CS_CANCEL: {
4888  // Deserialize opcode
4889  FwOpcodeType opCode = 0;
4890  deserStatus = msg.deserialize(opCode);
4891  FW_ASSERT (
4892  deserStatus == Fw::FW_SERIALIZE_OK,
4893  static_cast<FwAssertArgType>(deserStatus)
4894  );
4895 
4896  // Deserialize command sequence
4897  U32 cmdSeq = 0;
4898  deserStatus = msg.deserialize(cmdSeq);
4899  FW_ASSERT (
4900  deserStatus == Fw::FW_SERIALIZE_OK,
4901  static_cast<FwAssertArgType>(deserStatus)
4902  );
4903 
4904  // Deserialize command argument buffer
4905  Fw::CmdArgBuffer args;
4906  deserStatus = msg.deserialize(args);
4907  FW_ASSERT (
4908  deserStatus == Fw::FW_SERIALIZE_OK,
4909  static_cast<FwAssertArgType>(deserStatus)
4910  );
4911 
4912  // Reset buffer
4913  args.resetDeser();
4914 
4915  // Make sure there was no data left over.
4916  // That means the argument buffer size was incorrect.
4917 #if FW_CMD_CHECK_RESIDUAL
4918  if (args.getBuffLeft() != 0) {
4919  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4920  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4921  }
4922  // Don't crash the task if bad arguments were passed from the ground
4923  break;
4924  }
4925 #endif
4926 
4927  // Call handler function
4928  this->CS_CANCEL_cmdHandler(opCode, cmdSeq);
4929 
4930  break;
4931  }
4932 
4933  // Handle command CS_START
4934  case CMD_CS_START: {
4935  // Deserialize opcode
4936  FwOpcodeType opCode = 0;
4937  deserStatus = msg.deserialize(opCode);
4938  FW_ASSERT (
4939  deserStatus == Fw::FW_SERIALIZE_OK,
4940  static_cast<FwAssertArgType>(deserStatus)
4941  );
4942 
4943  // Deserialize command sequence
4944  U32 cmdSeq = 0;
4945  deserStatus = msg.deserialize(cmdSeq);
4946  FW_ASSERT (
4947  deserStatus == Fw::FW_SERIALIZE_OK,
4948  static_cast<FwAssertArgType>(deserStatus)
4949  );
4950 
4951  // Deserialize command argument buffer
4952  Fw::CmdArgBuffer args;
4953  deserStatus = msg.deserialize(args);
4954  FW_ASSERT (
4955  deserStatus == Fw::FW_SERIALIZE_OK,
4956  static_cast<FwAssertArgType>(deserStatus)
4957  );
4958 
4959  // Reset buffer
4960  args.resetDeser();
4961 
4962  // Make sure there was no data left over.
4963  // That means the argument buffer size was incorrect.
4964 #if FW_CMD_CHECK_RESIDUAL
4965  if (args.getBuffLeft() != 0) {
4966  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4967  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4968  }
4969  // Don't crash the task if bad arguments were passed from the ground
4970  break;
4971  }
4972 #endif
4973 
4974  // Call handler function
4975  this->CS_START_cmdHandler(opCode, cmdSeq);
4976 
4977  break;
4978  }
4979 
4980  // Handle command CS_STEP
4981  case CMD_CS_STEP: {
4982  // Deserialize opcode
4983  FwOpcodeType opCode = 0;
4984  deserStatus = msg.deserialize(opCode);
4985  FW_ASSERT (
4986  deserStatus == Fw::FW_SERIALIZE_OK,
4987  static_cast<FwAssertArgType>(deserStatus)
4988  );
4989 
4990  // Deserialize command sequence
4991  U32 cmdSeq = 0;
4992  deserStatus = msg.deserialize(cmdSeq);
4993  FW_ASSERT (
4994  deserStatus == Fw::FW_SERIALIZE_OK,
4995  static_cast<FwAssertArgType>(deserStatus)
4996  );
4997 
4998  // Deserialize command argument buffer
4999  Fw::CmdArgBuffer args;
5000  deserStatus = msg.deserialize(args);
5001  FW_ASSERT (
5002  deserStatus == Fw::FW_SERIALIZE_OK,
5003  static_cast<FwAssertArgType>(deserStatus)
5004  );
5005 
5006  // Reset buffer
5007  args.resetDeser();
5008 
5009  // Make sure there was no data left over.
5010  // That means the argument buffer size was incorrect.
5011 #if FW_CMD_CHECK_RESIDUAL
5012  if (args.getBuffLeft() != 0) {
5013  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5014  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5015  }
5016  // Don't crash the task if bad arguments were passed from the ground
5017  break;
5018  }
5019 #endif
5020 
5021  // Call handler function
5022  this->CS_STEP_cmdHandler(opCode, cmdSeq);
5023 
5024  break;
5025  }
5026 
5027  // Handle command CS_AUTO
5028  case CMD_CS_AUTO: {
5029  // Deserialize opcode
5030  FwOpcodeType opCode = 0;
5031  deserStatus = msg.deserialize(opCode);
5032  FW_ASSERT (
5033  deserStatus == Fw::FW_SERIALIZE_OK,
5034  static_cast<FwAssertArgType>(deserStatus)
5035  );
5036 
5037  // Deserialize command sequence
5038  U32 cmdSeq = 0;
5039  deserStatus = msg.deserialize(cmdSeq);
5040  FW_ASSERT (
5041  deserStatus == Fw::FW_SERIALIZE_OK,
5042  static_cast<FwAssertArgType>(deserStatus)
5043  );
5044 
5045  // Deserialize command argument buffer
5046  Fw::CmdArgBuffer args;
5047  deserStatus = msg.deserialize(args);
5048  FW_ASSERT (
5049  deserStatus == Fw::FW_SERIALIZE_OK,
5050  static_cast<FwAssertArgType>(deserStatus)
5051  );
5052 
5053  // Reset buffer
5054  args.resetDeser();
5055 
5056  // Make sure there was no data left over.
5057  // That means the argument buffer size was incorrect.
5058 #if FW_CMD_CHECK_RESIDUAL
5059  if (args.getBuffLeft() != 0) {
5060  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5061  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5062  }
5063  // Don't crash the task if bad arguments were passed from the ground
5064  break;
5065  }
5066 #endif
5067 
5068  // Call handler function
5069  this->CS_AUTO_cmdHandler(opCode, cmdSeq);
5070 
5071  break;
5072  }
5073 
5074  // Handle command CS_MANUAL
5075  case CMD_CS_MANUAL: {
5076  // Deserialize opcode
5077  FwOpcodeType opCode = 0;
5078  deserStatus = msg.deserialize(opCode);
5079  FW_ASSERT (
5080  deserStatus == Fw::FW_SERIALIZE_OK,
5081  static_cast<FwAssertArgType>(deserStatus)
5082  );
5083 
5084  // Deserialize command sequence
5085  U32 cmdSeq = 0;
5086  deserStatus = msg.deserialize(cmdSeq);
5087  FW_ASSERT (
5088  deserStatus == Fw::FW_SERIALIZE_OK,
5089  static_cast<FwAssertArgType>(deserStatus)
5090  );
5091 
5092  // Deserialize command argument buffer
5093  Fw::CmdArgBuffer args;
5094  deserStatus = msg.deserialize(args);
5095  FW_ASSERT (
5096  deserStatus == Fw::FW_SERIALIZE_OK,
5097  static_cast<FwAssertArgType>(deserStatus)
5098  );
5099 
5100  // Reset buffer
5101  args.resetDeser();
5102 
5103  // Make sure there was no data left over.
5104  // That means the argument buffer size was incorrect.
5105 #if FW_CMD_CHECK_RESIDUAL
5106  if (args.getBuffLeft() != 0) {
5107  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5108  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5109  }
5110  // Don't crash the task if bad arguments were passed from the ground
5111  break;
5112  }
5113 #endif
5114 
5115  // Call handler function
5116  this->CS_MANUAL_cmdHandler(opCode, cmdSeq);
5117 
5118  break;
5119  }
5120 
5121  // Handle command CS_JOIN_WAIT
5122  case CMD_CS_JOIN_WAIT: {
5123  // Deserialize opcode
5124  FwOpcodeType opCode = 0;
5125  deserStatus = msg.deserialize(opCode);
5126  FW_ASSERT (
5127  deserStatus == Fw::FW_SERIALIZE_OK,
5128  static_cast<FwAssertArgType>(deserStatus)
5129  );
5130 
5131  // Deserialize command sequence
5132  U32 cmdSeq = 0;
5133  deserStatus = msg.deserialize(cmdSeq);
5134  FW_ASSERT (
5135  deserStatus == Fw::FW_SERIALIZE_OK,
5136  static_cast<FwAssertArgType>(deserStatus)
5137  );
5138 
5139  // Deserialize command argument buffer
5140  Fw::CmdArgBuffer args;
5141  deserStatus = msg.deserialize(args);
5142  FW_ASSERT (
5143  deserStatus == Fw::FW_SERIALIZE_OK,
5144  static_cast<FwAssertArgType>(deserStatus)
5145  );
5146 
5147  // Reset buffer
5148  args.resetDeser();
5149 
5150  // Make sure there was no data left over.
5151  // That means the argument buffer size was incorrect.
5152 #if FW_CMD_CHECK_RESIDUAL
5153  if (args.getBuffLeft() != 0) {
5154  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5155  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5156  }
5157  // Don't crash the task if bad arguments were passed from the ground
5158  break;
5159  }
5160 #endif
5161 
5162  // Call handler function
5163  this->CS_JOIN_WAIT_cmdHandler(opCode, cmdSeq);
5164 
5165  break;
5166  }
5167 
5168  default:
5169  return MSG_DISPATCH_ERROR;
5170  }
5171 
5172  return MSG_DISPATCH_OK;
5173  }
5174 
5175  // ----------------------------------------------------------------------
5176  // Calls for messages received on special input ports
5177  // ----------------------------------------------------------------------
5178 
5179  void CmdSequencerComponentBase ::
5180  m_p_cmdIn_in(
5181  Fw::PassiveComponentBase* callComp,
5182  FwIndexType portNum,
5183  FwOpcodeType opCode,
5184  U32 cmdSeq,
5185  Fw::CmdArgBuffer& args
5186  )
5187  {
5188  FW_ASSERT(callComp);
5189  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5190 
5191  const U32 idBase = callComp->getIdBase();
5192  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
5193 
5194  // Select base class function based on opcode
5195  switch (opCode - idBase) {
5196  case OPCODE_CS_RUN: {
5197  compPtr->CS_RUN_cmdHandlerBase(
5198  opCode,
5199  cmdSeq,
5200  args
5201  );
5202  break;
5203  }
5204 
5205  case OPCODE_CS_VALIDATE: {
5206  compPtr->CS_VALIDATE_cmdHandlerBase(
5207  opCode,
5208  cmdSeq,
5209  args
5210  );
5211  break;
5212  }
5213 
5214  case OPCODE_CS_CANCEL: {
5215  compPtr->CS_CANCEL_cmdHandlerBase(
5216  opCode,
5217  cmdSeq,
5218  args
5219  );
5220  break;
5221  }
5222 
5223  case OPCODE_CS_START: {
5224  compPtr->CS_START_cmdHandlerBase(
5225  opCode,
5226  cmdSeq,
5227  args
5228  );
5229  break;
5230  }
5231 
5232  case OPCODE_CS_STEP: {
5233  compPtr->CS_STEP_cmdHandlerBase(
5234  opCode,
5235  cmdSeq,
5236  args
5237  );
5238  break;
5239  }
5240 
5241  case OPCODE_CS_AUTO: {
5242  compPtr->CS_AUTO_cmdHandlerBase(
5243  opCode,
5244  cmdSeq,
5245  args
5246  );
5247  break;
5248  }
5249 
5250  case OPCODE_CS_MANUAL: {
5251  compPtr->CS_MANUAL_cmdHandlerBase(
5252  opCode,
5253  cmdSeq,
5254  args
5255  );
5256  break;
5257  }
5258 
5259  case OPCODE_CS_JOIN_WAIT: {
5260  compPtr->CS_JOIN_WAIT_cmdHandlerBase(
5261  opCode,
5262  cmdSeq,
5263  args
5264  );
5265  break;
5266  }
5267  }
5268  }
5269 
5270  // ----------------------------------------------------------------------
5271  // Calls for messages received on typed input ports
5272  // ----------------------------------------------------------------------
5273 
5274  void CmdSequencerComponentBase ::
5275  m_p_cmdResponseIn_in(
5276  Fw::PassiveComponentBase* callComp,
5277  FwIndexType portNum,
5278  FwOpcodeType opCode,
5279  U32 cmdSeq,
5280  const Fw::CmdResponse& response
5281  )
5282  {
5283  FW_ASSERT(callComp);
5284  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5285  compPtr->cmdResponseIn_handlerBase(
5286  portNum,
5287  opCode,
5288  cmdSeq,
5289  response
5290  );
5291  }
5292 
5293  void CmdSequencerComponentBase ::
5294  m_p_pingIn_in(
5295  Fw::PassiveComponentBase* callComp,
5296  FwIndexType portNum,
5297  U32 key
5298  )
5299  {
5300  FW_ASSERT(callComp);
5301  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5302  compPtr->pingIn_handlerBase(
5303  portNum,
5304  key
5305  );
5306  }
5307 
5308  void CmdSequencerComponentBase ::
5309  m_p_schedIn_in(
5310  Fw::PassiveComponentBase* callComp,
5311  FwIndexType portNum,
5312  U32 context
5313  )
5314  {
5315  FW_ASSERT(callComp);
5316  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5317  compPtr->schedIn_handlerBase(
5318  portNum,
5319  context
5320  );
5321  }
5322 
5323  void CmdSequencerComponentBase ::
5324  m_p_seqCancelIn_in(
5325  Fw::PassiveComponentBase* callComp,
5326  FwIndexType portNum
5327  )
5328  {
5329  FW_ASSERT(callComp);
5330  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5331  compPtr->seqCancelIn_handlerBase(portNum);
5332  }
5333 
5334  void CmdSequencerComponentBase ::
5335  m_p_seqRunIn_in(
5336  Fw::PassiveComponentBase* callComp,
5337  FwIndexType portNum,
5338  const Fw::StringBase& filename
5339  )
5340  {
5341  FW_ASSERT(callComp);
5342  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5343  compPtr->seqRunIn_handlerBase(
5344  portNum,
5345  filename
5346  );
5347  }
5348 
5349 }
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
Serialization/Deserialization operation was successful.
void log_WARNING_HI_CS_TimeContextMismatch(const Fw::StringBase &fileName, U8 currTimeBase, U8 seqTimeBase) const
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
Definition: Time.hpp:9
void init()
Initialization function.
Definition: ComPortAc.cpp:137
void log_WARNING_HI_CS_CommandError(const Fw::StringBase &fileName, U32 recordNumber, U32 opCode, U32 errorStatus) const
Operation succeeded.
Definition: Os.hpp:26
void log_WARNING_HI_CS_FileSizeError(const Fw::StringBase &fileName, U32 size) const
void log_ACTIVITY_HI_CS_ModeSwitched(Svc::CmdSequencer_SeqMode mode) const
bool isConnected_comCmdOut_OutputPort(FwIndexType portNum)
void cmdResponseIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port cmdResponseIn.
The running time base doesn&#39;t match the time base in the sequence files.
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)
NATIVE_UINT_TYPE SizeType
Status
status returned from the queue send function
Definition: Queue.hpp:30
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
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
Definition: String.hpp:50
void regCommands()
Register commands with the Command Dispatcher.
void init()
Initialization function.
A command in a sequence was stepped through.
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
virtual void schedIn_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port schedIn.
virtual void CS_AUTO_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_AUTO.
The stage of the file read operation.
void log_ACTIVITY_LO_CS_SequenceLoaded(const Fw::StringBase &fileName) const
void log_WARNING_HI_CS_UnexpectedCompletion(U32 opcode) const
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
FwIndexType getNum_cmdResponseOut_OutputPorts() const
void CS_STEP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void invoke(U32 key) const
Invoke a port interface.
Definition: PingPortAc.cpp:147
The Command Sequencer received a command that was invalid for its current mode.
const Time ZERO_TIME
Definition: Time.cpp:5
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
A command status came back when no sequence was running.
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)
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].
I32 FwEnumStoreType
Definition: FpConfig.h:64
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.
void seqRunIn_handlerBase(FwIndexType portNum, const Fw::StringBase &filename)
Handler base-class function for input port seqRunIn.
A sequence related command came with no active sequence.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
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
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:26
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:37
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:45
virtual void CS_RUN_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_RUN.
The Command Sequencer issued a command and received an error status in return.
void tlmWrite_CS_CancelCommands(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
virtual ~CmdSequencerComponentBase()
Destroy CmdSequencerComponentBase object.
void tlmWrite_CS_CommandsExecuted(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
Wait for sequences that are running to finish. Allow user to run multiple seq files in SEQ_NO_BLOCK m...
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
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
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
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
Number of records in header doesn&#39;t match number in file.
void setPortNum(NATIVE_INT_TYPE portNum)
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:72
A less serious but recoverable event.
void init()
Initialization function.
Definition: PingPortAc.cpp:128
Wait for the current running sequence file complete.
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
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)
U32 FwOpcodeType
Definition: FpConfig.h:91
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
const char * toChar() const
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
No time base has been established.
Definition: FpConfig.h:70
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
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
The Command Sequencer issued a command and received a success status in return.
void log_ACTIVITY_HI_CS_JoinWaiting(const Fw::StringBase &filename, U32 recordNumber, U32 opCode) const
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
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()
reset deserialization to beginning
The size of the serial representations of the port arguments.
A string backed by an external buffer.
A serious but recoverable event.
The size of the serial representations of the port arguments.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:42
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.
U32 FwEventIdType
Definition: FpConfig.h:103
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void init()
Initialization function.
Definition: LogPortAc.cpp:151
bool isConnected_seqDone_OutputPort(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
void set_comCmdOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comCmdOut[portNum].
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
BlockingType
message type
Definition: Queue.hpp:44
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
virtual void CS_AUTO_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
#define PRI_PlatformIntType
Command failed to deserialize.
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
PlatformQueuePriorityType FwQueuePriorityType
Definition: FpConfig.h:55
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)
The Sequence File Loader could not read the sequence file.
void CS_CANCEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
message to exit active component task
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
Definition: StringBase.hpp:42
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.
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void seqCancelIn_handlerBase(FwIndexType portNum)
Handler base-class function for input port seqCancelIn.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:70
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputCmdSeqInPort *callPort)
Register an input port.
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.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
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
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:31
FwIndexType getNum_seqStartOut_OutputPorts() const
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
The size of the serial representation.
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:142
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:46
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
virtual void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port cmdResponseIn.
Cannot run new sequence when current sequence file is still running.
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.
void init()
Initialization function.
virtual void CS_CANCEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:148
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
Svc::InputCmdSeqCancelPort * get_seqCancelIn_InputPort(FwIndexType portNum)
void log_ACTIVITY_LO_CS_CommandComplete(const Fw::StringBase &fileName, U32 recordNumber, U32 opCode) const
#define FW_ASSERT(...)
Definition: Assert.hpp:14
A local port request to run a sequence was started.
void log_ACTIVITY_HI_CS_SequenceValid(const Fw::StringBase &filename) const
bool isConnected_logOut_OutputPort(FwIndexType portNum)
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:319
virtual const CHAR * toChar() const =0
void log_WARNING_HI_CS_FileReadError(const Fw::StringBase &fileName) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
The running time base doesn&#39;t match the time base in the sequence files.
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
U32 FwChanIdType
Definition: FpConfig.h:95
Perform one step in a command sequence. Valid only if CmdSequencer is in MANUAL run mode...
void log_ACTIVITY_HI_CS_CmdStepped(const Fw::StringBase &filename, U32 command) const
FwIndexType getNum_cmdResponseIn_InputPorts() const
virtual void CS_JOIN_WAIT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CS_JOIN_WAIT.