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 
310 
315 
320 
321  PROTECTED:
322 
323  // ----------------------------------------------------------------------
324  // Getters for numbers of special output ports
325  // ----------------------------------------------------------------------
326 
331 
332 #if FW_ENABLE_TEXT_LOGGING == 1
333 
337  FwIndexType getNum_logTextOut_OutputPorts() const;
338 
339 #endif
340 
345 
350 
355 
360 
361  PROTECTED:
362 
363  // ----------------------------------------------------------------------
364  // Getters for numbers of typed output ports
365  // ----------------------------------------------------------------------
366 
371 
376 
381 
386 
391 
396 
397  PROTECTED:
398 
399  // ----------------------------------------------------------------------
400  // Connection status queries for special output ports
401  // ----------------------------------------------------------------------
402 
407  FwIndexType portNum
408  );
409 
410 #if FW_ENABLE_TEXT_LOGGING == 1
411 
415  bool isConnected_logTextOut_OutputPort(
416  FwIndexType portNum
417  );
418 
419 #endif
420 
425  FwIndexType portNum
426  );
427 
432  FwIndexType portNum
433  );
434 
439  FwIndexType portNum
440  );
441 
446  FwIndexType portNum
447  );
448 
449  PROTECTED:
450 
451  // ----------------------------------------------------------------------
452  // Connection status queries for typed output ports
453  // ----------------------------------------------------------------------
454 
459  FwIndexType portNum
460  );
461 
466  FwIndexType portNum
467  );
468 
473  FwIndexType portNum
474  );
475 
480  FwIndexType portNum
481  );
482 
487  FwIndexType portNum
488  );
489 
494  FwIndexType portNum
495  );
496 
497  PROTECTED:
498 
499  // ----------------------------------------------------------------------
500  // Handlers to implement for typed input ports
501  // ----------------------------------------------------------------------
502 
504  virtual void comStatusIn_handler(
505  FwIndexType portNum,
506  Fw::Success& condition
507  ) = 0;
508 
510  virtual void dataIn_handler(
511  FwIndexType portNum,
512  Fw::Buffer& data,
513  const ComCfg::FrameContext& context
514  ) = 0;
515 
517  virtual void dataReturnIn_handler(
518  FwIndexType portNum,
519  Fw::Buffer& data,
520  const ComCfg::FrameContext& context
521  ) = 0;
522 
523  PROTECTED:
524 
525  // ----------------------------------------------------------------------
526  // Port handler base-class functions for typed input ports
527  //
528  // Call these functions directly to bypass the corresponding ports
529  // ----------------------------------------------------------------------
530 
533  FwIndexType portNum,
534  Fw::Success& condition
535  );
536 
538  void dataIn_handlerBase(
539  FwIndexType portNum,
540  Fw::Buffer& data,
541  const ComCfg::FrameContext& context
542  );
543 
546  FwIndexType portNum,
547  Fw::Buffer& data,
548  const ComCfg::FrameContext& context
549  );
550 
551  PROTECTED:
552 
553  // ----------------------------------------------------------------------
554  // Invocation functions for typed output ports
555  // ----------------------------------------------------------------------
556 
559  FwIndexType portNum,
560  U32 size
561  );
562 
565  FwIndexType portNum,
566  Fw::Buffer& fwBuffer
567  );
568 
570  void comStatusOut_out(
571  FwIndexType portNum,
572  Fw::Success& condition
573  );
574 
576  void dataOut_out(
577  FwIndexType portNum,
578  Fw::Buffer& data,
579  const ComCfg::FrameContext& context
580  );
581 
583  void dataReturnOut_out(
584  FwIndexType portNum,
585  Fw::Buffer& data,
586  const ComCfg::FrameContext& context
587  );
588 
591  FwIndexType portNum,
592  const ComCfg::APID& apid,
593  U16 sequenceCount
594  );
595 
596  PROTECTED:
597 
598  // ----------------------------------------------------------------------
599  // Time
600  // ----------------------------------------------------------------------
601 
605  Fw::Time getTime() const;
606 
607  PRIVATE:
608 
609  // ----------------------------------------------------------------------
610  // Calls for messages received on typed input ports
611  // ----------------------------------------------------------------------
612 
614  static void m_p_comStatusIn_in(
615  Fw::PassiveComponentBase* callComp,
616  FwIndexType portNum,
617  Fw::Success& condition
618  );
619 
621  static void m_p_dataIn_in(
622  Fw::PassiveComponentBase* callComp,
623  FwIndexType portNum,
624  Fw::Buffer& data,
625  const ComCfg::FrameContext& context
626  );
627 
629  static void m_p_dataReturnIn_in(
630  Fw::PassiveComponentBase* callComp,
631  FwIndexType portNum,
632  Fw::Buffer& data,
633  const ComCfg::FrameContext& context
634  );
635 
636  PRIVATE:
637 
638  // ----------------------------------------------------------------------
639  // Typed input ports
640  // ----------------------------------------------------------------------
641 
644 
647 
650 
651  PRIVATE:
652 
653  // ----------------------------------------------------------------------
654  // Special output ports
655  // ----------------------------------------------------------------------
656 
658  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
659 
660 #if FW_ENABLE_TEXT_LOGGING == 1
661 
663  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
664 
665 #endif
666 
668  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
669 
671  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
672 
674  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
675 
677  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
678 
679  PRIVATE:
680 
681  // ----------------------------------------------------------------------
682  // Typed output ports
683  // ----------------------------------------------------------------------
684 
686  Fw::OutputBufferGetPort m_bufferAllocate_OutputPort[NUM_BUFFERALLOCATE_OUTPUT_PORTS];
687 
689  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
690 
693 
696 
699 
702 
703  };
704 
705  }
706 
707 }
708 
709 #endif
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].
Definition: Time.hpp:9
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)
virtual ~SpacePacketFramerComponentBase()
Destroy SpacePacketFramerComponentBase object.
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 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].
friend class SpacePacketFramerTesterBase
Friend class tester to support autocoded test harness.
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.
Auto-generated base for SpacePacketFramer component.
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
Fw::Buffer bufferAllocate_out(FwIndexType portNum, U32 size)
Invoke output port bufferAllocate.
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
friend class SpacePacketFramerTester
Friend class tester implementation to support white-box testing.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
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.
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
Type used to pass context info between components during framing/deframing.
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.
Success/Failure.