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  FwQueueSizeType 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  Os::Queue::QueueStatus qStat = this->createQueue(
410  queueDepth,
411  ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
412  );
413  FW_ASSERT(
414  Os::Queue::QUEUE_OK == qStat,
415  static_cast<FwAssertArgType>(qStat)
416  );
417  }
418 
419  // ----------------------------------------------------------------------
420  // Getters for special input ports
421  // ----------------------------------------------------------------------
422 
425  {
426  FW_ASSERT(
427  portNum < this->getNum_cmdIn_InputPorts(),
428  static_cast<FwAssertArgType>(portNum)
429  );
430 
431  return &this->m_cmdIn_InputPort[portNum];
432  }
433 
434  // ----------------------------------------------------------------------
435  // Getters for typed input ports
436  // ----------------------------------------------------------------------
437 
440  {
441  FW_ASSERT(
442  portNum < this->getNum_cmdResponseIn_InputPorts(),
443  static_cast<FwAssertArgType>(portNum)
444  );
445 
446  return &this->m_cmdResponseIn_InputPort[portNum];
447  }
448 
451  {
452  FW_ASSERT(
453  portNum < this->getNum_pingIn_InputPorts(),
454  static_cast<FwAssertArgType>(portNum)
455  );
456 
457  return &this->m_pingIn_InputPort[portNum];
458  }
459 
462  {
463  FW_ASSERT(
464  portNum < this->getNum_schedIn_InputPorts(),
465  static_cast<FwAssertArgType>(portNum)
466  );
467 
468  return &this->m_schedIn_InputPort[portNum];
469  }
470 
473  {
474  FW_ASSERT(
475  portNum < this->getNum_seqCancelIn_InputPorts(),
476  static_cast<FwAssertArgType>(portNum)
477  );
478 
479  return &this->m_seqCancelIn_InputPort[portNum];
480  }
481 
484  {
485  FW_ASSERT(
486  portNum < this->getNum_seqRunIn_InputPorts(),
487  static_cast<FwAssertArgType>(portNum)
488  );
489 
490  return &this->m_seqRunIn_InputPort[portNum];
491  }
492 
493  // ----------------------------------------------------------------------
494  // Connect input ports to special output ports
495  // ----------------------------------------------------------------------
496 
497 #if FW_ENABLE_TEXT_LOGGING == 1
498 
499  void CmdSequencerComponentBase ::
500  set_LogText_OutputPort(
501  FwIndexType portNum,
503  )
504  {
505  FW_ASSERT(
506  portNum < this->getNum_LogText_OutputPorts(),
507  static_cast<FwAssertArgType>(portNum)
508  );
509 
510  this->m_LogText_OutputPort[portNum].addCallPort(port);
511  }
512 
513 #endif
514 
517  FwIndexType portNum,
518  Fw::InputCmdRegPort* port
519  )
520  {
521  FW_ASSERT(
522  portNum < this->getNum_cmdRegOut_OutputPorts(),
523  static_cast<FwAssertArgType>(portNum)
524  );
525 
526  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
527  }
528 
531  FwIndexType portNum,
533  )
534  {
535  FW_ASSERT(
536  portNum < this->getNum_cmdResponseOut_OutputPorts(),
537  static_cast<FwAssertArgType>(portNum)
538  );
539 
540  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
541  }
542 
545  FwIndexType portNum,
546  Fw::InputLogPort* port
547  )
548  {
549  FW_ASSERT(
550  portNum < this->getNum_logOut_OutputPorts(),
551  static_cast<FwAssertArgType>(portNum)
552  );
553 
554  this->m_logOut_OutputPort[portNum].addCallPort(port);
555  }
556 
559  FwIndexType portNum,
560  Fw::InputTimePort* port
561  )
562  {
563  FW_ASSERT(
564  portNum < this->getNum_timeCaller_OutputPorts(),
565  static_cast<FwAssertArgType>(portNum)
566  );
567 
568  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
569  }
570 
573  FwIndexType portNum,
574  Fw::InputTlmPort* port
575  )
576  {
577  FW_ASSERT(
578  portNum < this->getNum_tlmOut_OutputPorts(),
579  static_cast<FwAssertArgType>(portNum)
580  );
581 
582  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
583  }
584 
585  // ----------------------------------------------------------------------
586  // Connect typed input ports to typed output ports
587  // ----------------------------------------------------------------------
588 
591  FwIndexType portNum,
592  Fw::InputComPort* port
593  )
594  {
595  FW_ASSERT(
596  portNum < this->getNum_comCmdOut_OutputPorts(),
597  static_cast<FwAssertArgType>(portNum)
598  );
599 
600  this->m_comCmdOut_OutputPort[portNum].addCallPort(port);
601  }
602 
605  FwIndexType portNum,
606  Svc::InputPingPort* port
607  )
608  {
609  FW_ASSERT(
610  portNum < this->getNum_pingOut_OutputPorts(),
611  static_cast<FwAssertArgType>(portNum)
612  );
613 
614  this->m_pingOut_OutputPort[portNum].addCallPort(port);
615  }
616 
619  FwIndexType portNum,
621  )
622  {
623  FW_ASSERT(
624  portNum < this->getNum_seqDone_OutputPorts(),
625  static_cast<FwAssertArgType>(portNum)
626  );
627 
628  this->m_seqDone_OutputPort[portNum].addCallPort(port);
629  }
630 
631 #if FW_PORT_SERIALIZATION
632 
633  // ----------------------------------------------------------------------
634  // Connect serial input ports to special output ports
635  // ----------------------------------------------------------------------
636 
637 #if FW_ENABLE_TEXT_LOGGING == 1
638 
639  void CmdSequencerComponentBase ::
640  set_LogText_OutputPort(
641  FwIndexType portNum,
642  Fw::InputSerializePort* port
643  )
644  {
645  FW_ASSERT(
646  portNum < this->getNum_LogText_OutputPorts(),
647  static_cast<FwAssertArgType>(portNum)
648  );
649 
650  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
651  }
652 
653 #endif
654 
657  FwIndexType portNum,
658  Fw::InputSerializePort* port
659  )
660  {
661  FW_ASSERT(
662  portNum < this->getNum_cmdRegOut_OutputPorts(),
663  static_cast<FwAssertArgType>(portNum)
664  );
665 
666  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
667  }
668 
671  FwIndexType portNum,
672  Fw::InputSerializePort* port
673  )
674  {
675  FW_ASSERT(
676  portNum < this->getNum_cmdResponseOut_OutputPorts(),
677  static_cast<FwAssertArgType>(portNum)
678  );
679 
680  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
681  }
682 
685  FwIndexType portNum,
686  Fw::InputSerializePort* port
687  )
688  {
689  FW_ASSERT(
690  portNum < this->getNum_logOut_OutputPorts(),
691  static_cast<FwAssertArgType>(portNum)
692  );
693 
694  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
695  }
696 
699  FwIndexType portNum,
700  Fw::InputSerializePort* port
701  )
702  {
703  FW_ASSERT(
704  portNum < this->getNum_timeCaller_OutputPorts(),
705  static_cast<FwAssertArgType>(portNum)
706  );
707 
708  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
709  }
710 
713  FwIndexType portNum,
714  Fw::InputSerializePort* port
715  )
716  {
717  FW_ASSERT(
718  portNum < this->getNum_tlmOut_OutputPorts(),
719  static_cast<FwAssertArgType>(portNum)
720  );
721 
722  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
723  }
724 
725 #endif
726 
727 #if FW_PORT_SERIALIZATION
728 
729  // ----------------------------------------------------------------------
730  // Connect serial input ports to typed output ports
731  // ----------------------------------------------------------------------
732 
735  FwIndexType portNum,
736  Fw::InputSerializePort* port
737  )
738  {
739  FW_ASSERT(
740  portNum < this->getNum_comCmdOut_OutputPorts(),
741  static_cast<FwAssertArgType>(portNum)
742  );
743 
744  this->m_comCmdOut_OutputPort[portNum].registerSerialPort(port);
745  }
746 
749  FwIndexType portNum,
750  Fw::InputSerializePort* port
751  )
752  {
753  FW_ASSERT(
754  portNum < this->getNum_pingOut_OutputPorts(),
755  static_cast<FwAssertArgType>(portNum)
756  );
757 
758  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
759  }
760 
763  FwIndexType portNum,
764  Fw::InputSerializePort* port
765  )
766  {
767  FW_ASSERT(
768  portNum < this->getNum_seqDone_OutputPorts(),
769  static_cast<FwAssertArgType>(portNum)
770  );
771 
772  this->m_seqDone_OutputPort[portNum].registerSerialPort(port);
773  }
774 
775 #endif
776 
777  // ----------------------------------------------------------------------
778  // Command registration
779  // ----------------------------------------------------------------------
780 
782  regCommands()
783  {
784  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
785 
786  this->m_cmdRegOut_OutputPort[0].invoke(
787  this->getIdBase() + OPCODE_CS_RUN
788  );
789 
790  this->m_cmdRegOut_OutputPort[0].invoke(
791  this->getIdBase() + OPCODE_CS_VALIDATE
792  );
793 
794  this->m_cmdRegOut_OutputPort[0].invoke(
795  this->getIdBase() + OPCODE_CS_CANCEL
796  );
797 
798  this->m_cmdRegOut_OutputPort[0].invoke(
799  this->getIdBase() + OPCODE_CS_START
800  );
801 
802  this->m_cmdRegOut_OutputPort[0].invoke(
803  this->getIdBase() + OPCODE_CS_STEP
804  );
805 
806  this->m_cmdRegOut_OutputPort[0].invoke(
807  this->getIdBase() + OPCODE_CS_AUTO
808  );
809 
810  this->m_cmdRegOut_OutputPort[0].invoke(
811  this->getIdBase() + OPCODE_CS_MANUAL
812  );
813 
814  this->m_cmdRegOut_OutputPort[0].invoke(
816  );
817  }
818 
819  // ----------------------------------------------------------------------
820  // Component construction and destruction
821  // ----------------------------------------------------------------------
822 
824  CmdSequencerComponentBase(const char* compName) :
825  Fw::ActiveComponentBase(compName)
826  {
827 
828  }
829 
832  {
833 
834  }
835 
836  // ----------------------------------------------------------------------
837  // Getters for numbers of special input ports
838  // ----------------------------------------------------------------------
839 
842  {
843  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
844  }
845 
846  // ----------------------------------------------------------------------
847  // Getters for numbers of typed input ports
848  // ----------------------------------------------------------------------
849 
852  {
853  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseIn_InputPort));
854  }
855 
858  {
859  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
860  }
861 
864  {
865  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_schedIn_InputPort));
866  }
867 
870  {
871  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqCancelIn_InputPort));
872  }
873 
876  {
877  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqRunIn_InputPort));
878  }
879 
880  // ----------------------------------------------------------------------
881  // Getters for numbers of special output ports
882  // ----------------------------------------------------------------------
883 
884 #if FW_ENABLE_TEXT_LOGGING == 1
885 
886  FwIndexType CmdSequencerComponentBase ::
887  getNum_LogText_OutputPorts() const
888  {
889  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
890  }
891 
892 #endif
893 
896  {
897  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
898  }
899 
902  {
903  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
904  }
905 
908  {
909  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
910  }
911 
914  {
915  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
916  }
917 
920  {
921  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
922  }
923 
924  // ----------------------------------------------------------------------
925  // Getters for numbers of typed output ports
926  // ----------------------------------------------------------------------
927 
930  {
931  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comCmdOut_OutputPort));
932  }
933 
936  {
937  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
938  }
939 
942  {
943  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqDone_OutputPort));
944  }
945 
946  // ----------------------------------------------------------------------
947  // Connection status queries for special output ports
948  // ----------------------------------------------------------------------
949 
950 #if FW_ENABLE_TEXT_LOGGING == 1
951 
952  bool CmdSequencerComponentBase ::
953  isConnected_LogText_OutputPort(FwIndexType portNum)
954  {
955  FW_ASSERT(
956  portNum < this->getNum_LogText_OutputPorts(),
957  static_cast<FwAssertArgType>(portNum)
958  );
959 
960  return this->m_LogText_OutputPort[portNum].isConnected();
961  }
962 
963 #endif
964 
967  {
968  FW_ASSERT(
969  portNum < this->getNum_cmdRegOut_OutputPorts(),
970  static_cast<FwAssertArgType>(portNum)
971  );
972 
973  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
974  }
975 
978  {
979  FW_ASSERT(
980  portNum < this->getNum_cmdResponseOut_OutputPorts(),
981  static_cast<FwAssertArgType>(portNum)
982  );
983 
984  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
985  }
986 
989  {
990  FW_ASSERT(
991  portNum < this->getNum_logOut_OutputPorts(),
992  static_cast<FwAssertArgType>(portNum)
993  );
994 
995  return this->m_logOut_OutputPort[portNum].isConnected();
996  }
997 
1000  {
1001  FW_ASSERT(
1002  portNum < this->getNum_timeCaller_OutputPorts(),
1003  static_cast<FwAssertArgType>(portNum)
1004  );
1005 
1006  return this->m_timeCaller_OutputPort[portNum].isConnected();
1007  }
1008 
1011  {
1012  FW_ASSERT(
1013  portNum < this->getNum_tlmOut_OutputPorts(),
1014  static_cast<FwAssertArgType>(portNum)
1015  );
1016 
1017  return this->m_tlmOut_OutputPort[portNum].isConnected();
1018  }
1019 
1020  // ----------------------------------------------------------------------
1021  // Connection status queries for typed output ports
1022  // ----------------------------------------------------------------------
1023 
1026  {
1027  FW_ASSERT(
1028  portNum < this->getNum_comCmdOut_OutputPorts(),
1029  static_cast<FwAssertArgType>(portNum)
1030  );
1031 
1032  return this->m_comCmdOut_OutputPort[portNum].isConnected();
1033  }
1034 
1037  {
1038  FW_ASSERT(
1039  portNum < this->getNum_pingOut_OutputPorts(),
1040  static_cast<FwAssertArgType>(portNum)
1041  );
1042 
1043  return this->m_pingOut_OutputPort[portNum].isConnected();
1044  }
1045 
1048  {
1049  FW_ASSERT(
1050  portNum < this->getNum_seqDone_OutputPorts(),
1051  static_cast<FwAssertArgType>(portNum)
1052  );
1053 
1054  return this->m_seqDone_OutputPort[portNum].isConnected();
1055  }
1056 
1057  // ----------------------------------------------------------------------
1058  // Port handler base-class functions for typed input ports
1059  //
1060  // Call these functions directly to bypass the corresponding ports
1061  // ----------------------------------------------------------------------
1062 
1065  FwIndexType portNum,
1066  FwOpcodeType opCode,
1067  U32 cmdSeq,
1068  const Fw::CmdResponse& response
1069  )
1070  {
1071  // Make sure port number is valid
1072  FW_ASSERT(
1073  portNum < this->getNum_cmdResponseIn_InputPorts(),
1074  static_cast<FwAssertArgType>(portNum)
1075  );
1076 
1077  // Call pre-message hook
1079  portNum,
1080  opCode,
1081  cmdSeq,
1082  response
1083  );
1084  ComponentIpcSerializableBuffer msg;
1086 
1087  // Serialize message ID
1088  _status = msg.serialize(
1089  static_cast<FwEnumStoreType>(CMDRESPONSEIN_CMDRESPONSE)
1090  );
1091  FW_ASSERT(
1092  _status == Fw::FW_SERIALIZE_OK,
1093  static_cast<FwAssertArgType>(_status)
1094  );
1095 
1096  // Serialize port number
1097  _status = msg.serialize(portNum);
1098  FW_ASSERT(
1099  _status == Fw::FW_SERIALIZE_OK,
1100  static_cast<FwAssertArgType>(_status)
1101  );
1102 
1103  // Serialize argument opCode
1104  _status = msg.serialize(opCode);
1105  FW_ASSERT(
1106  _status == Fw::FW_SERIALIZE_OK,
1107  static_cast<FwAssertArgType>(_status)
1108  );
1109 
1110  // Serialize argument cmdSeq
1111  _status = msg.serialize(cmdSeq);
1112  FW_ASSERT(
1113  _status == Fw::FW_SERIALIZE_OK,
1114  static_cast<FwAssertArgType>(_status)
1115  );
1116 
1117  // Serialize argument response
1118  _status = msg.serialize(response);
1119  FW_ASSERT(
1120  _status == Fw::FW_SERIALIZE_OK,
1121  static_cast<FwAssertArgType>(_status)
1122  );
1123 
1124  // Send message
1126  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1127 
1128  FW_ASSERT(
1129  qStatus == Os::Queue::QUEUE_OK,
1130  static_cast<FwAssertArgType>(qStatus)
1131  );
1132  }
1133 
1136  FwIndexType portNum,
1137  U32 key
1138  )
1139  {
1140  // Make sure port number is valid
1141  FW_ASSERT(
1142  portNum < this->getNum_pingIn_InputPorts(),
1143  static_cast<FwAssertArgType>(portNum)
1144  );
1145 
1146  // Call pre-message hook
1148  portNum,
1149  key
1150  );
1151  ComponentIpcSerializableBuffer msg;
1153 
1154  // Serialize message ID
1155  _status = msg.serialize(
1156  static_cast<FwEnumStoreType>(PINGIN_PING)
1157  );
1158  FW_ASSERT(
1159  _status == Fw::FW_SERIALIZE_OK,
1160  static_cast<FwAssertArgType>(_status)
1161  );
1162 
1163  // Serialize port number
1164  _status = msg.serialize(portNum);
1165  FW_ASSERT(
1166  _status == Fw::FW_SERIALIZE_OK,
1167  static_cast<FwAssertArgType>(_status)
1168  );
1169 
1170  // Serialize argument key
1171  _status = msg.serialize(key);
1172  FW_ASSERT(
1173  _status == Fw::FW_SERIALIZE_OK,
1174  static_cast<FwAssertArgType>(_status)
1175  );
1176 
1177  // Send message
1179  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1180 
1181  FW_ASSERT(
1182  qStatus == Os::Queue::QUEUE_OK,
1183  static_cast<FwAssertArgType>(qStatus)
1184  );
1185  }
1186 
1189  FwIndexType portNum,
1190  U32 context
1191  )
1192  {
1193  // Make sure port number is valid
1194  FW_ASSERT(
1195  portNum < this->getNum_schedIn_InputPorts(),
1196  static_cast<FwAssertArgType>(portNum)
1197  );
1198 
1199  // Call pre-message hook
1201  portNum,
1202  context
1203  );
1204  ComponentIpcSerializableBuffer msg;
1206 
1207  // Serialize message ID
1208  _status = msg.serialize(
1209  static_cast<FwEnumStoreType>(SCHEDIN_SCHED)
1210  );
1211  FW_ASSERT(
1212  _status == Fw::FW_SERIALIZE_OK,
1213  static_cast<FwAssertArgType>(_status)
1214  );
1215 
1216  // Serialize port number
1217  _status = msg.serialize(portNum);
1218  FW_ASSERT(
1219  _status == Fw::FW_SERIALIZE_OK,
1220  static_cast<FwAssertArgType>(_status)
1221  );
1222 
1223  // Serialize argument context
1224  _status = msg.serialize(context);
1225  FW_ASSERT(
1226  _status == Fw::FW_SERIALIZE_OK,
1227  static_cast<FwAssertArgType>(_status)
1228  );
1229 
1230  // Send message
1232  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1233 
1234  FW_ASSERT(
1235  qStatus == Os::Queue::QUEUE_OK,
1236  static_cast<FwAssertArgType>(qStatus)
1237  );
1238  }
1239 
1242  {
1243  // Make sure port number is valid
1244  FW_ASSERT(
1245  portNum < this->getNum_seqCancelIn_InputPorts(),
1246  static_cast<FwAssertArgType>(portNum)
1247  );
1248 
1249  // Call pre-message hook
1250  seqCancelIn_preMsgHook(portNum);
1251  ComponentIpcSerializableBuffer msg;
1253 
1254  // Serialize message ID
1255  _status = msg.serialize(
1256  static_cast<FwEnumStoreType>(SEQCANCELIN_CMDSEQCANCEL)
1257  );
1258  FW_ASSERT(
1259  _status == Fw::FW_SERIALIZE_OK,
1260  static_cast<FwAssertArgType>(_status)
1261  );
1262 
1263  // Serialize port number
1264  _status = msg.serialize(portNum);
1265  FW_ASSERT(
1266  _status == Fw::FW_SERIALIZE_OK,
1267  static_cast<FwAssertArgType>(_status)
1268  );
1269 
1270  // Send message
1272  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1273 
1274  FW_ASSERT(
1275  qStatus == Os::Queue::QUEUE_OK,
1276  static_cast<FwAssertArgType>(qStatus)
1277  );
1278  }
1279 
1282  FwIndexType portNum,
1283  Fw::String& filename
1284  )
1285  {
1286  // Make sure port number is valid
1287  FW_ASSERT(
1288  portNum < this->getNum_seqRunIn_InputPorts(),
1289  static_cast<FwAssertArgType>(portNum)
1290  );
1291 
1292  // Call pre-message hook
1294  portNum,
1295  filename
1296  );
1297  ComponentIpcSerializableBuffer msg;
1299 
1300  // Serialize message ID
1301  _status = msg.serialize(
1302  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
1303  );
1304  FW_ASSERT(
1305  _status == Fw::FW_SERIALIZE_OK,
1306  static_cast<FwAssertArgType>(_status)
1307  );
1308 
1309  // Serialize port number
1310  _status = msg.serialize(portNum);
1311  FW_ASSERT(
1312  _status == Fw::FW_SERIALIZE_OK,
1313  static_cast<FwAssertArgType>(_status)
1314  );
1315 
1316  // Serialize argument filename
1317  _status = msg.serialize(filename);
1318  FW_ASSERT(
1319  _status == Fw::FW_SERIALIZE_OK,
1320  static_cast<FwAssertArgType>(_status)
1321  );
1322 
1323  // Send message
1325  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1326 
1327  FW_ASSERT(
1328  qStatus == Os::Queue::QUEUE_OK,
1329  static_cast<FwAssertArgType>(qStatus)
1330  );
1331  }
1332 
1333  // ----------------------------------------------------------------------
1334  // Pre-message hooks for typed async input ports
1335  //
1336  // Each of these functions is invoked just before processing a message
1337  // on the corresponding port. By default, they do nothing. You can
1338  // override them to provide specific pre-message behavior.
1339  // ----------------------------------------------------------------------
1340 
1343  FwIndexType portNum,
1344  FwOpcodeType opCode,
1345  U32 cmdSeq,
1346  const Fw::CmdResponse& response
1347  )
1348  {
1349  // Default: no-op
1350  }
1351 
1354  FwIndexType portNum,
1355  U32 key
1356  )
1357  {
1358  // Default: no-op
1359  }
1360 
1363  FwIndexType portNum,
1364  U32 context
1365  )
1366  {
1367  // Default: no-op
1368  }
1369 
1372  {
1373  // Default: no-op
1374  }
1375 
1378  FwIndexType portNum,
1379  Fw::String& filename
1380  )
1381  {
1382  // Default: no-op
1383  }
1384 
1385  // ----------------------------------------------------------------------
1386  // Invocation functions for typed output ports
1387  // ----------------------------------------------------------------------
1388 
1391  FwIndexType portNum,
1392  Fw::ComBuffer& data,
1393  U32 context
1394  )
1395  {
1396  FW_ASSERT(
1397  portNum < this->getNum_comCmdOut_OutputPorts(),
1398  static_cast<FwAssertArgType>(portNum)
1399  );
1400  this->m_comCmdOut_OutputPort[portNum].invoke(
1401  data,
1402  context
1403  );
1404  }
1405 
1407  pingOut_out(
1408  FwIndexType portNum,
1409  U32 key
1410  )
1411  {
1412  FW_ASSERT(
1413  portNum < this->getNum_pingOut_OutputPorts(),
1414  static_cast<FwAssertArgType>(portNum)
1415  );
1416  this->m_pingOut_OutputPort[portNum].invoke(
1417  key
1418  );
1419  }
1420 
1422  seqDone_out(
1423  FwIndexType portNum,
1424  FwOpcodeType opCode,
1425  U32 cmdSeq,
1426  const Fw::CmdResponse& response
1427  )
1428  {
1429  FW_ASSERT(
1430  portNum < this->getNum_seqDone_OutputPorts(),
1431  static_cast<FwAssertArgType>(portNum)
1432  );
1433  this->m_seqDone_OutputPort[portNum].invoke(
1434  opCode,
1435  cmdSeq,
1436  response
1437  );
1438  }
1439 
1440  // ----------------------------------------------------------------------
1441  // Command response
1442  // ----------------------------------------------------------------------
1443 
1446  FwOpcodeType opCode,
1447  U32 cmdSeq,
1448  Fw::CmdResponse response
1449  )
1450  {
1451  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1452  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1453  }
1454 
1455  // ----------------------------------------------------------------------
1456  // Command handler base-class functions
1457  //
1458  // Call these functions directly to bypass the command input port
1459  // ----------------------------------------------------------------------
1460 
1463  FwOpcodeType opCode,
1464  U32 cmdSeq,
1465  Fw::CmdArgBuffer& args
1466  )
1467  {
1468  // Call pre-message hook
1469  this->CS_RUN_preMsgHook(opCode,cmdSeq);
1470 
1471  // Defer deserializing arguments to the message dispatcher
1472  // to avoid deserializing and reserializing just for IPC
1473  ComponentIpcSerializableBuffer msg;
1475 
1476  // Serialize for IPC
1477  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_RUN));
1478  FW_ASSERT (
1479  _status == Fw::FW_SERIALIZE_OK,
1480  static_cast<FwAssertArgType>(_status)
1481  );
1482 
1483  // Fake port number to make message dequeue work
1484  FwIndexType port = 0;
1485 
1486  _status = msg.serialize(port);
1487  FW_ASSERT (
1488  _status == Fw::FW_SERIALIZE_OK,
1489  static_cast<FwAssertArgType>(_status)
1490  );
1491 
1492  _status = msg.serialize(opCode);
1493  FW_ASSERT (
1494  _status == Fw::FW_SERIALIZE_OK,
1495  static_cast<FwAssertArgType>(_status)
1496  );
1497 
1498  _status = msg.serialize(cmdSeq);
1499  FW_ASSERT (
1500  _status == Fw::FW_SERIALIZE_OK,
1501  static_cast<FwAssertArgType>(_status)
1502  );
1503 
1504  _status = msg.serialize(args);
1505  FW_ASSERT (
1506  _status == Fw::FW_SERIALIZE_OK,
1507  static_cast<FwAssertArgType>(_status)
1508  );
1509 
1510  // Send message
1512  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1513 
1514  FW_ASSERT(
1515  qStatus == Os::Queue::QUEUE_OK,
1516  static_cast<FwAssertArgType>(qStatus)
1517  );
1518  }
1519 
1522  FwOpcodeType opCode,
1523  U32 cmdSeq,
1524  Fw::CmdArgBuffer& args
1525  )
1526  {
1527  // Call pre-message hook
1528  this->CS_VALIDATE_preMsgHook(opCode,cmdSeq);
1529 
1530  // Defer deserializing arguments to the message dispatcher
1531  // to avoid deserializing and reserializing just for IPC
1532  ComponentIpcSerializableBuffer msg;
1534 
1535  // Serialize for IPC
1536  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_VALIDATE));
1537  FW_ASSERT (
1538  _status == Fw::FW_SERIALIZE_OK,
1539  static_cast<FwAssertArgType>(_status)
1540  );
1541 
1542  // Fake port number to make message dequeue work
1543  FwIndexType port = 0;
1544 
1545  _status = msg.serialize(port);
1546  FW_ASSERT (
1547  _status == Fw::FW_SERIALIZE_OK,
1548  static_cast<FwAssertArgType>(_status)
1549  );
1550 
1551  _status = msg.serialize(opCode);
1552  FW_ASSERT (
1553  _status == Fw::FW_SERIALIZE_OK,
1554  static_cast<FwAssertArgType>(_status)
1555  );
1556 
1557  _status = msg.serialize(cmdSeq);
1558  FW_ASSERT (
1559  _status == Fw::FW_SERIALIZE_OK,
1560  static_cast<FwAssertArgType>(_status)
1561  );
1562 
1563  _status = msg.serialize(args);
1564  FW_ASSERT (
1565  _status == Fw::FW_SERIALIZE_OK,
1566  static_cast<FwAssertArgType>(_status)
1567  );
1568 
1569  // Send message
1571  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1572 
1573  FW_ASSERT(
1574  qStatus == Os::Queue::QUEUE_OK,
1575  static_cast<FwAssertArgType>(qStatus)
1576  );
1577  }
1578 
1581  FwOpcodeType opCode,
1582  U32 cmdSeq,
1583  Fw::CmdArgBuffer& args
1584  )
1585  {
1586  // Call pre-message hook
1587  this->CS_CANCEL_preMsgHook(opCode,cmdSeq);
1588 
1589  // Defer deserializing arguments to the message dispatcher
1590  // to avoid deserializing and reserializing just for IPC
1591  ComponentIpcSerializableBuffer msg;
1593 
1594  // Serialize for IPC
1595  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_CANCEL));
1596  FW_ASSERT (
1597  _status == Fw::FW_SERIALIZE_OK,
1598  static_cast<FwAssertArgType>(_status)
1599  );
1600 
1601  // Fake port number to make message dequeue work
1602  FwIndexType port = 0;
1603 
1604  _status = msg.serialize(port);
1605  FW_ASSERT (
1606  _status == Fw::FW_SERIALIZE_OK,
1607  static_cast<FwAssertArgType>(_status)
1608  );
1609 
1610  _status = msg.serialize(opCode);
1611  FW_ASSERT (
1612  _status == Fw::FW_SERIALIZE_OK,
1613  static_cast<FwAssertArgType>(_status)
1614  );
1615 
1616  _status = msg.serialize(cmdSeq);
1617  FW_ASSERT (
1618  _status == Fw::FW_SERIALIZE_OK,
1619  static_cast<FwAssertArgType>(_status)
1620  );
1621 
1622  _status = msg.serialize(args);
1623  FW_ASSERT (
1624  _status == Fw::FW_SERIALIZE_OK,
1625  static_cast<FwAssertArgType>(_status)
1626  );
1627 
1628  // Send message
1630  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1631 
1632  FW_ASSERT(
1633  qStatus == Os::Queue::QUEUE_OK,
1634  static_cast<FwAssertArgType>(qStatus)
1635  );
1636  }
1637 
1640  FwOpcodeType opCode,
1641  U32 cmdSeq,
1642  Fw::CmdArgBuffer& args
1643  )
1644  {
1645  // Call pre-message hook
1646  this->CS_START_preMsgHook(opCode,cmdSeq);
1647 
1648  // Defer deserializing arguments to the message dispatcher
1649  // to avoid deserializing and reserializing just for IPC
1650  ComponentIpcSerializableBuffer msg;
1652 
1653  // Serialize for IPC
1654  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_START));
1655  FW_ASSERT (
1656  _status == Fw::FW_SERIALIZE_OK,
1657  static_cast<FwAssertArgType>(_status)
1658  );
1659 
1660  // Fake port number to make message dequeue work
1661  FwIndexType port = 0;
1662 
1663  _status = msg.serialize(port);
1664  FW_ASSERT (
1665  _status == Fw::FW_SERIALIZE_OK,
1666  static_cast<FwAssertArgType>(_status)
1667  );
1668 
1669  _status = msg.serialize(opCode);
1670  FW_ASSERT (
1671  _status == Fw::FW_SERIALIZE_OK,
1672  static_cast<FwAssertArgType>(_status)
1673  );
1674 
1675  _status = msg.serialize(cmdSeq);
1676  FW_ASSERT (
1677  _status == Fw::FW_SERIALIZE_OK,
1678  static_cast<FwAssertArgType>(_status)
1679  );
1680 
1681  _status = msg.serialize(args);
1682  FW_ASSERT (
1683  _status == Fw::FW_SERIALIZE_OK,
1684  static_cast<FwAssertArgType>(_status)
1685  );
1686 
1687  // Send message
1689  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1690 
1691  FW_ASSERT(
1692  qStatus == Os::Queue::QUEUE_OK,
1693  static_cast<FwAssertArgType>(qStatus)
1694  );
1695  }
1696 
1699  FwOpcodeType opCode,
1700  U32 cmdSeq,
1701  Fw::CmdArgBuffer& args
1702  )
1703  {
1704  // Call pre-message hook
1705  this->CS_STEP_preMsgHook(opCode,cmdSeq);
1706 
1707  // Defer deserializing arguments to the message dispatcher
1708  // to avoid deserializing and reserializing just for IPC
1709  ComponentIpcSerializableBuffer msg;
1711 
1712  // Serialize for IPC
1713  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_STEP));
1714  FW_ASSERT (
1715  _status == Fw::FW_SERIALIZE_OK,
1716  static_cast<FwAssertArgType>(_status)
1717  );
1718 
1719  // Fake port number to make message dequeue work
1720  FwIndexType port = 0;
1721 
1722  _status = msg.serialize(port);
1723  FW_ASSERT (
1724  _status == Fw::FW_SERIALIZE_OK,
1725  static_cast<FwAssertArgType>(_status)
1726  );
1727 
1728  _status = msg.serialize(opCode);
1729  FW_ASSERT (
1730  _status == Fw::FW_SERIALIZE_OK,
1731  static_cast<FwAssertArgType>(_status)
1732  );
1733 
1734  _status = msg.serialize(cmdSeq);
1735  FW_ASSERT (
1736  _status == Fw::FW_SERIALIZE_OK,
1737  static_cast<FwAssertArgType>(_status)
1738  );
1739 
1740  _status = msg.serialize(args);
1741  FW_ASSERT (
1742  _status == Fw::FW_SERIALIZE_OK,
1743  static_cast<FwAssertArgType>(_status)
1744  );
1745 
1746  // Send message
1748  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1749 
1750  FW_ASSERT(
1751  qStatus == Os::Queue::QUEUE_OK,
1752  static_cast<FwAssertArgType>(qStatus)
1753  );
1754  }
1755 
1758  FwOpcodeType opCode,
1759  U32 cmdSeq,
1760  Fw::CmdArgBuffer& args
1761  )
1762  {
1763  // Call pre-message hook
1764  this->CS_AUTO_preMsgHook(opCode,cmdSeq);
1765 
1766  // Defer deserializing arguments to the message dispatcher
1767  // to avoid deserializing and reserializing just for IPC
1768  ComponentIpcSerializableBuffer msg;
1770 
1771  // Serialize for IPC
1772  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_AUTO));
1773  FW_ASSERT (
1774  _status == Fw::FW_SERIALIZE_OK,
1775  static_cast<FwAssertArgType>(_status)
1776  );
1777 
1778  // Fake port number to make message dequeue work
1779  FwIndexType port = 0;
1780 
1781  _status = msg.serialize(port);
1782  FW_ASSERT (
1783  _status == Fw::FW_SERIALIZE_OK,
1784  static_cast<FwAssertArgType>(_status)
1785  );
1786 
1787  _status = msg.serialize(opCode);
1788  FW_ASSERT (
1789  _status == Fw::FW_SERIALIZE_OK,
1790  static_cast<FwAssertArgType>(_status)
1791  );
1792 
1793  _status = msg.serialize(cmdSeq);
1794  FW_ASSERT (
1795  _status == Fw::FW_SERIALIZE_OK,
1796  static_cast<FwAssertArgType>(_status)
1797  );
1798 
1799  _status = msg.serialize(args);
1800  FW_ASSERT (
1801  _status == Fw::FW_SERIALIZE_OK,
1802  static_cast<FwAssertArgType>(_status)
1803  );
1804 
1805  // Send message
1807  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1808 
1809  FW_ASSERT(
1810  qStatus == Os::Queue::QUEUE_OK,
1811  static_cast<FwAssertArgType>(qStatus)
1812  );
1813  }
1814 
1817  FwOpcodeType opCode,
1818  U32 cmdSeq,
1819  Fw::CmdArgBuffer& args
1820  )
1821  {
1822  // Call pre-message hook
1823  this->CS_MANUAL_preMsgHook(opCode,cmdSeq);
1824 
1825  // Defer deserializing arguments to the message dispatcher
1826  // to avoid deserializing and reserializing just for IPC
1827  ComponentIpcSerializableBuffer msg;
1829 
1830  // Serialize for IPC
1831  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_MANUAL));
1832  FW_ASSERT (
1833  _status == Fw::FW_SERIALIZE_OK,
1834  static_cast<FwAssertArgType>(_status)
1835  );
1836 
1837  // Fake port number to make message dequeue work
1838  FwIndexType port = 0;
1839 
1840  _status = msg.serialize(port);
1841  FW_ASSERT (
1842  _status == Fw::FW_SERIALIZE_OK,
1843  static_cast<FwAssertArgType>(_status)
1844  );
1845 
1846  _status = msg.serialize(opCode);
1847  FW_ASSERT (
1848  _status == Fw::FW_SERIALIZE_OK,
1849  static_cast<FwAssertArgType>(_status)
1850  );
1851 
1852  _status = msg.serialize(cmdSeq);
1853  FW_ASSERT (
1854  _status == Fw::FW_SERIALIZE_OK,
1855  static_cast<FwAssertArgType>(_status)
1856  );
1857 
1858  _status = msg.serialize(args);
1859  FW_ASSERT (
1860  _status == Fw::FW_SERIALIZE_OK,
1861  static_cast<FwAssertArgType>(_status)
1862  );
1863 
1864  // Send message
1866  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1867 
1868  FW_ASSERT(
1869  qStatus == Os::Queue::QUEUE_OK,
1870  static_cast<FwAssertArgType>(qStatus)
1871  );
1872  }
1873 
1876  FwOpcodeType opCode,
1877  U32 cmdSeq,
1878  Fw::CmdArgBuffer& args
1879  )
1880  {
1881  // Call pre-message hook
1882  this->CS_JOIN_WAIT_preMsgHook(opCode,cmdSeq);
1883 
1884  // Defer deserializing arguments to the message dispatcher
1885  // to avoid deserializing and reserializing just for IPC
1886  ComponentIpcSerializableBuffer msg;
1888 
1889  // Serialize for IPC
1890  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CS_JOIN_WAIT));
1891  FW_ASSERT (
1892  _status == Fw::FW_SERIALIZE_OK,
1893  static_cast<FwAssertArgType>(_status)
1894  );
1895 
1896  // Fake port number to make message dequeue work
1897  FwIndexType port = 0;
1898 
1899  _status = msg.serialize(port);
1900  FW_ASSERT (
1901  _status == Fw::FW_SERIALIZE_OK,
1902  static_cast<FwAssertArgType>(_status)
1903  );
1904 
1905  _status = msg.serialize(opCode);
1906  FW_ASSERT (
1907  _status == Fw::FW_SERIALIZE_OK,
1908  static_cast<FwAssertArgType>(_status)
1909  );
1910 
1911  _status = msg.serialize(cmdSeq);
1912  FW_ASSERT (
1913  _status == Fw::FW_SERIALIZE_OK,
1914  static_cast<FwAssertArgType>(_status)
1915  );
1916 
1917  _status = msg.serialize(args);
1918  FW_ASSERT (
1919  _status == Fw::FW_SERIALIZE_OK,
1920  static_cast<FwAssertArgType>(_status)
1921  );
1922 
1923  // Send message
1925  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1926 
1927  FW_ASSERT(
1928  qStatus == Os::Queue::QUEUE_OK,
1929  static_cast<FwAssertArgType>(qStatus)
1930  );
1931  }
1932 
1933  // ----------------------------------------------------------------------
1934  // Pre-message hooks for async commands
1935  //
1936  // Each of these functions is invoked just before processing the
1937  // corresponding command. By default they do nothing. You can
1938  // override them to provide specific pre-command behavior.
1939  // ----------------------------------------------------------------------
1940 
1943  FwOpcodeType opCode,
1944  U32 cmdSeq
1945  )
1946  {
1947  // Defaults to no-op; can be overridden
1948  (void) opCode;
1949  (void) cmdSeq;
1950  }
1951 
1954  FwOpcodeType opCode,
1955  U32 cmdSeq
1956  )
1957  {
1958  // Defaults to no-op; can be overridden
1959  (void) opCode;
1960  (void) cmdSeq;
1961  }
1962 
1965  FwOpcodeType opCode,
1966  U32 cmdSeq
1967  )
1968  {
1969  // Defaults to no-op; can be overridden
1970  (void) opCode;
1971  (void) cmdSeq;
1972  }
1973 
1976  FwOpcodeType opCode,
1977  U32 cmdSeq
1978  )
1979  {
1980  // Defaults to no-op; can be overridden
1981  (void) opCode;
1982  (void) cmdSeq;
1983  }
1984 
1987  FwOpcodeType opCode,
1988  U32 cmdSeq
1989  )
1990  {
1991  // Defaults to no-op; can be overridden
1992  (void) opCode;
1993  (void) cmdSeq;
1994  }
1995 
1998  FwOpcodeType opCode,
1999  U32 cmdSeq
2000  )
2001  {
2002  // Defaults to no-op; can be overridden
2003  (void) opCode;
2004  (void) cmdSeq;
2005  }
2006 
2009  FwOpcodeType opCode,
2010  U32 cmdSeq
2011  )
2012  {
2013  // Defaults to no-op; can be overridden
2014  (void) opCode;
2015  (void) cmdSeq;
2016  }
2017 
2020  FwOpcodeType opCode,
2021  U32 cmdSeq
2022  )
2023  {
2024  // Defaults to no-op; can be overridden
2025  (void) opCode;
2026  (void) cmdSeq;
2027  }
2028 
2029  // ----------------------------------------------------------------------
2030  // Event logging functions
2031  // ----------------------------------------------------------------------
2032 
2035  {
2036  // Get the time
2037  Fw::Time _logTime;
2038  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2039  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2040  }
2041 
2042  FwEventIdType _id = static_cast<FwEventIdType>(0);
2043 
2044  _id = this->getIdBase() + EVENTID_CS_SEQUENCELOADED;
2045 
2046  // Emit the event on the log port
2047  if (this->m_logOut_OutputPort[0].isConnected()) {
2048  Fw::LogBuffer _logBuff;
2050 
2051 #if FW_AMPCS_COMPATIBLE
2052  // Serialize the number of arguments
2053  _status = _logBuff.serialize(static_cast<U8>(1));
2054  FW_ASSERT(
2055  _status == Fw::FW_SERIALIZE_OK,
2056  static_cast<FwAssertArgType>(_status)
2057  );
2058 #endif
2059 
2060  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2061  FW_ASSERT(
2062  _status == Fw::FW_SERIALIZE_OK,
2063  static_cast<FwAssertArgType>(_status)
2064  );
2065 
2066  this->m_logOut_OutputPort[0].invoke(
2067  _id,
2068  _logTime,
2070  _logBuff
2071  );
2072  }
2073 
2074  // Emit the event on the text log port
2075 #if FW_ENABLE_TEXT_LOGGING
2076  if (this->m_LogText_OutputPort[0].isConnected()) {
2077 #if FW_OBJECT_NAMES == 1
2078  const char* _formatString =
2079  "(%s) %s: Loaded sequence %s";
2080 #else
2081  const char* _formatString =
2082  "%s: Loaded sequence %s";
2083 #endif
2084 
2085  Fw::TextLogString _logString;
2086  _logString.format(
2087  _formatString,
2088 #if FW_OBJECT_NAMES == 1
2089  this->m_objName.toChar(),
2090 #endif
2091  "CS_SequenceLoaded ",
2092  fileName.toChar()
2093  );
2094 
2095  this->m_LogText_OutputPort[0].invoke(
2096  _id,
2097  _logTime,
2099  _logString
2100  );
2101  }
2102 #endif
2103  }
2104 
2107  {
2108  // Get the time
2109  Fw::Time _logTime;
2110  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2111  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2112  }
2113 
2114  FwEventIdType _id = static_cast<FwEventIdType>(0);
2115 
2116  _id = this->getIdBase() + EVENTID_CS_SEQUENCECANCELED;
2117 
2118  // Emit the event on the log port
2119  if (this->m_logOut_OutputPort[0].isConnected()) {
2120  Fw::LogBuffer _logBuff;
2122 
2123 #if FW_AMPCS_COMPATIBLE
2124  // Serialize the number of arguments
2125  _status = _logBuff.serialize(static_cast<U8>(1));
2126  FW_ASSERT(
2127  _status == Fw::FW_SERIALIZE_OK,
2128  static_cast<FwAssertArgType>(_status)
2129  );
2130 #endif
2131 
2132  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2133  FW_ASSERT(
2134  _status == Fw::FW_SERIALIZE_OK,
2135  static_cast<FwAssertArgType>(_status)
2136  );
2137 
2138  this->m_logOut_OutputPort[0].invoke(
2139  _id,
2140  _logTime,
2142  _logBuff
2143  );
2144  }
2145 
2146  // Emit the event on the text log port
2147 #if FW_ENABLE_TEXT_LOGGING
2148  if (this->m_LogText_OutputPort[0].isConnected()) {
2149 #if FW_OBJECT_NAMES == 1
2150  const char* _formatString =
2151  "(%s) %s: Sequence file %s canceled";
2152 #else
2153  const char* _formatString =
2154  "%s: Sequence file %s canceled";
2155 #endif
2156 
2157  Fw::TextLogString _logString;
2158  _logString.format(
2159  _formatString,
2160 #if FW_OBJECT_NAMES == 1
2161  this->m_objName.toChar(),
2162 #endif
2163  "CS_SequenceCanceled ",
2164  fileName.toChar()
2165  );
2166 
2167  this->m_LogText_OutputPort[0].invoke(
2168  _id,
2169  _logTime,
2171  _logString
2172  );
2173  }
2174 #endif
2175  }
2176 
2179  {
2180  // Get the time
2181  Fw::Time _logTime;
2182  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2183  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2184  }
2185 
2186  FwEventIdType _id = static_cast<FwEventIdType>(0);
2187 
2188  _id = this->getIdBase() + EVENTID_CS_FILEREADERROR;
2189 
2190  // Emit the event on the log port
2191  if (this->m_logOut_OutputPort[0].isConnected()) {
2192  Fw::LogBuffer _logBuff;
2194 
2195 #if FW_AMPCS_COMPATIBLE
2196  // Serialize the number of arguments
2197  _status = _logBuff.serialize(static_cast<U8>(1));
2198  FW_ASSERT(
2199  _status == Fw::FW_SERIALIZE_OK,
2200  static_cast<FwAssertArgType>(_status)
2201  );
2202 #endif
2203 
2204  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2205  FW_ASSERT(
2206  _status == Fw::FW_SERIALIZE_OK,
2207  static_cast<FwAssertArgType>(_status)
2208  );
2209 
2210  this->m_logOut_OutputPort[0].invoke(
2211  _id,
2212  _logTime,
2214  _logBuff
2215  );
2216  }
2217 
2218  // Emit the event on the text log port
2219 #if FW_ENABLE_TEXT_LOGGING
2220  if (this->m_LogText_OutputPort[0].isConnected()) {
2221 #if FW_OBJECT_NAMES == 1
2222  const char* _formatString =
2223  "(%s) %s: Error reading sequence file %s";
2224 #else
2225  const char* _formatString =
2226  "%s: Error reading sequence file %s";
2227 #endif
2228 
2229  Fw::TextLogString _logString;
2230  _logString.format(
2231  _formatString,
2232 #if FW_OBJECT_NAMES == 1
2233  this->m_objName.toChar(),
2234 #endif
2235  "CS_FileReadError ",
2236  fileName.toChar()
2237  );
2238 
2239  this->m_LogText_OutputPort[0].invoke(
2240  _id,
2241  _logTime,
2243  _logString
2244  );
2245  }
2246 #endif
2247  }
2248 
2251  const Fw::StringBase& fileName,
2253  I32 error
2254  )
2255  {
2256  // Get the time
2257  Fw::Time _logTime;
2258  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2259  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2260  }
2261 
2262  FwEventIdType _id = static_cast<FwEventIdType>(0);
2263 
2264  _id = this->getIdBase() + EVENTID_CS_FILEINVALID;
2265 
2266  // Emit the event on the log port
2267  if (this->m_logOut_OutputPort[0].isConnected()) {
2268  Fw::LogBuffer _logBuff;
2270 
2271 #if FW_AMPCS_COMPATIBLE
2272  // Serialize the number of arguments
2273  _status = _logBuff.serialize(static_cast<U8>(3));
2274  FW_ASSERT(
2275  _status == Fw::FW_SERIALIZE_OK,
2276  static_cast<FwAssertArgType>(_status)
2277  );
2278 #endif
2279 
2280  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2281  FW_ASSERT(
2282  _status == Fw::FW_SERIALIZE_OK,
2283  static_cast<FwAssertArgType>(_status)
2284  );
2285 
2286 #if FW_AMPCS_COMPATIBLE
2287  // Serialize the argument size
2288  _status = _logBuff.serialize(
2290  );
2291  FW_ASSERT(
2292  _status == Fw::FW_SERIALIZE_OK,
2293  static_cast<FwAssertArgType>(_status)
2294  );
2295 #endif
2296  _status = _logBuff.serialize(stage);
2297  FW_ASSERT(
2298  _status == Fw::FW_SERIALIZE_OK,
2299  static_cast<FwAssertArgType>(_status)
2300  );
2301 
2302 #if FW_AMPCS_COMPATIBLE
2303  // Serialize the argument size
2304  _status = _logBuff.serialize(
2305  static_cast<U8>(sizeof(I32))
2306  );
2307  FW_ASSERT(
2308  _status == Fw::FW_SERIALIZE_OK,
2309  static_cast<FwAssertArgType>(_status)
2310  );
2311 #endif
2312  _status = _logBuff.serialize(error);
2313  FW_ASSERT(
2314  _status == Fw::FW_SERIALIZE_OK,
2315  static_cast<FwAssertArgType>(_status)
2316  );
2317 
2318  this->m_logOut_OutputPort[0].invoke(
2319  _id,
2320  _logTime,
2322  _logBuff
2323  );
2324  }
2325 
2326  // Emit the event on the text log port
2327 #if FW_ENABLE_TEXT_LOGGING
2328  if (this->m_LogText_OutputPort[0].isConnected()) {
2329 #if FW_OBJECT_NAMES == 1
2330  const char* _formatString =
2331  "(%s) %s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2332 #else
2333  const char* _formatString =
2334  "%s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2335 #endif
2336 
2337  Fw::String stageStr;
2338  stage.toString(stageStr);
2339 
2340  Fw::TextLogString _logString;
2341  _logString.format(
2342  _formatString,
2343 #if FW_OBJECT_NAMES == 1
2344  this->m_objName.toChar(),
2345 #endif
2346  "CS_FileInvalid ",
2347  fileName.toChar(),
2348  stageStr.toChar(),
2349  error
2350  );
2351 
2352  this->m_LogText_OutputPort[0].invoke(
2353  _id,
2354  _logTime,
2356  _logString
2357  );
2358  }
2359 #endif
2360  }
2361 
2364  const Fw::StringBase& fileName,
2365  U32 recordNumber,
2366  I32 error
2367  )
2368  {
2369  // Get the time
2370  Fw::Time _logTime;
2371  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2372  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2373  }
2374 
2375  FwEventIdType _id = static_cast<FwEventIdType>(0);
2376 
2377  _id = this->getIdBase() + EVENTID_CS_RECORDINVALID;
2378 
2379  // Emit the event on the log port
2380  if (this->m_logOut_OutputPort[0].isConnected()) {
2381  Fw::LogBuffer _logBuff;
2383 
2384 #if FW_AMPCS_COMPATIBLE
2385  // Serialize the number of arguments
2386  _status = _logBuff.serialize(static_cast<U8>(3));
2387  FW_ASSERT(
2388  _status == Fw::FW_SERIALIZE_OK,
2389  static_cast<FwAssertArgType>(_status)
2390  );
2391 #endif
2392 
2393  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2394  FW_ASSERT(
2395  _status == Fw::FW_SERIALIZE_OK,
2396  static_cast<FwAssertArgType>(_status)
2397  );
2398 
2399 #if FW_AMPCS_COMPATIBLE
2400  // Serialize the argument size
2401  _status = _logBuff.serialize(
2402  static_cast<U8>(sizeof(U32))
2403  );
2404  FW_ASSERT(
2405  _status == Fw::FW_SERIALIZE_OK,
2406  static_cast<FwAssertArgType>(_status)
2407  );
2408 #endif
2409  _status = _logBuff.serialize(recordNumber);
2410  FW_ASSERT(
2411  _status == Fw::FW_SERIALIZE_OK,
2412  static_cast<FwAssertArgType>(_status)
2413  );
2414 
2415 #if FW_AMPCS_COMPATIBLE
2416  // Serialize the argument size
2417  _status = _logBuff.serialize(
2418  static_cast<U8>(sizeof(I32))
2419  );
2420  FW_ASSERT(
2421  _status == Fw::FW_SERIALIZE_OK,
2422  static_cast<FwAssertArgType>(_status)
2423  );
2424 #endif
2425  _status = _logBuff.serialize(error);
2426  FW_ASSERT(
2427  _status == Fw::FW_SERIALIZE_OK,
2428  static_cast<FwAssertArgType>(_status)
2429  );
2430 
2431  this->m_logOut_OutputPort[0].invoke(
2432  _id,
2433  _logTime,
2435  _logBuff
2436  );
2437  }
2438 
2439  // Emit the event on the text log port
2440 #if FW_ENABLE_TEXT_LOGGING
2441  if (this->m_LogText_OutputPort[0].isConnected()) {
2442 #if FW_OBJECT_NAMES == 1
2443  const char* _formatString =
2444  "(%s) %s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2445 #else
2446  const char* _formatString =
2447  "%s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2448 #endif
2449 
2450  Fw::TextLogString _logString;
2451  _logString.format(
2452  _formatString,
2453 #if FW_OBJECT_NAMES == 1
2454  this->m_objName.toChar(),
2455 #endif
2456  "CS_RecordInvalid ",
2457  fileName.toChar(),
2458  recordNumber,
2459  error
2460  );
2461 
2462  this->m_LogText_OutputPort[0].invoke(
2463  _id,
2464  _logTime,
2466  _logString
2467  );
2468  }
2469 #endif
2470  }
2471 
2474  const Fw::StringBase& fileName,
2475  U32 size
2476  )
2477  {
2478  // Get the time
2479  Fw::Time _logTime;
2480  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2481  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2482  }
2483 
2484  FwEventIdType _id = static_cast<FwEventIdType>(0);
2485 
2486  _id = this->getIdBase() + EVENTID_CS_FILESIZEERROR;
2487 
2488  // Emit the event on the log port
2489  if (this->m_logOut_OutputPort[0].isConnected()) {
2490  Fw::LogBuffer _logBuff;
2492 
2493 #if FW_AMPCS_COMPATIBLE
2494  // Serialize the number of arguments
2495  _status = _logBuff.serialize(static_cast<U8>(2));
2496  FW_ASSERT(
2497  _status == Fw::FW_SERIALIZE_OK,
2498  static_cast<FwAssertArgType>(_status)
2499  );
2500 #endif
2501 
2502  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2503  FW_ASSERT(
2504  _status == Fw::FW_SERIALIZE_OK,
2505  static_cast<FwAssertArgType>(_status)
2506  );
2507 
2508 #if FW_AMPCS_COMPATIBLE
2509  // Serialize the argument size
2510  _status = _logBuff.serialize(
2511  static_cast<U8>(sizeof(U32))
2512  );
2513  FW_ASSERT(
2514  _status == Fw::FW_SERIALIZE_OK,
2515  static_cast<FwAssertArgType>(_status)
2516  );
2517 #endif
2518  _status = _logBuff.serialize(size);
2519  FW_ASSERT(
2520  _status == Fw::FW_SERIALIZE_OK,
2521  static_cast<FwAssertArgType>(_status)
2522  );
2523 
2524  this->m_logOut_OutputPort[0].invoke(
2525  _id,
2526  _logTime,
2528  _logBuff
2529  );
2530  }
2531 
2532  // Emit the event on the text log port
2533 #if FW_ENABLE_TEXT_LOGGING
2534  if (this->m_LogText_OutputPort[0].isConnected()) {
2535 #if FW_OBJECT_NAMES == 1
2536  const char* _formatString =
2537  "(%s) %s: Sequence file %s too large. Size: %" PRIu32 "";
2538 #else
2539  const char* _formatString =
2540  "%s: Sequence file %s too large. Size: %" PRIu32 "";
2541 #endif
2542 
2543  Fw::TextLogString _logString;
2544  _logString.format(
2545  _formatString,
2546 #if FW_OBJECT_NAMES == 1
2547  this->m_objName.toChar(),
2548 #endif
2549  "CS_FileSizeError ",
2550  fileName.toChar(),
2551  size
2552  );
2553 
2554  this->m_LogText_OutputPort[0].invoke(
2555  _id,
2556  _logTime,
2558  _logString
2559  );
2560  }
2561 #endif
2562  }
2563 
2566  {
2567  // Get the time
2568  Fw::Time _logTime;
2569  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2570  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2571  }
2572 
2573  FwEventIdType _id = static_cast<FwEventIdType>(0);
2574 
2575  _id = this->getIdBase() + EVENTID_CS_FILENOTFOUND;
2576 
2577  // Emit the event on the log port
2578  if (this->m_logOut_OutputPort[0].isConnected()) {
2579  Fw::LogBuffer _logBuff;
2581 
2582 #if FW_AMPCS_COMPATIBLE
2583  // Serialize the number of arguments
2584  _status = _logBuff.serialize(static_cast<U8>(1));
2585  FW_ASSERT(
2586  _status == Fw::FW_SERIALIZE_OK,
2587  static_cast<FwAssertArgType>(_status)
2588  );
2589 #endif
2590 
2591  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2592  FW_ASSERT(
2593  _status == Fw::FW_SERIALIZE_OK,
2594  static_cast<FwAssertArgType>(_status)
2595  );
2596 
2597  this->m_logOut_OutputPort[0].invoke(
2598  _id,
2599  _logTime,
2601  _logBuff
2602  );
2603  }
2604 
2605  // Emit the event on the text log port
2606 #if FW_ENABLE_TEXT_LOGGING
2607  if (this->m_LogText_OutputPort[0].isConnected()) {
2608 #if FW_OBJECT_NAMES == 1
2609  const char* _formatString =
2610  "(%s) %s: Sequence file %s not found.";
2611 #else
2612  const char* _formatString =
2613  "%s: Sequence file %s not found.";
2614 #endif
2615 
2616  Fw::TextLogString _logString;
2617  _logString.format(
2618  _formatString,
2619 #if FW_OBJECT_NAMES == 1
2620  this->m_objName.toChar(),
2621 #endif
2622  "CS_FileNotFound ",
2623  fileName.toChar()
2624  );
2625 
2626  this->m_LogText_OutputPort[0].invoke(
2627  _id,
2628  _logTime,
2630  _logString
2631  );
2632  }
2633 #endif
2634  }
2635 
2638  const Fw::StringBase& fileName,
2639  U32 storedCRC,
2640  U32 computedCRC
2641  )
2642  {
2643  // Get the time
2644  Fw::Time _logTime;
2645  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2646  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2647  }
2648 
2649  FwEventIdType _id = static_cast<FwEventIdType>(0);
2650 
2651  _id = this->getIdBase() + EVENTID_CS_FILECRCFAILURE;
2652 
2653  // Emit the event on the log port
2654  if (this->m_logOut_OutputPort[0].isConnected()) {
2655  Fw::LogBuffer _logBuff;
2657 
2658 #if FW_AMPCS_COMPATIBLE
2659  // Serialize the number of arguments
2660  _status = _logBuff.serialize(static_cast<U8>(3));
2661  FW_ASSERT(
2662  _status == Fw::FW_SERIALIZE_OK,
2663  static_cast<FwAssertArgType>(_status)
2664  );
2665 #endif
2666 
2667  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2668  FW_ASSERT(
2669  _status == Fw::FW_SERIALIZE_OK,
2670  static_cast<FwAssertArgType>(_status)
2671  );
2672 
2673 #if FW_AMPCS_COMPATIBLE
2674  // Serialize the argument size
2675  _status = _logBuff.serialize(
2676  static_cast<U8>(sizeof(U32))
2677  );
2678  FW_ASSERT(
2679  _status == Fw::FW_SERIALIZE_OK,
2680  static_cast<FwAssertArgType>(_status)
2681  );
2682 #endif
2683  _status = _logBuff.serialize(storedCRC);
2684  FW_ASSERT(
2685  _status == Fw::FW_SERIALIZE_OK,
2686  static_cast<FwAssertArgType>(_status)
2687  );
2688 
2689 #if FW_AMPCS_COMPATIBLE
2690  // Serialize the argument size
2691  _status = _logBuff.serialize(
2692  static_cast<U8>(sizeof(U32))
2693  );
2694  FW_ASSERT(
2695  _status == Fw::FW_SERIALIZE_OK,
2696  static_cast<FwAssertArgType>(_status)
2697  );
2698 #endif
2699  _status = _logBuff.serialize(computedCRC);
2700  FW_ASSERT(
2701  _status == Fw::FW_SERIALIZE_OK,
2702  static_cast<FwAssertArgType>(_status)
2703  );
2704 
2705  this->m_logOut_OutputPort[0].invoke(
2706  _id,
2707  _logTime,
2709  _logBuff
2710  );
2711  }
2712 
2713  // Emit the event on the text log port
2714 #if FW_ENABLE_TEXT_LOGGING
2715  if (this->m_LogText_OutputPort[0].isConnected()) {
2716 #if FW_OBJECT_NAMES == 1
2717  const char* _formatString =
2718  "(%s) %s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2719 #else
2720  const char* _formatString =
2721  "%s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2722 #endif
2723 
2724  Fw::TextLogString _logString;
2725  _logString.format(
2726  _formatString,
2727 #if FW_OBJECT_NAMES == 1
2728  this->m_objName.toChar(),
2729 #endif
2730  "CS_FileCrcFailure ",
2731  fileName.toChar(),
2732  storedCRC,
2733  computedCRC
2734  );
2735 
2736  this->m_LogText_OutputPort[0].invoke(
2737  _id,
2738  _logTime,
2740  _logString
2741  );
2742  }
2743 #endif
2744  }
2745 
2748  const Fw::StringBase& fileName,
2749  U32 recordNumber,
2750  U32 opCode
2751  )
2752  {
2753  // Get the time
2754  Fw::Time _logTime;
2755  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2756  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2757  }
2758 
2759  FwEventIdType _id = static_cast<FwEventIdType>(0);
2760 
2761  _id = this->getIdBase() + EVENTID_CS_COMMANDCOMPLETE;
2762 
2763  // Emit the event on the log port
2764  if (this->m_logOut_OutputPort[0].isConnected()) {
2765  Fw::LogBuffer _logBuff;
2767 
2768 #if FW_AMPCS_COMPATIBLE
2769  // Serialize the number of arguments
2770  _status = _logBuff.serialize(static_cast<U8>(3));
2771  FW_ASSERT(
2772  _status == Fw::FW_SERIALIZE_OK,
2773  static_cast<FwAssertArgType>(_status)
2774  );
2775 #endif
2776 
2777  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2778  FW_ASSERT(
2779  _status == Fw::FW_SERIALIZE_OK,
2780  static_cast<FwAssertArgType>(_status)
2781  );
2782 
2783 #if FW_AMPCS_COMPATIBLE
2784  // Serialize the argument size
2785  _status = _logBuff.serialize(
2786  static_cast<U8>(sizeof(U32))
2787  );
2788  FW_ASSERT(
2789  _status == Fw::FW_SERIALIZE_OK,
2790  static_cast<FwAssertArgType>(_status)
2791  );
2792 #endif
2793  _status = _logBuff.serialize(recordNumber);
2794  FW_ASSERT(
2795  _status == Fw::FW_SERIALIZE_OK,
2796  static_cast<FwAssertArgType>(_status)
2797  );
2798 
2799 #if FW_AMPCS_COMPATIBLE
2800  // Serialize the argument size
2801  _status = _logBuff.serialize(
2802  static_cast<U8>(sizeof(U32))
2803  );
2804  FW_ASSERT(
2805  _status == Fw::FW_SERIALIZE_OK,
2806  static_cast<FwAssertArgType>(_status)
2807  );
2808 #endif
2809  _status = _logBuff.serialize(opCode);
2810  FW_ASSERT(
2811  _status == Fw::FW_SERIALIZE_OK,
2812  static_cast<FwAssertArgType>(_status)
2813  );
2814 
2815  this->m_logOut_OutputPort[0].invoke(
2816  _id,
2817  _logTime,
2819  _logBuff
2820  );
2821  }
2822 
2823  // Emit the event on the text log port
2824 #if FW_ENABLE_TEXT_LOGGING
2825  if (this->m_LogText_OutputPort[0].isConnected()) {
2826 #if FW_OBJECT_NAMES == 1
2827  const char* _formatString =
2828  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
2829 #else
2830  const char* _formatString =
2831  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
2832 #endif
2833 
2834  Fw::TextLogString _logString;
2835  _logString.format(
2836  _formatString,
2837 #if FW_OBJECT_NAMES == 1
2838  this->m_objName.toChar(),
2839 #endif
2840  "CS_CommandComplete ",
2841  fileName.toChar(),
2842  recordNumber,
2843  opCode
2844  );
2845 
2846  this->m_LogText_OutputPort[0].invoke(
2847  _id,
2848  _logTime,
2850  _logString
2851  );
2852  }
2853 #endif
2854  }
2855 
2858  {
2859  // Get the time
2860  Fw::Time _logTime;
2861  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2862  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2863  }
2864 
2865  FwEventIdType _id = static_cast<FwEventIdType>(0);
2866 
2867  _id = this->getIdBase() + EVENTID_CS_SEQUENCECOMPLETE;
2868 
2869  // Emit the event on the log port
2870  if (this->m_logOut_OutputPort[0].isConnected()) {
2871  Fw::LogBuffer _logBuff;
2873 
2874 #if FW_AMPCS_COMPATIBLE
2875  // Serialize the number of arguments
2876  _status = _logBuff.serialize(static_cast<U8>(1));
2877  FW_ASSERT(
2878  _status == Fw::FW_SERIALIZE_OK,
2879  static_cast<FwAssertArgType>(_status)
2880  );
2881 #endif
2882 
2883  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2884  FW_ASSERT(
2885  _status == Fw::FW_SERIALIZE_OK,
2886  static_cast<FwAssertArgType>(_status)
2887  );
2888 
2889  this->m_logOut_OutputPort[0].invoke(
2890  _id,
2891  _logTime,
2893  _logBuff
2894  );
2895  }
2896 
2897  // Emit the event on the text log port
2898 #if FW_ENABLE_TEXT_LOGGING
2899  if (this->m_LogText_OutputPort[0].isConnected()) {
2900 #if FW_OBJECT_NAMES == 1
2901  const char* _formatString =
2902  "(%s) %s: Sequence file %s complete";
2903 #else
2904  const char* _formatString =
2905  "%s: Sequence file %s complete";
2906 #endif
2907 
2908  Fw::TextLogString _logString;
2909  _logString.format(
2910  _formatString,
2911 #if FW_OBJECT_NAMES == 1
2912  this->m_objName.toChar(),
2913 #endif
2914  "CS_SequenceComplete ",
2915  fileName.toChar()
2916  );
2917 
2918  this->m_LogText_OutputPort[0].invoke(
2919  _id,
2920  _logTime,
2922  _logString
2923  );
2924  }
2925 #endif
2926  }
2927 
2930  const Fw::StringBase& fileName,
2931  U32 recordNumber,
2932  U32 opCode,
2933  U32 errorStatus
2934  )
2935  {
2936  // Get the time
2937  Fw::Time _logTime;
2938  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2939  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2940  }
2941 
2942  FwEventIdType _id = static_cast<FwEventIdType>(0);
2943 
2944  _id = this->getIdBase() + EVENTID_CS_COMMANDERROR;
2945 
2946  // Emit the event on the log port
2947  if (this->m_logOut_OutputPort[0].isConnected()) {
2948  Fw::LogBuffer _logBuff;
2950 
2951 #if FW_AMPCS_COMPATIBLE
2952  // Serialize the number of arguments
2953  _status = _logBuff.serialize(static_cast<U8>(4));
2954  FW_ASSERT(
2955  _status == Fw::FW_SERIALIZE_OK,
2956  static_cast<FwAssertArgType>(_status)
2957  );
2958 #endif
2959 
2960  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
2961  FW_ASSERT(
2962  _status == Fw::FW_SERIALIZE_OK,
2963  static_cast<FwAssertArgType>(_status)
2964  );
2965 
2966 #if FW_AMPCS_COMPATIBLE
2967  // Serialize the argument size
2968  _status = _logBuff.serialize(
2969  static_cast<U8>(sizeof(U32))
2970  );
2971  FW_ASSERT(
2972  _status == Fw::FW_SERIALIZE_OK,
2973  static_cast<FwAssertArgType>(_status)
2974  );
2975 #endif
2976  _status = _logBuff.serialize(recordNumber);
2977  FW_ASSERT(
2978  _status == Fw::FW_SERIALIZE_OK,
2979  static_cast<FwAssertArgType>(_status)
2980  );
2981 
2982 #if FW_AMPCS_COMPATIBLE
2983  // Serialize the argument size
2984  _status = _logBuff.serialize(
2985  static_cast<U8>(sizeof(U32))
2986  );
2987  FW_ASSERT(
2988  _status == Fw::FW_SERIALIZE_OK,
2989  static_cast<FwAssertArgType>(_status)
2990  );
2991 #endif
2992  _status = _logBuff.serialize(opCode);
2993  FW_ASSERT(
2994  _status == Fw::FW_SERIALIZE_OK,
2995  static_cast<FwAssertArgType>(_status)
2996  );
2997 
2998 #if FW_AMPCS_COMPATIBLE
2999  // Serialize the argument size
3000  _status = _logBuff.serialize(
3001  static_cast<U8>(sizeof(U32))
3002  );
3003  FW_ASSERT(
3004  _status == Fw::FW_SERIALIZE_OK,
3005  static_cast<FwAssertArgType>(_status)
3006  );
3007 #endif
3008  _status = _logBuff.serialize(errorStatus);
3009  FW_ASSERT(
3010  _status == Fw::FW_SERIALIZE_OK,
3011  static_cast<FwAssertArgType>(_status)
3012  );
3013 
3014  this->m_logOut_OutputPort[0].invoke(
3015  _id,
3016  _logTime,
3018  _logBuff
3019  );
3020  }
3021 
3022  // Emit the event on the text log port
3023 #if FW_ENABLE_TEXT_LOGGING
3024  if (this->m_LogText_OutputPort[0].isConnected()) {
3025 #if FW_OBJECT_NAMES == 1
3026  const char* _formatString =
3027  "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3028 #else
3029  const char* _formatString =
3030  "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3031 #endif
3032 
3033  Fw::TextLogString _logString;
3034  _logString.format(
3035  _formatString,
3036 #if FW_OBJECT_NAMES == 1
3037  this->m_objName.toChar(),
3038 #endif
3039  "CS_CommandError ",
3040  fileName.toChar(),
3041  recordNumber,
3042  opCode,
3043  errorStatus
3044  );
3045 
3046  this->m_LogText_OutputPort[0].invoke(
3047  _id,
3048  _logTime,
3050  _logString
3051  );
3052  }
3053 #endif
3054  }
3055 
3058  {
3059  // Get the time
3060  Fw::Time _logTime;
3061  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3062  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3063  }
3064 
3065  FwEventIdType _id = static_cast<FwEventIdType>(0);
3066 
3067  _id = this->getIdBase() + EVENTID_CS_INVALIDMODE;
3068 
3069  // Emit the event on the log port
3070  if (this->m_logOut_OutputPort[0].isConnected()) {
3071  Fw::LogBuffer _logBuff;
3072 
3073 #if FW_AMPCS_COMPATIBLE
3075  // Serialize the number of arguments
3076  _status = _logBuff.serialize(static_cast<U8>(0));
3077  FW_ASSERT(
3078  _status == Fw::FW_SERIALIZE_OK,
3079  static_cast<FwAssertArgType>(_status)
3080  );
3081 #endif
3082 
3083  this->m_logOut_OutputPort[0].invoke(
3084  _id,
3085  _logTime,
3087  _logBuff
3088  );
3089  }
3090 
3091  // Emit the event on the text log port
3092 #if FW_ENABLE_TEXT_LOGGING
3093  if (this->m_LogText_OutputPort[0].isConnected()) {
3094 #if FW_OBJECT_NAMES == 1
3095  const char* _formatString =
3096  "(%s) %s: Invalid mode";
3097 #else
3098  const char* _formatString =
3099  "%s: Invalid mode";
3100 #endif
3101 
3102  Fw::TextLogString _logString;
3103  _logString.format(
3104  _formatString,
3105 #if FW_OBJECT_NAMES == 1
3106  this->m_objName.toChar(),
3107 #endif
3108  "CS_InvalidMode "
3109  );
3110 
3111  this->m_LogText_OutputPort[0].invoke(
3112  _id,
3113  _logTime,
3115  _logString
3116  );
3117  }
3118 #endif
3119  }
3120 
3123  const Fw::StringBase& fileName,
3124  U32 header_records,
3125  U32 extra_bytes
3126  )
3127  {
3128  // Get the time
3129  Fw::Time _logTime;
3130  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3131  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3132  }
3133 
3134  FwEventIdType _id = static_cast<FwEventIdType>(0);
3135 
3136  _id = this->getIdBase() + EVENTID_CS_RECORDMISMATCH;
3137 
3138  // Emit the event on the log port
3139  if (this->m_logOut_OutputPort[0].isConnected()) {
3140  Fw::LogBuffer _logBuff;
3142 
3143 #if FW_AMPCS_COMPATIBLE
3144  // Serialize the number of arguments
3145  _status = _logBuff.serialize(static_cast<U8>(3));
3146  FW_ASSERT(
3147  _status == Fw::FW_SERIALIZE_OK,
3148  static_cast<FwAssertArgType>(_status)
3149  );
3150 #endif
3151 
3152  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3153  FW_ASSERT(
3154  _status == Fw::FW_SERIALIZE_OK,
3155  static_cast<FwAssertArgType>(_status)
3156  );
3157 
3158 #if FW_AMPCS_COMPATIBLE
3159  // Serialize the argument size
3160  _status = _logBuff.serialize(
3161  static_cast<U8>(sizeof(U32))
3162  );
3163  FW_ASSERT(
3164  _status == Fw::FW_SERIALIZE_OK,
3165  static_cast<FwAssertArgType>(_status)
3166  );
3167 #endif
3168  _status = _logBuff.serialize(header_records);
3169  FW_ASSERT(
3170  _status == Fw::FW_SERIALIZE_OK,
3171  static_cast<FwAssertArgType>(_status)
3172  );
3173 
3174 #if FW_AMPCS_COMPATIBLE
3175  // Serialize the argument size
3176  _status = _logBuff.serialize(
3177  static_cast<U8>(sizeof(U32))
3178  );
3179  FW_ASSERT(
3180  _status == Fw::FW_SERIALIZE_OK,
3181  static_cast<FwAssertArgType>(_status)
3182  );
3183 #endif
3184  _status = _logBuff.serialize(extra_bytes);
3185  FW_ASSERT(
3186  _status == Fw::FW_SERIALIZE_OK,
3187  static_cast<FwAssertArgType>(_status)
3188  );
3189 
3190  this->m_logOut_OutputPort[0].invoke(
3191  _id,
3192  _logTime,
3194  _logBuff
3195  );
3196  }
3197 
3198  // Emit the event on the text log port
3199 #if FW_ENABLE_TEXT_LOGGING
3200  if (this->m_LogText_OutputPort[0].isConnected()) {
3201 #if FW_OBJECT_NAMES == 1
3202  const char* _formatString =
3203  "(%s) %s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3204 #else
3205  const char* _formatString =
3206  "%s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3207 #endif
3208 
3209  Fw::TextLogString _logString;
3210  _logString.format(
3211  _formatString,
3212 #if FW_OBJECT_NAMES == 1
3213  this->m_objName.toChar(),
3214 #endif
3215  "CS_RecordMismatch ",
3216  fileName.toChar(),
3217  header_records,
3218  extra_bytes
3219  );
3220 
3221  this->m_LogText_OutputPort[0].invoke(
3222  _id,
3223  _logTime,
3225  _logString
3226  );
3227  }
3228 #endif
3229  }
3230 
3233  const Fw::StringBase& fileName,
3234  U16 time_base,
3235  U16 seq_time_base
3236  )
3237  {
3238  // Get the time
3239  Fw::Time _logTime;
3240  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3241  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3242  }
3243 
3244  FwEventIdType _id = static_cast<FwEventIdType>(0);
3245 
3246  _id = this->getIdBase() + EVENTID_CS_TIMEBASEMISMATCH;
3247 
3248  // Emit the event on the log port
3249  if (this->m_logOut_OutputPort[0].isConnected()) {
3250  Fw::LogBuffer _logBuff;
3252 
3253 #if FW_AMPCS_COMPATIBLE
3254  // Serialize the number of arguments
3255  _status = _logBuff.serialize(static_cast<U8>(3));
3256  FW_ASSERT(
3257  _status == Fw::FW_SERIALIZE_OK,
3258  static_cast<FwAssertArgType>(_status)
3259  );
3260 #endif
3261 
3262  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3263  FW_ASSERT(
3264  _status == Fw::FW_SERIALIZE_OK,
3265  static_cast<FwAssertArgType>(_status)
3266  );
3267 
3268 #if FW_AMPCS_COMPATIBLE
3269  // Serialize the argument size
3270  _status = _logBuff.serialize(
3271  static_cast<U8>(sizeof(U16))
3272  );
3273  FW_ASSERT(
3274  _status == Fw::FW_SERIALIZE_OK,
3275  static_cast<FwAssertArgType>(_status)
3276  );
3277 #endif
3278  _status = _logBuff.serialize(time_base);
3279  FW_ASSERT(
3280  _status == Fw::FW_SERIALIZE_OK,
3281  static_cast<FwAssertArgType>(_status)
3282  );
3283 
3284 #if FW_AMPCS_COMPATIBLE
3285  // Serialize the argument size
3286  _status = _logBuff.serialize(
3287  static_cast<U8>(sizeof(U16))
3288  );
3289  FW_ASSERT(
3290  _status == Fw::FW_SERIALIZE_OK,
3291  static_cast<FwAssertArgType>(_status)
3292  );
3293 #endif
3294  _status = _logBuff.serialize(seq_time_base);
3295  FW_ASSERT(
3296  _status == Fw::FW_SERIALIZE_OK,
3297  static_cast<FwAssertArgType>(_status)
3298  );
3299 
3300  this->m_logOut_OutputPort[0].invoke(
3301  _id,
3302  _logTime,
3304  _logBuff
3305  );
3306  }
3307 
3308  // Emit the event on the text log port
3309 #if FW_ENABLE_TEXT_LOGGING
3310  if (this->m_LogText_OutputPort[0].isConnected()) {
3311 #if FW_OBJECT_NAMES == 1
3312  const char* _formatString =
3313  "(%s) %s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3314 #else
3315  const char* _formatString =
3316  "%s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3317 #endif
3318 
3319  Fw::TextLogString _logString;
3320  _logString.format(
3321  _formatString,
3322 #if FW_OBJECT_NAMES == 1
3323  this->m_objName.toChar(),
3324 #endif
3325  "CS_TimeBaseMismatch ",
3326  fileName.toChar(),
3327  time_base,
3328  seq_time_base
3329  );
3330 
3331  this->m_LogText_OutputPort[0].invoke(
3332  _id,
3333  _logTime,
3335  _logString
3336  );
3337  }
3338 #endif
3339  }
3340 
3343  const Fw::StringBase& fileName,
3344  U8 currTimeBase,
3345  U8 seqTimeBase
3346  )
3347  {
3348  // Get the time
3349  Fw::Time _logTime;
3350  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3351  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3352  }
3353 
3354  FwEventIdType _id = static_cast<FwEventIdType>(0);
3355 
3356  _id = this->getIdBase() + EVENTID_CS_TIMECONTEXTMISMATCH;
3357 
3358  // Emit the event on the log port
3359  if (this->m_logOut_OutputPort[0].isConnected()) {
3360  Fw::LogBuffer _logBuff;
3362 
3363 #if FW_AMPCS_COMPATIBLE
3364  // Serialize the number of arguments
3365  _status = _logBuff.serialize(static_cast<U8>(3));
3366  FW_ASSERT(
3367  _status == Fw::FW_SERIALIZE_OK,
3368  static_cast<FwAssertArgType>(_status)
3369  );
3370 #endif
3371 
3372  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3373  FW_ASSERT(
3374  _status == Fw::FW_SERIALIZE_OK,
3375  static_cast<FwAssertArgType>(_status)
3376  );
3377 
3378 #if FW_AMPCS_COMPATIBLE
3379  // Serialize the argument size
3380  _status = _logBuff.serialize(
3381  static_cast<U8>(sizeof(U8))
3382  );
3383  FW_ASSERT(
3384  _status == Fw::FW_SERIALIZE_OK,
3385  static_cast<FwAssertArgType>(_status)
3386  );
3387 #endif
3388  _status = _logBuff.serialize(currTimeBase);
3389  FW_ASSERT(
3390  _status == Fw::FW_SERIALIZE_OK,
3391  static_cast<FwAssertArgType>(_status)
3392  );
3393 
3394 #if FW_AMPCS_COMPATIBLE
3395  // Serialize the argument size
3396  _status = _logBuff.serialize(
3397  static_cast<U8>(sizeof(U8))
3398  );
3399  FW_ASSERT(
3400  _status == Fw::FW_SERIALIZE_OK,
3401  static_cast<FwAssertArgType>(_status)
3402  );
3403 #endif
3404  _status = _logBuff.serialize(seqTimeBase);
3405  FW_ASSERT(
3406  _status == Fw::FW_SERIALIZE_OK,
3407  static_cast<FwAssertArgType>(_status)
3408  );
3409 
3410  this->m_logOut_OutputPort[0].invoke(
3411  _id,
3412  _logTime,
3414  _logBuff
3415  );
3416  }
3417 
3418  // Emit the event on the text log port
3419 #if FW_ENABLE_TEXT_LOGGING
3420  if (this->m_LogText_OutputPort[0].isConnected()) {
3421 #if FW_OBJECT_NAMES == 1
3422  const char* _formatString =
3423  "(%s) %s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3424 #else
3425  const char* _formatString =
3426  "%s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3427 #endif
3428 
3429  Fw::TextLogString _logString;
3430  _logString.format(
3431  _formatString,
3432 #if FW_OBJECT_NAMES == 1
3433  this->m_objName.toChar(),
3434 #endif
3435  "CS_TimeContextMismatch ",
3436  fileName.toChar(),
3437  currTimeBase,
3438  seqTimeBase
3439  );
3440 
3441  this->m_LogText_OutputPort[0].invoke(
3442  _id,
3443  _logTime,
3445  _logString
3446  );
3447  }
3448 #endif
3449  }
3450 
3453  {
3454  // Get the time
3455  Fw::Time _logTime;
3456  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3457  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3458  }
3459 
3460  FwEventIdType _id = static_cast<FwEventIdType>(0);
3461 
3462  _id = this->getIdBase() + EVENTID_CS_PORTSEQUENCESTARTED;
3463 
3464  // Emit the event on the log port
3465  if (this->m_logOut_OutputPort[0].isConnected()) {
3466  Fw::LogBuffer _logBuff;
3468 
3469 #if FW_AMPCS_COMPATIBLE
3470  // Serialize the number of arguments
3471  _status = _logBuff.serialize(static_cast<U8>(1));
3472  FW_ASSERT(
3473  _status == Fw::FW_SERIALIZE_OK,
3474  static_cast<FwAssertArgType>(_status)
3475  );
3476 #endif
3477 
3478  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3479  FW_ASSERT(
3480  _status == Fw::FW_SERIALIZE_OK,
3481  static_cast<FwAssertArgType>(_status)
3482  );
3483 
3484  this->m_logOut_OutputPort[0].invoke(
3485  _id,
3486  _logTime,
3488  _logBuff
3489  );
3490  }
3491 
3492  // Emit the event on the text log port
3493 #if FW_ENABLE_TEXT_LOGGING
3494  if (this->m_LogText_OutputPort[0].isConnected()) {
3495 #if FW_OBJECT_NAMES == 1
3496  const char* _formatString =
3497  "(%s) %s: Local request for sequence %s started.";
3498 #else
3499  const char* _formatString =
3500  "%s: Local request for sequence %s started.";
3501 #endif
3502 
3503  Fw::TextLogString _logString;
3504  _logString.format(
3505  _formatString,
3506 #if FW_OBJECT_NAMES == 1
3507  this->m_objName.toChar(),
3508 #endif
3509  "CS_PortSequenceStarted ",
3510  filename.toChar()
3511  );
3512 
3513  this->m_LogText_OutputPort[0].invoke(
3514  _id,
3515  _logTime,
3517  _logString
3518  );
3519  }
3520 #endif
3521  }
3522 
3525  {
3526  // Get the time
3527  Fw::Time _logTime;
3528  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3529  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3530  }
3531 
3532  FwEventIdType _id = static_cast<FwEventIdType>(0);
3533 
3535 
3536  // Emit the event on the log port
3537  if (this->m_logOut_OutputPort[0].isConnected()) {
3538  Fw::LogBuffer _logBuff;
3540 
3541 #if FW_AMPCS_COMPATIBLE
3542  // Serialize the number of arguments
3543  _status = _logBuff.serialize(static_cast<U8>(1));
3544  FW_ASSERT(
3545  _status == Fw::FW_SERIALIZE_OK,
3546  static_cast<FwAssertArgType>(_status)
3547  );
3548 #endif
3549 
3550 #if FW_AMPCS_COMPATIBLE
3551  // Serialize the argument size
3552  _status = _logBuff.serialize(
3553  static_cast<U8>(sizeof(U32))
3554  );
3555  FW_ASSERT(
3556  _status == Fw::FW_SERIALIZE_OK,
3557  static_cast<FwAssertArgType>(_status)
3558  );
3559 #endif
3560  _status = _logBuff.serialize(opcode);
3561  FW_ASSERT(
3562  _status == Fw::FW_SERIALIZE_OK,
3563  static_cast<FwAssertArgType>(_status)
3564  );
3565 
3566  this->m_logOut_OutputPort[0].invoke(
3567  _id,
3568  _logTime,
3570  _logBuff
3571  );
3572  }
3573 
3574  // Emit the event on the text log port
3575 #if FW_ENABLE_TEXT_LOGGING
3576  if (this->m_LogText_OutputPort[0].isConnected()) {
3577 #if FW_OBJECT_NAMES == 1
3578  const char* _formatString =
3579  "(%s) %s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3580 #else
3581  const char* _formatString =
3582  "%s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3583 #endif
3584 
3585  Fw::TextLogString _logString;
3586  _logString.format(
3587  _formatString,
3588 #if FW_OBJECT_NAMES == 1
3589  this->m_objName.toChar(),
3590 #endif
3591  "CS_UnexpectedCompletion ",
3592  opcode
3593  );
3594 
3595  this->m_LogText_OutputPort[0].invoke(
3596  _id,
3597  _logTime,
3599  _logString
3600  );
3601  }
3602 #endif
3603  }
3604 
3607  {
3608  // Get the time
3609  Fw::Time _logTime;
3610  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3611  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3612  }
3613 
3614  FwEventIdType _id = static_cast<FwEventIdType>(0);
3615 
3616  _id = this->getIdBase() + EVENTID_CS_MODESWITCHED;
3617 
3618  // Emit the event on the log port
3619  if (this->m_logOut_OutputPort[0].isConnected()) {
3620  Fw::LogBuffer _logBuff;
3622 
3623 #if FW_AMPCS_COMPATIBLE
3624  // Serialize the number of arguments
3625  _status = _logBuff.serialize(static_cast<U8>(1));
3626  FW_ASSERT(
3627  _status == Fw::FW_SERIALIZE_OK,
3628  static_cast<FwAssertArgType>(_status)
3629  );
3630 #endif
3631 
3632 #if FW_AMPCS_COMPATIBLE
3633  // Serialize the argument size
3634  _status = _logBuff.serialize(
3636  );
3637  FW_ASSERT(
3638  _status == Fw::FW_SERIALIZE_OK,
3639  static_cast<FwAssertArgType>(_status)
3640  );
3641 #endif
3642  _status = _logBuff.serialize(mode);
3643  FW_ASSERT(
3644  _status == Fw::FW_SERIALIZE_OK,
3645  static_cast<FwAssertArgType>(_status)
3646  );
3647 
3648  this->m_logOut_OutputPort[0].invoke(
3649  _id,
3650  _logTime,
3652  _logBuff
3653  );
3654  }
3655 
3656  // Emit the event on the text log port
3657 #if FW_ENABLE_TEXT_LOGGING
3658  if (this->m_LogText_OutputPort[0].isConnected()) {
3659 #if FW_OBJECT_NAMES == 1
3660  const char* _formatString =
3661  "(%s) %s: Sequencer switched to %s step mode";
3662 #else
3663  const char* _formatString =
3664  "%s: Sequencer switched to %s step mode";
3665 #endif
3666 
3667  Fw::String modeStr;
3668  mode.toString(modeStr);
3669 
3670  Fw::TextLogString _logString;
3671  _logString.format(
3672  _formatString,
3673 #if FW_OBJECT_NAMES == 1
3674  this->m_objName.toChar(),
3675 #endif
3676  "CS_ModeSwitched ",
3677  modeStr.toChar()
3678  );
3679 
3680  this->m_LogText_OutputPort[0].invoke(
3681  _id,
3682  _logTime,
3684  _logString
3685  );
3686  }
3687 #endif
3688  }
3689 
3692  {
3693  // Get the time
3694  Fw::Time _logTime;
3695  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3696  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3697  }
3698 
3699  FwEventIdType _id = static_cast<FwEventIdType>(0);
3700 
3701  _id = this->getIdBase() + EVENTID_CS_NOSEQUENCEACTIVE;
3702 
3703  // Emit the event on the log port
3704  if (this->m_logOut_OutputPort[0].isConnected()) {
3705  Fw::LogBuffer _logBuff;
3706 
3707 #if FW_AMPCS_COMPATIBLE
3709  // Serialize the number of arguments
3710  _status = _logBuff.serialize(static_cast<U8>(0));
3711  FW_ASSERT(
3712  _status == Fw::FW_SERIALIZE_OK,
3713  static_cast<FwAssertArgType>(_status)
3714  );
3715 #endif
3716 
3717  this->m_logOut_OutputPort[0].invoke(
3718  _id,
3719  _logTime,
3721  _logBuff
3722  );
3723  }
3724 
3725  // Emit the event on the text log port
3726 #if FW_ENABLE_TEXT_LOGGING
3727  if (this->m_LogText_OutputPort[0].isConnected()) {
3728 #if FW_OBJECT_NAMES == 1
3729  const char* _formatString =
3730  "(%s) %s: No sequence active.";
3731 #else
3732  const char* _formatString =
3733  "%s: No sequence active.";
3734 #endif
3735 
3736  Fw::TextLogString _logString;
3737  _logString.format(
3738  _formatString,
3739 #if FW_OBJECT_NAMES == 1
3740  this->m_objName.toChar(),
3741 #endif
3742  "CS_NoSequenceActive "
3743  );
3744 
3745  this->m_LogText_OutputPort[0].invoke(
3746  _id,
3747  _logTime,
3749  _logString
3750  );
3751  }
3752 #endif
3753  }
3754 
3757  {
3758  // Get the time
3759  Fw::Time _logTime;
3760  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3761  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3762  }
3763 
3764  FwEventIdType _id = static_cast<FwEventIdType>(0);
3765 
3766  _id = this->getIdBase() + EVENTID_CS_SEQUENCEVALID;
3767 
3768  // Emit the event on the log port
3769  if (this->m_logOut_OutputPort[0].isConnected()) {
3770  Fw::LogBuffer _logBuff;
3772 
3773 #if FW_AMPCS_COMPATIBLE
3774  // Serialize the number of arguments
3775  _status = _logBuff.serialize(static_cast<U8>(1));
3776  FW_ASSERT(
3777  _status == Fw::FW_SERIALIZE_OK,
3778  static_cast<FwAssertArgType>(_status)
3779  );
3780 #endif
3781 
3782  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3783  FW_ASSERT(
3784  _status == Fw::FW_SERIALIZE_OK,
3785  static_cast<FwAssertArgType>(_status)
3786  );
3787 
3788  this->m_logOut_OutputPort[0].invoke(
3789  _id,
3790  _logTime,
3792  _logBuff
3793  );
3794  }
3795 
3796  // Emit the event on the text log port
3797 #if FW_ENABLE_TEXT_LOGGING
3798  if (this->m_LogText_OutputPort[0].isConnected()) {
3799 #if FW_OBJECT_NAMES == 1
3800  const char* _formatString =
3801  "(%s) %s: Sequence %s is valid.";
3802 #else
3803  const char* _formatString =
3804  "%s: Sequence %s is valid.";
3805 #endif
3806 
3807  Fw::TextLogString _logString;
3808  _logString.format(
3809  _formatString,
3810 #if FW_OBJECT_NAMES == 1
3811  this->m_objName.toChar(),
3812 #endif
3813  "CS_SequenceValid ",
3814  filename.toChar()
3815  );
3816 
3817  this->m_LogText_OutputPort[0].invoke(
3818  _id,
3819  _logTime,
3821  _logString
3822  );
3823  }
3824 #endif
3825  }
3826 
3829  const Fw::StringBase& filename,
3830  U32 command
3831  )
3832  {
3833  // Get the time
3834  Fw::Time _logTime;
3835  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3836  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3837  }
3838 
3839  FwEventIdType _id = static_cast<FwEventIdType>(0);
3840 
3841  _id = this->getIdBase() + EVENTID_CS_SEQUENCETIMEOUT;
3842 
3843  // Emit the event on the log port
3844  if (this->m_logOut_OutputPort[0].isConnected()) {
3845  Fw::LogBuffer _logBuff;
3847 
3848 #if FW_AMPCS_COMPATIBLE
3849  // Serialize the number of arguments
3850  _status = _logBuff.serialize(static_cast<U8>(2));
3851  FW_ASSERT(
3852  _status == Fw::FW_SERIALIZE_OK,
3853  static_cast<FwAssertArgType>(_status)
3854  );
3855 #endif
3856 
3857  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3858  FW_ASSERT(
3859  _status == Fw::FW_SERIALIZE_OK,
3860  static_cast<FwAssertArgType>(_status)
3861  );
3862 
3863 #if FW_AMPCS_COMPATIBLE
3864  // Serialize the argument size
3865  _status = _logBuff.serialize(
3866  static_cast<U8>(sizeof(U32))
3867  );
3868  FW_ASSERT(
3869  _status == Fw::FW_SERIALIZE_OK,
3870  static_cast<FwAssertArgType>(_status)
3871  );
3872 #endif
3873  _status = _logBuff.serialize(command);
3874  FW_ASSERT(
3875  _status == Fw::FW_SERIALIZE_OK,
3876  static_cast<FwAssertArgType>(_status)
3877  );
3878 
3879  this->m_logOut_OutputPort[0].invoke(
3880  _id,
3881  _logTime,
3883  _logBuff
3884  );
3885  }
3886 
3887  // Emit the event on the text log port
3888 #if FW_ENABLE_TEXT_LOGGING
3889  if (this->m_LogText_OutputPort[0].isConnected()) {
3890 #if FW_OBJECT_NAMES == 1
3891  const char* _formatString =
3892  "(%s) %s: Sequence %s timed out on command %" PRIu32 "";
3893 #else
3894  const char* _formatString =
3895  "%s: Sequence %s timed out on command %" PRIu32 "";
3896 #endif
3897 
3898  Fw::TextLogString _logString;
3899  _logString.format(
3900  _formatString,
3901 #if FW_OBJECT_NAMES == 1
3902  this->m_objName.toChar(),
3903 #endif
3904  "CS_SequenceTimeout ",
3905  filename.toChar(),
3906  command
3907  );
3908 
3909  this->m_LogText_OutputPort[0].invoke(
3910  _id,
3911  _logTime,
3913  _logString
3914  );
3915  }
3916 #endif
3917  }
3918 
3921  const Fw::StringBase& filename,
3922  U32 command
3923  )
3924  {
3925  // Get the time
3926  Fw::Time _logTime;
3927  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3928  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3929  }
3930 
3931  FwEventIdType _id = static_cast<FwEventIdType>(0);
3932 
3933  _id = this->getIdBase() + EVENTID_CS_CMDSTEPPED;
3934 
3935  // Emit the event on the log port
3936  if (this->m_logOut_OutputPort[0].isConnected()) {
3937  Fw::LogBuffer _logBuff;
3939 
3940 #if FW_AMPCS_COMPATIBLE
3941  // Serialize the number of arguments
3942  _status = _logBuff.serialize(static_cast<U8>(2));
3943  FW_ASSERT(
3944  _status == Fw::FW_SERIALIZE_OK,
3945  static_cast<FwAssertArgType>(_status)
3946  );
3947 #endif
3948 
3949  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
3950  FW_ASSERT(
3951  _status == Fw::FW_SERIALIZE_OK,
3952  static_cast<FwAssertArgType>(_status)
3953  );
3954 
3955 #if FW_AMPCS_COMPATIBLE
3956  // Serialize the argument size
3957  _status = _logBuff.serialize(
3958  static_cast<U8>(sizeof(U32))
3959  );
3960  FW_ASSERT(
3961  _status == Fw::FW_SERIALIZE_OK,
3962  static_cast<FwAssertArgType>(_status)
3963  );
3964 #endif
3965  _status = _logBuff.serialize(command);
3966  FW_ASSERT(
3967  _status == Fw::FW_SERIALIZE_OK,
3968  static_cast<FwAssertArgType>(_status)
3969  );
3970 
3971  this->m_logOut_OutputPort[0].invoke(
3972  _id,
3973  _logTime,
3975  _logBuff
3976  );
3977  }
3978 
3979  // Emit the event on the text log port
3980 #if FW_ENABLE_TEXT_LOGGING
3981  if (this->m_LogText_OutputPort[0].isConnected()) {
3982 #if FW_OBJECT_NAMES == 1
3983  const char* _formatString =
3984  "(%s) %s: Sequence %s command %" PRIu32 " stepped";
3985 #else
3986  const char* _formatString =
3987  "%s: Sequence %s command %" PRIu32 " stepped";
3988 #endif
3989 
3990  Fw::TextLogString _logString;
3991  _logString.format(
3992  _formatString,
3993 #if FW_OBJECT_NAMES == 1
3994  this->m_objName.toChar(),
3995 #endif
3996  "CS_CmdStepped ",
3997  filename.toChar(),
3998  command
3999  );
4000 
4001  this->m_LogText_OutputPort[0].invoke(
4002  _id,
4003  _logTime,
4005  _logString
4006  );
4007  }
4008 #endif
4009  }
4010 
4013  {
4014  // Get the time
4015  Fw::Time _logTime;
4016  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4017  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4018  }
4019 
4020  FwEventIdType _id = static_cast<FwEventIdType>(0);
4021 
4022  _id = this->getIdBase() + EVENTID_CS_CMDSTARTED;
4023 
4024  // Emit the event on the log port
4025  if (this->m_logOut_OutputPort[0].isConnected()) {
4026  Fw::LogBuffer _logBuff;
4028 
4029 #if FW_AMPCS_COMPATIBLE
4030  // Serialize the number of arguments
4031  _status = _logBuff.serialize(static_cast<U8>(1));
4032  FW_ASSERT(
4033  _status == Fw::FW_SERIALIZE_OK,
4034  static_cast<FwAssertArgType>(_status)
4035  );
4036 #endif
4037 
4038  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4039  FW_ASSERT(
4040  _status == Fw::FW_SERIALIZE_OK,
4041  static_cast<FwAssertArgType>(_status)
4042  );
4043 
4044  this->m_logOut_OutputPort[0].invoke(
4045  _id,
4046  _logTime,
4048  _logBuff
4049  );
4050  }
4051 
4052  // Emit the event on the text log port
4053 #if FW_ENABLE_TEXT_LOGGING
4054  if (this->m_LogText_OutputPort[0].isConnected()) {
4055 #if FW_OBJECT_NAMES == 1
4056  const char* _formatString =
4057  "(%s) %s: Sequence %s started";
4058 #else
4059  const char* _formatString =
4060  "%s: Sequence %s started";
4061 #endif
4062 
4063  Fw::TextLogString _logString;
4064  _logString.format(
4065  _formatString,
4066 #if FW_OBJECT_NAMES == 1
4067  this->m_objName.toChar(),
4068 #endif
4069  "CS_CmdStarted ",
4070  filename.toChar()
4071  );
4072 
4073  this->m_LogText_OutputPort[0].invoke(
4074  _id,
4075  _logTime,
4077  _logString
4078  );
4079  }
4080 #endif
4081  }
4082 
4085  const Fw::StringBase& filename,
4086  U32 recordNumber,
4087  U32 opCode
4088  )
4089  {
4090  // Get the time
4091  Fw::Time _logTime;
4092  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4093  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4094  }
4095 
4096  FwEventIdType _id = static_cast<FwEventIdType>(0);
4097 
4098  _id = this->getIdBase() + EVENTID_CS_JOINWAITING;
4099 
4100  // Emit the event on the log port
4101  if (this->m_logOut_OutputPort[0].isConnected()) {
4102  Fw::LogBuffer _logBuff;
4104 
4105 #if FW_AMPCS_COMPATIBLE
4106  // Serialize the number of arguments
4107  _status = _logBuff.serialize(static_cast<U8>(3));
4108  FW_ASSERT(
4109  _status == Fw::FW_SERIALIZE_OK,
4110  static_cast<FwAssertArgType>(_status)
4111  );
4112 #endif
4113 
4114  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 60));
4115  FW_ASSERT(
4116  _status == Fw::FW_SERIALIZE_OK,
4117  static_cast<FwAssertArgType>(_status)
4118  );
4119 
4120 #if FW_AMPCS_COMPATIBLE
4121  // Serialize the argument size
4122  _status = _logBuff.serialize(
4123  static_cast<U8>(sizeof(U32))
4124  );
4125  FW_ASSERT(
4126  _status == Fw::FW_SERIALIZE_OK,
4127  static_cast<FwAssertArgType>(_status)
4128  );
4129 #endif
4130  _status = _logBuff.serialize(recordNumber);
4131  FW_ASSERT(
4132  _status == Fw::FW_SERIALIZE_OK,
4133  static_cast<FwAssertArgType>(_status)
4134  );
4135 
4136 #if FW_AMPCS_COMPATIBLE
4137  // Serialize the argument size
4138  _status = _logBuff.serialize(
4139  static_cast<U8>(sizeof(U32))
4140  );
4141  FW_ASSERT(
4142  _status == Fw::FW_SERIALIZE_OK,
4143  static_cast<FwAssertArgType>(_status)
4144  );
4145 #endif
4146  _status = _logBuff.serialize(opCode);
4147  FW_ASSERT(
4148  _status == Fw::FW_SERIALIZE_OK,
4149  static_cast<FwAssertArgType>(_status)
4150  );
4151 
4152  this->m_logOut_OutputPort[0].invoke(
4153  _id,
4154  _logTime,
4156  _logBuff
4157  );
4158  }
4159 
4160  // Emit the event on the text log port
4161 #if FW_ENABLE_TEXT_LOGGING
4162  if (this->m_LogText_OutputPort[0].isConnected()) {
4163 #if FW_OBJECT_NAMES == 1
4164  const char* _formatString =
4165  "(%s) %s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4166 #else
4167  const char* _formatString =
4168  "%s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4169 #endif
4170 
4171  Fw::TextLogString _logString;
4172  _logString.format(
4173  _formatString,
4174 #if FW_OBJECT_NAMES == 1
4175  this->m_objName.toChar(),
4176 #endif
4177  "CS_JoinWaiting ",
4178  filename.toChar(),
4179  recordNumber,
4180  opCode
4181  );
4182 
4183  this->m_LogText_OutputPort[0].invoke(
4184  _id,
4185  _logTime,
4187  _logString
4188  );
4189  }
4190 #endif
4191  }
4192 
4195  {
4196  // Get the time
4197  Fw::Time _logTime;
4198  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4199  this->m_timeCaller_OutputPort[0].invoke(_logTime);
4200  }
4201 
4202  FwEventIdType _id = static_cast<FwEventIdType>(0);
4203 
4205 
4206  // Emit the event on the log port
4207  if (this->m_logOut_OutputPort[0].isConnected()) {
4208  Fw::LogBuffer _logBuff;
4209 
4210 #if FW_AMPCS_COMPATIBLE
4212  // Serialize the number of arguments
4213  _status = _logBuff.serialize(static_cast<U8>(0));
4214  FW_ASSERT(
4215  _status == Fw::FW_SERIALIZE_OK,
4216  static_cast<FwAssertArgType>(_status)
4217  );
4218 #endif
4219 
4220  this->m_logOut_OutputPort[0].invoke(
4221  _id,
4222  _logTime,
4224  _logBuff
4225  );
4226  }
4227 
4228  // Emit the event on the text log port
4229 #if FW_ENABLE_TEXT_LOGGING
4230  if (this->m_LogText_OutputPort[0].isConnected()) {
4231 #if FW_OBJECT_NAMES == 1
4232  const char* _formatString =
4233  "(%s) %s: Still waiting for sequence file to complete";
4234 #else
4235  const char* _formatString =
4236  "%s: Still waiting for sequence file to complete";
4237 #endif
4238 
4239  Fw::TextLogString _logString;
4240  _logString.format(
4241  _formatString,
4242 #if FW_OBJECT_NAMES == 1
4243  this->m_objName.toChar(),
4244 #endif
4245  "CS_JoinWaitingNotComplete "
4246  );
4247 
4248  this->m_LogText_OutputPort[0].invoke(
4249  _id,
4250  _logTime,
4252  _logString
4253  );
4254  }
4255 #endif
4256  }
4257 
4258  // ----------------------------------------------------------------------
4259  // Telemetry write functions
4260  // ----------------------------------------------------------------------
4261 
4264  U32 arg,
4265  Fw::Time _tlmTime
4266  )
4267  {
4268  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4269  if (
4270  this->m_timeCaller_OutputPort[0].isConnected() &&
4271  (_tlmTime == Fw::ZERO_TIME)
4272  ) {
4273  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4274  }
4275 
4276  Fw::TlmBuffer _tlmBuff;
4277  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4278  FW_ASSERT(
4279  _stat == Fw::FW_SERIALIZE_OK,
4280  static_cast<FwAssertArgType>(_stat)
4281  );
4282 
4283  FwChanIdType _id;
4284 
4285  _id = this->getIdBase() + CHANNELID_CS_LOADCOMMANDS;
4286 
4287  this->m_tlmOut_OutputPort[0].invoke(
4288  _id,
4289  _tlmTime,
4290  _tlmBuff
4291  );
4292  }
4293  }
4294 
4297  U32 arg,
4298  Fw::Time _tlmTime
4299  )
4300  {
4301  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4302  if (
4303  this->m_timeCaller_OutputPort[0].isConnected() &&
4304  (_tlmTime == Fw::ZERO_TIME)
4305  ) {
4306  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4307  }
4308 
4309  Fw::TlmBuffer _tlmBuff;
4310  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4311  FW_ASSERT(
4312  _stat == Fw::FW_SERIALIZE_OK,
4313  static_cast<FwAssertArgType>(_stat)
4314  );
4315 
4316  FwChanIdType _id;
4317 
4318  _id = this->getIdBase() + CHANNELID_CS_CANCELCOMMANDS;
4319 
4320  this->m_tlmOut_OutputPort[0].invoke(
4321  _id,
4322  _tlmTime,
4323  _tlmBuff
4324  );
4325  }
4326  }
4327 
4330  U32 arg,
4331  Fw::Time _tlmTime
4332  )
4333  {
4334  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4335  if (
4336  this->m_timeCaller_OutputPort[0].isConnected() &&
4337  (_tlmTime == Fw::ZERO_TIME)
4338  ) {
4339  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4340  }
4341 
4342  Fw::TlmBuffer _tlmBuff;
4343  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4344  FW_ASSERT(
4345  _stat == Fw::FW_SERIALIZE_OK,
4346  static_cast<FwAssertArgType>(_stat)
4347  );
4348 
4349  FwChanIdType _id;
4350 
4351  _id = this->getIdBase() + CHANNELID_CS_ERRORS;
4352 
4353  this->m_tlmOut_OutputPort[0].invoke(
4354  _id,
4355  _tlmTime,
4356  _tlmBuff
4357  );
4358  }
4359  }
4360 
4363  U32 arg,
4364  Fw::Time _tlmTime
4365  )
4366  {
4367  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4368  if (
4369  this->m_timeCaller_OutputPort[0].isConnected() &&
4370  (_tlmTime == Fw::ZERO_TIME)
4371  ) {
4372  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4373  }
4374 
4375  Fw::TlmBuffer _tlmBuff;
4376  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4377  FW_ASSERT(
4378  _stat == Fw::FW_SERIALIZE_OK,
4379  static_cast<FwAssertArgType>(_stat)
4380  );
4381 
4382  FwChanIdType _id;
4383 
4384  _id = this->getIdBase() + CHANNELID_CS_COMMANDSEXECUTED;
4385 
4386  this->m_tlmOut_OutputPort[0].invoke(
4387  _id,
4388  _tlmTime,
4389  _tlmBuff
4390  );
4391  }
4392  }
4393 
4396  U32 arg,
4397  Fw::Time _tlmTime
4398  )
4399  {
4400  if (this->m_tlmOut_OutputPort[0].isConnected()) {
4401  if (
4402  this->m_timeCaller_OutputPort[0].isConnected() &&
4403  (_tlmTime == Fw::ZERO_TIME)
4404  ) {
4405  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4406  }
4407 
4408  Fw::TlmBuffer _tlmBuff;
4409  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4410  FW_ASSERT(
4411  _stat == Fw::FW_SERIALIZE_OK,
4412  static_cast<FwAssertArgType>(_stat)
4413  );
4414 
4415  FwChanIdType _id;
4416 
4418 
4419  this->m_tlmOut_OutputPort[0].invoke(
4420  _id,
4421  _tlmTime,
4422  _tlmBuff
4423  );
4424  }
4425  }
4426 
4427  // ----------------------------------------------------------------------
4428  // Time
4429  // ----------------------------------------------------------------------
4430 
4432  getTime()
4433  {
4434  if (this->m_timeCaller_OutputPort[0].isConnected()) {
4435  Fw::Time _time;
4436  this->m_timeCaller_OutputPort[0].invoke(_time);
4437  return _time;
4438  }
4439  else {
4440  return Fw::Time(TB_NONE, 0, 0);
4441  }
4442  }
4443 
4444  // ----------------------------------------------------------------------
4445  // Message dispatch functions
4446  // ----------------------------------------------------------------------
4447 
4448  Fw::QueuedComponentBase::MsgDispatchStatus CmdSequencerComponentBase ::
4449  doDispatch()
4450  {
4451  ComponentIpcSerializableBuffer msg;
4452  FwQueuePriorityType priority = 0;
4453 
4454  Os::Queue::QueueStatus msgStatus = this->m_queue.receive(
4455  msg,
4456  priority,
4458  );
4459  FW_ASSERT(
4460  msgStatus == Os::Queue::QUEUE_OK,
4461  static_cast<FwAssertArgType>(msgStatus)
4462  );
4463 
4464  // Reset to beginning of buffer
4465  msg.resetDeser();
4466 
4467  FwEnumStoreType desMsg = 0;
4468  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
4469  FW_ASSERT(
4470  deserStatus == Fw::FW_SERIALIZE_OK,
4471  static_cast<FwAssertArgType>(deserStatus)
4472  );
4473 
4474  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
4475 
4476  if (msgType == CMDSEQUENCER_COMPONENT_EXIT) {
4477  return MSG_DISPATCH_EXIT;
4478  }
4479 
4480  FwIndexType portNum = 0;
4481  deserStatus = msg.deserialize(portNum);
4482  FW_ASSERT(
4483  deserStatus == Fw::FW_SERIALIZE_OK,
4484  static_cast<FwAssertArgType>(deserStatus)
4485  );
4486 
4487  switch (msgType) {
4488  // Handle async input port cmdResponseIn
4489  case CMDRESPONSEIN_CMDRESPONSE: {
4490  // Deserialize argument opCode
4491  FwOpcodeType opCode;
4492  deserStatus = msg.deserialize(opCode);
4493  FW_ASSERT(
4494  deserStatus == Fw::FW_SERIALIZE_OK,
4495  static_cast<FwAssertArgType>(deserStatus)
4496  );
4497 
4498  // Deserialize argument cmdSeq
4499  U32 cmdSeq;
4500  deserStatus = msg.deserialize(cmdSeq);
4501  FW_ASSERT(
4502  deserStatus == Fw::FW_SERIALIZE_OK,
4503  static_cast<FwAssertArgType>(deserStatus)
4504  );
4505 
4506  // Deserialize argument response
4507  Fw::CmdResponse response;
4508  deserStatus = msg.deserialize(response);
4509  FW_ASSERT(
4510  deserStatus == Fw::FW_SERIALIZE_OK,
4511  static_cast<FwAssertArgType>(deserStatus)
4512  );
4513  // Call handler function
4514  this->cmdResponseIn_handler(
4515  portNum,
4516  opCode,
4517  cmdSeq,
4518  response
4519  );
4520 
4521  break;
4522  }
4523 
4524  // Handle async input port pingIn
4525  case PINGIN_PING: {
4526  // Deserialize argument key
4527  U32 key;
4528  deserStatus = msg.deserialize(key);
4529  FW_ASSERT(
4530  deserStatus == Fw::FW_SERIALIZE_OK,
4531  static_cast<FwAssertArgType>(deserStatus)
4532  );
4533  // Call handler function
4534  this->pingIn_handler(
4535  portNum,
4536  key
4537  );
4538 
4539  break;
4540  }
4541 
4542  // Handle async input port schedIn
4543  case SCHEDIN_SCHED: {
4544  // Deserialize argument context
4545  U32 context;
4546  deserStatus = msg.deserialize(context);
4547  FW_ASSERT(
4548  deserStatus == Fw::FW_SERIALIZE_OK,
4549  static_cast<FwAssertArgType>(deserStatus)
4550  );
4551  // Call handler function
4552  this->schedIn_handler(
4553  portNum,
4554  context
4555  );
4556 
4557  break;
4558  }
4559 
4560  // Handle async input port seqCancelIn
4561  case SEQCANCELIN_CMDSEQCANCEL: {
4562  // Call handler function
4563  this->seqCancelIn_handler(portNum);
4564 
4565  break;
4566  }
4567 
4568  // Handle async input port seqRunIn
4569  case SEQRUNIN_CMDSEQIN: {
4570  // Deserialize argument filename
4571  Fw::String filename;
4572  deserStatus = msg.deserialize(filename);
4573  FW_ASSERT(
4574  deserStatus == Fw::FW_SERIALIZE_OK,
4575  static_cast<FwAssertArgType>(deserStatus)
4576  );
4577  // Call handler function
4578  this->seqRunIn_handler(
4579  portNum,
4580  filename
4581  );
4582 
4583  break;
4584  }
4585 
4586  // Handle command CS_RUN
4587  case CMD_CS_RUN: {
4588  // Deserialize opcode
4589  FwOpcodeType opCode = 0;
4590  deserStatus = msg.deserialize(opCode);
4591  FW_ASSERT (
4592  deserStatus == Fw::FW_SERIALIZE_OK,
4593  static_cast<FwAssertArgType>(deserStatus)
4594  );
4595 
4596  // Deserialize command sequence
4597  U32 cmdSeq = 0;
4598  deserStatus = msg.deserialize(cmdSeq);
4599  FW_ASSERT (
4600  deserStatus == Fw::FW_SERIALIZE_OK,
4601  static_cast<FwAssertArgType>(deserStatus)
4602  );
4603 
4604  // Deserialize command argument buffer
4605  Fw::CmdArgBuffer args;
4606  deserStatus = msg.deserialize(args);
4607  FW_ASSERT (
4608  deserStatus == Fw::FW_SERIALIZE_OK,
4609  static_cast<FwAssertArgType>(deserStatus)
4610  );
4611 
4612  // Reset buffer
4613  args.resetDeser();
4614 
4615  // Deserialize argument fileName
4616  Fw::CmdStringArg fileName;
4617  deserStatus = args.deserialize(fileName);
4618  if (deserStatus != Fw::FW_SERIALIZE_OK) {
4619  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4620  this->cmdResponse_out(
4621  opCode,
4622  cmdSeq,
4624  );
4625  }
4626  // Don't crash the task if bad arguments were passed from the ground
4627  break;
4628  }
4629 
4630  // Deserialize argument block
4632  deserStatus = args.deserialize(block);
4633  if (deserStatus != Fw::FW_SERIALIZE_OK) {
4634  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4635  this->cmdResponse_out(
4636  opCode,
4637  cmdSeq,
4639  );
4640  }
4641  // Don't crash the task if bad arguments were passed from the ground
4642  break;
4643  }
4644 
4645  // Make sure there was no data left over.
4646  // That means the argument buffer size was incorrect.
4647 #if FW_CMD_CHECK_RESIDUAL
4648  if (args.getBuffLeft() != 0) {
4649  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4650  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4651  }
4652  // Don't crash the task if bad arguments were passed from the ground
4653  break;
4654  }
4655 #endif
4656 
4657  // Call handler function
4658  this->CS_RUN_cmdHandler(
4659  opCode, cmdSeq,
4660  fileName,
4661  block
4662  );
4663 
4664  break;
4665  }
4666 
4667  // Handle command CS_VALIDATE
4668  case CMD_CS_VALIDATE: {
4669  // Deserialize opcode
4670  FwOpcodeType opCode = 0;
4671  deserStatus = msg.deserialize(opCode);
4672  FW_ASSERT (
4673  deserStatus == Fw::FW_SERIALIZE_OK,
4674  static_cast<FwAssertArgType>(deserStatus)
4675  );
4676 
4677  // Deserialize command sequence
4678  U32 cmdSeq = 0;
4679  deserStatus = msg.deserialize(cmdSeq);
4680  FW_ASSERT (
4681  deserStatus == Fw::FW_SERIALIZE_OK,
4682  static_cast<FwAssertArgType>(deserStatus)
4683  );
4684 
4685  // Deserialize command argument buffer
4686  Fw::CmdArgBuffer args;
4687  deserStatus = msg.deserialize(args);
4688  FW_ASSERT (
4689  deserStatus == Fw::FW_SERIALIZE_OK,
4690  static_cast<FwAssertArgType>(deserStatus)
4691  );
4692 
4693  // Reset buffer
4694  args.resetDeser();
4695 
4696  // Deserialize argument fileName
4697  Fw::CmdStringArg fileName;
4698  deserStatus = args.deserialize(fileName);
4699  if (deserStatus != Fw::FW_SERIALIZE_OK) {
4700  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4701  this->cmdResponse_out(
4702  opCode,
4703  cmdSeq,
4705  );
4706  }
4707  // Don't crash the task if bad arguments were passed from the ground
4708  break;
4709  }
4710 
4711  // Make sure there was no data left over.
4712  // That means the argument buffer size was incorrect.
4713 #if FW_CMD_CHECK_RESIDUAL
4714  if (args.getBuffLeft() != 0) {
4715  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4716  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4717  }
4718  // Don't crash the task if bad arguments were passed from the ground
4719  break;
4720  }
4721 #endif
4722 
4723  // Call handler function
4724  this->CS_VALIDATE_cmdHandler(
4725  opCode, cmdSeq,
4726  fileName
4727  );
4728 
4729  break;
4730  }
4731 
4732  // Handle command CS_CANCEL
4733  case CMD_CS_CANCEL: {
4734  // Deserialize opcode
4735  FwOpcodeType opCode = 0;
4736  deserStatus = msg.deserialize(opCode);
4737  FW_ASSERT (
4738  deserStatus == Fw::FW_SERIALIZE_OK,
4739  static_cast<FwAssertArgType>(deserStatus)
4740  );
4741 
4742  // Deserialize command sequence
4743  U32 cmdSeq = 0;
4744  deserStatus = msg.deserialize(cmdSeq);
4745  FW_ASSERT (
4746  deserStatus == Fw::FW_SERIALIZE_OK,
4747  static_cast<FwAssertArgType>(deserStatus)
4748  );
4749 
4750  // Deserialize command argument buffer
4751  Fw::CmdArgBuffer args;
4752  deserStatus = msg.deserialize(args);
4753  FW_ASSERT (
4754  deserStatus == Fw::FW_SERIALIZE_OK,
4755  static_cast<FwAssertArgType>(deserStatus)
4756  );
4757 
4758  // Reset buffer
4759  args.resetDeser();
4760 
4761  // Make sure there was no data left over.
4762  // That means the argument buffer size was incorrect.
4763 #if FW_CMD_CHECK_RESIDUAL
4764  if (args.getBuffLeft() != 0) {
4765  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4766  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4767  }
4768  // Don't crash the task if bad arguments were passed from the ground
4769  break;
4770  }
4771 #endif
4772 
4773  // Call handler function
4774  this->CS_CANCEL_cmdHandler(opCode, cmdSeq);
4775 
4776  break;
4777  }
4778 
4779  // Handle command CS_START
4780  case CMD_CS_START: {
4781  // Deserialize opcode
4782  FwOpcodeType opCode = 0;
4783  deserStatus = msg.deserialize(opCode);
4784  FW_ASSERT (
4785  deserStatus == Fw::FW_SERIALIZE_OK,
4786  static_cast<FwAssertArgType>(deserStatus)
4787  );
4788 
4789  // Deserialize command sequence
4790  U32 cmdSeq = 0;
4791  deserStatus = msg.deserialize(cmdSeq);
4792  FW_ASSERT (
4793  deserStatus == Fw::FW_SERIALIZE_OK,
4794  static_cast<FwAssertArgType>(deserStatus)
4795  );
4796 
4797  // Deserialize command argument buffer
4798  Fw::CmdArgBuffer args;
4799  deserStatus = msg.deserialize(args);
4800  FW_ASSERT (
4801  deserStatus == Fw::FW_SERIALIZE_OK,
4802  static_cast<FwAssertArgType>(deserStatus)
4803  );
4804 
4805  // Reset buffer
4806  args.resetDeser();
4807 
4808  // Make sure there was no data left over.
4809  // That means the argument buffer size was incorrect.
4810 #if FW_CMD_CHECK_RESIDUAL
4811  if (args.getBuffLeft() != 0) {
4812  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4813  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4814  }
4815  // Don't crash the task if bad arguments were passed from the ground
4816  break;
4817  }
4818 #endif
4819 
4820  // Call handler function
4821  this->CS_START_cmdHandler(opCode, cmdSeq);
4822 
4823  break;
4824  }
4825 
4826  // Handle command CS_STEP
4827  case CMD_CS_STEP: {
4828  // Deserialize opcode
4829  FwOpcodeType opCode = 0;
4830  deserStatus = msg.deserialize(opCode);
4831  FW_ASSERT (
4832  deserStatus == Fw::FW_SERIALIZE_OK,
4833  static_cast<FwAssertArgType>(deserStatus)
4834  );
4835 
4836  // Deserialize command sequence
4837  U32 cmdSeq = 0;
4838  deserStatus = msg.deserialize(cmdSeq);
4839  FW_ASSERT (
4840  deserStatus == Fw::FW_SERIALIZE_OK,
4841  static_cast<FwAssertArgType>(deserStatus)
4842  );
4843 
4844  // Deserialize command argument buffer
4845  Fw::CmdArgBuffer args;
4846  deserStatus = msg.deserialize(args);
4847  FW_ASSERT (
4848  deserStatus == Fw::FW_SERIALIZE_OK,
4849  static_cast<FwAssertArgType>(deserStatus)
4850  );
4851 
4852  // Reset buffer
4853  args.resetDeser();
4854 
4855  // Make sure there was no data left over.
4856  // That means the argument buffer size was incorrect.
4857 #if FW_CMD_CHECK_RESIDUAL
4858  if (args.getBuffLeft() != 0) {
4859  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4860  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4861  }
4862  // Don't crash the task if bad arguments were passed from the ground
4863  break;
4864  }
4865 #endif
4866 
4867  // Call handler function
4868  this->CS_STEP_cmdHandler(opCode, cmdSeq);
4869 
4870  break;
4871  }
4872 
4873  // Handle command CS_AUTO
4874  case CMD_CS_AUTO: {
4875  // Deserialize opcode
4876  FwOpcodeType opCode = 0;
4877  deserStatus = msg.deserialize(opCode);
4878  FW_ASSERT (
4879  deserStatus == Fw::FW_SERIALIZE_OK,
4880  static_cast<FwAssertArgType>(deserStatus)
4881  );
4882 
4883  // Deserialize command sequence
4884  U32 cmdSeq = 0;
4885  deserStatus = msg.deserialize(cmdSeq);
4886  FW_ASSERT (
4887  deserStatus == Fw::FW_SERIALIZE_OK,
4888  static_cast<FwAssertArgType>(deserStatus)
4889  );
4890 
4891  // Deserialize command argument buffer
4892  Fw::CmdArgBuffer args;
4893  deserStatus = msg.deserialize(args);
4894  FW_ASSERT (
4895  deserStatus == Fw::FW_SERIALIZE_OK,
4896  static_cast<FwAssertArgType>(deserStatus)
4897  );
4898 
4899  // Reset buffer
4900  args.resetDeser();
4901 
4902  // Make sure there was no data left over.
4903  // That means the argument buffer size was incorrect.
4904 #if FW_CMD_CHECK_RESIDUAL
4905  if (args.getBuffLeft() != 0) {
4906  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4907  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4908  }
4909  // Don't crash the task if bad arguments were passed from the ground
4910  break;
4911  }
4912 #endif
4913 
4914  // Call handler function
4915  this->CS_AUTO_cmdHandler(opCode, cmdSeq);
4916 
4917  break;
4918  }
4919 
4920  // Handle command CS_MANUAL
4921  case CMD_CS_MANUAL: {
4922  // Deserialize opcode
4923  FwOpcodeType opCode = 0;
4924  deserStatus = msg.deserialize(opCode);
4925  FW_ASSERT (
4926  deserStatus == Fw::FW_SERIALIZE_OK,
4927  static_cast<FwAssertArgType>(deserStatus)
4928  );
4929 
4930  // Deserialize command sequence
4931  U32 cmdSeq = 0;
4932  deserStatus = msg.deserialize(cmdSeq);
4933  FW_ASSERT (
4934  deserStatus == Fw::FW_SERIALIZE_OK,
4935  static_cast<FwAssertArgType>(deserStatus)
4936  );
4937 
4938  // Deserialize command argument buffer
4939  Fw::CmdArgBuffer args;
4940  deserStatus = msg.deserialize(args);
4941  FW_ASSERT (
4942  deserStatus == Fw::FW_SERIALIZE_OK,
4943  static_cast<FwAssertArgType>(deserStatus)
4944  );
4945 
4946  // Reset buffer
4947  args.resetDeser();
4948 
4949  // Make sure there was no data left over.
4950  // That means the argument buffer size was incorrect.
4951 #if FW_CMD_CHECK_RESIDUAL
4952  if (args.getBuffLeft() != 0) {
4953  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4954  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4955  }
4956  // Don't crash the task if bad arguments were passed from the ground
4957  break;
4958  }
4959 #endif
4960 
4961  // Call handler function
4962  this->CS_MANUAL_cmdHandler(opCode, cmdSeq);
4963 
4964  break;
4965  }
4966 
4967  // Handle command CS_JOIN_WAIT
4968  case CMD_CS_JOIN_WAIT: {
4969  // Deserialize opcode
4970  FwOpcodeType opCode = 0;
4971  deserStatus = msg.deserialize(opCode);
4972  FW_ASSERT (
4973  deserStatus == Fw::FW_SERIALIZE_OK,
4974  static_cast<FwAssertArgType>(deserStatus)
4975  );
4976 
4977  // Deserialize command sequence
4978  U32 cmdSeq = 0;
4979  deserStatus = msg.deserialize(cmdSeq);
4980  FW_ASSERT (
4981  deserStatus == Fw::FW_SERIALIZE_OK,
4982  static_cast<FwAssertArgType>(deserStatus)
4983  );
4984 
4985  // Deserialize command argument buffer
4986  Fw::CmdArgBuffer args;
4987  deserStatus = msg.deserialize(args);
4988  FW_ASSERT (
4989  deserStatus == Fw::FW_SERIALIZE_OK,
4990  static_cast<FwAssertArgType>(deserStatus)
4991  );
4992 
4993  // Reset buffer
4994  args.resetDeser();
4995 
4996  // Make sure there was no data left over.
4997  // That means the argument buffer size was incorrect.
4998 #if FW_CMD_CHECK_RESIDUAL
4999  if (args.getBuffLeft() != 0) {
5000  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5001  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5002  }
5003  // Don't crash the task if bad arguments were passed from the ground
5004  break;
5005  }
5006 #endif
5007 
5008  // Call handler function
5009  this->CS_JOIN_WAIT_cmdHandler(opCode, cmdSeq);
5010 
5011  break;
5012  }
5013 
5014  default:
5015  return MSG_DISPATCH_ERROR;
5016  }
5017 
5018  return MSG_DISPATCH_OK;
5019  }
5020 
5021  // ----------------------------------------------------------------------
5022  // Calls for messages received on special input ports
5023  // ----------------------------------------------------------------------
5024 
5025  void CmdSequencerComponentBase ::
5026  m_p_cmdIn_in(
5027  Fw::PassiveComponentBase* callComp,
5028  FwIndexType portNum,
5029  FwOpcodeType opCode,
5030  U32 cmdSeq,
5031  Fw::CmdArgBuffer& args
5032  )
5033  {
5034  FW_ASSERT(callComp);
5035  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5036 
5037  const U32 idBase = callComp->getIdBase();
5038  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
5039 
5040  // Select base class function based on opcode
5041  switch (opCode - idBase) {
5042  case OPCODE_CS_RUN: {
5043  compPtr->CS_RUN_cmdHandlerBase(
5044  opCode,
5045  cmdSeq,
5046  args
5047  );
5048  break;
5049  }
5050 
5051  case OPCODE_CS_VALIDATE: {
5052  compPtr->CS_VALIDATE_cmdHandlerBase(
5053  opCode,
5054  cmdSeq,
5055  args
5056  );
5057  break;
5058  }
5059 
5060  case OPCODE_CS_CANCEL: {
5061  compPtr->CS_CANCEL_cmdHandlerBase(
5062  opCode,
5063  cmdSeq,
5064  args
5065  );
5066  break;
5067  }
5068 
5069  case OPCODE_CS_START: {
5070  compPtr->CS_START_cmdHandlerBase(
5071  opCode,
5072  cmdSeq,
5073  args
5074  );
5075  break;
5076  }
5077 
5078  case OPCODE_CS_STEP: {
5079  compPtr->CS_STEP_cmdHandlerBase(
5080  opCode,
5081  cmdSeq,
5082  args
5083  );
5084  break;
5085  }
5086 
5087  case OPCODE_CS_AUTO: {
5088  compPtr->CS_AUTO_cmdHandlerBase(
5089  opCode,
5090  cmdSeq,
5091  args
5092  );
5093  break;
5094  }
5095 
5096  case OPCODE_CS_MANUAL: {
5097  compPtr->CS_MANUAL_cmdHandlerBase(
5098  opCode,
5099  cmdSeq,
5100  args
5101  );
5102  break;
5103  }
5104 
5105  case OPCODE_CS_JOIN_WAIT: {
5106  compPtr->CS_JOIN_WAIT_cmdHandlerBase(
5107  opCode,
5108  cmdSeq,
5109  args
5110  );
5111  break;
5112  }
5113  }
5114  }
5115 
5116  // ----------------------------------------------------------------------
5117  // Calls for messages received on typed input ports
5118  // ----------------------------------------------------------------------
5119 
5120  void CmdSequencerComponentBase ::
5121  m_p_cmdResponseIn_in(
5122  Fw::PassiveComponentBase* callComp,
5123  FwIndexType portNum,
5124  FwOpcodeType opCode,
5125  U32 cmdSeq,
5126  const Fw::CmdResponse& response
5127  )
5128  {
5129  FW_ASSERT(callComp);
5130  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5131  compPtr->cmdResponseIn_handlerBase(
5132  portNum,
5133  opCode,
5134  cmdSeq,
5135  response
5136  );
5137  }
5138 
5139  void CmdSequencerComponentBase ::
5140  m_p_pingIn_in(
5141  Fw::PassiveComponentBase* callComp,
5142  FwIndexType portNum,
5143  U32 key
5144  )
5145  {
5146  FW_ASSERT(callComp);
5147  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5148  compPtr->pingIn_handlerBase(
5149  portNum,
5150  key
5151  );
5152  }
5153 
5154  void CmdSequencerComponentBase ::
5155  m_p_schedIn_in(
5156  Fw::PassiveComponentBase* callComp,
5157  FwIndexType portNum,
5158  U32 context
5159  )
5160  {
5161  FW_ASSERT(callComp);
5162  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5163  compPtr->schedIn_handlerBase(
5164  portNum,
5165  context
5166  );
5167  }
5168 
5169  void CmdSequencerComponentBase ::
5170  m_p_seqCancelIn_in(
5171  Fw::PassiveComponentBase* callComp,
5172  FwIndexType portNum
5173  )
5174  {
5175  FW_ASSERT(callComp);
5176  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5177  compPtr->seqCancelIn_handlerBase(portNum);
5178  }
5179 
5180  void CmdSequencerComponentBase ::
5181  m_p_seqRunIn_in(
5182  Fw::PassiveComponentBase* callComp,
5183  FwIndexType portNum,
5184  Fw::String& filename
5185  )
5186  {
5187  FW_ASSERT(callComp);
5188  CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5189  compPtr->seqRunIn_handlerBase(
5190  portNum,
5191  filename
5192  );
5193  }
5194 
5195 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
U8 BYTE
byte type
Definition: BasicTypes.h:27
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:68
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:26
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:66
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition: FpConfig.h:57
I32 FwEnumStoreType
Definition: FpConfig.h:51
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:34
U32 FwChanIdType
Definition: FpConfig.h:82
U32 FwEventIdType
Definition: FpConfig.h:86
FwIndexType FwQueueSizeType
Definition: FpConfig.h:117
U32 FwOpcodeType
Definition: FpConfig.h:78
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:300
I32 FwQueuePriorityType
Definition: FpConfig.h:98
PlatformIndexType FwIndexType
Definition: FpConfig.h:20
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition: FpConfig.h:135
@ 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.
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::QueueStatus createQueue(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE 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
virtual SerializeStatus deserialize(SerializeBufferBase &buffer)
deserialization function
Definition: StringBase.cpp:147
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:137
const char * toChar() const
Definition: String.hpp:50
Definition: Time.hpp:9
QueueStatus
Definition: Queue.hpp:27
@ QUEUE_OK
message sent/received okay
Definition: Queue.hpp:28
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
Definition: QueueCommon.cpp:13
QueueStatus receive(Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE &priority, QueueBlocking block)
receive a message
Definition: QueueCommon.cpp:22
QueueBlocking
Definition: Queue.hpp:40
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
Definition: Queue.hpp:41
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
Definition: Queue.hpp:42
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)
void seqCancelIn_handlerBase(FwIndexType portNum)
Handler base-class function for input port seqCancelIn.
void log_WARNING_HI_CS_FileNotFound(const Fw::StringBase &fileName)
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.
void tlmWrite_CS_CancelCommands(U32 arg, Fw::Time _tlmTime=Fw::Time())
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 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 seqRunIn_preMsgHook(FwIndexType portNum, Fw::String &filename)
Pre-message hook for async input port seqRunIn.
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)
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)
@ 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 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)
@ 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 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
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.
@ 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...
virtual void seqRunIn_handler(FwIndexType portNum, Fw::String &filename)=0
Handler for input port seqRunIn.
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 seqRunIn_handlerBase(FwIndexType portNum, Fw::String &filename)
Handler base-class function for input port seqRunIn.
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 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)
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 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.
void init()
Initialization function.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
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: 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(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