F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SeqDispatcherComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SeqDispatcherComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for SeqDispatcher 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  SEQDISPATCHER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  SEQDONEIN_CMDRESPONSE,
20  SEQRUNIN_CMDSEQIN,
21  SEQSTARTIN_CMDSEQIN,
22  CMD_RUN,
23  CMD_LOG_STATUS,
24  };
25 
26  // Get the max size by constructing a union of the async input, command, and
27  // internal port serialization sizes
28  union BuffUnion {
33  };
34 
35  // Define a message buffer class large enough to handle all the
36  // asynchronous inputs to the component
37  class ComponentIpcSerializableBuffer :
39  {
40 
41  public:
42 
43  enum {
44  // Max. message size = size of data + message id + port
45  SERIALIZATION_SIZE =
46  sizeof(BuffUnion) +
47  sizeof(FwEnumStoreType) +
48  sizeof(FwIndexType)
49  };
50 
51  Fw::Serializable::SizeType getBuffCapacity() const {
52  return sizeof(m_buff);
53  }
54 
55  U8* getBuffAddr() {
56  return m_buff;
57  }
58 
59  const U8* getBuffAddr() const {
60  return m_buff;
61  }
62 
63  private:
64  // Should be the max of all the input ports serialized sizes...
65  U8 m_buff[SERIALIZATION_SIZE];
66 
67  };
68  }
69 
70  // ----------------------------------------------------------------------
71  // Component initialization
72  // ----------------------------------------------------------------------
73 
75  init(
76  FwSizeType queueDepth,
77  FwEnumStoreType instance
78  )
79  {
80  // Initialize base class
82 
83  // Connect input port cmdIn
84  for (
85  FwIndexType port = 0;
86  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
87  port++
88  ) {
89  this->m_cmdIn_InputPort[port].init();
90  this->m_cmdIn_InputPort[port].addCallComp(
91  this,
92  m_p_cmdIn_in
93  );
94  this->m_cmdIn_InputPort[port].setPortNum(port);
95 
96 #if FW_OBJECT_NAMES == 1
97  Fw::ObjectName portName;
98  portName.format(
99  "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]",
100  this->m_objName.toChar(),
101  port
102  );
103  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
104 #endif
105  }
106 
107  // Connect input port seqDoneIn
108  for (
109  FwIndexType port = 0;
110  port < static_cast<FwIndexType>(this->getNum_seqDoneIn_InputPorts());
111  port++
112  ) {
113  this->m_seqDoneIn_InputPort[port].init();
114  this->m_seqDoneIn_InputPort[port].addCallComp(
115  this,
116  m_p_seqDoneIn_in
117  );
118  this->m_seqDoneIn_InputPort[port].setPortNum(port);
119 
120 #if FW_OBJECT_NAMES == 1
121  Fw::ObjectName portName;
122  portName.format(
123  "%s_seqDoneIn_InputPort[%" PRI_PlatformIntType "]",
124  this->m_objName.toChar(),
125  port
126  );
127  this->m_seqDoneIn_InputPort[port].setObjName(portName.toChar());
128 #endif
129  }
130 
131  // Connect input port seqRunIn
132  for (
133  FwIndexType port = 0;
134  port < static_cast<FwIndexType>(this->getNum_seqRunIn_InputPorts());
135  port++
136  ) {
137  this->m_seqRunIn_InputPort[port].init();
138  this->m_seqRunIn_InputPort[port].addCallComp(
139  this,
140  m_p_seqRunIn_in
141  );
142  this->m_seqRunIn_InputPort[port].setPortNum(port);
143 
144 #if FW_OBJECT_NAMES == 1
145  Fw::ObjectName portName;
146  portName.format(
147  "%s_seqRunIn_InputPort[%" PRI_PlatformIntType "]",
148  this->m_objName.toChar(),
149  port
150  );
151  this->m_seqRunIn_InputPort[port].setObjName(portName.toChar());
152 #endif
153  }
154 
155  // Connect input port seqStartIn
156  for (
157  FwIndexType port = 0;
158  port < static_cast<FwIndexType>(this->getNum_seqStartIn_InputPorts());
159  port++
160  ) {
161  this->m_seqStartIn_InputPort[port].init();
162  this->m_seqStartIn_InputPort[port].addCallComp(
163  this,
164  m_p_seqStartIn_in
165  );
166  this->m_seqStartIn_InputPort[port].setPortNum(port);
167 
168 #if FW_OBJECT_NAMES == 1
169  Fw::ObjectName portName;
170  portName.format(
171  "%s_seqStartIn_InputPort[%" PRI_PlatformIntType "]",
172  this->m_objName.toChar(),
173  port
174  );
175  this->m_seqStartIn_InputPort[port].setObjName(portName.toChar());
176 #endif
177  }
178 
179  // Connect output port cmdRegOut
180  for (
181  FwIndexType port = 0;
182  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
183  port++
184  ) {
185  this->m_cmdRegOut_OutputPort[port].init();
186 
187 #if FW_OBJECT_NAMES == 1
188  Fw::ObjectName portName;
189  portName.format(
190  "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]",
191  this->m_objName.toChar(),
192  port
193  );
194  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
195 #endif
196  }
197 
198  // Connect output port cmdResponseOut
199  for (
200  FwIndexType port = 0;
201  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
202  port++
203  ) {
204  this->m_cmdResponseOut_OutputPort[port].init();
205 
206 #if FW_OBJECT_NAMES == 1
207  Fw::ObjectName portName;
208  portName.format(
209  "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]",
210  this->m_objName.toChar(),
211  port
212  );
213  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
214 #endif
215  }
216 
217  // Connect output port logOut
218  for (
219  FwIndexType port = 0;
220  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
221  port++
222  ) {
223  this->m_logOut_OutputPort[port].init();
224 
225 #if FW_OBJECT_NAMES == 1
226  Fw::ObjectName portName;
227  portName.format(
228  "%s_logOut_OutputPort[%" PRI_PlatformIntType "]",
229  this->m_objName.toChar(),
230  port
231  );
232  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
233 #endif
234  }
235 
236 #if FW_ENABLE_TEXT_LOGGING == 1
237  // Connect output port logTextOut
238  for (
239  FwIndexType port = 0;
240  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
241  port++
242  ) {
243  this->m_logTextOut_OutputPort[port].init();
244 
245 #if FW_OBJECT_NAMES == 1
246  Fw::ObjectName portName;
247  portName.format(
248  "%s_logTextOut_OutputPort[%" PRI_PlatformIntType "]",
249  this->m_objName.toChar(),
250  port
251  );
252  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
253 #endif
254  }
255 #endif
256 
257  // Connect output port timeCaller
258  for (
259  FwIndexType port = 0;
260  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
261  port++
262  ) {
263  this->m_timeCaller_OutputPort[port].init();
264 
265 #if FW_OBJECT_NAMES == 1
266  Fw::ObjectName portName;
267  portName.format(
268  "%s_timeCaller_OutputPort[%" PRI_PlatformIntType "]",
269  this->m_objName.toChar(),
270  port
271  );
272  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
273 #endif
274  }
275 
276  // Connect output port tlmOut
277  for (
278  FwIndexType port = 0;
279  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
280  port++
281  ) {
282  this->m_tlmOut_OutputPort[port].init();
283 
284 #if FW_OBJECT_NAMES == 1
285  Fw::ObjectName portName;
286  portName.format(
287  "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]",
288  this->m_objName.toChar(),
289  port
290  );
291  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
292 #endif
293  }
294 
295  // Connect output port seqRunOut
296  for (
297  FwIndexType port = 0;
298  port < static_cast<FwIndexType>(this->getNum_seqRunOut_OutputPorts());
299  port++
300  ) {
301  this->m_seqRunOut_OutputPort[port].init();
302 
303 #if FW_OBJECT_NAMES == 1
304  Fw::ObjectName portName;
305  portName.format(
306  "%s_seqRunOut_OutputPort[%" PRI_PlatformIntType "]",
307  this->m_objName.toChar(),
308  port
309  );
310  this->m_seqRunOut_OutputPort[port].setObjName(portName.toChar());
311 #endif
312  }
313 
314  Os::Queue::Status qStat = this->createQueue(
315  queueDepth,
316  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
317  );
318  FW_ASSERT(
319  Os::Queue::Status::OP_OK == qStat,
320  static_cast<FwAssertArgType>(qStat)
321  );
322  }
323 
324  // ----------------------------------------------------------------------
325  // Getters for special input ports
326  // ----------------------------------------------------------------------
327 
330  {
331  FW_ASSERT(
332  portNum < this->getNum_cmdIn_InputPorts(),
333  static_cast<FwAssertArgType>(portNum)
334  );
335 
336  return &this->m_cmdIn_InputPort[portNum];
337  }
338 
339  // ----------------------------------------------------------------------
340  // Getters for typed input ports
341  // ----------------------------------------------------------------------
342 
345  {
346  FW_ASSERT(
347  portNum < this->getNum_seqDoneIn_InputPorts(),
348  static_cast<FwAssertArgType>(portNum)
349  );
350 
351  return &this->m_seqDoneIn_InputPort[portNum];
352  }
353 
356  {
357  FW_ASSERT(
358  portNum < this->getNum_seqRunIn_InputPorts(),
359  static_cast<FwAssertArgType>(portNum)
360  );
361 
362  return &this->m_seqRunIn_InputPort[portNum];
363  }
364 
367  {
368  FW_ASSERT(
369  portNum < this->getNum_seqStartIn_InputPorts(),
370  static_cast<FwAssertArgType>(portNum)
371  );
372 
373  return &this->m_seqStartIn_InputPort[portNum];
374  }
375 
376  // ----------------------------------------------------------------------
377  // Connect input ports to special output ports
378  // ----------------------------------------------------------------------
379 
382  FwIndexType portNum,
383  Fw::InputCmdRegPort* port
384  )
385  {
386  FW_ASSERT(
387  portNum < this->getNum_cmdRegOut_OutputPorts(),
388  static_cast<FwAssertArgType>(portNum)
389  );
390 
391  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
392  }
393 
396  FwIndexType portNum,
398  )
399  {
400  FW_ASSERT(
401  portNum < this->getNum_cmdResponseOut_OutputPorts(),
402  static_cast<FwAssertArgType>(portNum)
403  );
404 
405  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
406  }
407 
410  FwIndexType portNum,
411  Fw::InputLogPort* port
412  )
413  {
414  FW_ASSERT(
415  portNum < this->getNum_logOut_OutputPorts(),
416  static_cast<FwAssertArgType>(portNum)
417  );
418 
419  this->m_logOut_OutputPort[portNum].addCallPort(port);
420  }
421 
422 #if FW_ENABLE_TEXT_LOGGING == 1
423 
424  void SeqDispatcherComponentBase ::
425  set_logTextOut_OutputPort(
426  FwIndexType portNum,
428  )
429  {
430  FW_ASSERT(
431  portNum < this->getNum_logTextOut_OutputPorts(),
432  static_cast<FwAssertArgType>(portNum)
433  );
434 
435  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
436  }
437 
438 #endif
439 
442  FwIndexType portNum,
443  Fw::InputTimePort* port
444  )
445  {
446  FW_ASSERT(
447  portNum < this->getNum_timeCaller_OutputPorts(),
448  static_cast<FwAssertArgType>(portNum)
449  );
450 
451  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
452  }
453 
456  FwIndexType portNum,
457  Fw::InputTlmPort* port
458  )
459  {
460  FW_ASSERT(
461  portNum < this->getNum_tlmOut_OutputPorts(),
462  static_cast<FwAssertArgType>(portNum)
463  );
464 
465  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
466  }
467 
468  // ----------------------------------------------------------------------
469  // Connect typed input ports to typed output ports
470  // ----------------------------------------------------------------------
471 
474  FwIndexType portNum,
476  )
477  {
478  FW_ASSERT(
479  portNum < this->getNum_seqRunOut_OutputPorts(),
480  static_cast<FwAssertArgType>(portNum)
481  );
482 
483  this->m_seqRunOut_OutputPort[portNum].addCallPort(port);
484  }
485 
486 #if FW_PORT_SERIALIZATION
487 
488  // ----------------------------------------------------------------------
489  // Connect serial input ports to special output ports
490  // ----------------------------------------------------------------------
491 
494  FwIndexType portNum,
495  Fw::InputSerializePort* port
496  )
497  {
498  FW_ASSERT(
499  portNum < this->getNum_cmdRegOut_OutputPorts(),
500  static_cast<FwAssertArgType>(portNum)
501  );
502 
503  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
504  }
505 
508  FwIndexType portNum,
509  Fw::InputSerializePort* port
510  )
511  {
512  FW_ASSERT(
513  portNum < this->getNum_cmdResponseOut_OutputPorts(),
514  static_cast<FwAssertArgType>(portNum)
515  );
516 
517  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
518  }
519 
522  FwIndexType portNum,
523  Fw::InputSerializePort* port
524  )
525  {
526  FW_ASSERT(
527  portNum < this->getNum_logOut_OutputPorts(),
528  static_cast<FwAssertArgType>(portNum)
529  );
530 
531  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
532  }
533 
534 #if FW_ENABLE_TEXT_LOGGING == 1
535 
536  void SeqDispatcherComponentBase ::
537  set_logTextOut_OutputPort(
538  FwIndexType portNum,
539  Fw::InputSerializePort* port
540  )
541  {
542  FW_ASSERT(
543  portNum < this->getNum_logTextOut_OutputPorts(),
544  static_cast<FwAssertArgType>(portNum)
545  );
546 
547  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
548  }
549 
550 #endif
551 
554  FwIndexType portNum,
555  Fw::InputSerializePort* port
556  )
557  {
558  FW_ASSERT(
559  portNum < this->getNum_timeCaller_OutputPorts(),
560  static_cast<FwAssertArgType>(portNum)
561  );
562 
563  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
564  }
565 
568  FwIndexType portNum,
569  Fw::InputSerializePort* port
570  )
571  {
572  FW_ASSERT(
573  portNum < this->getNum_tlmOut_OutputPorts(),
574  static_cast<FwAssertArgType>(portNum)
575  );
576 
577  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
578  }
579 
580 #endif
581 
582 #if FW_PORT_SERIALIZATION
583 
584  // ----------------------------------------------------------------------
585  // Connect serial input ports to typed output ports
586  // ----------------------------------------------------------------------
587 
590  FwIndexType portNum,
591  Fw::InputSerializePort* port
592  )
593  {
594  FW_ASSERT(
595  portNum < this->getNum_seqRunOut_OutputPorts(),
596  static_cast<FwAssertArgType>(portNum)
597  );
598 
599  this->m_seqRunOut_OutputPort[portNum].registerSerialPort(port);
600  }
601 
602 #endif
603 
604  // ----------------------------------------------------------------------
605  // Command registration
606  // ----------------------------------------------------------------------
607 
609  regCommands()
610  {
611  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
612 
613  this->m_cmdRegOut_OutputPort[0].invoke(
614  this->getIdBase() + OPCODE_RUN
615  );
616 
617  this->m_cmdRegOut_OutputPort[0].invoke(
618  this->getIdBase() + OPCODE_LOG_STATUS
619  );
620  }
621 
622  // ----------------------------------------------------------------------
623  // Component construction and destruction
624  // ----------------------------------------------------------------------
625 
627  SeqDispatcherComponentBase(const char* compName) :
628  Fw::ActiveComponentBase(compName)
629  {
630 
631  }
632 
635  {
636 
637  }
638 
639  // ----------------------------------------------------------------------
640  // Getters for numbers of special input ports
641  // ----------------------------------------------------------------------
642 
645  {
646  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
647  }
648 
649  // ----------------------------------------------------------------------
650  // Getters for numbers of typed input ports
651  // ----------------------------------------------------------------------
652 
655  {
656  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqDoneIn_InputPort));
657  }
658 
661  {
662  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqRunIn_InputPort));
663  }
664 
667  {
668  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqStartIn_InputPort));
669  }
670 
671  // ----------------------------------------------------------------------
672  // Getters for numbers of special output ports
673  // ----------------------------------------------------------------------
674 
677  {
678  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
679  }
680 
683  {
684  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
685  }
686 
689  {
690  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
691  }
692 
693 #if FW_ENABLE_TEXT_LOGGING == 1
694 
695  FwIndexType SeqDispatcherComponentBase ::
696  getNum_logTextOut_OutputPorts() const
697  {
698  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logTextOut_OutputPort));
699  }
700 
701 #endif
702 
705  {
706  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
707  }
708 
711  {
712  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
713  }
714 
715  // ----------------------------------------------------------------------
716  // Getters for numbers of typed output ports
717  // ----------------------------------------------------------------------
718 
721  {
722  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_seqRunOut_OutputPort));
723  }
724 
725  // ----------------------------------------------------------------------
726  // Connection status queries for special output ports
727  // ----------------------------------------------------------------------
728 
731  {
732  FW_ASSERT(
733  portNum < this->getNum_cmdRegOut_OutputPorts(),
734  static_cast<FwAssertArgType>(portNum)
735  );
736 
737  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
738  }
739 
742  {
743  FW_ASSERT(
744  portNum < this->getNum_cmdResponseOut_OutputPorts(),
745  static_cast<FwAssertArgType>(portNum)
746  );
747 
748  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
749  }
750 
753  {
754  FW_ASSERT(
755  portNum < this->getNum_logOut_OutputPorts(),
756  static_cast<FwAssertArgType>(portNum)
757  );
758 
759  return this->m_logOut_OutputPort[portNum].isConnected();
760  }
761 
762 #if FW_ENABLE_TEXT_LOGGING == 1
763 
764  bool SeqDispatcherComponentBase ::
765  isConnected_logTextOut_OutputPort(FwIndexType portNum)
766  {
767  FW_ASSERT(
768  portNum < this->getNum_logTextOut_OutputPorts(),
769  static_cast<FwAssertArgType>(portNum)
770  );
771 
772  return this->m_logTextOut_OutputPort[portNum].isConnected();
773  }
774 
775 #endif
776 
779  {
780  FW_ASSERT(
781  portNum < this->getNum_timeCaller_OutputPorts(),
782  static_cast<FwAssertArgType>(portNum)
783  );
784 
785  return this->m_timeCaller_OutputPort[portNum].isConnected();
786  }
787 
790  {
791  FW_ASSERT(
792  portNum < this->getNum_tlmOut_OutputPorts(),
793  static_cast<FwAssertArgType>(portNum)
794  );
795 
796  return this->m_tlmOut_OutputPort[portNum].isConnected();
797  }
798 
799  // ----------------------------------------------------------------------
800  // Connection status queries for typed output ports
801  // ----------------------------------------------------------------------
802 
805  {
806  FW_ASSERT(
807  portNum < this->getNum_seqRunOut_OutputPorts(),
808  static_cast<FwAssertArgType>(portNum)
809  );
810 
811  return this->m_seqRunOut_OutputPort[portNum].isConnected();
812  }
813 
814  // ----------------------------------------------------------------------
815  // Port handler base-class functions for typed input ports
816  //
817  // Call these functions directly to bypass the corresponding ports
818  // ----------------------------------------------------------------------
819 
822  FwIndexType portNum,
823  FwOpcodeType opCode,
824  U32 cmdSeq,
825  const Fw::CmdResponse& response
826  )
827  {
828  // Make sure port number is valid
829  FW_ASSERT(
830  portNum < this->getNum_seqDoneIn_InputPorts(),
831  static_cast<FwAssertArgType>(portNum)
832  );
833 
834  // Call pre-message hook
836  portNum,
837  opCode,
838  cmdSeq,
839  response
840  );
841  ComponentIpcSerializableBuffer msg;
843 
844  // Serialize message ID
845  _status = msg.serialize(
846  static_cast<FwEnumStoreType>(SEQDONEIN_CMDRESPONSE)
847  );
848  FW_ASSERT(
849  _status == Fw::FW_SERIALIZE_OK,
850  static_cast<FwAssertArgType>(_status)
851  );
852 
853  // Serialize port number
854  _status = msg.serialize(portNum);
855  FW_ASSERT(
856  _status == Fw::FW_SERIALIZE_OK,
857  static_cast<FwAssertArgType>(_status)
858  );
859 
860  // Serialize argument opCode
861  _status = msg.serialize(opCode);
862  FW_ASSERT(
863  _status == Fw::FW_SERIALIZE_OK,
864  static_cast<FwAssertArgType>(_status)
865  );
866 
867  // Serialize argument cmdSeq
868  _status = msg.serialize(cmdSeq);
869  FW_ASSERT(
870  _status == Fw::FW_SERIALIZE_OK,
871  static_cast<FwAssertArgType>(_status)
872  );
873 
874  // Serialize argument response
875  _status = msg.serialize(response);
876  FW_ASSERT(
877  _status == Fw::FW_SERIALIZE_OK,
878  static_cast<FwAssertArgType>(_status)
879  );
880 
881  // Send message
883  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
884 
885  FW_ASSERT(
886  qStatus == Os::Queue::OP_OK,
887  static_cast<FwAssertArgType>(qStatus)
888  );
889  }
890 
893  FwIndexType portNum,
894  const Fw::StringBase& filename
895  )
896  {
897  // Make sure port number is valid
898  FW_ASSERT(
899  portNum < this->getNum_seqRunIn_InputPorts(),
900  static_cast<FwAssertArgType>(portNum)
901  );
902 
903  // Call pre-message hook
905  portNum,
906  filename
907  );
908  ComponentIpcSerializableBuffer msg;
910 
911  // Serialize message ID
912  _status = msg.serialize(
913  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
914  );
915  FW_ASSERT(
916  _status == Fw::FW_SERIALIZE_OK,
917  static_cast<FwAssertArgType>(_status)
918  );
919 
920  // Serialize port number
921  _status = msg.serialize(portNum);
922  FW_ASSERT(
923  _status == Fw::FW_SERIALIZE_OK,
924  static_cast<FwAssertArgType>(_status)
925  );
926 
927  // Serialize argument filename
928  _status = filename.serialize(msg, 240);
929  FW_ASSERT(
930  _status == Fw::FW_SERIALIZE_OK,
931  static_cast<FwAssertArgType>(_status)
932  );
933 
934  // Send message
936  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
937 
938  FW_ASSERT(
939  qStatus == Os::Queue::OP_OK,
940  static_cast<FwAssertArgType>(qStatus)
941  );
942  }
943 
946  FwIndexType portNum,
947  const Fw::StringBase& filename
948  )
949  {
950  // Make sure port number is valid
951  FW_ASSERT(
952  portNum < this->getNum_seqStartIn_InputPorts(),
953  static_cast<FwAssertArgType>(portNum)
954  );
955 
956  // Call pre-message hook
958  portNum,
959  filename
960  );
961  ComponentIpcSerializableBuffer msg;
963 
964  // Serialize message ID
965  _status = msg.serialize(
966  static_cast<FwEnumStoreType>(SEQSTARTIN_CMDSEQIN)
967  );
968  FW_ASSERT(
969  _status == Fw::FW_SERIALIZE_OK,
970  static_cast<FwAssertArgType>(_status)
971  );
972 
973  // Serialize port number
974  _status = msg.serialize(portNum);
975  FW_ASSERT(
976  _status == Fw::FW_SERIALIZE_OK,
977  static_cast<FwAssertArgType>(_status)
978  );
979 
980  // Serialize argument filename
981  _status = filename.serialize(msg, 240);
982  FW_ASSERT(
983  _status == Fw::FW_SERIALIZE_OK,
984  static_cast<FwAssertArgType>(_status)
985  );
986 
987  // Send message
989  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
990 
991  FW_ASSERT(
992  qStatus == Os::Queue::OP_OK,
993  static_cast<FwAssertArgType>(qStatus)
994  );
995  }
996 
997  // ----------------------------------------------------------------------
998  // Pre-message hooks for typed async input ports
999  //
1000  // Each of these functions is invoked just before processing a message
1001  // on the corresponding port. By default, they do nothing. You can
1002  // override them to provide specific pre-message behavior.
1003  // ----------------------------------------------------------------------
1004 
1007  FwIndexType portNum,
1008  FwOpcodeType opCode,
1009  U32 cmdSeq,
1010  const Fw::CmdResponse& response
1011  )
1012  {
1013  // Default: no-op
1014  }
1015 
1018  FwIndexType portNum,
1019  const Fw::StringBase& filename
1020  )
1021  {
1022  // Default: no-op
1023  }
1024 
1027  FwIndexType portNum,
1028  const Fw::StringBase& filename
1029  )
1030  {
1031  // Default: no-op
1032  }
1033 
1034  // ----------------------------------------------------------------------
1035  // Invocation functions for typed output ports
1036  // ----------------------------------------------------------------------
1037 
1040  FwIndexType portNum,
1041  const Fw::StringBase& filename
1042  )
1043  {
1044  FW_ASSERT(
1045  portNum < this->getNum_seqRunOut_OutputPorts(),
1046  static_cast<FwAssertArgType>(portNum)
1047  );
1048  this->m_seqRunOut_OutputPort[portNum].invoke(
1049  filename
1050  );
1051  }
1052 
1053  // ----------------------------------------------------------------------
1054  // Command response
1055  // ----------------------------------------------------------------------
1056 
1059  FwOpcodeType opCode,
1060  U32 cmdSeq,
1061  Fw::CmdResponse response
1062  )
1063  {
1064  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1065  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1066  }
1067 
1068  // ----------------------------------------------------------------------
1069  // Command handler base-class functions
1070  //
1071  // Call these functions directly to bypass the command input port
1072  // ----------------------------------------------------------------------
1073 
1076  FwOpcodeType opCode,
1077  U32 cmdSeq,
1078  Fw::CmdArgBuffer& args
1079  )
1080  {
1081  // Call pre-message hook
1082  this->RUN_preMsgHook(opCode,cmdSeq);
1083 
1084  // Defer deserializing arguments to the message dispatcher
1085  // to avoid deserializing and reserializing just for IPC
1086  ComponentIpcSerializableBuffer msg;
1088 
1089  // Serialize for IPC
1090  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_RUN));
1091  FW_ASSERT (
1092  _status == Fw::FW_SERIALIZE_OK,
1093  static_cast<FwAssertArgType>(_status)
1094  );
1095 
1096  // Fake port number to make message dequeue work
1097  FwIndexType port = 0;
1098 
1099  _status = msg.serialize(port);
1100  FW_ASSERT (
1101  _status == Fw::FW_SERIALIZE_OK,
1102  static_cast<FwAssertArgType>(_status)
1103  );
1104 
1105  _status = msg.serialize(opCode);
1106  FW_ASSERT (
1107  _status == Fw::FW_SERIALIZE_OK,
1108  static_cast<FwAssertArgType>(_status)
1109  );
1110 
1111  _status = msg.serialize(cmdSeq);
1112  FW_ASSERT (
1113  _status == Fw::FW_SERIALIZE_OK,
1114  static_cast<FwAssertArgType>(_status)
1115  );
1116 
1117  _status = msg.serialize(args);
1118  FW_ASSERT (
1119  _status == Fw::FW_SERIALIZE_OK,
1120  static_cast<FwAssertArgType>(_status)
1121  );
1122 
1123  // Send message
1125  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1126 
1127  FW_ASSERT(
1128  qStatus == Os::Queue::OP_OK,
1129  static_cast<FwAssertArgType>(qStatus)
1130  );
1131  }
1132 
1135  FwOpcodeType opCode,
1136  U32 cmdSeq,
1137  Fw::CmdArgBuffer& args
1138  )
1139  {
1140  // Call pre-message hook
1141  this->LOG_STATUS_preMsgHook(opCode,cmdSeq);
1142 
1143  // Defer deserializing arguments to the message dispatcher
1144  // to avoid deserializing and reserializing just for IPC
1145  ComponentIpcSerializableBuffer msg;
1147 
1148  // Serialize for IPC
1149  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_LOG_STATUS));
1150  FW_ASSERT (
1151  _status == Fw::FW_SERIALIZE_OK,
1152  static_cast<FwAssertArgType>(_status)
1153  );
1154 
1155  // Fake port number to make message dequeue work
1156  FwIndexType port = 0;
1157 
1158  _status = msg.serialize(port);
1159  FW_ASSERT (
1160  _status == Fw::FW_SERIALIZE_OK,
1161  static_cast<FwAssertArgType>(_status)
1162  );
1163 
1164  _status = msg.serialize(opCode);
1165  FW_ASSERT (
1166  _status == Fw::FW_SERIALIZE_OK,
1167  static_cast<FwAssertArgType>(_status)
1168  );
1169 
1170  _status = msg.serialize(cmdSeq);
1171  FW_ASSERT (
1172  _status == Fw::FW_SERIALIZE_OK,
1173  static_cast<FwAssertArgType>(_status)
1174  );
1175 
1176  _status = msg.serialize(args);
1177  FW_ASSERT (
1178  _status == Fw::FW_SERIALIZE_OK,
1179  static_cast<FwAssertArgType>(_status)
1180  );
1181 
1182  // Send message
1184  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1185 
1186  FW_ASSERT(
1187  qStatus == Os::Queue::OP_OK,
1188  static_cast<FwAssertArgType>(qStatus)
1189  );
1190  }
1191 
1192  // ----------------------------------------------------------------------
1193  // Pre-message hooks for async commands
1194  //
1195  // Each of these functions is invoked just before processing the
1196  // corresponding command. By default they do nothing. You can
1197  // override them to provide specific pre-command behavior.
1198  // ----------------------------------------------------------------------
1199 
1202  FwOpcodeType opCode,
1203  U32 cmdSeq
1204  )
1205  {
1206  // Defaults to no-op; can be overridden
1207  (void) opCode;
1208  (void) cmdSeq;
1209  }
1210 
1213  FwOpcodeType opCode,
1214  U32 cmdSeq
1215  )
1216  {
1217  // Defaults to no-op; can be overridden
1218  (void) opCode;
1219  (void) cmdSeq;
1220  }
1221 
1222  // ----------------------------------------------------------------------
1223  // Event logging functions
1224  // ----------------------------------------------------------------------
1225 
1228  {
1229  // Get the time
1230  Fw::Time _logTime;
1231  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1232  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1233  }
1234 
1235  FwEventIdType _id = static_cast<FwEventIdType>(0);
1236 
1237  _id = this->getIdBase() + EVENTID_INVALIDSEQUENCER;
1238 
1239  // Emit the event on the log port
1240  if (this->m_logOut_OutputPort[0].isConnected()) {
1241  Fw::LogBuffer _logBuff;
1243 
1244 #if FW_AMPCS_COMPATIBLE
1245  // Serialize the number of arguments
1246  _status = _logBuff.serialize(static_cast<U8>(1));
1247  FW_ASSERT(
1248  _status == Fw::FW_SERIALIZE_OK,
1249  static_cast<FwAssertArgType>(_status)
1250  );
1251 #endif
1252 
1253 #if FW_AMPCS_COMPATIBLE
1254  // Serialize the argument size
1255  _status = _logBuff.serialize(
1256  static_cast<U8>(sizeof(U16))
1257  );
1258  FW_ASSERT(
1259  _status == Fw::FW_SERIALIZE_OK,
1260  static_cast<FwAssertArgType>(_status)
1261  );
1262 #endif
1263  _status = _logBuff.serialize(idx);
1264  FW_ASSERT(
1265  _status == Fw::FW_SERIALIZE_OK,
1266  static_cast<FwAssertArgType>(_status)
1267  );
1268 
1269  this->m_logOut_OutputPort[0].invoke(
1270  _id,
1271  _logTime,
1273  _logBuff
1274  );
1275  }
1276 
1277  // Emit the event on the text log port
1278 #if FW_ENABLE_TEXT_LOGGING
1279  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1280 #if FW_OBJECT_NAMES == 1
1281  const char* _formatString =
1282  "(%s) %s: Invalid sequence index %" PRIu16 "";
1283 #else
1284  const char* _formatString =
1285  "%s: Invalid sequence index %" PRIu16 "";
1286 #endif
1287 
1288  Fw::TextLogString _logString;
1289  _logString.format(
1290  _formatString,
1291 #if FW_OBJECT_NAMES == 1
1292  this->m_objName.toChar(),
1293 #endif
1294  "InvalidSequencer ",
1295  idx
1296  );
1297 
1298  this->m_logTextOut_OutputPort[0].invoke(
1299  _id,
1300  _logTime,
1302  _logString
1303  );
1304  }
1305 #endif
1306  }
1307 
1310  {
1311  // Get the time
1312  Fw::Time _logTime;
1313  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1314  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1315  }
1316 
1317  FwEventIdType _id = static_cast<FwEventIdType>(0);
1318 
1319  _id = this->getIdBase() + EVENTID_NOAVAILABLESEQUENCERS;
1320 
1321  // Emit the event on the log port
1322  if (this->m_logOut_OutputPort[0].isConnected()) {
1323  Fw::LogBuffer _logBuff;
1324 
1325 #if FW_AMPCS_COMPATIBLE
1327  // Serialize the number of arguments
1328  _status = _logBuff.serialize(static_cast<U8>(0));
1329  FW_ASSERT(
1330  _status == Fw::FW_SERIALIZE_OK,
1331  static_cast<FwAssertArgType>(_status)
1332  );
1333 #endif
1334 
1335  this->m_logOut_OutputPort[0].invoke(
1336  _id,
1337  _logTime,
1339  _logBuff
1340  );
1341  }
1342 
1343  // Emit the event on the text log port
1344 #if FW_ENABLE_TEXT_LOGGING
1345  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1346 #if FW_OBJECT_NAMES == 1
1347  const char* _formatString =
1348  "(%s) %s: No available cmd sequencers to dispatch a sequence to";
1349 #else
1350  const char* _formatString =
1351  "%s: No available cmd sequencers to dispatch a sequence to";
1352 #endif
1353 
1354  Fw::TextLogString _logString;
1355  _logString.format(
1356  _formatString,
1357 #if FW_OBJECT_NAMES == 1
1358  this->m_objName.toChar(),
1359 #endif
1360  "NoAvailableSequencers "
1361  );
1362 
1363  this->m_logTextOut_OutputPort[0].invoke(
1364  _id,
1365  _logTime,
1367  _logString
1368  );
1369  }
1370 #endif
1371  }
1372 
1375  {
1376  // Get the time
1377  Fw::Time _logTime;
1378  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1379  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1380  }
1381 
1382  FwEventIdType _id = static_cast<FwEventIdType>(0);
1383 
1385 
1386  // Emit the event on the log port
1387  if (this->m_logOut_OutputPort[0].isConnected()) {
1388  Fw::LogBuffer _logBuff;
1390 
1391 #if FW_AMPCS_COMPATIBLE
1392  // Serialize the number of arguments
1393  _status = _logBuff.serialize(static_cast<U8>(1));
1394  FW_ASSERT(
1395  _status == Fw::FW_SERIALIZE_OK,
1396  static_cast<FwAssertArgType>(_status)
1397  );
1398 #endif
1399 
1400 #if FW_AMPCS_COMPATIBLE
1401  // Serialize the argument size
1402  _status = _logBuff.serialize(
1403  static_cast<U8>(sizeof(U16))
1404  );
1405  FW_ASSERT(
1406  _status == Fw::FW_SERIALIZE_OK,
1407  static_cast<FwAssertArgType>(_status)
1408  );
1409 #endif
1410  _status = _logBuff.serialize(idx);
1411  FW_ASSERT(
1412  _status == Fw::FW_SERIALIZE_OK,
1413  static_cast<FwAssertArgType>(_status)
1414  );
1415 
1416  this->m_logOut_OutputPort[0].invoke(
1417  _id,
1418  _logTime,
1420  _logBuff
1421  );
1422  }
1423 
1424  // Emit the event on the text log port
1425 #if FW_ENABLE_TEXT_LOGGING
1426  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1427 #if FW_OBJECT_NAMES == 1
1428  const char* _formatString =
1429  "(%s) %s: Sequencer %" PRIu16 " completed a sequence with no matching start notification";
1430 #else
1431  const char* _formatString =
1432  "%s: Sequencer %" PRIu16 " completed a sequence with no matching start notification";
1433 #endif
1434 
1435  Fw::TextLogString _logString;
1436  _logString.format(
1437  _formatString,
1438 #if FW_OBJECT_NAMES == 1
1439  this->m_objName.toChar(),
1440 #endif
1441  "UnknownSequenceFinished ",
1442  idx
1443  );
1444 
1445  this->m_logTextOut_OutputPort[0].invoke(
1446  _id,
1447  _logTime,
1449  _logString
1450  );
1451  }
1452 #endif
1453  }
1454 
1457  U16 idx,
1458  const Fw::StringBase& newSequence,
1459  const Fw::StringBase& sequenceInInternalState
1460  )
1461  {
1462  // Get the time
1463  Fw::Time _logTime;
1464  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1465  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1466  }
1467 
1468  FwEventIdType _id = static_cast<FwEventIdType>(0);
1469 
1471 
1472  // Emit the event on the log port
1473  if (this->m_logOut_OutputPort[0].isConnected()) {
1474  Fw::LogBuffer _logBuff;
1476 
1477 #if FW_AMPCS_COMPATIBLE
1478  // Serialize the number of arguments
1479  _status = _logBuff.serialize(static_cast<U8>(3));
1480  FW_ASSERT(
1481  _status == Fw::FW_SERIALIZE_OK,
1482  static_cast<FwAssertArgType>(_status)
1483  );
1484 #endif
1485 
1486 #if FW_AMPCS_COMPATIBLE
1487  // Serialize the argument size
1488  _status = _logBuff.serialize(
1489  static_cast<U8>(sizeof(U16))
1490  );
1491  FW_ASSERT(
1492  _status == Fw::FW_SERIALIZE_OK,
1493  static_cast<FwAssertArgType>(_status)
1494  );
1495 #endif
1496  _status = _logBuff.serialize(idx);
1497  FW_ASSERT(
1498  _status == Fw::FW_SERIALIZE_OK,
1499  static_cast<FwAssertArgType>(_status)
1500  );
1501 
1502  _status = newSequence.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1503  FW_ASSERT(
1504  _status == Fw::FW_SERIALIZE_OK,
1505  static_cast<FwAssertArgType>(_status)
1506  );
1507 
1508  _status = sequenceInInternalState.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1509  FW_ASSERT(
1510  _status == Fw::FW_SERIALIZE_OK,
1511  static_cast<FwAssertArgType>(_status)
1512  );
1513 
1514  this->m_logOut_OutputPort[0].invoke(
1515  _id,
1516  _logTime,
1518  _logBuff
1519  );
1520  }
1521 
1522  // Emit the event on the text log port
1523 #if FW_ENABLE_TEXT_LOGGING
1524  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1525 #if FW_OBJECT_NAMES == 1
1526  const char* _formatString =
1527  "(%s) %s: Sequencer %" PRIu16 " started a sequence %s while still running %s";
1528 #else
1529  const char* _formatString =
1530  "%s: Sequencer %" PRIu16 " started a sequence %s while still running %s";
1531 #endif
1532 
1533  Fw::TextLogString _logString;
1534  _logString.format(
1535  _formatString,
1536 #if FW_OBJECT_NAMES == 1
1537  this->m_objName.toChar(),
1538 #endif
1539  "ConflictingSequenceStarted ",
1540  idx,
1541  newSequence.toChar(),
1542  sequenceInInternalState.toChar()
1543  );
1544 
1545  this->m_logTextOut_OutputPort[0].invoke(
1546  _id,
1547  _logTime,
1549  _logString
1550  );
1551  }
1552 #endif
1553  }
1554 
1557  U16 idx,
1558  const Fw::StringBase& newSequence
1559  )
1560  {
1561  // Get the time
1562  Fw::Time _logTime;
1563  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1564  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1565  }
1566 
1567  FwEventIdType _id = static_cast<FwEventIdType>(0);
1568 
1570 
1571  // Emit the event on the log port
1572  if (this->m_logOut_OutputPort[0].isConnected()) {
1573  Fw::LogBuffer _logBuff;
1575 
1576 #if FW_AMPCS_COMPATIBLE
1577  // Serialize the number of arguments
1578  _status = _logBuff.serialize(static_cast<U8>(2));
1579  FW_ASSERT(
1580  _status == Fw::FW_SERIALIZE_OK,
1581  static_cast<FwAssertArgType>(_status)
1582  );
1583 #endif
1584 
1585 #if FW_AMPCS_COMPATIBLE
1586  // Serialize the argument size
1587  _status = _logBuff.serialize(
1588  static_cast<U8>(sizeof(U16))
1589  );
1590  FW_ASSERT(
1591  _status == Fw::FW_SERIALIZE_OK,
1592  static_cast<FwAssertArgType>(_status)
1593  );
1594 #endif
1595  _status = _logBuff.serialize(idx);
1596  FW_ASSERT(
1597  _status == Fw::FW_SERIALIZE_OK,
1598  static_cast<FwAssertArgType>(_status)
1599  );
1600 
1601  _status = newSequence.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1602  FW_ASSERT(
1603  _status == Fw::FW_SERIALIZE_OK,
1604  static_cast<FwAssertArgType>(_status)
1605  );
1606 
1607  this->m_logOut_OutputPort[0].invoke(
1608  _id,
1609  _logTime,
1611  _logBuff
1612  );
1613  }
1614 
1615  // Emit the event on the text log port
1616 #if FW_ENABLE_TEXT_LOGGING
1617  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1618 #if FW_OBJECT_NAMES == 1
1619  const char* _formatString =
1620  "(%s) %s: Sequencer %" PRIu16 " was externally commanded to start a sequence %s";
1621 #else
1622  const char* _formatString =
1623  "%s: Sequencer %" PRIu16 " was externally commanded to start a sequence %s";
1624 #endif
1625 
1626  Fw::TextLogString _logString;
1627  _logString.format(
1628  _formatString,
1629 #if FW_OBJECT_NAMES == 1
1630  this->m_objName.toChar(),
1631 #endif
1632  "UnexpectedSequenceStarted ",
1633  idx,
1634  newSequence.toChar()
1635  );
1636 
1637  this->m_logTextOut_OutputPort[0].invoke(
1638  _id,
1639  _logTime,
1641  _logString
1642  );
1643  }
1644 #endif
1645  }
1646 
1649  U16 idx,
1651  const Fw::StringBase& filename
1652  )
1653  {
1654  // Get the time
1655  Fw::Time _logTime;
1656  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1657  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1658  }
1659 
1660  FwEventIdType _id = static_cast<FwEventIdType>(0);
1661 
1662  _id = this->getIdBase() + EVENTID_LOGSEQUENCERSTATUS;
1663 
1664  // Emit the event on the log port
1665  if (this->m_logOut_OutputPort[0].isConnected()) {
1666  Fw::LogBuffer _logBuff;
1668 
1669 #if FW_AMPCS_COMPATIBLE
1670  // Serialize the number of arguments
1671  _status = _logBuff.serialize(static_cast<U8>(3));
1672  FW_ASSERT(
1673  _status == Fw::FW_SERIALIZE_OK,
1674  static_cast<FwAssertArgType>(_status)
1675  );
1676 #endif
1677 
1678 #if FW_AMPCS_COMPATIBLE
1679  // Serialize the argument size
1680  _status = _logBuff.serialize(
1681  static_cast<U8>(sizeof(U16))
1682  );
1683  FW_ASSERT(
1684  _status == Fw::FW_SERIALIZE_OK,
1685  static_cast<FwAssertArgType>(_status)
1686  );
1687 #endif
1688  _status = _logBuff.serialize(idx);
1689  FW_ASSERT(
1690  _status == Fw::FW_SERIALIZE_OK,
1691  static_cast<FwAssertArgType>(_status)
1692  );
1693 
1694 #if FW_AMPCS_COMPATIBLE
1695  // Serialize the argument size
1696  _status = _logBuff.serialize(
1698  );
1699  FW_ASSERT(
1700  _status == Fw::FW_SERIALIZE_OK,
1701  static_cast<FwAssertArgType>(_status)
1702  );
1703 #endif
1704  _status = _logBuff.serialize(state);
1705  FW_ASSERT(
1706  _status == Fw::FW_SERIALIZE_OK,
1707  static_cast<FwAssertArgType>(_status)
1708  );
1709 
1710  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1711  FW_ASSERT(
1712  _status == Fw::FW_SERIALIZE_OK,
1713  static_cast<FwAssertArgType>(_status)
1714  );
1715 
1716  this->m_logOut_OutputPort[0].invoke(
1717  _id,
1718  _logTime,
1720  _logBuff
1721  );
1722  }
1723 
1724  // Emit the event on the text log port
1725 #if FW_ENABLE_TEXT_LOGGING
1726  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1727 #if FW_OBJECT_NAMES == 1
1728  const char* _formatString =
1729  "(%s) %s: Sequencer %" PRIu16 " with state %s is running file %s";
1730 #else
1731  const char* _formatString =
1732  "%s: Sequencer %" PRIu16 " with state %s is running file %s";
1733 #endif
1734 
1735  Fw::String stateStr;
1736  state.toString(stateStr);
1737 
1738  Fw::TextLogString _logString;
1739  _logString.format(
1740  _formatString,
1741 #if FW_OBJECT_NAMES == 1
1742  this->m_objName.toChar(),
1743 #endif
1744  "LogSequencerStatus ",
1745  idx,
1746  stateStr.toChar(),
1747  filename.toChar()
1748  );
1749 
1750  this->m_logTextOut_OutputPort[0].invoke(
1751  _id,
1752  _logTime,
1754  _logString
1755  );
1756  }
1757 #endif
1758  }
1759 
1760  // ----------------------------------------------------------------------
1761  // Telemetry write functions
1762  // ----------------------------------------------------------------------
1763 
1766  U32 arg,
1767  Fw::Time _tlmTime
1768  )
1769  {
1770  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1771  if (
1772  this->m_timeCaller_OutputPort[0].isConnected() &&
1773  (_tlmTime == Fw::ZERO_TIME)
1774  ) {
1775  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1776  }
1777 
1778  Fw::TlmBuffer _tlmBuff;
1779  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1780  FW_ASSERT(
1781  _stat == Fw::FW_SERIALIZE_OK,
1782  static_cast<FwAssertArgType>(_stat)
1783  );
1784 
1785  FwChanIdType _id;
1786 
1787  _id = this->getIdBase() + CHANNELID_DISPATCHEDCOUNT;
1788 
1789  this->m_tlmOut_OutputPort[0].invoke(
1790  _id,
1791  _tlmTime,
1792  _tlmBuff
1793  );
1794  }
1795  }
1796 
1799  U32 arg,
1800  Fw::Time _tlmTime
1801  )
1802  {
1803  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1804  if (
1805  this->m_timeCaller_OutputPort[0].isConnected() &&
1806  (_tlmTime == Fw::ZERO_TIME)
1807  ) {
1808  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1809  }
1810 
1811  Fw::TlmBuffer _tlmBuff;
1812  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1813  FW_ASSERT(
1814  _stat == Fw::FW_SERIALIZE_OK,
1815  static_cast<FwAssertArgType>(_stat)
1816  );
1817 
1818  FwChanIdType _id;
1819 
1820  _id = this->getIdBase() + CHANNELID_ERRORCOUNT;
1821 
1822  this->m_tlmOut_OutputPort[0].invoke(
1823  _id,
1824  _tlmTime,
1825  _tlmBuff
1826  );
1827  }
1828  }
1829 
1832  U32 arg,
1833  Fw::Time _tlmTime
1834  )
1835  {
1836  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1837  if (
1838  this->m_timeCaller_OutputPort[0].isConnected() &&
1839  (_tlmTime == Fw::ZERO_TIME)
1840  ) {
1841  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1842  }
1843 
1844  Fw::TlmBuffer _tlmBuff;
1845  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1846  FW_ASSERT(
1847  _stat == Fw::FW_SERIALIZE_OK,
1848  static_cast<FwAssertArgType>(_stat)
1849  );
1850 
1851  FwChanIdType _id;
1852 
1853  _id = this->getIdBase() + CHANNELID_SEQUENCERSAVAILABLE;
1854 
1855  this->m_tlmOut_OutputPort[0].invoke(
1856  _id,
1857  _tlmTime,
1858  _tlmBuff
1859  );
1860  }
1861  }
1862 
1863  // ----------------------------------------------------------------------
1864  // Time
1865  // ----------------------------------------------------------------------
1866 
1868  getTime()
1869  {
1870  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1871  Fw::Time _time;
1872  this->m_timeCaller_OutputPort[0].invoke(_time);
1873  return _time;
1874  }
1875  else {
1876  return Fw::Time(TB_NONE, 0, 0);
1877  }
1878  }
1879 
1880  // ----------------------------------------------------------------------
1881  // Message dispatch functions
1882  // ----------------------------------------------------------------------
1883 
1884  Fw::QueuedComponentBase::MsgDispatchStatus SeqDispatcherComponentBase ::
1885  doDispatch()
1886  {
1887  ComponentIpcSerializableBuffer msg;
1888  FwQueuePriorityType priority = 0;
1889 
1890  Os::Queue::Status msgStatus = this->m_queue.receive(
1891  msg,
1893  priority
1894  );
1895  FW_ASSERT(
1896  msgStatus == Os::Queue::OP_OK,
1897  static_cast<FwAssertArgType>(msgStatus)
1898  );
1899 
1900  // Reset to beginning of buffer
1901  msg.resetDeser();
1902 
1903  FwEnumStoreType desMsg = 0;
1904  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
1905  FW_ASSERT(
1906  deserStatus == Fw::FW_SERIALIZE_OK,
1907  static_cast<FwAssertArgType>(deserStatus)
1908  );
1909 
1910  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
1911 
1912  if (msgType == SEQDISPATCHER_COMPONENT_EXIT) {
1913  return MSG_DISPATCH_EXIT;
1914  }
1915 
1916  FwIndexType portNum = 0;
1917  deserStatus = msg.deserialize(portNum);
1918  FW_ASSERT(
1919  deserStatus == Fw::FW_SERIALIZE_OK,
1920  static_cast<FwAssertArgType>(deserStatus)
1921  );
1922 
1923  switch (msgType) {
1924  // Handle async input port seqDoneIn
1925  case SEQDONEIN_CMDRESPONSE: {
1926  // Deserialize argument opCode
1927  FwOpcodeType opCode;
1928  deserStatus = msg.deserialize(opCode);
1929  FW_ASSERT(
1930  deserStatus == Fw::FW_SERIALIZE_OK,
1931  static_cast<FwAssertArgType>(deserStatus)
1932  );
1933 
1934  // Deserialize argument cmdSeq
1935  U32 cmdSeq;
1936  deserStatus = msg.deserialize(cmdSeq);
1937  FW_ASSERT(
1938  deserStatus == Fw::FW_SERIALIZE_OK,
1939  static_cast<FwAssertArgType>(deserStatus)
1940  );
1941 
1942  // Deserialize argument response
1943  Fw::CmdResponse response;
1944  deserStatus = msg.deserialize(response);
1945  FW_ASSERT(
1946  deserStatus == Fw::FW_SERIALIZE_OK,
1947  static_cast<FwAssertArgType>(deserStatus)
1948  );
1949  // Call handler function
1950  this->seqDoneIn_handler(
1951  portNum,
1952  opCode,
1953  cmdSeq,
1954  response
1955  );
1956 
1957  break;
1958  }
1959 
1960  // Handle async input port seqRunIn
1961  case SEQRUNIN_CMDSEQIN: {
1962  // Deserialize argument filename
1963  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
1964  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
1965  deserStatus = msg.deserialize(filename);
1966  FW_ASSERT(
1967  deserStatus == Fw::FW_SERIALIZE_OK,
1968  static_cast<FwAssertArgType>(deserStatus)
1969  );
1970  // Call handler function
1971  this->seqRunIn_handler(
1972  portNum,
1973  filename
1974  );
1975 
1976  break;
1977  }
1978 
1979  // Handle async input port seqStartIn
1980  case SEQSTARTIN_CMDSEQIN: {
1981  // Deserialize argument filename
1982  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
1983  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
1984  deserStatus = msg.deserialize(filename);
1985  FW_ASSERT(
1986  deserStatus == Fw::FW_SERIALIZE_OK,
1987  static_cast<FwAssertArgType>(deserStatus)
1988  );
1989  // Call handler function
1990  this->seqStartIn_handler(
1991  portNum,
1992  filename
1993  );
1994 
1995  break;
1996  }
1997 
1998  // Handle command RUN
1999  case CMD_RUN: {
2000  // Deserialize opcode
2001  FwOpcodeType opCode = 0;
2002  deserStatus = msg.deserialize(opCode);
2003  FW_ASSERT (
2004  deserStatus == Fw::FW_SERIALIZE_OK,
2005  static_cast<FwAssertArgType>(deserStatus)
2006  );
2007 
2008  // Deserialize command sequence
2009  U32 cmdSeq = 0;
2010  deserStatus = msg.deserialize(cmdSeq);
2011  FW_ASSERT (
2012  deserStatus == Fw::FW_SERIALIZE_OK,
2013  static_cast<FwAssertArgType>(deserStatus)
2014  );
2015 
2016  // Deserialize command argument buffer
2017  Fw::CmdArgBuffer args;
2018  deserStatus = msg.deserialize(args);
2019  FW_ASSERT (
2020  deserStatus == Fw::FW_SERIALIZE_OK,
2021  static_cast<FwAssertArgType>(deserStatus)
2022  );
2023 
2024  // Reset buffer
2025  args.resetDeser();
2026 
2027  // Deserialize argument fileName
2028  Fw::CmdStringArg fileName;
2029  deserStatus = args.deserialize(fileName);
2030  if (deserStatus != Fw::FW_SERIALIZE_OK) {
2031  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2032  this->cmdResponse_out(
2033  opCode,
2034  cmdSeq,
2036  );
2037  }
2038  // Don't crash the task if bad arguments were passed from the ground
2039  break;
2040  }
2041 
2042  // Deserialize argument block
2043  Fw::Wait block;
2044  deserStatus = args.deserialize(block);
2045  if (deserStatus != Fw::FW_SERIALIZE_OK) {
2046  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2047  this->cmdResponse_out(
2048  opCode,
2049  cmdSeq,
2051  );
2052  }
2053  // Don't crash the task if bad arguments were passed from the ground
2054  break;
2055  }
2056 
2057  // Make sure there was no data left over.
2058  // That means the argument buffer size was incorrect.
2059 #if FW_CMD_CHECK_RESIDUAL
2060  if (args.getBuffLeft() != 0) {
2061  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2062  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2063  }
2064  // Don't crash the task if bad arguments were passed from the ground
2065  break;
2066  }
2067 #endif
2068 
2069  // Call handler function
2070  this->RUN_cmdHandler(
2071  opCode, cmdSeq,
2072  fileName,
2073  block
2074  );
2075 
2076  break;
2077  }
2078 
2079  // Handle command LOG_STATUS
2080  case CMD_LOG_STATUS: {
2081  // Deserialize opcode
2082  FwOpcodeType opCode = 0;
2083  deserStatus = msg.deserialize(opCode);
2084  FW_ASSERT (
2085  deserStatus == Fw::FW_SERIALIZE_OK,
2086  static_cast<FwAssertArgType>(deserStatus)
2087  );
2088 
2089  // Deserialize command sequence
2090  U32 cmdSeq = 0;
2091  deserStatus = msg.deserialize(cmdSeq);
2092  FW_ASSERT (
2093  deserStatus == Fw::FW_SERIALIZE_OK,
2094  static_cast<FwAssertArgType>(deserStatus)
2095  );
2096 
2097  // Deserialize command argument buffer
2098  Fw::CmdArgBuffer args;
2099  deserStatus = msg.deserialize(args);
2100  FW_ASSERT (
2101  deserStatus == Fw::FW_SERIALIZE_OK,
2102  static_cast<FwAssertArgType>(deserStatus)
2103  );
2104 
2105  // Reset buffer
2106  args.resetDeser();
2107 
2108  // Make sure there was no data left over.
2109  // That means the argument buffer size was incorrect.
2110 #if FW_CMD_CHECK_RESIDUAL
2111  if (args.getBuffLeft() != 0) {
2112  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2113  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2114  }
2115  // Don't crash the task if bad arguments were passed from the ground
2116  break;
2117  }
2118 #endif
2119 
2120  // Call handler function
2121  this->LOG_STATUS_cmdHandler(opCode, cmdSeq);
2122 
2123  break;
2124  }
2125 
2126  default:
2127  return MSG_DISPATCH_ERROR;
2128  }
2129 
2130  return MSG_DISPATCH_OK;
2131  }
2132 
2133  // ----------------------------------------------------------------------
2134  // Calls for messages received on special input ports
2135  // ----------------------------------------------------------------------
2136 
2137  void SeqDispatcherComponentBase ::
2138  m_p_cmdIn_in(
2139  Fw::PassiveComponentBase* callComp,
2140  FwIndexType portNum,
2141  FwOpcodeType opCode,
2142  U32 cmdSeq,
2143  Fw::CmdArgBuffer& args
2144  )
2145  {
2146  FW_ASSERT(callComp);
2147  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2148 
2149  const U32 idBase = callComp->getIdBase();
2150  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
2151 
2152  // Select base class function based on opcode
2153  switch (opCode - idBase) {
2154  case OPCODE_RUN: {
2155  compPtr->RUN_cmdHandlerBase(
2156  opCode,
2157  cmdSeq,
2158  args
2159  );
2160  break;
2161  }
2162 
2163  case OPCODE_LOG_STATUS: {
2164  compPtr->LOG_STATUS_cmdHandlerBase(
2165  opCode,
2166  cmdSeq,
2167  args
2168  );
2169  break;
2170  }
2171  }
2172  }
2173 
2174  // ----------------------------------------------------------------------
2175  // Calls for messages received on typed input ports
2176  // ----------------------------------------------------------------------
2177 
2178  void SeqDispatcherComponentBase ::
2179  m_p_seqDoneIn_in(
2180  Fw::PassiveComponentBase* callComp,
2181  FwIndexType portNum,
2182  FwOpcodeType opCode,
2183  U32 cmdSeq,
2184  const Fw::CmdResponse& response
2185  )
2186  {
2187  FW_ASSERT(callComp);
2188  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2189  compPtr->seqDoneIn_handlerBase(
2190  portNum,
2191  opCode,
2192  cmdSeq,
2193  response
2194  );
2195  }
2196 
2197  void SeqDispatcherComponentBase ::
2198  m_p_seqRunIn_in(
2199  Fw::PassiveComponentBase* callComp,
2200  FwIndexType portNum,
2201  const Fw::StringBase& filename
2202  )
2203  {
2204  FW_ASSERT(callComp);
2205  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2206  compPtr->seqRunIn_handlerBase(
2207  portNum,
2208  filename
2209  );
2210  }
2211 
2212  void SeqDispatcherComponentBase ::
2213  m_p_seqStartIn_in(
2214  Fw::PassiveComponentBase* callComp,
2215  FwIndexType portNum,
2216  const Fw::StringBase& filename
2217  )
2218  {
2219  FW_ASSERT(callComp);
2220  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2221  compPtr->seqStartIn_handlerBase(
2222  portNum,
2223  filename
2224  );
2225  }
2226 
2227 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
U8 BYTE
byte type
Definition: BasicTypes.h:31
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:72
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:70
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition: FpConfig.h:70
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:39
U32 FwChanIdType
Definition: FpConfig.h:95
U32 FwEventIdType
Definition: FpConfig.h:103
U32 FwOpcodeType
Definition: FpConfig.h:91
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:319
PlatformQueuePriorityType FwQueuePriorityType
Definition: FpConfig.h:55
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition: FpConfig.h:148
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
A string backed by an external buffer.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:37
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void setPortNum(NATIVE_INT_TYPE portNum)
@ WARNING_HI
A serious but recoverable event.
@ WARNING_LO
A less serious but recoverable event.
@ ACTIVITY_LO
Less important informational events.
void init()
Object initializer.
Definition: ObjBase.cpp:27
const char * toChar() const
Definition: ObjectName.hpp:50
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode)
Invoke a port interface.
void init()
Initialization function.
void init()
Initialization function.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke a port interface.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:170
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void invoke(Fw::Time &time)
Invoke a port interface.
Definition: TimePortAc.cpp:147
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected()
Definition: PortBase.cpp:41
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Os::Queue m_queue
queue object for active component
@ MSG_DISPATCH_OK
Dispatch was normal.
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
@ MSG_DISPATCH_ERROR
Errors dispatching messages.
NATIVE_UINT_TYPE SizeType
void resetDeser()
reset deserialization to beginning
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
virtual const CHAR * toChar() const =0
void format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:56
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:146
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
Definition: StringBase.hpp:41
const char * toChar() const
Definition: String.hpp:50
Definition: Time.hpp:9
Wait or don't wait for something.
Definition: WaitEnumAc.hpp:19
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
BlockingType
message type
Definition: Queue.hpp:44
@ BLOCKING
Message will block until space is available.
Definition: Queue.hpp:45
@ NONBLOCKING
Message will return with status when space is unavailable.
Definition: Queue.hpp:46
Status
status returned from the queue send function
Definition: Queue.hpp:30
@ OP_OK
message sent/received okay
Definition: Queue.hpp:31
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void init()
Initialization function.
void invoke(const Fw::StringBase &filename)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputCmdSeqInPort *callPort)
Register an input port.
@ SERIALIZED_SIZE
The size of the serial representation.
void log_WARNING_LO_UnexpectedSequenceStarted(U16 idx, const Fw::StringBase &newSequence)
Log event UnexpectedSequenceStarted.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
virtual void seqRunIn_preMsgHook(FwIndexType portNum, const Fw::StringBase &filename)
Pre-message hook for async input port seqRunIn.
void tlmWrite_errorCount(U32 arg, Fw::Time _tlmTime=Fw::Time())
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
virtual void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &filename)=0
Handler for input port seqRunIn.
@ OPCODE_LOG_STATUS
Logs via Events the state of each connected command sequencer.
@ OPCODE_RUN
Dispatches a sequence to the first available sequencer.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
@ CHANNELID_ERRORCOUNT
Channel ID for errorCount.
@ CHANNELID_DISPATCHEDCOUNT
Channel ID for dispatchedCount.
@ CHANNELID_SEQUENCERSAVAILABLE
Channel ID for sequencersAvailable.
Fw::InputCmdResponsePort * get_seqDoneIn_InputPort(FwIndexType portNum)
Svc::InputCmdSeqInPort * get_seqRunIn_InputPort(FwIndexType portNum)
virtual void seqStartIn_handler(FwIndexType portNum, const Fw::StringBase &filename)=0
Handler for input port seqStartIn.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
void seqRunIn_handlerBase(FwIndexType portNum, const Fw::StringBase &filename)
Handler base-class function for input port seqRunIn.
Svc::InputCmdSeqInPort * get_seqStartIn_InputPort(FwIndexType portNum)
virtual void seqDoneIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port seqDoneIn.
virtual void RUN_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, Fw::Wait block)=0
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void log_WARNING_HI_ConflictingSequenceStarted(U16 idx, const Fw::StringBase &newSequence, const Fw::StringBase &sequenceInInternalState)
Log event ConflictingSequenceStarted.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
void seqStartIn_handlerBase(FwIndexType portNum, const Fw::StringBase &filename)
Handler base-class function for input port seqStartIn.
virtual void RUN_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RUN.
void regCommands()
Register commands with the Command Dispatcher.
void tlmWrite_dispatchedCount(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_NoAvailableSequencers()
Log event NoAvailableSequencers.
void LOG_STATUS_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void log_ACTIVITY_LO_LogSequencerStatus(U16 idx, Svc::SeqDispatcher_CmdSequencerState state, const Fw::StringBase &filename)
Log event LogSequencerStatus.
virtual void LOG_STATUS_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command LOG_STATUS.
void RUN_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
bool isConnected_seqRunOut_OutputPort(FwIndexType portNum)
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
SeqDispatcherComponentBase(const char *compName="")
Construct SeqDispatcherComponentBase object.
void set_seqRunOut_OutputPort(FwIndexType portNum, Svc::InputCmdSeqInPort *port)
Connect port to seqRunOut[portNum].
virtual void LOG_STATUS_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void seqRunOut_out(FwIndexType portNum, const Fw::StringBase &filename)
Invoke output port seqRunOut.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
virtual void seqDoneIn_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port seqDoneIn.
void log_WARNING_LO_UnknownSequenceFinished(U16 idx)
Log event UnknownSequenceFinished.
void seqDoneIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port seqDoneIn.
virtual void seqStartIn_preMsgHook(FwIndexType portNum, const Fw::StringBase &filename)
Pre-message hook for async input port seqStartIn.
virtual ~SeqDispatcherComponentBase()
Destroy SeqDispatcherComponentBase object.
void tlmWrite_sequencersAvailable(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_InvalidSequencer(U16 idx)
Log event InvalidSequencer.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
const Time ZERO_TIME
Definition: Time.cpp:5
@ OP_OK
Operation succeeded.
Definition: Os.hpp:26