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