F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SpacePacketDeframerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SpacePacketDeframerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for SpacePacketDeframer component base class
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_SpacePacketDeframerComponentAc_HPP
8 #define Svc_Ccsds_SpacePacketDeframerComponentAc_HPP
9 
10 #include <atomic>
11 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
15 #include "Fw/Log/LogString.hpp"
16 #if FW_ENABLE_TEXT_LOGGING == 1
17 #include "Fw/Log/LogTextPortAc.hpp"
18 #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"
25 #include "Os/Mutex.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 {
61  };
62 
64  enum {
71  };
72 
74  enum {
78  };
79 
81  enum {
83  };
84 
85  public:
86 
87  // ----------------------------------------------------------------------
88  // Component initialization
89  // ----------------------------------------------------------------------
90 
92  void init(
93  FwEnumStoreType instance = 0
94  );
95 
96  public:
97 
98  // ----------------------------------------------------------------------
99  // Getters for typed input ports
100  // ----------------------------------------------------------------------
101 
106  FwIndexType portNum
107  );
108 
113  FwIndexType portNum
114  );
115 
116  public:
117 
118  // ----------------------------------------------------------------------
119  // Connect input ports to special output ports
120  // ----------------------------------------------------------------------
121 
124  FwIndexType portNum,
125  Fw::InputLogPort* port
126  );
127 
128 #if FW_ENABLE_TEXT_LOGGING == 1
129 
131  void set_logTextOut_OutputPort(
132  FwIndexType portNum,
133  Fw::InputLogTextPort* port
134  );
135 
136 #endif
137 
140  FwIndexType portNum,
141  Fw::InputPrmGetPort* port
142  );
143 
146  FwIndexType portNum,
147  Fw::InputPrmSetPort* port
148  );
149 
152  FwIndexType portNum,
153  Fw::InputTimePort* port
154  );
155 
158  FwIndexType portNum,
159  Fw::InputTlmPort* port
160  );
161 
162  public:
163 
164  // ----------------------------------------------------------------------
165  // Connect typed input ports to typed output ports
166  // ----------------------------------------------------------------------
167 
170  FwIndexType portNum,
172  );
173 
176  FwIndexType portNum,
178  );
179 
182  FwIndexType portNum,
184  );
185 
186 #if FW_PORT_SERIALIZATION
187 
188  public:
189 
190  // ----------------------------------------------------------------------
191  // Connect serial input ports to special output ports
192  // ----------------------------------------------------------------------
193 
196  FwIndexType portNum,
197  Fw::InputSerializePort* port
198  );
199 
200 #if FW_ENABLE_TEXT_LOGGING == 1
201 
203  void set_logTextOut_OutputPort(
204  FwIndexType portNum,
205  Fw::InputSerializePort* port
206  );
207 
208 #endif
209 
212  FwIndexType portNum,
213  Fw::InputSerializePort* port
214  );
215 
218  FwIndexType portNum,
219  Fw::InputSerializePort* port
220  );
221 
224  FwIndexType portNum,
225  Fw::InputSerializePort* port
226  );
227 
228 #endif
229 
230 #if FW_PORT_SERIALIZATION
231 
232  public:
233 
234  // ----------------------------------------------------------------------
235  // Connect serial input ports to typed output ports
236  // ----------------------------------------------------------------------
237 
240  FwIndexType portNum,
241  Fw::InputSerializePort* port
242  );
243 
246  FwIndexType portNum,
247  Fw::InputSerializePort* port
248  );
249 
250 #endif
251 
252  protected:
253 
254  // ----------------------------------------------------------------------
255  // Component construction and destruction
256  // ----------------------------------------------------------------------
257 
260  const char* compName = ""
261  );
262 
265 
266  protected:
267 
268  // ----------------------------------------------------------------------
269  // Getters for numbers of typed input ports
270  // ----------------------------------------------------------------------
271 
276 
281 
282  protected:
283 
284  // ----------------------------------------------------------------------
285  // Getters for numbers of special output ports
286  // ----------------------------------------------------------------------
287 
292 
293 #if FW_ENABLE_TEXT_LOGGING == 1
294 
298  FwIndexType getNum_logTextOut_OutputPorts() const;
299 
300 #endif
301 
306 
311 
316 
321 
322  protected:
323 
324  // ----------------------------------------------------------------------
325  // Getters for numbers of typed output ports
326  // ----------------------------------------------------------------------
327 
332 
337 
342 
343  protected:
344 
345  // ----------------------------------------------------------------------
346  // Connection status queries for special output ports
347  // ----------------------------------------------------------------------
348 
353  FwIndexType portNum
354  );
355 
356 #if FW_ENABLE_TEXT_LOGGING == 1
357 
361  bool isConnected_logTextOut_OutputPort(
362  FwIndexType portNum
363  );
364 
365 #endif
366 
371  FwIndexType portNum
372  );
373 
378  FwIndexType portNum
379  );
380 
385  FwIndexType portNum
386  );
387 
392  FwIndexType portNum
393  );
394 
395  protected:
396 
397  // ----------------------------------------------------------------------
398  // Connection status queries for typed output ports
399  // ----------------------------------------------------------------------
400 
405  FwIndexType portNum
406  );
407 
412  FwIndexType portNum
413  );
414 
419  FwIndexType portNum
420  );
421 
422  protected:
423 
424  // ----------------------------------------------------------------------
425  // Handlers to implement for typed input ports
426  // ----------------------------------------------------------------------
427 
429  virtual void dataIn_handler(
430  FwIndexType portNum,
431  Fw::Buffer& data,
432  const ComCfg::FrameContext& context
433  ) = 0;
434 
436  virtual void dataReturnIn_handler(
437  FwIndexType portNum,
438  Fw::Buffer& data,
439  const ComCfg::FrameContext& context
440  ) = 0;
441 
442  protected:
443 
444  // ----------------------------------------------------------------------
445  // Port handler base-class functions for typed input ports
446  //
447  // Call these functions directly to bypass the corresponding ports
448  // ----------------------------------------------------------------------
449 
451  void dataIn_handlerBase(
452  FwIndexType portNum,
453  Fw::Buffer& data,
454  const ComCfg::FrameContext& context
455  );
456 
459  FwIndexType portNum,
460  Fw::Buffer& data,
461  const ComCfg::FrameContext& context
462  );
463 
464  protected:
465 
466  // ----------------------------------------------------------------------
467  // Invocation functions for typed output ports
468  // ----------------------------------------------------------------------
469 
471  void dataOut_out(
472  FwIndexType portNum,
473  Fw::Buffer& data,
474  const ComCfg::FrameContext& context
475  );
476 
478  void dataReturnOut_out(
479  FwIndexType portNum,
480  Fw::Buffer& data,
481  const ComCfg::FrameContext& context
482  );
483 
486  FwIndexType portNum,
487  const ComCfg::APID& apid,
488  U16 sequenceCount
489  );
490 
491  protected:
492 
493  // ----------------------------------------------------------------------
494  // Event logging functions
495  // ----------------------------------------------------------------------
496 
501  U16 transmitted,
502  FwSizeType actual
503  ) const;
504 
505  protected:
506 
507  // ----------------------------------------------------------------------
508  // Time
509  // ----------------------------------------------------------------------
510 
514  Fw::Time getTime() const;
515 
516  protected:
517 
518  // ----------------------------------------------------------------------
519  // Mutex operations for guarded ports
520  //
521  // You can override these operations to provide more sophisticated
522  // synchronization
523  // ----------------------------------------------------------------------
524 
526  virtual void lock();
527 
529  virtual void unLock();
530 
531  private:
532 
533  // ----------------------------------------------------------------------
534  // Calls for messages received on typed input ports
535  // ----------------------------------------------------------------------
536 
538  static void m_p_dataIn_in(
539  Fw::PassiveComponentBase* callComp,
540  FwIndexType portNum,
541  Fw::Buffer& data,
542  const ComCfg::FrameContext& context
543  );
544 
546  static void m_p_dataReturnIn_in(
547  Fw::PassiveComponentBase* callComp,
548  FwIndexType portNum,
549  Fw::Buffer& data,
550  const ComCfg::FrameContext& context
551  );
552 
553  private:
554 
555  // ----------------------------------------------------------------------
556  // Typed input ports
557  // ----------------------------------------------------------------------
558 
561 
564 
565  private:
566 
567  // ----------------------------------------------------------------------
568  // Special output ports
569  // ----------------------------------------------------------------------
570 
572  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
573 
574 #if FW_ENABLE_TEXT_LOGGING == 1
575 
577  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
578 
579 #endif
580 
582  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
583 
585  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
586 
588  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
589 
591  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
592 
593  private:
594 
595  // ----------------------------------------------------------------------
596  // Typed output ports
597  // ----------------------------------------------------------------------
598 
601 
604 
607 
608  private:
609 
610  // ----------------------------------------------------------------------
611  // Mutexes
612  // ----------------------------------------------------------------------
613 
615  Os::Mutex m_guardedPortMutex;
616 
617  };
618 
619  }
620 
621 }
622 
623 #endif
PlatformSizeType FwSizeType
I32 FwEnumStoreType
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
void log_WARNING_HI_InvalidLength(U16 transmitted, FwSizeType actual) const
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void init()
Object initializer.
Definition: ObjBase.cpp:24
friend class SpacePacketDeframerTester
Friend class tester implementation to support white-box testing.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
U16 validateApidSeqCount_out(FwIndexType portNum, const ComCfg::APID &apid, U16 sequenceCount)
Invoke output port validateApidSeqCount.
SpacePacketDeframerComponentBase(const char *compName="")
Construct SpacePacketDeframerComponentBase object.
friend class SpacePacketDeframerTesterBase
Friend class tester to support autocoded test harness.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
PlatformIndexType FwIndexType
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.
void set_validateApidSeqCount_OutputPort(FwIndexType portNum, Svc::Ccsds::InputApidSequenceCountPort *port)
Connect port to validateApidSeqCount[portNum].
RateGroupDivider component implementation.
Auto-generated base for SpacePacketDeframer component.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
virtual ~SpacePacketDeframerComponentBase()
Destroy SpacePacketDeframerComponentBase object.