F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SpacePacketFramerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SpacePacketFramerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for SpacePacketFramer 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 CCSDS {
17 
18  // ----------------------------------------------------------------------
19  // Component initialization
20  // ----------------------------------------------------------------------
21 
24  {
25  // Initialize base class
27 
28  // Connect input port comStatusIn
29  for (
30  FwIndexType port = 0;
31  port < static_cast<FwIndexType>(this->getNum_comStatusIn_InputPorts());
32  port++
33  ) {
34  this->m_comStatusIn_InputPort[port].init();
35  this->m_comStatusIn_InputPort[port].addCallComp(
36  this,
37  m_p_comStatusIn_in
38  );
39  this->m_comStatusIn_InputPort[port].setPortNum(port);
40 
41 #if FW_OBJECT_NAMES == 1
42  Fw::ObjectName portName;
43  portName.format(
44  "%s_comStatusIn_InputPort[%" PRI_FwIndexType "]",
45  this->m_objName.toChar(),
46  port
47  );
48  this->m_comStatusIn_InputPort[port].setObjName(portName.toChar());
49 #endif
50  }
51 
52  // Connect input port dataIn
53  for (
54  FwIndexType port = 0;
55  port < static_cast<FwIndexType>(this->getNum_dataIn_InputPorts());
56  port++
57  ) {
58  this->m_dataIn_InputPort[port].init();
59  this->m_dataIn_InputPort[port].addCallComp(
60  this,
61  m_p_dataIn_in
62  );
63  this->m_dataIn_InputPort[port].setPortNum(port);
64 
65 #if FW_OBJECT_NAMES == 1
66  Fw::ObjectName portName;
67  portName.format(
68  "%s_dataIn_InputPort[%" PRI_FwIndexType "]",
69  this->m_objName.toChar(),
70  port
71  );
72  this->m_dataIn_InputPort[port].setObjName(portName.toChar());
73 #endif
74  }
75 
76  // Connect input port dataReturnIn
77  for (
78  FwIndexType port = 0;
79  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
80  port++
81  ) {
82  this->m_dataReturnIn_InputPort[port].init();
83  this->m_dataReturnIn_InputPort[port].addCallComp(
84  this,
85  m_p_dataReturnIn_in
86  );
87  this->m_dataReturnIn_InputPort[port].setPortNum(port);
88 
89 #if FW_OBJECT_NAMES == 1
90  Fw::ObjectName portName;
91  portName.format(
92  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
93  this->m_objName.toChar(),
94  port
95  );
96  this->m_dataReturnIn_InputPort[port].setObjName(portName.toChar());
97 #endif
98  }
99 
100  // Connect output port logOut
101  for (
102  FwIndexType port = 0;
103  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
104  port++
105  ) {
106  this->m_logOut_OutputPort[port].init();
107 
108 #if FW_OBJECT_NAMES == 1
109  Fw::ObjectName portName;
110  portName.format(
111  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
112  this->m_objName.toChar(),
113  port
114  );
115  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
116 #endif
117  }
118 
119 #if FW_ENABLE_TEXT_LOGGING == 1
120  // Connect output port logTextOut
121  for (
122  FwIndexType port = 0;
123  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
124  port++
125  ) {
126  this->m_logTextOut_OutputPort[port].init();
127 
128 #if FW_OBJECT_NAMES == 1
129  Fw::ObjectName portName;
130  portName.format(
131  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
132  this->m_objName.toChar(),
133  port
134  );
135  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
136 #endif
137  }
138 #endif
139 
140  // Connect output port prmGetOut
141  for (
142  FwIndexType port = 0;
143  port < static_cast<FwIndexType>(this->getNum_prmGetOut_OutputPorts());
144  port++
145  ) {
146  this->m_prmGetOut_OutputPort[port].init();
147 
148 #if FW_OBJECT_NAMES == 1
149  Fw::ObjectName portName;
150  portName.format(
151  "%s_prmGetOut_OutputPort[%" PRI_FwIndexType "]",
152  this->m_objName.toChar(),
153  port
154  );
155  this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar());
156 #endif
157  }
158 
159  // Connect output port prmSetOut
160  for (
161  FwIndexType port = 0;
162  port < static_cast<FwIndexType>(this->getNum_prmSetOut_OutputPorts());
163  port++
164  ) {
165  this->m_prmSetOut_OutputPort[port].init();
166 
167 #if FW_OBJECT_NAMES == 1
168  Fw::ObjectName portName;
169  portName.format(
170  "%s_prmSetOut_OutputPort[%" PRI_FwIndexType "]",
171  this->m_objName.toChar(),
172  port
173  );
174  this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar());
175 #endif
176  }
177 
178  // Connect output port timeCaller
179  for (
180  FwIndexType port = 0;
181  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
182  port++
183  ) {
184  this->m_timeCaller_OutputPort[port].init();
185 
186 #if FW_OBJECT_NAMES == 1
187  Fw::ObjectName portName;
188  portName.format(
189  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
190  this->m_objName.toChar(),
191  port
192  );
193  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
194 #endif
195  }
196 
197  // Connect output port tlmOut
198  for (
199  FwIndexType port = 0;
200  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
201  port++
202  ) {
203  this->m_tlmOut_OutputPort[port].init();
204 
205 #if FW_OBJECT_NAMES == 1
206  Fw::ObjectName portName;
207  portName.format(
208  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
209  this->m_objName.toChar(),
210  port
211  );
212  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
213 #endif
214  }
215 
216  // Connect output port bufferAllocate
217  for (
218  FwIndexType port = 0;
219  port < static_cast<FwIndexType>(this->getNum_bufferAllocate_OutputPorts());
220  port++
221  ) {
222  this->m_bufferAllocate_OutputPort[port].init();
223 
224 #if FW_OBJECT_NAMES == 1
225  Fw::ObjectName portName;
226  portName.format(
227  "%s_bufferAllocate_OutputPort[%" PRI_FwIndexType "]",
228  this->m_objName.toChar(),
229  port
230  );
231  this->m_bufferAllocate_OutputPort[port].setObjName(portName.toChar());
232 #endif
233  }
234 
235  // Connect output port bufferDeallocate
236  for (
237  FwIndexType port = 0;
238  port < static_cast<FwIndexType>(this->getNum_bufferDeallocate_OutputPorts());
239  port++
240  ) {
241  this->m_bufferDeallocate_OutputPort[port].init();
242 
243 #if FW_OBJECT_NAMES == 1
244  Fw::ObjectName portName;
245  portName.format(
246  "%s_bufferDeallocate_OutputPort[%" PRI_FwIndexType "]",
247  this->m_objName.toChar(),
248  port
249  );
250  this->m_bufferDeallocate_OutputPort[port].setObjName(portName.toChar());
251 #endif
252  }
253 
254  // Connect output port comStatusOut
255  for (
256  FwIndexType port = 0;
257  port < static_cast<FwIndexType>(this->getNum_comStatusOut_OutputPorts());
258  port++
259  ) {
260  this->m_comStatusOut_OutputPort[port].init();
261 
262 #if FW_OBJECT_NAMES == 1
263  Fw::ObjectName portName;
264  portName.format(
265  "%s_comStatusOut_OutputPort[%" PRI_FwIndexType "]",
266  this->m_objName.toChar(),
267  port
268  );
269  this->m_comStatusOut_OutputPort[port].setObjName(portName.toChar());
270 #endif
271  }
272 
273  // Connect output port dataOut
274  for (
275  FwIndexType port = 0;
276  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
277  port++
278  ) {
279  this->m_dataOut_OutputPort[port].init();
280 
281 #if FW_OBJECT_NAMES == 1
282  Fw::ObjectName portName;
283  portName.format(
284  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
285  this->m_objName.toChar(),
286  port
287  );
288  this->m_dataOut_OutputPort[port].setObjName(portName.toChar());
289 #endif
290  }
291 
292  // Connect output port dataReturnOut
293  for (
294  FwIndexType port = 0;
295  port < static_cast<FwIndexType>(this->getNum_dataReturnOut_OutputPorts());
296  port++
297  ) {
298  this->m_dataReturnOut_OutputPort[port].init();
299 
300 #if FW_OBJECT_NAMES == 1
301  Fw::ObjectName portName;
302  portName.format(
303  "%s_dataReturnOut_OutputPort[%" PRI_FwIndexType "]",
304  this->m_objName.toChar(),
305  port
306  );
307  this->m_dataReturnOut_OutputPort[port].setObjName(portName.toChar());
308 #endif
309  }
310 
311  // Connect output port getApidSeqCount
312  for (
313  FwIndexType port = 0;
314  port < static_cast<FwIndexType>(this->getNum_getApidSeqCount_OutputPorts());
315  port++
316  ) {
317  this->m_getApidSeqCount_OutputPort[port].init();
318 
319 #if FW_OBJECT_NAMES == 1
320  Fw::ObjectName portName;
321  portName.format(
322  "%s_getApidSeqCount_OutputPort[%" PRI_FwIndexType "]",
323  this->m_objName.toChar(),
324  port
325  );
326  this->m_getApidSeqCount_OutputPort[port].setObjName(portName.toChar());
327 #endif
328  }
329  }
330 
331  // ----------------------------------------------------------------------
332  // Getters for typed input ports
333  // ----------------------------------------------------------------------
334 
337  {
338  FW_ASSERT(
339  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
340  static_cast<FwAssertArgType>(portNum)
341  );
342 
343  return &this->m_comStatusIn_InputPort[portNum];
344  }
345 
348  {
349  FW_ASSERT(
350  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
351  static_cast<FwAssertArgType>(portNum)
352  );
353 
354  return &this->m_dataIn_InputPort[portNum];
355  }
356 
359  {
360  FW_ASSERT(
361  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
362  static_cast<FwAssertArgType>(portNum)
363  );
364 
365  return &this->m_dataReturnIn_InputPort[portNum];
366  }
367 
368  // ----------------------------------------------------------------------
369  // Connect input ports to special output ports
370  // ----------------------------------------------------------------------
371 
374  FwIndexType portNum,
375  Fw::InputLogPort* port
376  )
377  {
378  FW_ASSERT(
379  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
380  static_cast<FwAssertArgType>(portNum)
381  );
382 
383  this->m_logOut_OutputPort[portNum].addCallPort(port);
384  }
385 
386 #if FW_ENABLE_TEXT_LOGGING == 1
387 
388  void SpacePacketFramerComponentBase ::
389  set_logTextOut_OutputPort(
390  FwIndexType portNum,
392  )
393  {
394  FW_ASSERT(
395  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
396  static_cast<FwAssertArgType>(portNum)
397  );
398 
399  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
400  }
401 
402 #endif
403 
406  FwIndexType portNum,
407  Fw::InputPrmGetPort* port
408  )
409  {
410  FW_ASSERT(
411  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
412  static_cast<FwAssertArgType>(portNum)
413  );
414 
415  this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
416  }
417 
420  FwIndexType portNum,
421  Fw::InputPrmSetPort* port
422  )
423  {
424  FW_ASSERT(
425  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
426  static_cast<FwAssertArgType>(portNum)
427  );
428 
429  this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
430  }
431 
434  FwIndexType portNum,
435  Fw::InputTimePort* port
436  )
437  {
438  FW_ASSERT(
439  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
440  static_cast<FwAssertArgType>(portNum)
441  );
442 
443  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
444  }
445 
448  FwIndexType portNum,
449  Fw::InputTlmPort* port
450  )
451  {
452  FW_ASSERT(
453  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
454  static_cast<FwAssertArgType>(portNum)
455  );
456 
457  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
458  }
459 
460  // ----------------------------------------------------------------------
461  // Connect typed input ports to typed output ports
462  // ----------------------------------------------------------------------
463 
466  FwIndexType portNum,
468  )
469  {
470  FW_ASSERT(
471  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
472  static_cast<FwAssertArgType>(portNum)
473  );
474 
475  this->m_bufferAllocate_OutputPort[portNum].addCallPort(port);
476  }
477 
480  FwIndexType portNum,
482  )
483  {
484  FW_ASSERT(
485  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
486  static_cast<FwAssertArgType>(portNum)
487  );
488 
489  this->m_bufferDeallocate_OutputPort[portNum].addCallPort(port);
490  }
491 
494  FwIndexType portNum,
496  )
497  {
498  FW_ASSERT(
499  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
500  static_cast<FwAssertArgType>(portNum)
501  );
502 
503  this->m_comStatusOut_OutputPort[portNum].addCallPort(port);
504  }
505 
508  FwIndexType portNum,
510  )
511  {
512  FW_ASSERT(
513  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
514  static_cast<FwAssertArgType>(portNum)
515  );
516 
517  this->m_dataOut_OutputPort[portNum].addCallPort(port);
518  }
519 
522  FwIndexType portNum,
524  )
525  {
526  FW_ASSERT(
527  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
528  static_cast<FwAssertArgType>(portNum)
529  );
530 
531  this->m_dataReturnOut_OutputPort[portNum].addCallPort(port);
532  }
533 
536  FwIndexType portNum,
538  )
539  {
540  FW_ASSERT(
541  (0 <= portNum) && (portNum < this->getNum_getApidSeqCount_OutputPorts()),
542  static_cast<FwAssertArgType>(portNum)
543  );
544 
545  this->m_getApidSeqCount_OutputPort[portNum].addCallPort(port);
546  }
547 
548 #if FW_PORT_SERIALIZATION
549 
550  // ----------------------------------------------------------------------
551  // Connect serial input ports to special output ports
552  // ----------------------------------------------------------------------
553 
556  FwIndexType portNum,
557  Fw::InputSerializePort* port
558  )
559  {
560  FW_ASSERT(
561  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
562  static_cast<FwAssertArgType>(portNum)
563  );
564 
565  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
566  }
567 
568 #if FW_ENABLE_TEXT_LOGGING == 1
569 
570  void SpacePacketFramerComponentBase ::
571  set_logTextOut_OutputPort(
572  FwIndexType portNum,
573  Fw::InputSerializePort* port
574  )
575  {
576  FW_ASSERT(
577  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
578  static_cast<FwAssertArgType>(portNum)
579  );
580 
581  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
582  }
583 
584 #endif
585 
588  FwIndexType portNum,
589  Fw::InputSerializePort* port
590  )
591  {
592  FW_ASSERT(
593  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
594  static_cast<FwAssertArgType>(portNum)
595  );
596 
597  this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
598  }
599 
602  FwIndexType portNum,
603  Fw::InputSerializePort* port
604  )
605  {
606  FW_ASSERT(
607  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
608  static_cast<FwAssertArgType>(portNum)
609  );
610 
611  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
612  }
613 
616  FwIndexType portNum,
617  Fw::InputSerializePort* port
618  )
619  {
620  FW_ASSERT(
621  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
622  static_cast<FwAssertArgType>(portNum)
623  );
624 
625  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
626  }
627 
628 #endif
629 
630 #if FW_PORT_SERIALIZATION
631 
632  // ----------------------------------------------------------------------
633  // Connect serial input ports to typed output ports
634  // ----------------------------------------------------------------------
635 
638  FwIndexType portNum,
639  Fw::InputSerializePort* port
640  )
641  {
642  FW_ASSERT(
643  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
644  static_cast<FwAssertArgType>(portNum)
645  );
646 
647  this->m_bufferDeallocate_OutputPort[portNum].registerSerialPort(port);
648  }
649 
652  FwIndexType portNum,
653  Fw::InputSerializePort* port
654  )
655  {
656  FW_ASSERT(
657  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
658  static_cast<FwAssertArgType>(portNum)
659  );
660 
661  this->m_comStatusOut_OutputPort[portNum].registerSerialPort(port);
662  }
663 
666  FwIndexType portNum,
667  Fw::InputSerializePort* port
668  )
669  {
670  FW_ASSERT(
671  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
672  static_cast<FwAssertArgType>(portNum)
673  );
674 
675  this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
676  }
677 
680  FwIndexType portNum,
681  Fw::InputSerializePort* port
682  )
683  {
684  FW_ASSERT(
685  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
686  static_cast<FwAssertArgType>(portNum)
687  );
688 
689  this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
690  }
691 
692 #endif
693 
694  // ----------------------------------------------------------------------
695  // Component construction and destruction
696  // ----------------------------------------------------------------------
697 
699  SpacePacketFramerComponentBase(const char* compName) :
700  Fw::PassiveComponentBase(compName)
701  {
702 
703  }
704 
707  {
708 
709  }
710 
711  // ----------------------------------------------------------------------
712  // Getters for numbers of typed input ports
713  // ----------------------------------------------------------------------
714 
717  {
718  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comStatusIn_InputPort));
719  }
720 
723  {
724  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataIn_InputPort));
725  }
726 
729  {
730  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataReturnIn_InputPort));
731  }
732 
733  // ----------------------------------------------------------------------
734  // Getters for numbers of special output ports
735  // ----------------------------------------------------------------------
736 
739  {
740  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
741  }
742 
743 #if FW_ENABLE_TEXT_LOGGING == 1
744 
745  FwIndexType SpacePacketFramerComponentBase ::
746  getNum_logTextOut_OutputPorts() const
747  {
748  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logTextOut_OutputPort));
749  }
750 
751 #endif
752 
755  {
756  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_prmGetOut_OutputPort));
757  }
758 
761  {
762  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_prmSetOut_OutputPort));
763  }
764 
767  {
768  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
769  }
770 
773  {
774  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
775  }
776 
777  // ----------------------------------------------------------------------
778  // Getters for numbers of typed output ports
779  // ----------------------------------------------------------------------
780 
783  {
784  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferAllocate_OutputPort));
785  }
786 
789  {
790  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferDeallocate_OutputPort));
791  }
792 
795  {
796  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comStatusOut_OutputPort));
797  }
798 
801  {
802  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataOut_OutputPort));
803  }
804 
807  {
808  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataReturnOut_OutputPort));
809  }
810 
813  {
814  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_getApidSeqCount_OutputPort));
815  }
816 
817  // ----------------------------------------------------------------------
818  // Connection status queries for special output ports
819  // ----------------------------------------------------------------------
820 
823  {
824  FW_ASSERT(
825  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
826  static_cast<FwAssertArgType>(portNum)
827  );
828 
829  return this->m_logOut_OutputPort[portNum].isConnected();
830  }
831 
832 #if FW_ENABLE_TEXT_LOGGING == 1
833 
834  bool SpacePacketFramerComponentBase ::
835  isConnected_logTextOut_OutputPort(FwIndexType portNum)
836  {
837  FW_ASSERT(
838  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
839  static_cast<FwAssertArgType>(portNum)
840  );
841 
842  return this->m_logTextOut_OutputPort[portNum].isConnected();
843  }
844 
845 #endif
846 
849  {
850  FW_ASSERT(
851  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
852  static_cast<FwAssertArgType>(portNum)
853  );
854 
855  return this->m_prmGetOut_OutputPort[portNum].isConnected();
856  }
857 
860  {
861  FW_ASSERT(
862  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
863  static_cast<FwAssertArgType>(portNum)
864  );
865 
866  return this->m_prmSetOut_OutputPort[portNum].isConnected();
867  }
868 
871  {
872  FW_ASSERT(
873  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
874  static_cast<FwAssertArgType>(portNum)
875  );
876 
877  return this->m_timeCaller_OutputPort[portNum].isConnected();
878  }
879 
882  {
883  FW_ASSERT(
884  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
885  static_cast<FwAssertArgType>(portNum)
886  );
887 
888  return this->m_tlmOut_OutputPort[portNum].isConnected();
889  }
890 
891  // ----------------------------------------------------------------------
892  // Connection status queries for typed output ports
893  // ----------------------------------------------------------------------
894 
897  {
898  FW_ASSERT(
899  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
900  static_cast<FwAssertArgType>(portNum)
901  );
902 
903  return this->m_bufferAllocate_OutputPort[portNum].isConnected();
904  }
905 
908  {
909  FW_ASSERT(
910  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
911  static_cast<FwAssertArgType>(portNum)
912  );
913 
914  return this->m_bufferDeallocate_OutputPort[portNum].isConnected();
915  }
916 
919  {
920  FW_ASSERT(
921  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
922  static_cast<FwAssertArgType>(portNum)
923  );
924 
925  return this->m_comStatusOut_OutputPort[portNum].isConnected();
926  }
927 
930  {
931  FW_ASSERT(
932  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
933  static_cast<FwAssertArgType>(portNum)
934  );
935 
936  return this->m_dataOut_OutputPort[portNum].isConnected();
937  }
938 
941  {
942  FW_ASSERT(
943  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
944  static_cast<FwAssertArgType>(portNum)
945  );
946 
947  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
948  }
949 
952  {
953  FW_ASSERT(
954  (0 <= portNum) && (portNum < this->getNum_getApidSeqCount_OutputPorts()),
955  static_cast<FwAssertArgType>(portNum)
956  );
957 
958  return this->m_getApidSeqCount_OutputPort[portNum].isConnected();
959  }
960 
961  // ----------------------------------------------------------------------
962  // Port handler base-class functions for typed input ports
963  //
964  // Call these functions directly to bypass the corresponding ports
965  // ----------------------------------------------------------------------
966 
969  FwIndexType portNum,
970  Fw::Success& condition
971  )
972  {
973  // Make sure port number is valid
974  FW_ASSERT(
975  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
976  static_cast<FwAssertArgType>(portNum)
977  );
978 
979  // Call handler function
980  this->comStatusIn_handler(
981  portNum,
982  condition
983  );
984  }
985 
988  FwIndexType portNum,
989  Fw::Buffer& data,
990  const ComCfg::FrameContext& context
991  )
992  {
993  // Make sure port number is valid
994  FW_ASSERT(
995  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
996  static_cast<FwAssertArgType>(portNum)
997  );
998 
999  // Call handler function
1000  this->dataIn_handler(
1001  portNum,
1002  data,
1003  context
1004  );
1005  }
1006 
1009  FwIndexType portNum,
1010  Fw::Buffer& data,
1011  const ComCfg::FrameContext& context
1012  )
1013  {
1014  // Make sure port number is valid
1015  FW_ASSERT(
1016  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
1017  static_cast<FwAssertArgType>(portNum)
1018  );
1019 
1020  // Call handler function
1021  this->dataReturnIn_handler(
1022  portNum,
1023  data,
1024  context
1025  );
1026  }
1027 
1028  // ----------------------------------------------------------------------
1029  // Invocation functions for typed output ports
1030  // ----------------------------------------------------------------------
1031 
1034  FwIndexType portNum,
1035  U32 size
1036  )
1037  {
1038  FW_ASSERT(
1039  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
1040  static_cast<FwAssertArgType>(portNum)
1041  );
1042 
1043  FW_ASSERT(
1044  this->m_bufferAllocate_OutputPort[portNum].isConnected(),
1045  static_cast<FwAssertArgType>(portNum)
1046  );
1047  return this->m_bufferAllocate_OutputPort[portNum].invoke(
1048  size
1049  );
1050  }
1051 
1054  FwIndexType portNum,
1055  Fw::Buffer& fwBuffer
1056  )
1057  {
1058  FW_ASSERT(
1059  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
1060  static_cast<FwAssertArgType>(portNum)
1061  );
1062 
1063  FW_ASSERT(
1064  this->m_bufferDeallocate_OutputPort[portNum].isConnected(),
1065  static_cast<FwAssertArgType>(portNum)
1066  );
1067  this->m_bufferDeallocate_OutputPort[portNum].invoke(
1068  fwBuffer
1069  );
1070  }
1071 
1074  FwIndexType portNum,
1075  Fw::Success& condition
1076  )
1077  {
1078  FW_ASSERT(
1079  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
1080  static_cast<FwAssertArgType>(portNum)
1081  );
1082 
1083  FW_ASSERT(
1084  this->m_comStatusOut_OutputPort[portNum].isConnected(),
1085  static_cast<FwAssertArgType>(portNum)
1086  );
1087  this->m_comStatusOut_OutputPort[portNum].invoke(
1088  condition
1089  );
1090  }
1091 
1094  FwIndexType portNum,
1095  Fw::Buffer& data,
1096  const ComCfg::FrameContext& context
1097  )
1098  {
1099  FW_ASSERT(
1100  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
1101  static_cast<FwAssertArgType>(portNum)
1102  );
1103 
1104  FW_ASSERT(
1105  this->m_dataOut_OutputPort[portNum].isConnected(),
1106  static_cast<FwAssertArgType>(portNum)
1107  );
1108  this->m_dataOut_OutputPort[portNum].invoke(
1109  data,
1110  context
1111  );
1112  }
1113 
1116  FwIndexType portNum,
1117  Fw::Buffer& data,
1118  const ComCfg::FrameContext& context
1119  )
1120  {
1121  FW_ASSERT(
1122  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
1123  static_cast<FwAssertArgType>(portNum)
1124  );
1125 
1126  FW_ASSERT(
1127  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
1128  static_cast<FwAssertArgType>(portNum)
1129  );
1130  this->m_dataReturnOut_OutputPort[portNum].invoke(
1131  data,
1132  context
1133  );
1134  }
1135 
1138  FwIndexType portNum,
1139  const ComCfg::APID& apid,
1140  U16 sequenceCount
1141  )
1142  {
1143  FW_ASSERT(
1144  (0 <= portNum) && (portNum < this->getNum_getApidSeqCount_OutputPorts()),
1145  static_cast<FwAssertArgType>(portNum)
1146  );
1147 
1148  FW_ASSERT(
1149  this->m_getApidSeqCount_OutputPort[portNum].isConnected(),
1150  static_cast<FwAssertArgType>(portNum)
1151  );
1152  return this->m_getApidSeqCount_OutputPort[portNum].invoke(
1153  apid,
1154  sequenceCount
1155  );
1156  }
1157 
1158  // ----------------------------------------------------------------------
1159  // Time
1160  // ----------------------------------------------------------------------
1161 
1163  getTime() const
1164  {
1165  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1166  Fw::Time _time;
1167  this->m_timeCaller_OutputPort[0].invoke(_time);
1168  return _time;
1169  }
1170  else {
1171  return Fw::Time(TB_NONE, 0, 0);
1172  }
1173  }
1174 
1175  // ----------------------------------------------------------------------
1176  // Calls for messages received on typed input ports
1177  // ----------------------------------------------------------------------
1178 
1179  void SpacePacketFramerComponentBase ::
1180  m_p_comStatusIn_in(
1181  Fw::PassiveComponentBase* callComp,
1182  FwIndexType portNum,
1183  Fw::Success& condition
1184  )
1185  {
1186  FW_ASSERT(callComp);
1187  SpacePacketFramerComponentBase* compPtr = static_cast<SpacePacketFramerComponentBase*>(callComp);
1188  compPtr->comStatusIn_handlerBase(
1189  portNum,
1190  condition
1191  );
1192  }
1193 
1194  void SpacePacketFramerComponentBase ::
1195  m_p_dataIn_in(
1196  Fw::PassiveComponentBase* callComp,
1197  FwIndexType portNum,
1198  Fw::Buffer& data,
1199  const ComCfg::FrameContext& context
1200  )
1201  {
1202  FW_ASSERT(callComp);
1203  SpacePacketFramerComponentBase* compPtr = static_cast<SpacePacketFramerComponentBase*>(callComp);
1204  compPtr->dataIn_handlerBase(
1205  portNum,
1206  data,
1207  context
1208  );
1209  }
1210 
1211  void SpacePacketFramerComponentBase ::
1212  m_p_dataReturnIn_in(
1213  Fw::PassiveComponentBase* callComp,
1214  FwIndexType portNum,
1215  Fw::Buffer& data,
1216  const ComCfg::FrameContext& context
1217  )
1218  {
1219  FW_ASSERT(callComp);
1220  SpacePacketFramerComponentBase* compPtr = static_cast<SpacePacketFramerComponentBase*>(callComp);
1221  compPtr->dataReturnIn_handlerBase(
1222  portNum,
1223  data,
1224  context
1225  );
1226  }
1227 
1228  }
1229 
1230 }
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
Definition: Time.hpp:9
U16 invoke(const ComCfg::APID &apid, U16 sequenceCount) const
Invoke a port interface.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
Fw::Buffer invoke(U32 size) const
Invoke a port interface.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void addCallPort(InputPrmSetPort *callPort)
Register an input port.
virtual ~SpacePacketFramerComponentBase()
Destroy SpacePacketFramerComponentBase object.
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void addCallPort(InputSuccessConditionPort *callPort)
Register an input port.
void init()
Initialization function.
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void addCallPort(InputPrmGetPort *callPort)
Register an input port.
void init()
Object initializer.
Definition: ObjBase.cpp:26
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port interface.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
Auto-generated base for SpacePacketFramer component.
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
const char * toChar() const
Definition: ObjectName.hpp:50
void invoke(Fw::Success &condition) const
Invoke a port interface.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port interface.
void addCallPort(InputApidSequenceCountPort *callPort)
Register an input port.
void init()
Initialization function.
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
bool isConnected() const
Definition: PortBase.cpp:42
Fw::Buffer bufferAllocate_out(FwIndexType portNum, U32 size)
Invoke output port bufferAllocate.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void setPortNum(FwIndexType portNum)
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void init()
Initialization function.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
void init()
Initialization function.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
SpacePacketFramerComponentBase(const char *compName="")
Construct SpacePacketFramerComponentBase object.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition)
Invoke output port comStatusOut.
No time base has been established.
Definition: FpConfig.h:30
PlatformIndexType FwIndexType
void set_getApidSeqCount_OutputPort(FwIndexType portNum, Svc::CCSDS::InputApidSequenceCountPort *port)
Connect port to getApidSeqCount[portNum].
APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF.
Definition: APIDEnumAc.hpp:17
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:93
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
Type used to pass context info between components during framing/deframing.
void init()
Initialization function.
RateGroupDivider component implementation.
U16 getApidSeqCount_out(FwIndexType portNum, const ComCfg::APID &apid, U16 sequenceCount)
Invoke output port getApidSeqCount.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
void init()
Initialization function.
void init()
Initialization function.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Success/Failure.
void init()
Initialization function.