F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SpacePacketFramerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SpacePacketFramerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for SpacePacketFramer component base class
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_SpacePacketFramerComponentAc_HPP
8 #define Svc_Ccsds_SpacePacketFramerComponentAc_HPP
9 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
15 #include "Fw/Log/LogTextPortAc.hpp"
16 #if !FW_DIRECT_PORT_CALLS
18 #endif
19 #if !FW_DIRECT_PORT_CALLS
21 #endif
23 #include "Fw/Prm/PrmGetPortAc.hpp"
24 #include "Fw/Prm/PrmSetPortAc.hpp"
25 #include "Fw/Time/TimePortAc.hpp"
26 #include "Fw/Tlm/TlmPortAc.hpp"
29 
30 namespace Svc {
31 
32  namespace Ccsds {
33 
40  {
41 
42  // ----------------------------------------------------------------------
43  // Friend classes
44  // ----------------------------------------------------------------------
45 
50 
51  protected:
52 
53  // ----------------------------------------------------------------------
54  // Constants
55  // ----------------------------------------------------------------------
56 
58  enum {
62  };
63 
65  enum {
72  };
73 
75  enum {
82  };
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Component initialization
88  // ----------------------------------------------------------------------
89 
91  void init(
92  FwEnumStoreType instance = 0
93  );
94 
95 #if !FW_DIRECT_PORT_CALLS
96 
97  public:
98 
99  // ----------------------------------------------------------------------
100  // Getters for typed input ports
101  // ----------------------------------------------------------------------
102 
107  FwIndexType portNum
108  );
109 
114  FwIndexType portNum
115  );
116 
121  FwIndexType portNum
122  );
123 
124 #endif
125 
126 #if !FW_DIRECT_PORT_CALLS
127 
128  public:
129 
130  // ----------------------------------------------------------------------
131  // Connect input ports to special output ports
132  // ----------------------------------------------------------------------
133 
136  FwIndexType portNum,
137  Fw::InputLogPort* port
138  );
139 
140 #if FW_ENABLE_TEXT_LOGGING == 1
141 
143  void set_logTextOut_OutputPort(
144  FwIndexType portNum,
145  Fw::InputLogTextPort* port
146  );
147 
148 #endif
149 
152  FwIndexType portNum,
153  Fw::InputPrmGetPort* port
154  );
155 
158  FwIndexType portNum,
159  Fw::InputPrmSetPort* port
160  );
161 
164  FwIndexType portNum,
165  Fw::InputTimePort* port
166  );
167 
170  FwIndexType portNum,
171  Fw::InputTlmPort* port
172  );
173 
174 #endif
175 
176 #if !FW_DIRECT_PORT_CALLS
177 
178  public:
179 
180  // ----------------------------------------------------------------------
181  // Connect typed input ports to typed output ports
182  // ----------------------------------------------------------------------
183 
186  FwIndexType portNum,
188  );
189 
192  FwIndexType portNum,
194  );
195 
198  FwIndexType portNum,
200  );
201 
204  FwIndexType portNum,
206  );
207 
210  FwIndexType portNum,
212  );
213 
216  FwIndexType portNum,
218  );
219 
220 #endif
221 
222 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
223 
224  public:
225 
226  // ----------------------------------------------------------------------
227  // Connect serial input ports to special output ports
228  // ----------------------------------------------------------------------
229 
232  FwIndexType portNum,
233  Fw::InputSerializePort* port
234  );
235 
236 #if FW_ENABLE_TEXT_LOGGING == 1
237 
239  void set_logTextOut_OutputPort(
240  FwIndexType portNum,
241  Fw::InputSerializePort* port
242  );
243 
244 #endif
245 
248  FwIndexType portNum,
249  Fw::InputSerializePort* port
250  );
251 
254  FwIndexType portNum,
255  Fw::InputSerializePort* port
256  );
257 
260  FwIndexType portNum,
261  Fw::InputSerializePort* port
262  );
263 
264 #endif
265 
266 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
267 
268  public:
269 
270  // ----------------------------------------------------------------------
271  // Connect serial input ports to typed output ports
272  // ----------------------------------------------------------------------
273 
276  FwIndexType portNum,
277  Fw::InputSerializePort* port
278  );
279 
282  FwIndexType portNum,
283  Fw::InputSerializePort* port
284  );
285 
288  FwIndexType portNum,
289  Fw::InputSerializePort* port
290  );
291 
294  FwIndexType portNum,
295  Fw::InputSerializePort* port
296  );
297 
298 #endif
299 
300  protected:
301 
302  // ----------------------------------------------------------------------
303  // Component construction and destruction
304  // ----------------------------------------------------------------------
305 
308  const char* compName = ""
309  );
310 
313 
314  protected:
315 
316  // ----------------------------------------------------------------------
317  // Getters for numbers of typed input ports
318  // ----------------------------------------------------------------------
319 
325  }
326 
331  return NUM_DATAIN_INPUT_PORTS;
332  }
333 
339  }
340 
341  protected:
342 
343  // ----------------------------------------------------------------------
344  // Getters for numbers of special output ports
345  // ----------------------------------------------------------------------
346 
352  }
353 
354 #if FW_ENABLE_TEXT_LOGGING == 1
355 
359  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
361  }
362 
363 #endif
364 
370  }
371 
377  }
378 
384  }
385 
391  }
392 
393  protected:
394 
395  // ----------------------------------------------------------------------
396  // Getters for numbers of typed output ports
397  // ----------------------------------------------------------------------
398 
404  }
405 
411  }
412 
418  }
419 
425  }
426 
432  }
433 
439  }
440 
441  protected:
442 
443  // ----------------------------------------------------------------------
444  // Connection status queries for special output ports
445  // ----------------------------------------------------------------------
446 
451  FwIndexType portNum
452  ) const;
453 
454 #if FW_ENABLE_TEXT_LOGGING == 1
455 
459  bool isConnected_logTextOut_OutputPort(
460  FwIndexType portNum
461  ) const;
462 
463 #endif
464 
469  FwIndexType portNum
470  ) const;
471 
476  FwIndexType portNum
477  ) const;
478 
483  FwIndexType portNum
484  ) const;
485 
490  FwIndexType portNum
491  ) const;
492 
493  protected:
494 
495  // ----------------------------------------------------------------------
496  // Connection status queries for typed output ports
497  // ----------------------------------------------------------------------
498 
503  FwIndexType portNum
504  ) const;
505 
510  FwIndexType portNum
511  ) const;
512 
517  FwIndexType portNum
518  ) const;
519 
524  FwIndexType portNum
525  ) const;
526 
531  FwIndexType portNum
532  ) const;
533 
538  FwIndexType portNum
539  ) const;
540 
541  protected:
542 
543  // ----------------------------------------------------------------------
544  // Handlers to implement for typed input ports
545  // ----------------------------------------------------------------------
546 
548  virtual void comStatusIn_handler(
549  FwIndexType portNum,
550  Fw::Success& condition
551  ) = 0;
552 
554  virtual void dataIn_handler(
555  FwIndexType portNum,
556  Fw::Buffer& data,
557  const ComCfg::FrameContext& context
558  ) = 0;
559 
561  virtual void dataReturnIn_handler(
562  FwIndexType portNum,
563  Fw::Buffer& data,
564  const ComCfg::FrameContext& context
565  ) = 0;
566 
567 #if FW_DIRECT_PORT_CALLS
568  public:
569 #else
570  protected:
571 #endif
572 
573  // ----------------------------------------------------------------------
574  // Port handler base-class functions for typed input ports
575  //
576  // Call these functions directly to bypass the corresponding ports
577  // ----------------------------------------------------------------------
578 
581  FwIndexType portNum,
582  Fw::Success& condition
583  );
584 
586  void dataIn_handlerBase(
587  FwIndexType portNum,
588  Fw::Buffer& data,
589  const ComCfg::FrameContext& context
590  );
591 
594  FwIndexType portNum,
595  Fw::Buffer& data,
596  const ComCfg::FrameContext& context
597  );
598 
599  protected:
600 
601  // ----------------------------------------------------------------------
602  // Invocation functions for typed output ports
603  // ----------------------------------------------------------------------
604 
607  FwIndexType portNum,
608  FwSizeType size
609  ) const;
610 
613  FwIndexType portNum,
614  Fw::Buffer& fwBuffer
615  ) const;
616 
618  void comStatusOut_out(
619  FwIndexType portNum,
620  Fw::Success& condition
621  ) const;
622 
624  void dataOut_out(
625  FwIndexType portNum,
626  Fw::Buffer& data,
627  const ComCfg::FrameContext& context
628  ) const;
629 
631  void dataReturnOut_out(
632  FwIndexType portNum,
633  Fw::Buffer& data,
634  const ComCfg::FrameContext& context
635  ) const;
636 
639  FwIndexType portNum,
640  const ComCfg::Apid& apid,
641  U16 sequenceCount
642  ) const;
643 
644  protected:
645 
646  // ----------------------------------------------------------------------
647  // Time
648  // ----------------------------------------------------------------------
649 
653  Fw::Time getTime() const;
654 
655  private:
656 
657  // ----------------------------------------------------------------------
658  // Calls for messages received on typed input ports
659  // ----------------------------------------------------------------------
660 
662  static void m_p_comStatusIn_in(
663  Fw::PassiveComponentBase* callComp,
664  FwIndexType portNum,
665  Fw::Success& condition
666  );
667 
669  static void m_p_dataIn_in(
670  Fw::PassiveComponentBase* callComp,
671  FwIndexType portNum,
672  Fw::Buffer& data,
673  const ComCfg::FrameContext& context
674  );
675 
677  static void m_p_dataReturnIn_in(
678  Fw::PassiveComponentBase* callComp,
679  FwIndexType portNum,
680  Fw::Buffer& data,
681  const ComCfg::FrameContext& context
682  );
683 
684  private:
685 
686  // ----------------------------------------------------------------------
687  // Invocation functions for special output ports
688  // ----------------------------------------------------------------------
689 
691  void timeCaller_out(
692  FwIndexType portNum,
693  Fw::Time& time
694  ) const;
695 
696 #if !FW_DIRECT_PORT_CALLS
697 
698  private:
699 
700  // ----------------------------------------------------------------------
701  // Typed input ports
702  // ----------------------------------------------------------------------
703 
706 
709 
712 
713 #endif
714 
715 #if !FW_DIRECT_PORT_CALLS
716 
717  private:
718 
719  // ----------------------------------------------------------------------
720  // Special output ports
721  // ----------------------------------------------------------------------
722 
724  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
725 
726 #if FW_ENABLE_TEXT_LOGGING == 1
727 
729  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
730 
731 #endif
732 
734  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
735 
737  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
738 
740  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
741 
743  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
744 
745 #endif
746 
747 #if !FW_DIRECT_PORT_CALLS
748 
749  private:
750 
751  // ----------------------------------------------------------------------
752  // Typed output ports
753  // ----------------------------------------------------------------------
754 
756  Fw::OutputBufferGetPort m_bufferAllocate_OutputPort[NUM_BUFFERALLOCATE_OUTPUT_PORTS];
757 
759  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
760 
763 
766 
769 
772 
773 #endif
774 
775  };
776 
777  }
778 
779 }
780 
781 #endif
SpacePacketFramerComponentBase(const char *compName="")
Construct SpacePacketFramerComponentBase object.
bool isConnected_prmGetOut_OutputPort(FwIndexType portNum) const
PlatformSizeType FwSizeType
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
I32 FwEnumStoreType
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
bool isConnected_bufferAllocate_OutputPort(FwIndexType portNum) const
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
static constexpr FwIndexType getNum_getApidSeqCount_OutputPorts()
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:24
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port bufferDeallocate.
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition) const
Invoke output port comStatusOut.
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum) const
void set_getApidSeqCount_OutputPort(FwIndexType portNum, Svc::Ccsds::InputApidSequenceCountPort *port)
Connect port to getApidSeqCount[portNum].
friend class SpacePacketFramerTester
Friend class tester implementation to support white-box testing.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
static constexpr FwIndexType getNum_bufferAllocate_OutputPorts()
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
static constexpr FwIndexType getNum_bufferDeallocate_OutputPorts()
Fw::Buffer bufferAllocate_out(FwIndexType portNum, FwSizeType size) const
Invoke output port bufferAllocate.
Auto-generated base for SpacePacketFramer component.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
friend class SpacePacketFramerTesterBase
Friend class tester to support autocoded test harness.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
bool isConnected_getApidSeqCount_OutputPort(FwIndexType portNum) const
bool isConnected_prmSetOut_OutputPort(FwIndexType portNum) const
U16 getApidSeqCount_out(FwIndexType portNum, const ComCfg::Apid &apid, U16 sequenceCount) const
Invoke output port getApidSeqCount.
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum) const
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
Type used to pass context info between components during framing/deframing.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
RateGroupDivider component implementation.
virtual ~SpacePacketFramerComponentBase()
Destroy SpacePacketFramerComponentBase object.
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF.
Definition: ApidEnumAc.hpp:17
Success/Failure.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].