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"
28 
29 namespace Svc {
30 
31  namespace CCSDS {
32 
39  {
40 
41  // ----------------------------------------------------------------------
42  // Friend classes
43  // ----------------------------------------------------------------------
44 
49 
50  PROTECTED:
51 
52  // ----------------------------------------------------------------------
53  // Constants
54  // ----------------------------------------------------------------------
55 
57  enum {
60  };
61 
63  enum {
70  };
71 
73  enum {
77  };
78 
80  enum {
82  };
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Component initialization
88  // ----------------------------------------------------------------------
89 
91  void init(
92  FwEnumStoreType instance = 0
93  );
94 
95  public:
96 
97  // ----------------------------------------------------------------------
98  // Getters for typed input ports
99  // ----------------------------------------------------------------------
100 
105  FwIndexType portNum
106  );
107 
112  FwIndexType portNum
113  );
114 
115  public:
116 
117  // ----------------------------------------------------------------------
118  // Connect input ports to special output ports
119  // ----------------------------------------------------------------------
120 
123  FwIndexType portNum,
124  Fw::InputLogPort* port
125  );
126 
127 #if FW_ENABLE_TEXT_LOGGING == 1
128 
130  void set_logTextOut_OutputPort(
131  FwIndexType portNum,
132  Fw::InputLogTextPort* port
133  );
134 
135 #endif
136 
139  FwIndexType portNum,
140  Fw::InputPrmGetPort* port
141  );
142 
145  FwIndexType portNum,
146  Fw::InputPrmSetPort* port
147  );
148 
151  FwIndexType portNum,
152  Fw::InputTimePort* port
153  );
154 
157  FwIndexType portNum,
158  Fw::InputTlmPort* port
159  );
160 
161  public:
162 
163  // ----------------------------------------------------------------------
164  // Connect typed input ports to typed output ports
165  // ----------------------------------------------------------------------
166 
169  FwIndexType portNum,
171  );
172 
175  FwIndexType portNum,
177  );
178 
181  FwIndexType portNum,
183  );
184 
185 #if FW_PORT_SERIALIZATION
186 
187  public:
188 
189  // ----------------------------------------------------------------------
190  // Connect serial input ports to special output ports
191  // ----------------------------------------------------------------------
192 
195  FwIndexType portNum,
196  Fw::InputSerializePort* port
197  );
198 
199 #if FW_ENABLE_TEXT_LOGGING == 1
200 
202  void set_logTextOut_OutputPort(
203  FwIndexType portNum,
204  Fw::InputSerializePort* port
205  );
206 
207 #endif
208 
211  FwIndexType portNum,
212  Fw::InputSerializePort* port
213  );
214 
217  FwIndexType portNum,
218  Fw::InputSerializePort* port
219  );
220 
223  FwIndexType portNum,
224  Fw::InputSerializePort* port
225  );
226 
227 #endif
228 
229 #if FW_PORT_SERIALIZATION
230 
231  public:
232 
233  // ----------------------------------------------------------------------
234  // Connect serial input ports to typed output ports
235  // ----------------------------------------------------------------------
236 
239  FwIndexType portNum,
240  Fw::InputSerializePort* port
241  );
242 
245  FwIndexType portNum,
246  Fw::InputSerializePort* port
247  );
248 
249 #endif
250 
251  PROTECTED:
252 
253  // ----------------------------------------------------------------------
254  // Component construction and destruction
255  // ----------------------------------------------------------------------
256 
259  const char* compName = ""
260  );
261 
264 
265  PROTECTED:
266 
267  // ----------------------------------------------------------------------
268  // Getters for numbers of typed input ports
269  // ----------------------------------------------------------------------
270 
275 
280 
281  PROTECTED:
282 
283  // ----------------------------------------------------------------------
284  // Getters for numbers of special output ports
285  // ----------------------------------------------------------------------
286 
291 
292 #if FW_ENABLE_TEXT_LOGGING == 1
293 
297  FwIndexType getNum_logTextOut_OutputPorts() const;
298 
299 #endif
300 
305 
310 
315 
320 
321  PROTECTED:
322 
323  // ----------------------------------------------------------------------
324  // Getters for numbers of typed output ports
325  // ----------------------------------------------------------------------
326 
331 
336 
341 
342  PROTECTED:
343 
344  // ----------------------------------------------------------------------
345  // Connection status queries for special output ports
346  // ----------------------------------------------------------------------
347 
352  FwIndexType portNum
353  );
354 
355 #if FW_ENABLE_TEXT_LOGGING == 1
356 
360  bool isConnected_logTextOut_OutputPort(
361  FwIndexType portNum
362  );
363 
364 #endif
365 
370  FwIndexType portNum
371  );
372 
377  FwIndexType portNum
378  );
379 
384  FwIndexType portNum
385  );
386 
391  FwIndexType portNum
392  );
393 
394  PROTECTED:
395 
396  // ----------------------------------------------------------------------
397  // Connection status queries for typed output ports
398  // ----------------------------------------------------------------------
399 
404  FwIndexType portNum
405  );
406 
411  FwIndexType portNum
412  );
413 
418  FwIndexType portNum
419  );
420 
421  PROTECTED:
422 
423  // ----------------------------------------------------------------------
424  // Handlers to implement for typed input ports
425  // ----------------------------------------------------------------------
426 
428  virtual void dataIn_handler(
429  FwIndexType portNum,
430  Fw::Buffer& data,
431  const ComCfg::FrameContext& context
432  ) = 0;
433 
435  virtual void dataReturnIn_handler(
436  FwIndexType portNum,
437  Fw::Buffer& data,
438  const ComCfg::FrameContext& context
439  ) = 0;
440 
441  PROTECTED:
442 
443  // ----------------------------------------------------------------------
444  // Port handler base-class functions for typed input ports
445  //
446  // Call these functions directly to bypass the corresponding ports
447  // ----------------------------------------------------------------------
448 
450  void dataIn_handlerBase(
451  FwIndexType portNum,
452  Fw::Buffer& data,
453  const ComCfg::FrameContext& context
454  );
455 
458  FwIndexType portNum,
459  Fw::Buffer& data,
460  const ComCfg::FrameContext& context
461  );
462 
463  PROTECTED:
464 
465  // ----------------------------------------------------------------------
466  // Invocation functions for typed output ports
467  // ----------------------------------------------------------------------
468 
470  void dataOut_out(
471  FwIndexType portNum,
472  Fw::Buffer& data,
473  const ComCfg::FrameContext& context
474  );
475 
477  void dataReturnOut_out(
478  FwIndexType portNum,
479  Fw::Buffer& data,
480  const ComCfg::FrameContext& context
481  );
482 
485  FwIndexType portNum,
486  const ComCfg::APID& apid,
487  U16 sequenceCount
488  );
489 
490  PROTECTED:
491 
492  // ----------------------------------------------------------------------
493  // Event logging functions
494  // ----------------------------------------------------------------------
495 
500  U16 transmitted,
501  U32 actual
502  ) const;
503 
504  PROTECTED:
505 
506  // ----------------------------------------------------------------------
507  // Time
508  // ----------------------------------------------------------------------
509 
513  Fw::Time getTime() const;
514 
515  PROTECTED:
516 
517  // ----------------------------------------------------------------------
518  // Mutex operations for guarded ports
519  //
520  // You can override these operations to provide more sophisticated
521  // synchronization
522  // ----------------------------------------------------------------------
523 
525  virtual void lock();
526 
528  virtual void unLock();
529 
530  PRIVATE:
531 
532  // ----------------------------------------------------------------------
533  // Calls for messages received on typed input ports
534  // ----------------------------------------------------------------------
535 
537  static void m_p_dataIn_in(
538  Fw::PassiveComponentBase* callComp,
539  FwIndexType portNum,
540  Fw::Buffer& data,
541  const ComCfg::FrameContext& context
542  );
543 
545  static void m_p_dataReturnIn_in(
546  Fw::PassiveComponentBase* callComp,
547  FwIndexType portNum,
548  Fw::Buffer& data,
549  const ComCfg::FrameContext& context
550  );
551 
552  PRIVATE:
553 
554  // ----------------------------------------------------------------------
555  // Typed input ports
556  // ----------------------------------------------------------------------
557 
560 
563 
564  PRIVATE:
565 
566  // ----------------------------------------------------------------------
567  // Special output ports
568  // ----------------------------------------------------------------------
569 
571  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
572 
573 #if FW_ENABLE_TEXT_LOGGING == 1
574 
576  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
577 
578 #endif
579 
581  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
582 
584  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
585 
587  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
588 
590  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
591 
592  PRIVATE:
593 
594  // ----------------------------------------------------------------------
595  // Typed output ports
596  // ----------------------------------------------------------------------
597 
600 
603 
606 
607  PRIVATE:
608 
609  // ----------------------------------------------------------------------
610  // Mutexes
611  // ----------------------------------------------------------------------
612 
614  Os::Mutex m_guardedPortMutex;
615 
616  };
617 
618  }
619 
620 }
621 
622 #endif
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
Definition: Time.hpp:9
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
I32 FwEnumStoreType
Auto-generated base for SpacePacketDeframer component.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:26
U16 validateApidSeqCount_out(FwIndexType portNum, const ComCfg::APID &apid, U16 sequenceCount)
Invoke output port validateApidSeqCount.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void log_WARNING_HI_InvalidLength(U16 transmitted, U32 actual) const
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
friend class SpacePacketDeframerTester
Friend class tester implementation to support white-box testing.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
friend class SpacePacketDeframerTesterBase
Friend class tester to support autocoded test harness.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
SpacePacketDeframerComponentBase(const char *compName="")
Construct SpacePacketDeframerComponentBase object.
PlatformIndexType FwIndexType
APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF.
Definition: APIDEnumAc.hpp:17
virtual ~SpacePacketDeframerComponentBase()
Destroy SpacePacketDeframerComponentBase object.
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
void set_validateApidSeqCount_OutputPort(FwIndexType portNum, Svc::CCSDS::InputApidSequenceCountPort *port)
Connect port to validateApidSeqCount[portNum].
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.