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  this->m_seqRunOut_OutputPort[portNum].invoke(
1051  filename
1052  );
1053  }
1054 
1055  // ----------------------------------------------------------------------
1056  // Command response
1057  // ----------------------------------------------------------------------
1058 
1061  FwOpcodeType opCode,
1062  U32 cmdSeq,
1063  Fw::CmdResponse response
1064  )
1065  {
1066  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1067  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1068  }
1069 
1070  // ----------------------------------------------------------------------
1071  // Command handler base-class functions
1072  //
1073  // Call these functions directly to bypass the command input port
1074  // ----------------------------------------------------------------------
1075 
1078  FwOpcodeType opCode,
1079  U32 cmdSeq,
1080  Fw::CmdArgBuffer& args
1081  )
1082  {
1083  // Call pre-message hook
1084  this->RUN_preMsgHook(opCode,cmdSeq);
1085 
1086  // Defer deserializing arguments to the message dispatcher
1087  // to avoid deserializing and reserializing just for IPC
1088  ComponentIpcSerializableBuffer msg;
1090 
1091  // Serialize for IPC
1092  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_RUN));
1093  FW_ASSERT (
1094  _status == Fw::FW_SERIALIZE_OK,
1095  static_cast<FwAssertArgType>(_status)
1096  );
1097 
1098  // Fake port number to make message dequeue work
1099  FwIndexType port = 0;
1100 
1101  _status = msg.serialize(port);
1102  FW_ASSERT (
1103  _status == Fw::FW_SERIALIZE_OK,
1104  static_cast<FwAssertArgType>(_status)
1105  );
1106 
1107  _status = msg.serialize(opCode);
1108  FW_ASSERT (
1109  _status == Fw::FW_SERIALIZE_OK,
1110  static_cast<FwAssertArgType>(_status)
1111  );
1112 
1113  _status = msg.serialize(cmdSeq);
1114  FW_ASSERT (
1115  _status == Fw::FW_SERIALIZE_OK,
1116  static_cast<FwAssertArgType>(_status)
1117  );
1118 
1119  _status = msg.serialize(args);
1120  FW_ASSERT (
1121  _status == Fw::FW_SERIALIZE_OK,
1122  static_cast<FwAssertArgType>(_status)
1123  );
1124 
1125  // Send message
1127  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1128 
1129  FW_ASSERT(
1130  qStatus == Os::Queue::OP_OK,
1131  static_cast<FwAssertArgType>(qStatus)
1132  );
1133  }
1134 
1137  FwOpcodeType opCode,
1138  U32 cmdSeq,
1139  Fw::CmdArgBuffer& args
1140  )
1141  {
1142  // Call pre-message hook
1143  this->LOG_STATUS_preMsgHook(opCode,cmdSeq);
1144 
1145  // Defer deserializing arguments to the message dispatcher
1146  // to avoid deserializing and reserializing just for IPC
1147  ComponentIpcSerializableBuffer msg;
1149 
1150  // Serialize for IPC
1151  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_LOG_STATUS));
1152  FW_ASSERT (
1153  _status == Fw::FW_SERIALIZE_OK,
1154  static_cast<FwAssertArgType>(_status)
1155  );
1156 
1157  // Fake port number to make message dequeue work
1158  FwIndexType port = 0;
1159 
1160  _status = msg.serialize(port);
1161  FW_ASSERT (
1162  _status == Fw::FW_SERIALIZE_OK,
1163  static_cast<FwAssertArgType>(_status)
1164  );
1165 
1166  _status = msg.serialize(opCode);
1167  FW_ASSERT (
1168  _status == Fw::FW_SERIALIZE_OK,
1169  static_cast<FwAssertArgType>(_status)
1170  );
1171 
1172  _status = msg.serialize(cmdSeq);
1173  FW_ASSERT (
1174  _status == Fw::FW_SERIALIZE_OK,
1175  static_cast<FwAssertArgType>(_status)
1176  );
1177 
1178  _status = msg.serialize(args);
1179  FW_ASSERT (
1180  _status == Fw::FW_SERIALIZE_OK,
1181  static_cast<FwAssertArgType>(_status)
1182  );
1183 
1184  // Send message
1186  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1187 
1188  FW_ASSERT(
1189  qStatus == Os::Queue::OP_OK,
1190  static_cast<FwAssertArgType>(qStatus)
1191  );
1192  }
1193 
1194  // ----------------------------------------------------------------------
1195  // Pre-message hooks for async commands
1196  //
1197  // Each of these functions is invoked just before processing the
1198  // corresponding command. By default they do nothing. You can
1199  // override them to provide specific pre-command behavior.
1200  // ----------------------------------------------------------------------
1201 
1204  FwOpcodeType opCode,
1205  U32 cmdSeq
1206  )
1207  {
1208  // Defaults to no-op; can be overridden
1209  (void) opCode;
1210  (void) cmdSeq;
1211  }
1212 
1215  FwOpcodeType opCode,
1216  U32 cmdSeq
1217  )
1218  {
1219  // Defaults to no-op; can be overridden
1220  (void) opCode;
1221  (void) cmdSeq;
1222  }
1223 
1224  // ----------------------------------------------------------------------
1225  // Event logging functions
1226  // ----------------------------------------------------------------------
1227 
1230  {
1231  // Get the time
1232  Fw::Time _logTime;
1233  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1234  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1235  }
1236 
1237  FwEventIdType _id = static_cast<FwEventIdType>(0);
1238 
1239  _id = this->getIdBase() + EVENTID_INVALIDSEQUENCER;
1240 
1241  // Emit the event on the log port
1242  if (this->m_logOut_OutputPort[0].isConnected()) {
1243  Fw::LogBuffer _logBuff;
1245 
1246 #if FW_AMPCS_COMPATIBLE
1247  // Serialize the number of arguments
1248  _status = _logBuff.serialize(static_cast<U8>(1));
1249  FW_ASSERT(
1250  _status == Fw::FW_SERIALIZE_OK,
1251  static_cast<FwAssertArgType>(_status)
1252  );
1253 #endif
1254 
1255 #if FW_AMPCS_COMPATIBLE
1256  // Serialize the argument size
1257  _status = _logBuff.serialize(
1258  static_cast<U8>(sizeof(U16))
1259  );
1260  FW_ASSERT(
1261  _status == Fw::FW_SERIALIZE_OK,
1262  static_cast<FwAssertArgType>(_status)
1263  );
1264 #endif
1265  _status = _logBuff.serialize(idx);
1266  FW_ASSERT(
1267  _status == Fw::FW_SERIALIZE_OK,
1268  static_cast<FwAssertArgType>(_status)
1269  );
1270 
1271  this->m_logOut_OutputPort[0].invoke(
1272  _id,
1273  _logTime,
1275  _logBuff
1276  );
1277  }
1278 
1279  // Emit the event on the text log port
1280 #if FW_ENABLE_TEXT_LOGGING
1281  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1282 #if FW_OBJECT_NAMES == 1
1283  const char* _formatString =
1284  "(%s) %s: Invalid sequence index %" PRIu16 "";
1285 #else
1286  const char* _formatString =
1287  "%s: Invalid sequence index %" PRIu16 "";
1288 #endif
1289 
1290  Fw::TextLogString _logString;
1291  _logString.format(
1292  _formatString,
1293 #if FW_OBJECT_NAMES == 1
1294  this->m_objName.toChar(),
1295 #endif
1296  "InvalidSequencer ",
1297  idx
1298  );
1299 
1300  this->m_logTextOut_OutputPort[0].invoke(
1301  _id,
1302  _logTime,
1304  _logString
1305  );
1306  }
1307 #endif
1308  }
1309 
1312  {
1313  // Get the time
1314  Fw::Time _logTime;
1315  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1316  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1317  }
1318 
1319  FwEventIdType _id = static_cast<FwEventIdType>(0);
1320 
1321  _id = this->getIdBase() + EVENTID_NOAVAILABLESEQUENCERS;
1322 
1323  // Emit the event on the log port
1324  if (this->m_logOut_OutputPort[0].isConnected()) {
1325  Fw::LogBuffer _logBuff;
1326 
1327 #if FW_AMPCS_COMPATIBLE
1329  // Serialize the number of arguments
1330  _status = _logBuff.serialize(static_cast<U8>(0));
1331  FW_ASSERT(
1332  _status == Fw::FW_SERIALIZE_OK,
1333  static_cast<FwAssertArgType>(_status)
1334  );
1335 #endif
1336 
1337  this->m_logOut_OutputPort[0].invoke(
1338  _id,
1339  _logTime,
1341  _logBuff
1342  );
1343  }
1344 
1345  // Emit the event on the text log port
1346 #if FW_ENABLE_TEXT_LOGGING
1347  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1348 #if FW_OBJECT_NAMES == 1
1349  const char* _formatString =
1350  "(%s) %s: No available cmd sequencers to dispatch a sequence to";
1351 #else
1352  const char* _formatString =
1353  "%s: No available cmd sequencers to dispatch a sequence to";
1354 #endif
1355 
1356  Fw::TextLogString _logString;
1357  _logString.format(
1358  _formatString,
1359 #if FW_OBJECT_NAMES == 1
1360  this->m_objName.toChar(),
1361 #endif
1362  "NoAvailableSequencers "
1363  );
1364 
1365  this->m_logTextOut_OutputPort[0].invoke(
1366  _id,
1367  _logTime,
1369  _logString
1370  );
1371  }
1372 #endif
1373  }
1374 
1377  {
1378  // Get the time
1379  Fw::Time _logTime;
1380  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1381  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1382  }
1383 
1384  FwEventIdType _id = static_cast<FwEventIdType>(0);
1385 
1387 
1388  // Emit the event on the log port
1389  if (this->m_logOut_OutputPort[0].isConnected()) {
1390  Fw::LogBuffer _logBuff;
1392 
1393 #if FW_AMPCS_COMPATIBLE
1394  // Serialize the number of arguments
1395  _status = _logBuff.serialize(static_cast<U8>(1));
1396  FW_ASSERT(
1397  _status == Fw::FW_SERIALIZE_OK,
1398  static_cast<FwAssertArgType>(_status)
1399  );
1400 #endif
1401 
1402 #if FW_AMPCS_COMPATIBLE
1403  // Serialize the argument size
1404  _status = _logBuff.serialize(
1405  static_cast<U8>(sizeof(U16))
1406  );
1407  FW_ASSERT(
1408  _status == Fw::FW_SERIALIZE_OK,
1409  static_cast<FwAssertArgType>(_status)
1410  );
1411 #endif
1412  _status = _logBuff.serialize(idx);
1413  FW_ASSERT(
1414  _status == Fw::FW_SERIALIZE_OK,
1415  static_cast<FwAssertArgType>(_status)
1416  );
1417 
1418  this->m_logOut_OutputPort[0].invoke(
1419  _id,
1420  _logTime,
1422  _logBuff
1423  );
1424  }
1425 
1426  // Emit the event on the text log port
1427 #if FW_ENABLE_TEXT_LOGGING
1428  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1429 #if FW_OBJECT_NAMES == 1
1430  const char* _formatString =
1431  "(%s) %s: Sequencer %" PRIu16 " completed a sequence with no matching start notification";
1432 #else
1433  const char* _formatString =
1434  "%s: Sequencer %" PRIu16 " completed a sequence with no matching start notification";
1435 #endif
1436 
1437  Fw::TextLogString _logString;
1438  _logString.format(
1439  _formatString,
1440 #if FW_OBJECT_NAMES == 1
1441  this->m_objName.toChar(),
1442 #endif
1443  "UnknownSequenceFinished ",
1444  idx
1445  );
1446 
1447  this->m_logTextOut_OutputPort[0].invoke(
1448  _id,
1449  _logTime,
1451  _logString
1452  );
1453  }
1454 #endif
1455  }
1456 
1459  U16 idx,
1460  const Fw::StringBase& newSequence,
1461  const Fw::StringBase& sequenceInInternalState
1462  ) const
1463  {
1464  // Get the time
1465  Fw::Time _logTime;
1466  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1467  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1468  }
1469 
1470  FwEventIdType _id = static_cast<FwEventIdType>(0);
1471 
1473 
1474  // Emit the event on the log port
1475  if (this->m_logOut_OutputPort[0].isConnected()) {
1476  Fw::LogBuffer _logBuff;
1478 
1479 #if FW_AMPCS_COMPATIBLE
1480  // Serialize the number of arguments
1481  _status = _logBuff.serialize(static_cast<U8>(3));
1482  FW_ASSERT(
1483  _status == Fw::FW_SERIALIZE_OK,
1484  static_cast<FwAssertArgType>(_status)
1485  );
1486 #endif
1487 
1488 #if FW_AMPCS_COMPATIBLE
1489  // Serialize the argument size
1490  _status = _logBuff.serialize(
1491  static_cast<U8>(sizeof(U16))
1492  );
1493  FW_ASSERT(
1494  _status == Fw::FW_SERIALIZE_OK,
1495  static_cast<FwAssertArgType>(_status)
1496  );
1497 #endif
1498  _status = _logBuff.serialize(idx);
1499  FW_ASSERT(
1500  _status == Fw::FW_SERIALIZE_OK,
1501  static_cast<FwAssertArgType>(_status)
1502  );
1503 
1504  _status = newSequence.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1505  FW_ASSERT(
1506  _status == Fw::FW_SERIALIZE_OK,
1507  static_cast<FwAssertArgType>(_status)
1508  );
1509 
1510  _status = sequenceInInternalState.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1511  FW_ASSERT(
1512  _status == Fw::FW_SERIALIZE_OK,
1513  static_cast<FwAssertArgType>(_status)
1514  );
1515 
1516  this->m_logOut_OutputPort[0].invoke(
1517  _id,
1518  _logTime,
1520  _logBuff
1521  );
1522  }
1523 
1524  // Emit the event on the text log port
1525 #if FW_ENABLE_TEXT_LOGGING
1526  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1527 #if FW_OBJECT_NAMES == 1
1528  const char* _formatString =
1529  "(%s) %s: Sequencer %" PRIu16 " started a sequence %s while still running %s";
1530 #else
1531  const char* _formatString =
1532  "%s: Sequencer %" PRIu16 " started a sequence %s while still running %s";
1533 #endif
1534 
1535  Fw::TextLogString _logString;
1536  _logString.format(
1537  _formatString,
1538 #if FW_OBJECT_NAMES == 1
1539  this->m_objName.toChar(),
1540 #endif
1541  "ConflictingSequenceStarted ",
1542  idx,
1543  newSequence.toChar(),
1544  sequenceInInternalState.toChar()
1545  );
1546 
1547  this->m_logTextOut_OutputPort[0].invoke(
1548  _id,
1549  _logTime,
1551  _logString
1552  );
1553  }
1554 #endif
1555  }
1556 
1559  U16 idx,
1560  const Fw::StringBase& newSequence
1561  ) const
1562  {
1563  // Get the time
1564  Fw::Time _logTime;
1565  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1566  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1567  }
1568 
1569  FwEventIdType _id = static_cast<FwEventIdType>(0);
1570 
1572 
1573  // Emit the event on the log port
1574  if (this->m_logOut_OutputPort[0].isConnected()) {
1575  Fw::LogBuffer _logBuff;
1577 
1578 #if FW_AMPCS_COMPATIBLE
1579  // Serialize the number of arguments
1580  _status = _logBuff.serialize(static_cast<U8>(2));
1581  FW_ASSERT(
1582  _status == Fw::FW_SERIALIZE_OK,
1583  static_cast<FwAssertArgType>(_status)
1584  );
1585 #endif
1586 
1587 #if FW_AMPCS_COMPATIBLE
1588  // Serialize the argument size
1589  _status = _logBuff.serialize(
1590  static_cast<U8>(sizeof(U16))
1591  );
1592  FW_ASSERT(
1593  _status == Fw::FW_SERIALIZE_OK,
1594  static_cast<FwAssertArgType>(_status)
1595  );
1596 #endif
1597  _status = _logBuff.serialize(idx);
1598  FW_ASSERT(
1599  _status == Fw::FW_SERIALIZE_OK,
1600  static_cast<FwAssertArgType>(_status)
1601  );
1602 
1603  _status = newSequence.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1604  FW_ASSERT(
1605  _status == Fw::FW_SERIALIZE_OK,
1606  static_cast<FwAssertArgType>(_status)
1607  );
1608 
1609  this->m_logOut_OutputPort[0].invoke(
1610  _id,
1611  _logTime,
1613  _logBuff
1614  );
1615  }
1616 
1617  // Emit the event on the text log port
1618 #if FW_ENABLE_TEXT_LOGGING
1619  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1620 #if FW_OBJECT_NAMES == 1
1621  const char* _formatString =
1622  "(%s) %s: Sequencer %" PRIu16 " was externally commanded to start a sequence %s";
1623 #else
1624  const char* _formatString =
1625  "%s: Sequencer %" PRIu16 " was externally commanded to start a sequence %s";
1626 #endif
1627 
1628  Fw::TextLogString _logString;
1629  _logString.format(
1630  _formatString,
1631 #if FW_OBJECT_NAMES == 1
1632  this->m_objName.toChar(),
1633 #endif
1634  "UnexpectedSequenceStarted ",
1635  idx,
1636  newSequence.toChar()
1637  );
1638 
1639  this->m_logTextOut_OutputPort[0].invoke(
1640  _id,
1641  _logTime,
1643  _logString
1644  );
1645  }
1646 #endif
1647  }
1648 
1651  U16 idx,
1653  const Fw::StringBase& filename
1654  ) const
1655  {
1656  // Get the time
1657  Fw::Time _logTime;
1658  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1659  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1660  }
1661 
1662  FwEventIdType _id = static_cast<FwEventIdType>(0);
1663 
1664  _id = this->getIdBase() + EVENTID_LOGSEQUENCERSTATUS;
1665 
1666  // Emit the event on the log port
1667  if (this->m_logOut_OutputPort[0].isConnected()) {
1668  Fw::LogBuffer _logBuff;
1670 
1671 #if FW_AMPCS_COMPATIBLE
1672  // Serialize the number of arguments
1673  _status = _logBuff.serialize(static_cast<U8>(3));
1674  FW_ASSERT(
1675  _status == Fw::FW_SERIALIZE_OK,
1676  static_cast<FwAssertArgType>(_status)
1677  );
1678 #endif
1679 
1680 #if FW_AMPCS_COMPATIBLE
1681  // Serialize the argument size
1682  _status = _logBuff.serialize(
1683  static_cast<U8>(sizeof(U16))
1684  );
1685  FW_ASSERT(
1686  _status == Fw::FW_SERIALIZE_OK,
1687  static_cast<FwAssertArgType>(_status)
1688  );
1689 #endif
1690  _status = _logBuff.serialize(idx);
1691  FW_ASSERT(
1692  _status == Fw::FW_SERIALIZE_OK,
1693  static_cast<FwAssertArgType>(_status)
1694  );
1695 
1696 #if FW_AMPCS_COMPATIBLE
1697  // Serialize the argument size
1698  _status = _logBuff.serialize(
1700  );
1701  FW_ASSERT(
1702  _status == Fw::FW_SERIALIZE_OK,
1703  static_cast<FwAssertArgType>(_status)
1704  );
1705 #endif
1706  _status = _logBuff.serialize(state);
1707  FW_ASSERT(
1708  _status == Fw::FW_SERIALIZE_OK,
1709  static_cast<FwAssertArgType>(_status)
1710  );
1711 
1712  _status = filename.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1713  FW_ASSERT(
1714  _status == Fw::FW_SERIALIZE_OK,
1715  static_cast<FwAssertArgType>(_status)
1716  );
1717 
1718  this->m_logOut_OutputPort[0].invoke(
1719  _id,
1720  _logTime,
1722  _logBuff
1723  );
1724  }
1725 
1726  // Emit the event on the text log port
1727 #if FW_ENABLE_TEXT_LOGGING
1728  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1729 #if FW_OBJECT_NAMES == 1
1730  const char* _formatString =
1731  "(%s) %s: Sequencer %" PRIu16 " with state %s is running file %s";
1732 #else
1733  const char* _formatString =
1734  "%s: Sequencer %" PRIu16 " with state %s is running file %s";
1735 #endif
1736 
1737  Fw::String stateStr;
1738  state.toString(stateStr);
1739 
1740  Fw::TextLogString _logString;
1741  _logString.format(
1742  _formatString,
1743 #if FW_OBJECT_NAMES == 1
1744  this->m_objName.toChar(),
1745 #endif
1746  "LogSequencerStatus ",
1747  idx,
1748  stateStr.toChar(),
1749  filename.toChar()
1750  );
1751 
1752  this->m_logTextOut_OutputPort[0].invoke(
1753  _id,
1754  _logTime,
1756  _logString
1757  );
1758  }
1759 #endif
1760  }
1761 
1762  // ----------------------------------------------------------------------
1763  // Telemetry write functions
1764  // ----------------------------------------------------------------------
1765 
1768  U32 arg,
1769  Fw::Time _tlmTime
1770  ) const
1771  {
1772  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1773  if (
1774  this->m_timeCaller_OutputPort[0].isConnected() &&
1775  (_tlmTime == Fw::ZERO_TIME)
1776  ) {
1777  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1778  }
1779 
1780  Fw::TlmBuffer _tlmBuff;
1781  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1782  FW_ASSERT(
1783  _stat == Fw::FW_SERIALIZE_OK,
1784  static_cast<FwAssertArgType>(_stat)
1785  );
1786 
1787  FwChanIdType _id;
1788 
1789  _id = this->getIdBase() + CHANNELID_DISPATCHEDCOUNT;
1790 
1791  this->m_tlmOut_OutputPort[0].invoke(
1792  _id,
1793  _tlmTime,
1794  _tlmBuff
1795  );
1796  }
1797  }
1798 
1801  U32 arg,
1802  Fw::Time _tlmTime
1803  ) const
1804  {
1805  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1806  if (
1807  this->m_timeCaller_OutputPort[0].isConnected() &&
1808  (_tlmTime == Fw::ZERO_TIME)
1809  ) {
1810  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1811  }
1812 
1813  Fw::TlmBuffer _tlmBuff;
1814  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1815  FW_ASSERT(
1816  _stat == Fw::FW_SERIALIZE_OK,
1817  static_cast<FwAssertArgType>(_stat)
1818  );
1819 
1820  FwChanIdType _id;
1821 
1822  _id = this->getIdBase() + CHANNELID_ERRORCOUNT;
1823 
1824  this->m_tlmOut_OutputPort[0].invoke(
1825  _id,
1826  _tlmTime,
1827  _tlmBuff
1828  );
1829  }
1830  }
1831 
1834  U32 arg,
1835  Fw::Time _tlmTime
1836  ) const
1837  {
1838  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1839  if (
1840  this->m_timeCaller_OutputPort[0].isConnected() &&
1841  (_tlmTime == Fw::ZERO_TIME)
1842  ) {
1843  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1844  }
1845 
1846  Fw::TlmBuffer _tlmBuff;
1847  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1848  FW_ASSERT(
1849  _stat == Fw::FW_SERIALIZE_OK,
1850  static_cast<FwAssertArgType>(_stat)
1851  );
1852 
1853  FwChanIdType _id;
1854 
1855  _id = this->getIdBase() + CHANNELID_SEQUENCERSAVAILABLE;
1856 
1857  this->m_tlmOut_OutputPort[0].invoke(
1858  _id,
1859  _tlmTime,
1860  _tlmBuff
1861  );
1862  }
1863  }
1864 
1865  // ----------------------------------------------------------------------
1866  // Time
1867  // ----------------------------------------------------------------------
1868 
1871  {
1872  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1873  Fw::Time _time;
1874  this->m_timeCaller_OutputPort[0].invoke(_time);
1875  return _time;
1876  }
1877  else {
1878  return Fw::Time(TB_NONE, 0, 0);
1879  }
1880  }
1881 
1882  // ----------------------------------------------------------------------
1883  // Message dispatch functions
1884  // ----------------------------------------------------------------------
1885 
1886  Fw::QueuedComponentBase::MsgDispatchStatus SeqDispatcherComponentBase ::
1887  doDispatch()
1888  {
1889  ComponentIpcSerializableBuffer msg;
1890  FwQueuePriorityType priority = 0;
1891 
1892  Os::Queue::Status msgStatus = this->m_queue.receive(
1893  msg,
1895  priority
1896  );
1897  FW_ASSERT(
1898  msgStatus == Os::Queue::OP_OK,
1899  static_cast<FwAssertArgType>(msgStatus)
1900  );
1901 
1902  // Reset to beginning of buffer
1903  msg.resetDeser();
1904 
1905  FwEnumStoreType desMsg = 0;
1906  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
1907  FW_ASSERT(
1908  deserStatus == Fw::FW_SERIALIZE_OK,
1909  static_cast<FwAssertArgType>(deserStatus)
1910  );
1911 
1912  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
1913 
1914  if (msgType == SEQDISPATCHER_COMPONENT_EXIT) {
1915  return MSG_DISPATCH_EXIT;
1916  }
1917 
1918  FwIndexType portNum = 0;
1919  deserStatus = msg.deserialize(portNum);
1920  FW_ASSERT(
1921  deserStatus == Fw::FW_SERIALIZE_OK,
1922  static_cast<FwAssertArgType>(deserStatus)
1923  );
1924 
1925  switch (msgType) {
1926  // Handle async input port seqDoneIn
1927  case SEQDONEIN_CMDRESPONSE: {
1928  // Deserialize argument opCode
1929  FwOpcodeType opCode;
1930  deserStatus = msg.deserialize(opCode);
1931  FW_ASSERT(
1932  deserStatus == Fw::FW_SERIALIZE_OK,
1933  static_cast<FwAssertArgType>(deserStatus)
1934  );
1935 
1936  // Deserialize argument cmdSeq
1937  U32 cmdSeq;
1938  deserStatus = msg.deserialize(cmdSeq);
1939  FW_ASSERT(
1940  deserStatus == Fw::FW_SERIALIZE_OK,
1941  static_cast<FwAssertArgType>(deserStatus)
1942  );
1943 
1944  // Deserialize argument response
1945  Fw::CmdResponse response;
1946  deserStatus = msg.deserialize(response);
1947  FW_ASSERT(
1948  deserStatus == Fw::FW_SERIALIZE_OK,
1949  static_cast<FwAssertArgType>(deserStatus)
1950  );
1951  // Call handler function
1952  this->seqDoneIn_handler(
1953  portNum,
1954  opCode,
1955  cmdSeq,
1956  response
1957  );
1958 
1959  break;
1960  }
1961 
1962  // Handle async input port seqRunIn
1963  case SEQRUNIN_CMDSEQIN: {
1964  // Deserialize argument filename
1965  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
1966  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
1967  deserStatus = msg.deserialize(filename);
1968  FW_ASSERT(
1969  deserStatus == Fw::FW_SERIALIZE_OK,
1970  static_cast<FwAssertArgType>(deserStatus)
1971  );
1972  // Call handler function
1973  this->seqRunIn_handler(
1974  portNum,
1975  filename
1976  );
1977 
1978  break;
1979  }
1980 
1981  // Handle async input port seqStartIn
1982  case SEQSTARTIN_CMDSEQIN: {
1983  // Deserialize argument filename
1984  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
1985  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
1986  deserStatus = msg.deserialize(filename);
1987  FW_ASSERT(
1988  deserStatus == Fw::FW_SERIALIZE_OK,
1989  static_cast<FwAssertArgType>(deserStatus)
1990  );
1991  // Call handler function
1992  this->seqStartIn_handler(
1993  portNum,
1994  filename
1995  );
1996 
1997  break;
1998  }
1999 
2000  // Handle command RUN
2001  case CMD_RUN: {
2002  // Deserialize opcode
2003  FwOpcodeType opCode = 0;
2004  deserStatus = msg.deserialize(opCode);
2005  FW_ASSERT (
2006  deserStatus == Fw::FW_SERIALIZE_OK,
2007  static_cast<FwAssertArgType>(deserStatus)
2008  );
2009 
2010  // Deserialize command sequence
2011  U32 cmdSeq = 0;
2012  deserStatus = msg.deserialize(cmdSeq);
2013  FW_ASSERT (
2014  deserStatus == Fw::FW_SERIALIZE_OK,
2015  static_cast<FwAssertArgType>(deserStatus)
2016  );
2017 
2018  // Deserialize command argument buffer
2019  Fw::CmdArgBuffer args;
2020  deserStatus = msg.deserialize(args);
2021  FW_ASSERT (
2022  deserStatus == Fw::FW_SERIALIZE_OK,
2023  static_cast<FwAssertArgType>(deserStatus)
2024  );
2025 
2026  // Reset buffer
2027  args.resetDeser();
2028 
2029  // Deserialize argument fileName
2030  Fw::CmdStringArg fileName;
2031  deserStatus = args.deserialize(fileName);
2032  if (deserStatus != Fw::FW_SERIALIZE_OK) {
2033  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2034  this->cmdResponse_out(
2035  opCode,
2036  cmdSeq,
2038  );
2039  }
2040  // Don't crash the task if bad arguments were passed from the ground
2041  break;
2042  }
2043 
2044  // Deserialize argument block
2045  Fw::Wait block;
2046  deserStatus = args.deserialize(block);
2047  if (deserStatus != Fw::FW_SERIALIZE_OK) {
2048  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2049  this->cmdResponse_out(
2050  opCode,
2051  cmdSeq,
2053  );
2054  }
2055  // Don't crash the task if bad arguments were passed from the ground
2056  break;
2057  }
2058 
2059  // Make sure there was no data left over.
2060  // That means the argument buffer size was incorrect.
2061 #if FW_CMD_CHECK_RESIDUAL
2062  if (args.getBuffLeft() != 0) {
2063  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2064  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2065  }
2066  // Don't crash the task if bad arguments were passed from the ground
2067  break;
2068  }
2069 #endif
2070 
2071  // Call handler function
2072  this->RUN_cmdHandler(
2073  opCode, cmdSeq,
2074  fileName,
2075  block
2076  );
2077 
2078  break;
2079  }
2080 
2081  // Handle command LOG_STATUS
2082  case CMD_LOG_STATUS: {
2083  // Deserialize opcode
2084  FwOpcodeType opCode = 0;
2085  deserStatus = msg.deserialize(opCode);
2086  FW_ASSERT (
2087  deserStatus == Fw::FW_SERIALIZE_OK,
2088  static_cast<FwAssertArgType>(deserStatus)
2089  );
2090 
2091  // Deserialize command sequence
2092  U32 cmdSeq = 0;
2093  deserStatus = msg.deserialize(cmdSeq);
2094  FW_ASSERT (
2095  deserStatus == Fw::FW_SERIALIZE_OK,
2096  static_cast<FwAssertArgType>(deserStatus)
2097  );
2098 
2099  // Deserialize command argument buffer
2100  Fw::CmdArgBuffer args;
2101  deserStatus = msg.deserialize(args);
2102  FW_ASSERT (
2103  deserStatus == Fw::FW_SERIALIZE_OK,
2104  static_cast<FwAssertArgType>(deserStatus)
2105  );
2106 
2107  // Reset buffer
2108  args.resetDeser();
2109 
2110  // Make sure there was no data left over.
2111  // That means the argument buffer size was incorrect.
2112 #if FW_CMD_CHECK_RESIDUAL
2113  if (args.getBuffLeft() != 0) {
2114  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2115  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2116  }
2117  // Don't crash the task if bad arguments were passed from the ground
2118  break;
2119  }
2120 #endif
2121 
2122  // Call handler function
2123  this->LOG_STATUS_cmdHandler(opCode, cmdSeq);
2124 
2125  break;
2126  }
2127 
2128  default:
2129  return MSG_DISPATCH_ERROR;
2130  }
2131 
2132  return MSG_DISPATCH_OK;
2133  }
2134 
2135  // ----------------------------------------------------------------------
2136  // Calls for messages received on special input ports
2137  // ----------------------------------------------------------------------
2138 
2139  void SeqDispatcherComponentBase ::
2140  m_p_cmdIn_in(
2141  Fw::PassiveComponentBase* callComp,
2142  FwIndexType portNum,
2143  FwOpcodeType opCode,
2144  U32 cmdSeq,
2145  Fw::CmdArgBuffer& args
2146  )
2147  {
2148  FW_ASSERT(callComp);
2149  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2150 
2151  const U32 idBase = callComp->getIdBase();
2152  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
2153 
2154  // Select base class function based on opcode
2155  switch (opCode - idBase) {
2156  case OPCODE_RUN: {
2157  compPtr->RUN_cmdHandlerBase(
2158  opCode,
2159  cmdSeq,
2160  args
2161  );
2162  break;
2163  }
2164 
2165  case OPCODE_LOG_STATUS: {
2166  compPtr->LOG_STATUS_cmdHandlerBase(
2167  opCode,
2168  cmdSeq,
2169  args
2170  );
2171  break;
2172  }
2173  }
2174  }
2175 
2176  // ----------------------------------------------------------------------
2177  // Calls for messages received on typed input ports
2178  // ----------------------------------------------------------------------
2179 
2180  void SeqDispatcherComponentBase ::
2181  m_p_seqDoneIn_in(
2182  Fw::PassiveComponentBase* callComp,
2183  FwIndexType portNum,
2184  FwOpcodeType opCode,
2185  U32 cmdSeq,
2186  const Fw::CmdResponse& response
2187  )
2188  {
2189  FW_ASSERT(callComp);
2190  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2191  compPtr->seqDoneIn_handlerBase(
2192  portNum,
2193  opCode,
2194  cmdSeq,
2195  response
2196  );
2197  }
2198 
2199  void SeqDispatcherComponentBase ::
2200  m_p_seqRunIn_in(
2201  Fw::PassiveComponentBase* callComp,
2202  FwIndexType portNum,
2203  const Fw::StringBase& filename
2204  )
2205  {
2206  FW_ASSERT(callComp);
2207  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2208  compPtr->seqRunIn_handlerBase(
2209  portNum,
2210  filename
2211  );
2212  }
2213 
2214  void SeqDispatcherComponentBase ::
2215  m_p_seqStartIn_in(
2216  Fw::PassiveComponentBase* callComp,
2217  FwIndexType portNum,
2218  const Fw::StringBase& filename
2219  )
2220  {
2221  FW_ASSERT(callComp);
2222  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2223  compPtr->seqStartIn_handlerBase(
2224  portNum,
2225  filename
2226  );
2227  }
2228 
2229 }
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.
NATIVE_UINT_TYPE SizeType
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].
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
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:37
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:45
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
void setPortNum(NATIVE_INT_TYPE portNum)
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:72
A less serious but recoverable event.
void set_seqRunOut_OutputPort(FwIndexType portNum, Svc::InputCmdSeqInPort *port)
Connect port to seqRunOut[portNum].
Dispatches a sequence to the first available sequencer.
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
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
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
The size of the serial representations of the port arguments.
A string backed by an external buffer.
A serious but recoverable event.
The size of the serial representations of the port arguments.
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)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
BlockingType
message type
Definition: Queue.hpp:44
#define PRI_PlatformIntType
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.
message to exit active component task
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:70
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:31
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].
Logs via Events the state of each connected command sequencer.
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:142
Message will return with status when space is unavailable.
Definition: Queue.hpp:46
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
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