F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TcDeframerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TcDeframerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for TcDeframer component base class
5 // ======================================================================
6 
7 #ifndef Svc_CCSDS_TcDeframerComponentAc_HPP
8 #define Svc_CCSDS_TcDeframerComponentAc_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 
46  friend class TcDeframerTesterBase;
48  friend class TcDeframerTester;
49 
50  PROTECTED:
51 
52  // ----------------------------------------------------------------------
53  // Constants
54  // ----------------------------------------------------------------------
55 
57  enum {
60  };
61 
63  enum {
70  };
71 
73  enum {
76  };
77 
79  enum {
84  };
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Component initialization
90  // ----------------------------------------------------------------------
91 
93  void init(
94  FwEnumStoreType instance = 0
95  );
96 
97  public:
98 
99  // ----------------------------------------------------------------------
100  // Getters for typed input ports
101  // ----------------------------------------------------------------------
102 
107  FwIndexType portNum
108  );
109 
114  FwIndexType portNum
115  );
116 
117  public:
118 
119  // ----------------------------------------------------------------------
120  // Connect input ports to special output ports
121  // ----------------------------------------------------------------------
122 
125  FwIndexType portNum,
126  Fw::InputLogPort* port
127  );
128 
129 #if FW_ENABLE_TEXT_LOGGING == 1
130 
132  void set_logTextOut_OutputPort(
133  FwIndexType portNum,
134  Fw::InputLogTextPort* port
135  );
136 
137 #endif
138 
141  FwIndexType portNum,
142  Fw::InputPrmGetPort* port
143  );
144 
147  FwIndexType portNum,
148  Fw::InputPrmSetPort* port
149  );
150 
153  FwIndexType portNum,
154  Fw::InputTimePort* port
155  );
156 
159  FwIndexType portNum,
160  Fw::InputTlmPort* port
161  );
162 
163  public:
164 
165  // ----------------------------------------------------------------------
166  // Connect typed input ports to typed output ports
167  // ----------------------------------------------------------------------
168 
171  FwIndexType portNum,
173  );
174 
177  FwIndexType portNum,
179  );
180 
181 #if FW_PORT_SERIALIZATION
182 
183  public:
184 
185  // ----------------------------------------------------------------------
186  // Connect serial input ports to special output ports
187  // ----------------------------------------------------------------------
188 
191  FwIndexType portNum,
192  Fw::InputSerializePort* port
193  );
194 
195 #if FW_ENABLE_TEXT_LOGGING == 1
196 
198  void set_logTextOut_OutputPort(
199  FwIndexType portNum,
200  Fw::InputSerializePort* port
201  );
202 
203 #endif
204 
207  FwIndexType portNum,
208  Fw::InputSerializePort* port
209  );
210 
213  FwIndexType portNum,
214  Fw::InputSerializePort* port
215  );
216 
219  FwIndexType portNum,
220  Fw::InputSerializePort* port
221  );
222 
223 #endif
224 
225 #if FW_PORT_SERIALIZATION
226 
227  public:
228 
229  // ----------------------------------------------------------------------
230  // Connect serial input ports to typed output ports
231  // ----------------------------------------------------------------------
232 
235  FwIndexType portNum,
236  Fw::InputSerializePort* port
237  );
238 
241  FwIndexType portNum,
242  Fw::InputSerializePort* port
243  );
244 
245 #endif
246 
247  PROTECTED:
248 
249  // ----------------------------------------------------------------------
250  // Component construction and destruction
251  // ----------------------------------------------------------------------
252 
255  const char* compName = ""
256  );
257 
259  virtual ~TcDeframerComponentBase();
260 
261  PROTECTED:
262 
263  // ----------------------------------------------------------------------
264  // Getters for numbers of typed input ports
265  // ----------------------------------------------------------------------
266 
271 
276 
277  PROTECTED:
278 
279  // ----------------------------------------------------------------------
280  // Getters for numbers of special output ports
281  // ----------------------------------------------------------------------
282 
287 
288 #if FW_ENABLE_TEXT_LOGGING == 1
289 
293  FwIndexType getNum_logTextOut_OutputPorts() const;
294 
295 #endif
296 
301 
306 
311 
316 
317  PROTECTED:
318 
319  // ----------------------------------------------------------------------
320  // Getters for numbers of typed output ports
321  // ----------------------------------------------------------------------
322 
327 
332 
333  PROTECTED:
334 
335  // ----------------------------------------------------------------------
336  // Connection status queries for special output ports
337  // ----------------------------------------------------------------------
338 
343  FwIndexType portNum
344  );
345 
346 #if FW_ENABLE_TEXT_LOGGING == 1
347 
351  bool isConnected_logTextOut_OutputPort(
352  FwIndexType portNum
353  );
354 
355 #endif
356 
361  FwIndexType portNum
362  );
363 
368  FwIndexType portNum
369  );
370 
375  FwIndexType portNum
376  );
377 
382  FwIndexType portNum
383  );
384 
385  PROTECTED:
386 
387  // ----------------------------------------------------------------------
388  // Connection status queries for typed output ports
389  // ----------------------------------------------------------------------
390 
395  FwIndexType portNum
396  );
397 
402  FwIndexType portNum
403  );
404 
405  PROTECTED:
406 
407  // ----------------------------------------------------------------------
408  // Handlers to implement for typed input ports
409  // ----------------------------------------------------------------------
410 
412  virtual void dataIn_handler(
413  FwIndexType portNum,
414  Fw::Buffer& data,
415  const ComCfg::FrameContext& context
416  ) = 0;
417 
419  virtual void dataReturnIn_handler(
420  FwIndexType portNum,
421  Fw::Buffer& data,
422  const ComCfg::FrameContext& context
423  ) = 0;
424 
425  PROTECTED:
426 
427  // ----------------------------------------------------------------------
428  // Port handler base-class functions for typed input ports
429  //
430  // Call these functions directly to bypass the corresponding ports
431  // ----------------------------------------------------------------------
432 
434  void dataIn_handlerBase(
435  FwIndexType portNum,
436  Fw::Buffer& data,
437  const ComCfg::FrameContext& context
438  );
439 
442  FwIndexType portNum,
443  Fw::Buffer& data,
444  const ComCfg::FrameContext& context
445  );
446 
447  PROTECTED:
448 
449  // ----------------------------------------------------------------------
450  // Invocation functions for typed output ports
451  // ----------------------------------------------------------------------
452 
454  void dataOut_out(
455  FwIndexType portNum,
456  Fw::Buffer& data,
457  const ComCfg::FrameContext& context
458  );
459 
461  void dataReturnOut_out(
462  FwIndexType portNum,
463  Fw::Buffer& data,
464  const ComCfg::FrameContext& context
465  );
466 
467  PROTECTED:
468 
469  // ----------------------------------------------------------------------
470  // Event logging functions
471  // ----------------------------------------------------------------------
472 
477  U16 transmitted,
478  U16 configured
479  ) const;
480 
485  U16 transmitted,
486  FwSizeType actual
487  ) const;
488 
493  U16 transmitted,
494  U16 configured
495  ) const;
496 
501  U16 transmitted,
502  U16 computed
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 
605  PRIVATE:
606 
607  // ----------------------------------------------------------------------
608  // Mutexes
609  // ----------------------------------------------------------------------
610 
612  Os::Mutex m_guardedPortMutex;
613 
614  };
615 
616  }
617 
618 }
619 
620 #endif
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
Definition: Time.hpp:9
bool isConnected_prmSetOut_OutputPort(FwIndexType portNum)
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
PlatformSizeType FwSizeType
I32 FwEnumStoreType
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
Auto-generated base for TcDeframer component.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
friend class TcDeframerTester
Friend class tester implementation to support white-box testing.
bool isConnected_prmGetOut_OutputPort(FwIndexType portNum)
void log_WARNING_LO_InvalidSpacecraftId(U16 transmitted, U16 configured) const
friend class TcDeframerTesterBase
Friend class tester to support autocoded test harness.
void init()
Object initializer.
Definition: ObjBase.cpp:26
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void log_WARNING_HI_InvalidCrc(U16 transmitted, U16 computed) const
void log_WARNING_HI_InvalidFrameLength(U16 transmitted, FwSizeType actual) const
virtual void lock()
Lock the guarded mutex.
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
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_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.
virtual ~TcDeframerComponentBase()
Destroy TcDeframerComponentBase object.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
virtual void unLock()
Unlock the guarded mutex.
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
TcDeframerComponentBase(const char *compName="")
Construct TcDeframerComponentBase object.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
void log_ACTIVITY_LO_InvalidVcId(U16 transmitted, U16 configured) const