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