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 #if FW_ENABLE_TEXT_LOGGING == 1
16 #include "Fw/Log/LogTextPortAc.hpp"
17 #endif
21 #include "Fw/Prm/PrmGetPortAc.hpp"
22 #include "Fw/Prm/PrmSetPortAc.hpp"
23 #include "Fw/Time/TimePortAc.hpp"
24 #include "Fw/Tlm/TlmPortAc.hpp"
27 
28 namespace Svc {
29 
30  namespace Ccsds {
31 
38  {
39 
40  // ----------------------------------------------------------------------
41  // Friend classes
42  // ----------------------------------------------------------------------
43 
48 
49  protected:
50 
51  // ----------------------------------------------------------------------
52  // Constants
53  // ----------------------------------------------------------------------
54 
56  enum {
60  };
61 
63  enum {
70  };
71 
73  enum {
80  };
81 
82  public:
83 
84  // ----------------------------------------------------------------------
85  // Component initialization
86  // ----------------------------------------------------------------------
87 
89  void init(
90  FwEnumStoreType instance = 0
91  );
92 
93  public:
94 
95  // ----------------------------------------------------------------------
96  // Getters for typed input ports
97  // ----------------------------------------------------------------------
98 
103  FwIndexType portNum
104  );
105 
110  FwIndexType portNum
111  );
112 
117  FwIndexType portNum
118  );
119 
120  public:
121 
122  // ----------------------------------------------------------------------
123  // Connect input ports to special output ports
124  // ----------------------------------------------------------------------
125 
128  FwIndexType portNum,
129  Fw::InputLogPort* port
130  );
131 
132 #if FW_ENABLE_TEXT_LOGGING == 1
133 
135  void set_logTextOut_OutputPort(
136  FwIndexType portNum,
137  Fw::InputLogTextPort* port
138  );
139 
140 #endif
141 
144  FwIndexType portNum,
145  Fw::InputPrmGetPort* port
146  );
147 
150  FwIndexType portNum,
151  Fw::InputPrmSetPort* port
152  );
153 
156  FwIndexType portNum,
157  Fw::InputTimePort* port
158  );
159 
162  FwIndexType portNum,
163  Fw::InputTlmPort* port
164  );
165 
166  public:
167 
168  // ----------------------------------------------------------------------
169  // Connect typed input ports to typed output ports
170  // ----------------------------------------------------------------------
171 
174  FwIndexType portNum,
176  );
177 
180  FwIndexType portNum,
182  );
183 
186  FwIndexType portNum,
188  );
189 
192  FwIndexType portNum,
194  );
195 
198  FwIndexType portNum,
200  );
201 
204  FwIndexType portNum,
206  );
207 
208 #if FW_PORT_SERIALIZATION
209 
210  public:
211 
212  // ----------------------------------------------------------------------
213  // Connect serial input ports to special output ports
214  // ----------------------------------------------------------------------
215 
218  FwIndexType portNum,
219  Fw::InputSerializePort* port
220  );
221 
222 #if FW_ENABLE_TEXT_LOGGING == 1
223 
225  void set_logTextOut_OutputPort(
226  FwIndexType portNum,
227  Fw::InputSerializePort* port
228  );
229 
230 #endif
231 
234  FwIndexType portNum,
235  Fw::InputSerializePort* port
236  );
237 
240  FwIndexType portNum,
241  Fw::InputSerializePort* port
242  );
243 
246  FwIndexType portNum,
247  Fw::InputSerializePort* port
248  );
249 
250 #endif
251 
252 #if FW_PORT_SERIALIZATION
253 
254  public:
255 
256  // ----------------------------------------------------------------------
257  // Connect serial input ports to typed output ports
258  // ----------------------------------------------------------------------
259 
262  FwIndexType portNum,
263  Fw::InputSerializePort* port
264  );
265 
268  FwIndexType portNum,
269  Fw::InputSerializePort* port
270  );
271 
274  FwIndexType portNum,
275  Fw::InputSerializePort* port
276  );
277 
280  FwIndexType portNum,
281  Fw::InputSerializePort* port
282  );
283 
284 #endif
285 
286  protected:
287 
288  // ----------------------------------------------------------------------
289  // Component construction and destruction
290  // ----------------------------------------------------------------------
291 
294  const char* compName = ""
295  );
296 
299 
300  protected:
301 
302  // ----------------------------------------------------------------------
303  // Getters for numbers of typed input ports
304  // ----------------------------------------------------------------------
305 
311  }
312 
317  return NUM_DATAIN_INPUT_PORTS;
318  }
319 
325  }
326 
327  protected:
328 
329  // ----------------------------------------------------------------------
330  // Getters for numbers of special output ports
331  // ----------------------------------------------------------------------
332 
338  }
339 
340 #if FW_ENABLE_TEXT_LOGGING == 1
341 
345  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
347  }
348 
349 #endif
350 
356  }
357 
363  }
364 
370  }
371 
377  }
378 
379  protected:
380 
381  // ----------------------------------------------------------------------
382  // Getters for numbers of typed output ports
383  // ----------------------------------------------------------------------
384 
390  }
391 
397  }
398 
404  }
405 
411  }
412 
418  }
419 
425  }
426 
427  protected:
428 
429  // ----------------------------------------------------------------------
430  // Connection status queries for special output ports
431  // ----------------------------------------------------------------------
432 
437  FwIndexType portNum
438  );
439 
440 #if FW_ENABLE_TEXT_LOGGING == 1
441 
445  bool isConnected_logTextOut_OutputPort(
446  FwIndexType portNum
447  );
448 
449 #endif
450 
455  FwIndexType portNum
456  );
457 
462  FwIndexType portNum
463  );
464 
469  FwIndexType portNum
470  );
471 
476  FwIndexType portNum
477  );
478 
479  protected:
480 
481  // ----------------------------------------------------------------------
482  // Connection status queries for typed output ports
483  // ----------------------------------------------------------------------
484 
489  FwIndexType portNum
490  );
491 
496  FwIndexType portNum
497  );
498 
503  FwIndexType portNum
504  );
505 
510  FwIndexType portNum
511  );
512 
517  FwIndexType portNum
518  );
519 
524  FwIndexType portNum
525  );
526 
527  protected:
528 
529  // ----------------------------------------------------------------------
530  // Handlers to implement for typed input ports
531  // ----------------------------------------------------------------------
532 
534  virtual void comStatusIn_handler(
535  FwIndexType portNum,
536  Fw::Success& condition
537  ) = 0;
538 
540  virtual void dataIn_handler(
541  FwIndexType portNum,
542  Fw::Buffer& data,
543  const ComCfg::FrameContext& context
544  ) = 0;
545 
547  virtual void dataReturnIn_handler(
548  FwIndexType portNum,
549  Fw::Buffer& data,
550  const ComCfg::FrameContext& context
551  ) = 0;
552 
553  protected:
554 
555  // ----------------------------------------------------------------------
556  // Port handler base-class functions for typed input ports
557  //
558  // Call these functions directly to bypass the corresponding ports
559  // ----------------------------------------------------------------------
560 
563  FwIndexType portNum,
564  Fw::Success& condition
565  );
566 
568  void dataIn_handlerBase(
569  FwIndexType portNum,
570  Fw::Buffer& data,
571  const ComCfg::FrameContext& context
572  );
573 
576  FwIndexType portNum,
577  Fw::Buffer& data,
578  const ComCfg::FrameContext& context
579  );
580 
581  protected:
582 
583  // ----------------------------------------------------------------------
584  // Invocation functions for typed output ports
585  // ----------------------------------------------------------------------
586 
589  FwIndexType portNum,
590  FwSizeType size
591  );
592 
595  FwIndexType portNum,
596  Fw::Buffer& fwBuffer
597  );
598 
600  void comStatusOut_out(
601  FwIndexType portNum,
602  Fw::Success& condition
603  );
604 
606  void dataOut_out(
607  FwIndexType portNum,
608  Fw::Buffer& data,
609  const ComCfg::FrameContext& context
610  );
611 
613  void dataReturnOut_out(
614  FwIndexType portNum,
615  Fw::Buffer& data,
616  const ComCfg::FrameContext& context
617  );
618 
621  FwIndexType portNum,
622  const ComCfg::Apid& apid,
623  U16 sequenceCount
624  );
625 
626  protected:
627 
628  // ----------------------------------------------------------------------
629  // Time
630  // ----------------------------------------------------------------------
631 
635  Fw::Time getTime() const;
636 
637  private:
638 
639  // ----------------------------------------------------------------------
640  // Calls for messages received on typed input ports
641  // ----------------------------------------------------------------------
642 
644  static void m_p_comStatusIn_in(
645  Fw::PassiveComponentBase* callComp,
646  FwIndexType portNum,
647  Fw::Success& condition
648  );
649 
651  static void m_p_dataIn_in(
652  Fw::PassiveComponentBase* callComp,
653  FwIndexType portNum,
654  Fw::Buffer& data,
655  const ComCfg::FrameContext& context
656  );
657 
659  static void m_p_dataReturnIn_in(
660  Fw::PassiveComponentBase* callComp,
661  FwIndexType portNum,
662  Fw::Buffer& data,
663  const ComCfg::FrameContext& context
664  );
665 
666  private:
667 
668  // ----------------------------------------------------------------------
669  // Typed input ports
670  // ----------------------------------------------------------------------
671 
674 
677 
680 
681  private:
682 
683  // ----------------------------------------------------------------------
684  // Special output ports
685  // ----------------------------------------------------------------------
686 
688  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
689 
690 #if FW_ENABLE_TEXT_LOGGING == 1
691 
693  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
694 
695 #endif
696 
698  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
699 
701  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
702 
704  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
705 
707  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
708 
709  private:
710 
711  // ----------------------------------------------------------------------
712  // Typed output ports
713  // ----------------------------------------------------------------------
714 
716  Fw::OutputBufferGetPort m_bufferAllocate_OutputPort[NUM_BUFFERALLOCATE_OUTPUT_PORTS];
717 
719  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
720 
723 
726 
729 
732 
733  };
734 
735  }
736 
737 }
738 
739 #endif
SpacePacketFramerComponentBase(const char *compName="")
Construct SpacePacketFramerComponentBase object.
PlatformSizeType FwSizeType
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
I32 FwEnumStoreType
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
U16 getApidSeqCount_out(FwIndexType portNum, const ComCfg::Apid &apid, U16 sequenceCount)
Invoke output port getApidSeqCount.
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
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 dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition)
Invoke output port comStatusOut.
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].
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
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 dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
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()
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.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
virtual ~SpacePacketFramerComponentBase()
Destroy SpacePacketFramerComponentBase object.
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
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].
Fw::Buffer bufferAllocate_out(FwIndexType portNum, FwSizeType size)
Invoke output port bufferAllocate.