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