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
18 #if !FW_DIRECT_PORT_CALLS
20 #endif
21 #if !FW_DIRECT_PORT_CALLS
23 #endif
25 #include "Fw/Prm/PrmGetPortAc.hpp"
26 #include "Fw/Prm/PrmSetPortAc.hpp"
27 #include "Fw/Time/TimePortAc.hpp"
28 #include "Fw/Tlm/TlmPortAc.hpp"
31 
32 namespace Svc {
33 
34  namespace Ccsds {
35 
42  {
43 
44  // ----------------------------------------------------------------------
45  // Friend classes
46  // ----------------------------------------------------------------------
47 
52 
53  protected:
54 
55  // ----------------------------------------------------------------------
56  // Constants
57  // ----------------------------------------------------------------------
58 
60  enum {
64  };
65 
67  enum {
74  };
75 
77  enum {
84  };
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Component initialization
90  // ----------------------------------------------------------------------
91 
93  void init(
94  FwEnumStoreType instance = 0
95  );
96 
97 #if !FW_DIRECT_PORT_CALLS
98 
99  public:
100 
101  // ----------------------------------------------------------------------
102  // Getters for typed input ports
103  // ----------------------------------------------------------------------
104 
109  FwIndexType portNum
110  );
111 
116  FwIndexType portNum
117  );
118 
123  FwIndexType portNum
124  );
125 
126 #endif
127 
128 #if !FW_DIRECT_PORT_CALLS
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Connect input ports to special output ports
134  // ----------------------------------------------------------------------
135 
138  FwIndexType portNum,
139  Fw::InputLogPort* port
140  );
141 
142 #if FW_ENABLE_TEXT_LOGGING == 1
143 
145  void set_logTextOut_OutputPort(
146  FwIndexType portNum,
147  Fw::InputLogTextPort* port
148  );
149 
150 #endif
151 
154  FwIndexType portNum,
155  Fw::InputPrmGetPort* port
156  );
157 
160  FwIndexType portNum,
161  Fw::InputPrmSetPort* port
162  );
163 
166  FwIndexType portNum,
167  Fw::InputTimePort* port
168  );
169 
172  FwIndexType portNum,
173  Fw::InputTlmPort* port
174  );
175 
176 #endif
177 
178 #if !FW_DIRECT_PORT_CALLS
179 
180  public:
181 
182  // ----------------------------------------------------------------------
183  // Connect typed input ports to typed output ports
184  // ----------------------------------------------------------------------
185 
188  FwIndexType portNum,
190  );
191 
194  FwIndexType portNum,
196  );
197 
200  FwIndexType portNum,
202  );
203 
206  FwIndexType portNum,
208  );
209 
212  FwIndexType portNum,
214  );
215 
218  FwIndexType portNum,
220  );
221 
222 #endif
223 
224 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
225 
226  public:
227 
228  // ----------------------------------------------------------------------
229  // Connect serial input ports to special output ports
230  // ----------------------------------------------------------------------
231 
234  FwIndexType portNum,
235  Fw::InputSerializePort* port
236  );
237 
238 #if FW_ENABLE_TEXT_LOGGING == 1
239 
241  void set_logTextOut_OutputPort(
242  FwIndexType portNum,
243  Fw::InputSerializePort* port
244  );
245 
246 #endif
247 
250  FwIndexType portNum,
251  Fw::InputSerializePort* port
252  );
253 
256  FwIndexType portNum,
257  Fw::InputSerializePort* port
258  );
259 
262  FwIndexType portNum,
263  Fw::InputSerializePort* port
264  );
265 
266 #endif
267 
268 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
269 
270  public:
271 
272  // ----------------------------------------------------------------------
273  // Connect serial input ports to typed output ports
274  // ----------------------------------------------------------------------
275 
278  FwIndexType portNum,
279  Fw::InputSerializePort* port
280  );
281 
284  FwIndexType portNum,
285  Fw::InputSerializePort* port
286  );
287 
290  FwIndexType portNum,
291  Fw::InputSerializePort* port
292  );
293 
296  FwIndexType portNum,
297  Fw::InputSerializePort* port
298  );
299 
300 #endif
301 
302  protected:
303 
304  // ----------------------------------------------------------------------
305  // Component construction and destruction
306  // ----------------------------------------------------------------------
307 
310  const char* compName = ""
311  );
312 
315 
316  protected:
317 
318  // ----------------------------------------------------------------------
319  // Getters for numbers of typed input ports
320  // ----------------------------------------------------------------------
321 
327  }
328 
333  return NUM_DATAIN_INPUT_PORTS;
334  }
335 
341  }
342 
343  protected:
344 
345  // ----------------------------------------------------------------------
346  // Getters for numbers of special output ports
347  // ----------------------------------------------------------------------
348 
354  }
355 
356 #if FW_ENABLE_TEXT_LOGGING == 1
357 
361  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
363  }
364 
365 #endif
366 
372  }
373 
379  }
380 
386  }
387 
393  }
394 
395  protected:
396 
397  // ----------------------------------------------------------------------
398  // Getters for numbers of typed output ports
399  // ----------------------------------------------------------------------
400 
406  }
407 
413  }
414 
420  }
421 
427  }
428 
434  }
435 
441  }
442 
443  protected:
444 
445  // ----------------------------------------------------------------------
446  // Connection status queries for special output ports
447  // ----------------------------------------------------------------------
448 
453  FwIndexType portNum
454  ) const;
455 
456 #if FW_ENABLE_TEXT_LOGGING == 1
457 
461  bool isConnected_logTextOut_OutputPort(
462  FwIndexType portNum
463  ) const;
464 
465 #endif
466 
471  FwIndexType portNum
472  ) const;
473 
478  FwIndexType portNum
479  ) const;
480 
485  FwIndexType portNum
486  ) const;
487 
492  FwIndexType portNum
493  ) const;
494 
495  protected:
496 
497  // ----------------------------------------------------------------------
498  // Connection status queries for typed output ports
499  // ----------------------------------------------------------------------
500 
505  FwIndexType portNum
506  ) const;
507 
512  FwIndexType portNum
513  ) const;
514 
519  FwIndexType portNum
520  ) const;
521 
526  FwIndexType portNum
527  ) const;
528 
533  FwIndexType portNum
534  ) const;
535 
540  FwIndexType portNum
541  ) const;
542 
543  protected:
544 
545  // ----------------------------------------------------------------------
546  // Handlers to implement for typed input ports
547  // ----------------------------------------------------------------------
548 
550  virtual void comStatusIn_handler(
551  FwIndexType portNum,
552  Fw::Success& condition
553  ) = 0;
554 
556  virtual void dataIn_handler(
557  FwIndexType portNum,
558  Fw::Buffer& data,
559  const ComCfg::FrameContext& context
560  ) = 0;
561 
563  virtual void dataReturnIn_handler(
564  FwIndexType portNum,
565  Fw::Buffer& data,
566  const ComCfg::FrameContext& context
567  ) = 0;
568 
569 #if FW_DIRECT_PORT_CALLS
570  public:
571 #else
572  protected:
573 #endif
574 
575  // ----------------------------------------------------------------------
576  // Port handler base-class functions for typed input ports
577  //
578  // Call these functions directly to bypass the corresponding ports
579  // ----------------------------------------------------------------------
580 
583  FwIndexType portNum,
584  Fw::Success& condition
585  );
586 
588  void dataIn_handlerBase(
589  FwIndexType portNum,
590  Fw::Buffer& data,
591  const ComCfg::FrameContext& context
592  );
593 
596  FwIndexType portNum,
597  Fw::Buffer& data,
598  const ComCfg::FrameContext& context
599  );
600 
601  protected:
602 
603  // ----------------------------------------------------------------------
604  // Invocation functions for typed output ports
605  // ----------------------------------------------------------------------
606 
609  FwIndexType portNum,
610  FwSizeType size
611  ) const;
612 
615  FwIndexType portNum,
616  Fw::Buffer& fwBuffer
617  ) const;
618 
620  void comStatusOut_out(
621  FwIndexType portNum,
622  Fw::Success& condition
623  ) const;
624 
626  void dataOut_out(
627  FwIndexType portNum,
628  Fw::Buffer& data,
629  const ComCfg::FrameContext& context
630  ) const;
631 
633  void dataReturnOut_out(
634  FwIndexType portNum,
635  Fw::Buffer& data,
636  const ComCfg::FrameContext& context
637  ) const;
638 
641  FwIndexType portNum,
642  const ComCfg::Apid& apid,
643  U16 sequenceCount
644  ) const;
645 
646  protected:
647 
648  // ----------------------------------------------------------------------
649  // Time
650  // ----------------------------------------------------------------------
651 
655  Fw::Time getTime() const;
656 
657  private:
658 
659  // ----------------------------------------------------------------------
660  // Calls for messages received on typed input ports
661  // ----------------------------------------------------------------------
662 
664  static void m_p_comStatusIn_in(
665  Fw::PassiveComponentBase* callComp,
666  FwIndexType portNum,
667  Fw::Success& condition
668  );
669 
671  static void m_p_dataIn_in(
672  Fw::PassiveComponentBase* callComp,
673  FwIndexType portNum,
674  Fw::Buffer& data,
675  const ComCfg::FrameContext& context
676  );
677 
679  static void m_p_dataReturnIn_in(
680  Fw::PassiveComponentBase* callComp,
681  FwIndexType portNum,
682  Fw::Buffer& data,
683  const ComCfg::FrameContext& context
684  );
685 
686  private:
687 
688  // ----------------------------------------------------------------------
689  // Invocation functions for special output ports
690  // ----------------------------------------------------------------------
691 
693  void timeCaller_out(
694  FwIndexType portNum,
695  Fw::Time& time
696  ) const;
697 
698 #if !FW_DIRECT_PORT_CALLS
699 
700  private:
701 
702  // ----------------------------------------------------------------------
703  // Typed input ports
704  // ----------------------------------------------------------------------
705 
708 
711 
714 
715 #endif
716 
717 #if !FW_DIRECT_PORT_CALLS
718 
719  private:
720 
721  // ----------------------------------------------------------------------
722  // Special output ports
723  // ----------------------------------------------------------------------
724 
726  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
727 
728 #if FW_ENABLE_TEXT_LOGGING == 1
729 
731  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
732 
733 #endif
734 
736  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
737 
739  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
740 
742  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
743 
745  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
746 
747 #endif
748 
749 #if !FW_DIRECT_PORT_CALLS
750 
751  private:
752 
753  // ----------------------------------------------------------------------
754  // Typed output ports
755  // ----------------------------------------------------------------------
756 
758  Fw::OutputBufferGetPort m_bufferAllocate_OutputPort[NUM_BUFFERALLOCATE_OUTPUT_PORTS];
759 
761  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
762 
765 
768 
771 
774 
775 #endif
776 
777  };
778 
779  }
780 
781 }
782 
783 #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].