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 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #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 getCapacity() 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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  // Connection status queries for special output ports
643  // ----------------------------------------------------------------------
644 
647  {
648  FW_ASSERT(
649  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
650  static_cast<FwAssertArgType>(portNum)
651  );
652 
653  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
654  }
655 
658  {
659  FW_ASSERT(
660  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
661  static_cast<FwAssertArgType>(portNum)
662  );
663 
664  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
665  }
666 
669  {
670  FW_ASSERT(
671  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
672  static_cast<FwAssertArgType>(portNum)
673  );
674 
675  return this->m_logOut_OutputPort[portNum].isConnected();
676  }
677 
678 #if FW_ENABLE_TEXT_LOGGING == 1
679 
680  bool SeqDispatcherComponentBase ::
681  isConnected_logTextOut_OutputPort(FwIndexType portNum)
682  {
683  FW_ASSERT(
684  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
685  static_cast<FwAssertArgType>(portNum)
686  );
687 
688  return this->m_logTextOut_OutputPort[portNum].isConnected();
689  }
690 
691 #endif
692 
695  {
696  FW_ASSERT(
697  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
698  static_cast<FwAssertArgType>(portNum)
699  );
700 
701  return this->m_timeCaller_OutputPort[portNum].isConnected();
702  }
703 
706  {
707  FW_ASSERT(
708  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
709  static_cast<FwAssertArgType>(portNum)
710  );
711 
712  return this->m_tlmOut_OutputPort[portNum].isConnected();
713  }
714 
715  // ----------------------------------------------------------------------
716  // Connection status queries for typed output ports
717  // ----------------------------------------------------------------------
718 
721  {
722  FW_ASSERT(
723  (0 <= portNum) && (portNum < this->getNum_seqRunOut_OutputPorts()),
724  static_cast<FwAssertArgType>(portNum)
725  );
726 
727  return this->m_seqRunOut_OutputPort[portNum].isConnected();
728  }
729 
730  // ----------------------------------------------------------------------
731  // Port handler base-class functions for typed input ports
732  //
733  // Call these functions directly to bypass the corresponding ports
734  // ----------------------------------------------------------------------
735 
738  FwIndexType portNum,
739  FwOpcodeType opCode,
740  U32 cmdSeq,
741  const Fw::CmdResponse& response
742  )
743  {
744  // Make sure port number is valid
745  FW_ASSERT(
746  (0 <= portNum) && (portNum < this->getNum_seqDoneIn_InputPorts()),
747  static_cast<FwAssertArgType>(portNum)
748  );
749 
750  // Call pre-message hook
752  portNum,
753  opCode,
754  cmdSeq,
755  response
756  );
757  ComponentIpcSerializableBuffer msg;
759 
760  // Serialize message ID
761  _status = msg.serializeFrom(
762  static_cast<FwEnumStoreType>(SEQDONEIN_CMDRESPONSE)
763  );
764  FW_ASSERT(
765  _status == Fw::FW_SERIALIZE_OK,
766  static_cast<FwAssertArgType>(_status)
767  );
768 
769  // Serialize port number
770  _status = msg.serializeFrom(portNum);
771  FW_ASSERT(
772  _status == Fw::FW_SERIALIZE_OK,
773  static_cast<FwAssertArgType>(_status)
774  );
775 
776  // Serialize argument opCode
777  _status = msg.serializeFrom(opCode);
778  FW_ASSERT(
779  _status == Fw::FW_SERIALIZE_OK,
780  static_cast<FwAssertArgType>(_status)
781  );
782 
783  // Serialize argument cmdSeq
784  _status = msg.serializeFrom(cmdSeq);
785  FW_ASSERT(
786  _status == Fw::FW_SERIALIZE_OK,
787  static_cast<FwAssertArgType>(_status)
788  );
789 
790  // Serialize argument response
791  _status = msg.serializeFrom(response);
792  FW_ASSERT(
793  _status == Fw::FW_SERIALIZE_OK,
794  static_cast<FwAssertArgType>(_status)
795  );
796 
797  // Send message
799  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
800 
801  FW_ASSERT(
802  qStatus == Os::Queue::OP_OK,
803  static_cast<FwAssertArgType>(qStatus)
804  );
805  }
806 
809  FwIndexType portNum,
810  const Fw::StringBase& filename
811  )
812  {
813  // Make sure port number is valid
814  FW_ASSERT(
815  (0 <= portNum) && (portNum < this->getNum_seqRunIn_InputPorts()),
816  static_cast<FwAssertArgType>(portNum)
817  );
818 
819  // Call pre-message hook
821  portNum,
822  filename
823  );
824  ComponentIpcSerializableBuffer msg;
826 
827  // Serialize message ID
828  _status = msg.serializeFrom(
829  static_cast<FwEnumStoreType>(SEQRUNIN_CMDSEQIN)
830  );
831  FW_ASSERT(
832  _status == Fw::FW_SERIALIZE_OK,
833  static_cast<FwAssertArgType>(_status)
834  );
835 
836  // Serialize port number
837  _status = msg.serializeFrom(portNum);
838  FW_ASSERT(
839  _status == Fw::FW_SERIALIZE_OK,
840  static_cast<FwAssertArgType>(_status)
841  );
842 
843  // Serialize argument filename
844  _status = filename.serializeTo(msg, 240);
845  FW_ASSERT(
846  _status == Fw::FW_SERIALIZE_OK,
847  static_cast<FwAssertArgType>(_status)
848  );
849 
850  // Send message
852  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
853 
854  FW_ASSERT(
855  qStatus == Os::Queue::OP_OK,
856  static_cast<FwAssertArgType>(qStatus)
857  );
858  }
859 
862  FwIndexType portNum,
863  const Fw::StringBase& filename
864  )
865  {
866  // Make sure port number is valid
867  FW_ASSERT(
868  (0 <= portNum) && (portNum < this->getNum_seqStartIn_InputPorts()),
869  static_cast<FwAssertArgType>(portNum)
870  );
871 
872  // Call pre-message hook
874  portNum,
875  filename
876  );
877  ComponentIpcSerializableBuffer msg;
879 
880  // Serialize message ID
881  _status = msg.serializeFrom(
882  static_cast<FwEnumStoreType>(SEQSTARTIN_CMDSEQIN)
883  );
884  FW_ASSERT(
885  _status == Fw::FW_SERIALIZE_OK,
886  static_cast<FwAssertArgType>(_status)
887  );
888 
889  // Serialize port number
890  _status = msg.serializeFrom(portNum);
891  FW_ASSERT(
892  _status == Fw::FW_SERIALIZE_OK,
893  static_cast<FwAssertArgType>(_status)
894  );
895 
896  // Serialize argument filename
897  _status = filename.serializeTo(msg, 240);
898  FW_ASSERT(
899  _status == Fw::FW_SERIALIZE_OK,
900  static_cast<FwAssertArgType>(_status)
901  );
902 
903  // Send message
905  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
906 
907  FW_ASSERT(
908  qStatus == Os::Queue::OP_OK,
909  static_cast<FwAssertArgType>(qStatus)
910  );
911  }
912 
913  // ----------------------------------------------------------------------
914  // Pre-message hooks for typed async input ports
915  //
916  // Each of these functions is invoked just before processing a message
917  // on the corresponding port. By default, they do nothing. You can
918  // override them to provide specific pre-message behavior.
919  // ----------------------------------------------------------------------
920 
923  FwIndexType portNum,
924  FwOpcodeType opCode,
925  U32 cmdSeq,
926  const Fw::CmdResponse& response
927  )
928  {
929  // Default: no-op
930  }
931 
934  FwIndexType portNum,
935  const Fw::StringBase& filename
936  )
937  {
938  // Default: no-op
939  }
940 
943  FwIndexType portNum,
944  const Fw::StringBase& filename
945  )
946  {
947  // Default: no-op
948  }
949 
950  // ----------------------------------------------------------------------
951  // Invocation functions for typed output ports
952  // ----------------------------------------------------------------------
953 
956  FwIndexType portNum,
957  const Fw::StringBase& filename
958  )
959  {
960  FW_ASSERT(
961  (0 <= portNum) && (portNum < this->getNum_seqRunOut_OutputPorts()),
962  static_cast<FwAssertArgType>(portNum)
963  );
964 
965  FW_ASSERT(
966  this->m_seqRunOut_OutputPort[portNum].isConnected(),
967  static_cast<FwAssertArgType>(portNum)
968  );
969  this->m_seqRunOut_OutputPort[portNum].invoke(
970  filename
971  );
972  }
973 
974  // ----------------------------------------------------------------------
975  // Command response
976  // ----------------------------------------------------------------------
977 
980  FwOpcodeType opCode,
981  U32 cmdSeq,
982  Fw::CmdResponse response
983  )
984  {
985  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
986  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
987  }
988 
989  // ----------------------------------------------------------------------
990  // Command handler base-class functions
991  //
992  // Call these functions directly to bypass the command input port
993  // ----------------------------------------------------------------------
994 
997  FwOpcodeType opCode,
998  U32 cmdSeq,
999  Fw::CmdArgBuffer& args
1000  )
1001  {
1002  // Call pre-message hook
1003  this->RUN_preMsgHook(opCode,cmdSeq);
1004 
1005  // Defer deserializing arguments to the message dispatcher
1006  // to avoid deserializing and reserializing just for IPC
1007  ComponentIpcSerializableBuffer msg;
1009 
1010  // Serialize for IPC
1011  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_RUN));
1012  FW_ASSERT (
1013  _status == Fw::FW_SERIALIZE_OK,
1014  static_cast<FwAssertArgType>(_status)
1015  );
1016 
1017  // Fake port number to make message dequeue work
1018  FwIndexType port = 0;
1019 
1020  _status = msg.serializeFrom(port);
1021  FW_ASSERT (
1022  _status == Fw::FW_SERIALIZE_OK,
1023  static_cast<FwAssertArgType>(_status)
1024  );
1025 
1026  _status = msg.serializeFrom(opCode);
1027  FW_ASSERT (
1028  _status == Fw::FW_SERIALIZE_OK,
1029  static_cast<FwAssertArgType>(_status)
1030  );
1031 
1032  _status = msg.serializeFrom(cmdSeq);
1033  FW_ASSERT (
1034  _status == Fw::FW_SERIALIZE_OK,
1035  static_cast<FwAssertArgType>(_status)
1036  );
1037 
1038  _status = msg.serializeFrom(args);
1039  FW_ASSERT (
1040  _status == Fw::FW_SERIALIZE_OK,
1041  static_cast<FwAssertArgType>(_status)
1042  );
1043 
1044  // Send message
1046  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1047 
1048  FW_ASSERT(
1049  qStatus == Os::Queue::OP_OK,
1050  static_cast<FwAssertArgType>(qStatus)
1051  );
1052  }
1053 
1056  FwOpcodeType opCode,
1057  U32 cmdSeq,
1058  Fw::CmdArgBuffer& args
1059  )
1060  {
1061  // Call pre-message hook
1062  this->LOG_STATUS_preMsgHook(opCode,cmdSeq);
1063 
1064  // Defer deserializing arguments to the message dispatcher
1065  // to avoid deserializing and reserializing just for IPC
1066  ComponentIpcSerializableBuffer msg;
1068 
1069  // Serialize for IPC
1070  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_LOG_STATUS));
1071  FW_ASSERT (
1072  _status == Fw::FW_SERIALIZE_OK,
1073  static_cast<FwAssertArgType>(_status)
1074  );
1075 
1076  // Fake port number to make message dequeue work
1077  FwIndexType port = 0;
1078 
1079  _status = msg.serializeFrom(port);
1080  FW_ASSERT (
1081  _status == Fw::FW_SERIALIZE_OK,
1082  static_cast<FwAssertArgType>(_status)
1083  );
1084 
1085  _status = msg.serializeFrom(opCode);
1086  FW_ASSERT (
1087  _status == Fw::FW_SERIALIZE_OK,
1088  static_cast<FwAssertArgType>(_status)
1089  );
1090 
1091  _status = msg.serializeFrom(cmdSeq);
1092  FW_ASSERT (
1093  _status == Fw::FW_SERIALIZE_OK,
1094  static_cast<FwAssertArgType>(_status)
1095  );
1096 
1097  _status = msg.serializeFrom(args);
1098  FW_ASSERT (
1099  _status == Fw::FW_SERIALIZE_OK,
1100  static_cast<FwAssertArgType>(_status)
1101  );
1102 
1103  // Send message
1105  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1106 
1107  FW_ASSERT(
1108  qStatus == Os::Queue::OP_OK,
1109  static_cast<FwAssertArgType>(qStatus)
1110  );
1111  }
1112 
1113  // ----------------------------------------------------------------------
1114  // Pre-message hooks for async commands
1115  //
1116  // Each of these functions is invoked just before processing the
1117  // corresponding command. By default they do nothing. You can
1118  // override them to provide specific pre-command behavior.
1119  // ----------------------------------------------------------------------
1120 
1123  FwOpcodeType opCode,
1124  U32 cmdSeq
1125  )
1126  {
1127  // Defaults to no-op; can be overridden
1128  (void) opCode;
1129  (void) cmdSeq;
1130  }
1131 
1134  FwOpcodeType opCode,
1135  U32 cmdSeq
1136  )
1137  {
1138  // Defaults to no-op; can be overridden
1139  (void) opCode;
1140  (void) cmdSeq;
1141  }
1142 
1143  // ----------------------------------------------------------------------
1144  // Event logging functions
1145  // ----------------------------------------------------------------------
1146 
1149  {
1150  // Get the time
1151  Fw::Time _logTime;
1152  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1153  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1154  }
1155 
1156  FwEventIdType _id = static_cast<FwEventIdType>(0);
1157 
1158  _id = this->getIdBase() + EVENTID_INVALIDSEQUENCER;
1159 
1160  // Emit the event on the log port
1161  if (this->m_logOut_OutputPort[0].isConnected()) {
1162  Fw::LogBuffer _logBuff;
1164 
1165 #if FW_AMPCS_COMPATIBLE
1166  // Serialize the number of arguments
1167  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1168  FW_ASSERT(
1169  _status == Fw::FW_SERIALIZE_OK,
1170  static_cast<FwAssertArgType>(_status)
1171  );
1172 #endif
1173 
1174 #if FW_AMPCS_COMPATIBLE
1175  // Serialize the argument size
1176  _status = _logBuff.serializeFrom(
1177  static_cast<U8>(sizeof(U16))
1178  );
1179  FW_ASSERT(
1180  _status == Fw::FW_SERIALIZE_OK,
1181  static_cast<FwAssertArgType>(_status)
1182  );
1183 #endif
1184  _status = _logBuff.serializeFrom(idx);
1185  FW_ASSERT(
1186  _status == Fw::FW_SERIALIZE_OK,
1187  static_cast<FwAssertArgType>(_status)
1188  );
1189 
1190  this->m_logOut_OutputPort[0].invoke(
1191  _id,
1192  _logTime,
1194  _logBuff
1195  );
1196  }
1197 
1198  // Emit the event on the text log port
1199 #if FW_ENABLE_TEXT_LOGGING
1200  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1201 #if FW_OBJECT_NAMES == 1
1202  const char* _formatString =
1203  "(%s) %s: Invalid sequence index %" PRIu16 "";
1204 #else
1205  const char* _formatString =
1206  "%s: Invalid sequence index %" PRIu16 "";
1207 #endif
1208 
1209  Fw::TextLogString _logString;
1210  _logString.format(
1211  _formatString,
1212 #if FW_OBJECT_NAMES == 1
1213  this->m_objName.toChar(),
1214 #endif
1215  "InvalidSequencer ",
1216  idx
1217  );
1218 
1219  this->m_logTextOut_OutputPort[0].invoke(
1220  _id,
1221  _logTime,
1223  _logString
1224  );
1225  }
1226 #endif
1227  }
1228 
1231  {
1232  // Get the time
1233  Fw::Time _logTime;
1234  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1235  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1236  }
1237 
1238  FwEventIdType _id = static_cast<FwEventIdType>(0);
1239 
1240  _id = this->getIdBase() + EVENTID_NOAVAILABLESEQUENCERS;
1241 
1242  // Emit the event on the log port
1243  if (this->m_logOut_OutputPort[0].isConnected()) {
1244  Fw::LogBuffer _logBuff;
1245 
1246 #if FW_AMPCS_COMPATIBLE
1248  // Serialize the number of arguments
1249  _status = _logBuff.serializeFrom(static_cast<U8>(0));
1250  FW_ASSERT(
1251  _status == Fw::FW_SERIALIZE_OK,
1252  static_cast<FwAssertArgType>(_status)
1253  );
1254 #endif
1255 
1256  this->m_logOut_OutputPort[0].invoke(
1257  _id,
1258  _logTime,
1260  _logBuff
1261  );
1262  }
1263 
1264  // Emit the event on the text log port
1265 #if FW_ENABLE_TEXT_LOGGING
1266  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1267 #if FW_OBJECT_NAMES == 1
1268  const char* _formatString =
1269  "(%s) %s: No available cmd sequencers to dispatch a sequence to";
1270 #else
1271  const char* _formatString =
1272  "%s: No available cmd sequencers to dispatch a sequence to";
1273 #endif
1274 
1275  Fw::TextLogString _logString;
1276  _logString.format(
1277  _formatString,
1278 #if FW_OBJECT_NAMES == 1
1279  this->m_objName.toChar(),
1280 #endif
1281  "NoAvailableSequencers "
1282  );
1283 
1284  this->m_logTextOut_OutputPort[0].invoke(
1285  _id,
1286  _logTime,
1288  _logString
1289  );
1290  }
1291 #endif
1292  }
1293 
1296  {
1297  // Get the time
1298  Fw::Time _logTime;
1299  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1300  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1301  }
1302 
1303  FwEventIdType _id = static_cast<FwEventIdType>(0);
1304 
1306 
1307  // Emit the event on the log port
1308  if (this->m_logOut_OutputPort[0].isConnected()) {
1309  Fw::LogBuffer _logBuff;
1311 
1312 #if FW_AMPCS_COMPATIBLE
1313  // Serialize the number of arguments
1314  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1315  FW_ASSERT(
1316  _status == Fw::FW_SERIALIZE_OK,
1317  static_cast<FwAssertArgType>(_status)
1318  );
1319 #endif
1320 
1321 #if FW_AMPCS_COMPATIBLE
1322  // Serialize the argument size
1323  _status = _logBuff.serializeFrom(
1324  static_cast<U8>(sizeof(U16))
1325  );
1326  FW_ASSERT(
1327  _status == Fw::FW_SERIALIZE_OK,
1328  static_cast<FwAssertArgType>(_status)
1329  );
1330 #endif
1331  _status = _logBuff.serializeFrom(idx);
1332  FW_ASSERT(
1333  _status == Fw::FW_SERIALIZE_OK,
1334  static_cast<FwAssertArgType>(_status)
1335  );
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: Sequencer %" PRIu16 " completed a sequence with no matching start notification";
1351 #else
1352  const char* _formatString =
1353  "%s: Sequencer %" PRIu16 " completed a sequence with no matching start notification";
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  "UnknownSequenceFinished ",
1363  idx
1364  );
1365 
1366  this->m_logTextOut_OutputPort[0].invoke(
1367  _id,
1368  _logTime,
1370  _logString
1371  );
1372  }
1373 #endif
1374  }
1375 
1378  U16 idx,
1379  const Fw::StringBase& newSequence,
1380  const Fw::StringBase& sequenceInInternalState
1381  ) const
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.serializeFrom(static_cast<U8>(3));
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.serializeFrom(
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.serializeFrom(idx);
1418  FW_ASSERT(
1419  _status == Fw::FW_SERIALIZE_OK,
1420  static_cast<FwAssertArgType>(_status)
1421  );
1422 
1423  _status = newSequence.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1424  FW_ASSERT(
1425  _status == Fw::FW_SERIALIZE_OK,
1426  static_cast<FwAssertArgType>(_status)
1427  );
1428 
1429  _status = sequenceInInternalState.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1430  FW_ASSERT(
1431  _status == Fw::FW_SERIALIZE_OK,
1432  static_cast<FwAssertArgType>(_status)
1433  );
1434 
1435  this->m_logOut_OutputPort[0].invoke(
1436  _id,
1437  _logTime,
1439  _logBuff
1440  );
1441  }
1442 
1443  // Emit the event on the text log port
1444 #if FW_ENABLE_TEXT_LOGGING
1445  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1446 #if FW_OBJECT_NAMES == 1
1447  const char* _formatString =
1448  "(%s) %s: Sequencer %" PRIu16 " started a sequence %s while still running %s";
1449 #else
1450  const char* _formatString =
1451  "%s: Sequencer %" PRIu16 " started a sequence %s while still running %s";
1452 #endif
1453 
1454  Fw::TextLogString _logString;
1455  _logString.format(
1456  _formatString,
1457 #if FW_OBJECT_NAMES == 1
1458  this->m_objName.toChar(),
1459 #endif
1460  "ConflictingSequenceStarted ",
1461  idx,
1462  newSequence.toChar(),
1463  sequenceInInternalState.toChar()
1464  );
1465 
1466  this->m_logTextOut_OutputPort[0].invoke(
1467  _id,
1468  _logTime,
1470  _logString
1471  );
1472  }
1473 #endif
1474  }
1475 
1478  U16 idx,
1479  const Fw::StringBase& newSequence
1480  ) const
1481  {
1482  // Get the time
1483  Fw::Time _logTime;
1484  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1485  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1486  }
1487 
1488  FwEventIdType _id = static_cast<FwEventIdType>(0);
1489 
1491 
1492  // Emit the event on the log port
1493  if (this->m_logOut_OutputPort[0].isConnected()) {
1494  Fw::LogBuffer _logBuff;
1496 
1497 #if FW_AMPCS_COMPATIBLE
1498  // Serialize the number of arguments
1499  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1500  FW_ASSERT(
1501  _status == Fw::FW_SERIALIZE_OK,
1502  static_cast<FwAssertArgType>(_status)
1503  );
1504 #endif
1505 
1506 #if FW_AMPCS_COMPATIBLE
1507  // Serialize the argument size
1508  _status = _logBuff.serializeFrom(
1509  static_cast<U8>(sizeof(U16))
1510  );
1511  FW_ASSERT(
1512  _status == Fw::FW_SERIALIZE_OK,
1513  static_cast<FwAssertArgType>(_status)
1514  );
1515 #endif
1516  _status = _logBuff.serializeFrom(idx);
1517  FW_ASSERT(
1518  _status == Fw::FW_SERIALIZE_OK,
1519  static_cast<FwAssertArgType>(_status)
1520  );
1521 
1522  _status = newSequence.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1523  FW_ASSERT(
1524  _status == Fw::FW_SERIALIZE_OK,
1525  static_cast<FwAssertArgType>(_status)
1526  );
1527 
1528  this->m_logOut_OutputPort[0].invoke(
1529  _id,
1530  _logTime,
1532  _logBuff
1533  );
1534  }
1535 
1536  // Emit the event on the text log port
1537 #if FW_ENABLE_TEXT_LOGGING
1538  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1539 #if FW_OBJECT_NAMES == 1
1540  const char* _formatString =
1541  "(%s) %s: Sequencer %" PRIu16 " was externally commanded to start a sequence %s";
1542 #else
1543  const char* _formatString =
1544  "%s: Sequencer %" PRIu16 " was externally commanded to start a sequence %s";
1545 #endif
1546 
1547  Fw::TextLogString _logString;
1548  _logString.format(
1549  _formatString,
1550 #if FW_OBJECT_NAMES == 1
1551  this->m_objName.toChar(),
1552 #endif
1553  "UnexpectedSequenceStarted ",
1554  idx,
1555  newSequence.toChar()
1556  );
1557 
1558  this->m_logTextOut_OutputPort[0].invoke(
1559  _id,
1560  _logTime,
1562  _logString
1563  );
1564  }
1565 #endif
1566  }
1567 
1570  U16 idx,
1572  const Fw::StringBase& filename
1573  ) const
1574  {
1575  // Get the time
1576  Fw::Time _logTime;
1577  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1578  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1579  }
1580 
1581  FwEventIdType _id = static_cast<FwEventIdType>(0);
1582 
1583  _id = this->getIdBase() + EVENTID_LOGSEQUENCERSTATUS;
1584 
1585  // Emit the event on the log port
1586  if (this->m_logOut_OutputPort[0].isConnected()) {
1587  Fw::LogBuffer _logBuff;
1589 
1590 #if FW_AMPCS_COMPATIBLE
1591  // Serialize the number of arguments
1592  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1593  FW_ASSERT(
1594  _status == Fw::FW_SERIALIZE_OK,
1595  static_cast<FwAssertArgType>(_status)
1596  );
1597 #endif
1598 
1599 #if FW_AMPCS_COMPATIBLE
1600  // Serialize the argument size
1601  _status = _logBuff.serializeFrom(
1602  static_cast<U8>(sizeof(U16))
1603  );
1604  FW_ASSERT(
1605  _status == Fw::FW_SERIALIZE_OK,
1606  static_cast<FwAssertArgType>(_status)
1607  );
1608 #endif
1609  _status = _logBuff.serializeFrom(idx);
1610  FW_ASSERT(
1611  _status == Fw::FW_SERIALIZE_OK,
1612  static_cast<FwAssertArgType>(_status)
1613  );
1614 
1615 #if FW_AMPCS_COMPATIBLE
1616  // Serialize the argument size
1617  _status = _logBuff.serializeFrom(
1619  );
1620  FW_ASSERT(
1621  _status == Fw::FW_SERIALIZE_OK,
1622  static_cast<FwAssertArgType>(_status)
1623  );
1624 #endif
1625  _status = _logBuff.serializeFrom(state);
1626  FW_ASSERT(
1627  _status == Fw::FW_SERIALIZE_OK,
1628  static_cast<FwAssertArgType>(_status)
1629  );
1630 
1631  _status = filename.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 240));
1632  FW_ASSERT(
1633  _status == Fw::FW_SERIALIZE_OK,
1634  static_cast<FwAssertArgType>(_status)
1635  );
1636 
1637  this->m_logOut_OutputPort[0].invoke(
1638  _id,
1639  _logTime,
1641  _logBuff
1642  );
1643  }
1644 
1645  // Emit the event on the text log port
1646 #if FW_ENABLE_TEXT_LOGGING
1647  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1648 #if FW_OBJECT_NAMES == 1
1649  const char* _formatString =
1650  "(%s) %s: Sequencer %" PRIu16 " with state %s is running file %s";
1651 #else
1652  const char* _formatString =
1653  "%s: Sequencer %" PRIu16 " with state %s is running file %s";
1654 #endif
1655 
1656  Fw::String stateStr;
1657  state.toString(stateStr);
1658 
1659  Fw::TextLogString _logString;
1660  _logString.format(
1661  _formatString,
1662 #if FW_OBJECT_NAMES == 1
1663  this->m_objName.toChar(),
1664 #endif
1665  "LogSequencerStatus ",
1666  idx,
1667  stateStr.toChar(),
1668  filename.toChar()
1669  );
1670 
1671  this->m_logTextOut_OutputPort[0].invoke(
1672  _id,
1673  _logTime,
1675  _logString
1676  );
1677  }
1678 #endif
1679  }
1680 
1681  // ----------------------------------------------------------------------
1682  // Telemetry write functions
1683  // ----------------------------------------------------------------------
1684 
1687  U32 arg,
1688  Fw::Time _tlmTime
1689  ) const
1690  {
1691  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1692  if (
1693  this->m_timeCaller_OutputPort[0].isConnected() &&
1694  (_tlmTime == Fw::ZERO_TIME)
1695  ) {
1696  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1697  }
1698 
1699  Fw::TlmBuffer _tlmBuff;
1700  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1701  FW_ASSERT(
1702  _stat == Fw::FW_SERIALIZE_OK,
1703  static_cast<FwAssertArgType>(_stat)
1704  );
1705 
1706  FwChanIdType _id;
1707 
1708  _id = this->getIdBase() + CHANNELID_DISPATCHEDCOUNT;
1709 
1710  this->m_tlmOut_OutputPort[0].invoke(
1711  _id,
1712  _tlmTime,
1713  _tlmBuff
1714  );
1715  }
1716  }
1717 
1720  U32 arg,
1721  Fw::Time _tlmTime
1722  ) const
1723  {
1724  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1725  if (
1726  this->m_timeCaller_OutputPort[0].isConnected() &&
1727  (_tlmTime == Fw::ZERO_TIME)
1728  ) {
1729  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1730  }
1731 
1732  Fw::TlmBuffer _tlmBuff;
1733  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1734  FW_ASSERT(
1735  _stat == Fw::FW_SERIALIZE_OK,
1736  static_cast<FwAssertArgType>(_stat)
1737  );
1738 
1739  FwChanIdType _id;
1740 
1741  _id = this->getIdBase() + CHANNELID_ERRORCOUNT;
1742 
1743  this->m_tlmOut_OutputPort[0].invoke(
1744  _id,
1745  _tlmTime,
1746  _tlmBuff
1747  );
1748  }
1749  }
1750 
1753  U32 arg,
1754  Fw::Time _tlmTime
1755  ) const
1756  {
1757  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1758  if (
1759  this->m_timeCaller_OutputPort[0].isConnected() &&
1760  (_tlmTime == Fw::ZERO_TIME)
1761  ) {
1762  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1763  }
1764 
1765  Fw::TlmBuffer _tlmBuff;
1766  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1767  FW_ASSERT(
1768  _stat == Fw::FW_SERIALIZE_OK,
1769  static_cast<FwAssertArgType>(_stat)
1770  );
1771 
1772  FwChanIdType _id;
1773 
1774  _id = this->getIdBase() + CHANNELID_SEQUENCERSAVAILABLE;
1775 
1776  this->m_tlmOut_OutputPort[0].invoke(
1777  _id,
1778  _tlmTime,
1779  _tlmBuff
1780  );
1781  }
1782  }
1783 
1784  // ----------------------------------------------------------------------
1785  // Time
1786  // ----------------------------------------------------------------------
1787 
1789  getTime() const
1790  {
1791  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1792  Fw::Time _time;
1793  this->m_timeCaller_OutputPort[0].invoke(_time);
1794  return _time;
1795  }
1796  else {
1797  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1798  }
1799  }
1800 
1801  // ----------------------------------------------------------------------
1802  // Message dispatch functions
1803  // ----------------------------------------------------------------------
1804 
1805  Fw::QueuedComponentBase::MsgDispatchStatus SeqDispatcherComponentBase ::
1806  doDispatch()
1807  {
1808  ComponentIpcSerializableBuffer _msg;
1809  FwQueuePriorityType _priority = 0;
1810 
1811  Os::Queue::Status _msgStatus = this->m_queue.receive(
1812  _msg,
1814  _priority
1815  );
1816  FW_ASSERT(
1817  _msgStatus == Os::Queue::OP_OK,
1818  static_cast<FwAssertArgType>(_msgStatus)
1819  );
1820 
1821  // Reset to beginning of buffer
1822  _msg.resetDeser();
1823 
1824  FwEnumStoreType _desMsg = 0;
1825  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
1826  FW_ASSERT(
1827  _deserStatus == Fw::FW_SERIALIZE_OK,
1828  static_cast<FwAssertArgType>(_deserStatus)
1829  );
1830 
1831  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
1832 
1833  if (_msgType == SEQDISPATCHER_COMPONENT_EXIT) {
1834  return MSG_DISPATCH_EXIT;
1835  }
1836 
1837  FwIndexType portNum = 0;
1838  _deserStatus = _msg.deserializeTo(portNum);
1839  FW_ASSERT(
1840  _deserStatus == Fw::FW_SERIALIZE_OK,
1841  static_cast<FwAssertArgType>(_deserStatus)
1842  );
1843 
1844  switch (_msgType) {
1845  // Handle async input port seqDoneIn
1846  case SEQDONEIN_CMDRESPONSE: {
1847  // Deserialize argument opCode
1848  FwOpcodeType opCode;
1849  _deserStatus = _msg.deserializeTo(opCode);
1850  FW_ASSERT(
1851  _deserStatus == Fw::FW_SERIALIZE_OK,
1852  static_cast<FwAssertArgType>(_deserStatus)
1853  );
1854 
1855  // Deserialize argument cmdSeq
1856  U32 cmdSeq;
1857  _deserStatus = _msg.deserializeTo(cmdSeq);
1858  FW_ASSERT(
1859  _deserStatus == Fw::FW_SERIALIZE_OK,
1860  static_cast<FwAssertArgType>(_deserStatus)
1861  );
1862 
1863  // Deserialize argument response
1864  Fw::CmdResponse response;
1865  _deserStatus = _msg.deserializeTo(response);
1866  FW_ASSERT(
1867  _deserStatus == Fw::FW_SERIALIZE_OK,
1868  static_cast<FwAssertArgType>(_deserStatus)
1869  );
1870  // Call handler function
1871  this->seqDoneIn_handler(
1872  portNum,
1873  opCode,
1874  cmdSeq,
1875  response
1876  );
1877 
1878  break;
1879  }
1880 
1881  // Handle async input port seqRunIn
1882  case SEQRUNIN_CMDSEQIN: {
1883  // Deserialize argument filename
1884  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
1885  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
1886  _deserStatus = _msg.deserializeTo(filename);
1887  FW_ASSERT(
1888  _deserStatus == Fw::FW_SERIALIZE_OK,
1889  static_cast<FwAssertArgType>(_deserStatus)
1890  );
1891  // Call handler function
1892  this->seqRunIn_handler(
1893  portNum,
1894  filename
1895  );
1896 
1897  break;
1898  }
1899 
1900  // Handle async input port seqStartIn
1901  case SEQSTARTIN_CMDSEQIN: {
1902  // Deserialize argument filename
1903  char __fprime_ac_filename_buffer[Fw::StringBase::BUFFER_SIZE(240)];
1904  Fw::ExternalString filename(__fprime_ac_filename_buffer, sizeof __fprime_ac_filename_buffer);
1905  _deserStatus = _msg.deserializeTo(filename);
1906  FW_ASSERT(
1907  _deserStatus == Fw::FW_SERIALIZE_OK,
1908  static_cast<FwAssertArgType>(_deserStatus)
1909  );
1910  // Call handler function
1911  this->seqStartIn_handler(
1912  portNum,
1913  filename
1914  );
1915 
1916  break;
1917  }
1918 
1919  // Handle command RUN
1920  case CMD_RUN: {
1921  // Deserialize opcode
1922  FwOpcodeType _opCode = 0;
1923  _deserStatus = _msg.deserializeTo(_opCode);
1924  FW_ASSERT (
1925  _deserStatus == Fw::FW_SERIALIZE_OK,
1926  static_cast<FwAssertArgType>(_deserStatus)
1927  );
1928 
1929  // Deserialize command sequence
1930  U32 _cmdSeq = 0;
1931  _deserStatus = _msg.deserializeTo(_cmdSeq);
1932  FW_ASSERT (
1933  _deserStatus == Fw::FW_SERIALIZE_OK,
1934  static_cast<FwAssertArgType>(_deserStatus)
1935  );
1936 
1937  // Deserialize command argument buffer
1938  Fw::CmdArgBuffer args;
1939  _deserStatus = _msg.deserializeTo(args);
1940  FW_ASSERT (
1941  _deserStatus == Fw::FW_SERIALIZE_OK,
1942  static_cast<FwAssertArgType>(_deserStatus)
1943  );
1944 
1945  // Reset buffer
1946  args.resetDeser();
1947 
1948  // Deserialize argument fileName
1949  Fw::CmdStringArg fileName;
1950  _deserStatus = args.deserializeTo(fileName);
1951  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
1952  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1953  this->cmdResponse_out(
1954  _opCode,
1955  _cmdSeq,
1957  );
1958  }
1959  // Don't crash the task if bad arguments were passed from the ground
1960  break;
1961  }
1962 
1963  // Deserialize argument block
1964  Fw::Wait block;
1965  _deserStatus = args.deserializeTo(block);
1966  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
1967  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1968  this->cmdResponse_out(
1969  _opCode,
1970  _cmdSeq,
1972  );
1973  }
1974  // Don't crash the task if bad arguments were passed from the ground
1975  break;
1976  }
1977 
1978  // Make sure there was no data left over.
1979  // That means the argument buffer size was incorrect.
1980 #if FW_CMD_CHECK_RESIDUAL
1981  if (args.getDeserializeSizeLeft() != 0) {
1982  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1983  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
1984  }
1985  // Don't crash the task if bad arguments were passed from the ground
1986  break;
1987  }
1988 #endif
1989 
1990  // Call handler function
1991  this->RUN_cmdHandler(
1992  _opCode, _cmdSeq,
1993  fileName,
1994  block
1995  );
1996 
1997  break;
1998  }
1999 
2000  // Handle command LOG_STATUS
2001  case CMD_LOG_STATUS: {
2002  // Deserialize opcode
2003  FwOpcodeType _opCode = 0;
2004  _deserStatus = _msg.deserializeTo(_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.deserializeTo(_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.deserializeTo(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  // Make sure there was no data left over.
2030  // That means the argument buffer size was incorrect.
2031 #if FW_CMD_CHECK_RESIDUAL
2032  if (args.getDeserializeSizeLeft() != 0) {
2033  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2034  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2035  }
2036  // Don't crash the task if bad arguments were passed from the ground
2037  break;
2038  }
2039 #endif
2040 
2041  // Call handler function
2042  this->LOG_STATUS_cmdHandler(_opCode, _cmdSeq);
2043 
2044  break;
2045  }
2046 
2047  default:
2048  return MSG_DISPATCH_ERROR;
2049  }
2050 
2051  return MSG_DISPATCH_OK;
2052  }
2053 
2054  // ----------------------------------------------------------------------
2055  // Calls for messages received on special input ports
2056  // ----------------------------------------------------------------------
2057 
2058  void SeqDispatcherComponentBase ::
2059  m_p_cmdIn_in(
2060  Fw::PassiveComponentBase* callComp,
2061  FwIndexType portNum,
2062  FwOpcodeType opCode,
2063  U32 cmdSeq,
2064  Fw::CmdArgBuffer& args
2065  )
2066  {
2067  FW_ASSERT(callComp);
2068  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2069 
2070  const U32 idBase = callComp->getIdBase();
2071  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
2072 
2073  // Select base class function based on opcode
2074  switch (opCode - idBase) {
2075  case OPCODE_RUN: {
2076  compPtr->RUN_cmdHandlerBase(
2077  opCode,
2078  cmdSeq,
2079  args
2080  );
2081  break;
2082  }
2083 
2084  case OPCODE_LOG_STATUS: {
2085  compPtr->LOG_STATUS_cmdHandlerBase(
2086  opCode,
2087  cmdSeq,
2088  args
2089  );
2090  break;
2091  }
2092  }
2093  }
2094 
2095  // ----------------------------------------------------------------------
2096  // Calls for messages received on typed input ports
2097  // ----------------------------------------------------------------------
2098 
2099  void SeqDispatcherComponentBase ::
2100  m_p_seqDoneIn_in(
2101  Fw::PassiveComponentBase* callComp,
2102  FwIndexType portNum,
2103  FwOpcodeType opCode,
2104  U32 cmdSeq,
2105  const Fw::CmdResponse& response
2106  )
2107  {
2108  FW_ASSERT(callComp);
2109  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2110  compPtr->seqDoneIn_handlerBase(
2111  portNum,
2112  opCode,
2113  cmdSeq,
2114  response
2115  );
2116  }
2117 
2118  void SeqDispatcherComponentBase ::
2119  m_p_seqRunIn_in(
2120  Fw::PassiveComponentBase* callComp,
2121  FwIndexType portNum,
2122  const Fw::StringBase& filename
2123  )
2124  {
2125  FW_ASSERT(callComp);
2126  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2127  compPtr->seqRunIn_handlerBase(
2128  portNum,
2129  filename
2130  );
2131  }
2132 
2133  void SeqDispatcherComponentBase ::
2134  m_p_seqStartIn_in(
2135  Fw::PassiveComponentBase* callComp,
2136  FwIndexType portNum,
2137  const Fw::StringBase& filename
2138  )
2139  {
2140  FW_ASSERT(callComp);
2141  SeqDispatcherComponentBase* compPtr = static_cast<SeqDispatcherComponentBase*>(callComp);
2142  compPtr->seqStartIn_handlerBase(
2143  portNum,
2144  filename
2145  );
2146  }
2147 
2148 }
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
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.
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:26
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
The size of the serial representations of the port arguments.
PlatformSizeType FwSizeType
Svc::InputCmdSeqInPort * get_seqRunIn_InputPort(FwIndexType portNum)
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:63
I32 FwEnumStoreType
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
static constexpr FwIndexType getNum_seqDoneIn_InputPorts()
Svc::InputCmdSeqInPort * get_seqStartIn_InputPort(FwIndexType portNum)
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
void init()
Initialization function.
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
Logs via Events the state of each connected command sequencer.
const Time ZERO_TIME
Definition: Time.cpp:5
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
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.
No time base has been established (Required)
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
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
static constexpr FwIndexType getNum_logOut_OutputPorts()
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:24
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.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
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:47
void log_WARNING_LO_UnknownSequenceFinished(U16 idx) const
Log event UnknownSequenceFinished.
virtual ~SeqDispatcherComponentBase()
Destroy SeqDispatcherComponentBase object.
FwIdType FwEventIdType
The type of an event identifier.
static constexpr FwIndexType getNum_seqRunOut_OutputPorts()
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)
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:26
void init()
Initialization function.
Definition: TimePortAc.cpp:128
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Dispatches a sequence to the first available sequencer.
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:92
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
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
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
Definition: Queue.cpp:46
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void init()
Initialization function.
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
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:38
void invoke(const Fw::StringBase &filename) const
Invoke a port interface.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:151
bool isConnected_logOut_OutputPort(FwIndexType portNum)
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
BlockingType
message type
Definition: Queue.hpp:46
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.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
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
void init()
Initialization function.
bool isConnected_seqRunOut_OutputPort(FwIndexType portNum)
A message was sent requesting an exit of the loop.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
The size of the serial representations of the port arguments.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputCmdSeqInPort *callPort)
Register an input port.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
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)
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
U8 BYTE
byte type
Definition: BasicTypes.h:56
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].
message to exit active component task
static constexpr FwIndexType getNum_seqRunIn_InputPorts()
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
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.
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
static constexpr FwIndexType getNum_seqStartIn_InputPorts()
void tlmWrite_dispatchedCount(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.