F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FprimeDeframerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FprimeDeframerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FprimeDeframer component base class
5 // ======================================================================
6 
7 #ifndef Svc_FprimeDeframerComponentAc_HPP
8 #define Svc_FprimeDeframerComponentAc_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/Time/TimePortAc.hpp"
22 #include "Os/Mutex.hpp"
24 
25 namespace Svc {
26 
34  {
35 
36  // ----------------------------------------------------------------------
37  // Friend classes
38  // ----------------------------------------------------------------------
39 
43  friend class FprimeDeframerTester;
44 
45  PROTECTED:
46 
47  // ----------------------------------------------------------------------
48  // Constants
49  // ----------------------------------------------------------------------
50 
52  enum {
55  };
56 
58  enum {
62  };
63 
65  enum {
68  };
69 
71  enum {
76  };
77 
78  public:
79 
80  // ----------------------------------------------------------------------
81  // Component initialization
82  // ----------------------------------------------------------------------
83 
85  void init(
86  FwEnumStoreType instance = 0
87  );
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Getters for typed input ports
93  // ----------------------------------------------------------------------
94 
99  FwIndexType portNum
100  );
101 
106  FwIndexType portNum
107  );
108 
109  public:
110 
111  // ----------------------------------------------------------------------
112  // Connect input ports to special output ports
113  // ----------------------------------------------------------------------
114 
117  FwIndexType portNum,
118  Fw::InputLogPort* port
119  );
120 
121 #if FW_ENABLE_TEXT_LOGGING == 1
122 
124  void set_logTextOut_OutputPort(
125  FwIndexType portNum,
126  Fw::InputLogTextPort* port
127  );
128 
129 #endif
130 
133  FwIndexType portNum,
134  Fw::InputTimePort* port
135  );
136 
137  public:
138 
139  // ----------------------------------------------------------------------
140  // Connect typed input ports to typed output ports
141  // ----------------------------------------------------------------------
142 
145  FwIndexType portNum,
147  );
148 
151  FwIndexType portNum,
153  );
154 
155 #if FW_PORT_SERIALIZATION
156 
157  public:
158 
159  // ----------------------------------------------------------------------
160  // Connect serial input ports to special output ports
161  // ----------------------------------------------------------------------
162 
165  FwIndexType portNum,
166  Fw::InputSerializePort* port
167  );
168 
169 #if FW_ENABLE_TEXT_LOGGING == 1
170 
172  void set_logTextOut_OutputPort(
173  FwIndexType portNum,
174  Fw::InputSerializePort* port
175  );
176 
177 #endif
178 
181  FwIndexType portNum,
182  Fw::InputSerializePort* port
183  );
184 
185 #endif
186 
187 #if FW_PORT_SERIALIZATION
188 
189  public:
190 
191  // ----------------------------------------------------------------------
192  // Connect serial input ports to typed output ports
193  // ----------------------------------------------------------------------
194 
197  FwIndexType portNum,
198  Fw::InputSerializePort* port
199  );
200 
203  FwIndexType portNum,
204  Fw::InputSerializePort* port
205  );
206 
207 #endif
208 
209  PROTECTED:
210 
211  // ----------------------------------------------------------------------
212  // Component construction and destruction
213  // ----------------------------------------------------------------------
214 
217  const char* compName = ""
218  );
219 
222 
223  PROTECTED:
224 
225  // ----------------------------------------------------------------------
226  // Getters for numbers of typed input ports
227  // ----------------------------------------------------------------------
228 
233 
238 
239  PROTECTED:
240 
241  // ----------------------------------------------------------------------
242  // Getters for numbers of special output ports
243  // ----------------------------------------------------------------------
244 
249 
250 #if FW_ENABLE_TEXT_LOGGING == 1
251 
255  FwIndexType getNum_logTextOut_OutputPorts() const;
256 
257 #endif
258 
263 
264  PROTECTED:
265 
266  // ----------------------------------------------------------------------
267  // Getters for numbers of typed output ports
268  // ----------------------------------------------------------------------
269 
274 
279 
280  PROTECTED:
281 
282  // ----------------------------------------------------------------------
283  // Connection status queries for special output ports
284  // ----------------------------------------------------------------------
285 
290  FwIndexType portNum
291  );
292 
293 #if FW_ENABLE_TEXT_LOGGING == 1
294 
298  bool isConnected_logTextOut_OutputPort(
299  FwIndexType portNum
300  );
301 
302 #endif
303 
308  FwIndexType portNum
309  );
310 
311  PROTECTED:
312 
313  // ----------------------------------------------------------------------
314  // Connection status queries for typed output ports
315  // ----------------------------------------------------------------------
316 
321  FwIndexType portNum
322  );
323 
328  FwIndexType portNum
329  );
330 
331  PROTECTED:
332 
333  // ----------------------------------------------------------------------
334  // Handlers to implement for typed input ports
335  // ----------------------------------------------------------------------
336 
338  virtual void dataIn_handler(
339  FwIndexType portNum,
340  Fw::Buffer& data,
341  const ComCfg::FrameContext& context
342  ) = 0;
343 
345  virtual void dataReturnIn_handler(
346  FwIndexType portNum,
347  Fw::Buffer& data,
348  const ComCfg::FrameContext& context
349  ) = 0;
350 
351  PROTECTED:
352 
353  // ----------------------------------------------------------------------
354  // Port handler base-class functions for typed input ports
355  //
356  // Call these functions directly to bypass the corresponding ports
357  // ----------------------------------------------------------------------
358 
360  void dataIn_handlerBase(
361  FwIndexType portNum,
362  Fw::Buffer& data,
363  const ComCfg::FrameContext& context
364  );
365 
368  FwIndexType portNum,
369  Fw::Buffer& data,
370  const ComCfg::FrameContext& context
371  );
372 
373  PROTECTED:
374 
375  // ----------------------------------------------------------------------
376  // Invocation functions for typed output ports
377  // ----------------------------------------------------------------------
378 
380  void dataOut_out(
381  FwIndexType portNum,
382  Fw::Buffer& data,
383  const ComCfg::FrameContext& context
384  );
385 
387  void dataReturnOut_out(
388  FwIndexType portNum,
389  Fw::Buffer& data,
390  const ComCfg::FrameContext& context
391  );
392 
393  PROTECTED:
394 
395  // ----------------------------------------------------------------------
396  // Event logging functions
397  // ----------------------------------------------------------------------
398 
403 
407  void log_WARNING_HI_InvalidStartWord() const;
408 
413 
417  void log_WARNING_HI_InvalidChecksum() const;
418 
419  PROTECTED:
420 
421  // ----------------------------------------------------------------------
422  // Time
423  // ----------------------------------------------------------------------
424 
428  Fw::Time getTime() const;
429 
430  PROTECTED:
431 
432  // ----------------------------------------------------------------------
433  // Mutex operations for guarded ports
434  //
435  // You can override these operations to provide more sophisticated
436  // synchronization
437  // ----------------------------------------------------------------------
438 
440  virtual void lock();
441 
443  virtual void unLock();
444 
445  PRIVATE:
446 
447  // ----------------------------------------------------------------------
448  // Calls for messages received on typed input ports
449  // ----------------------------------------------------------------------
450 
452  static void m_p_dataIn_in(
453  Fw::PassiveComponentBase* callComp,
454  FwIndexType portNum,
455  Fw::Buffer& data,
456  const ComCfg::FrameContext& context
457  );
458 
460  static void m_p_dataReturnIn_in(
461  Fw::PassiveComponentBase* callComp,
462  FwIndexType portNum,
463  Fw::Buffer& data,
464  const ComCfg::FrameContext& context
465  );
466 
467  PRIVATE:
468 
469  // ----------------------------------------------------------------------
470  // Typed input ports
471  // ----------------------------------------------------------------------
472 
475 
478 
479  PRIVATE:
480 
481  // ----------------------------------------------------------------------
482  // Special output ports
483  // ----------------------------------------------------------------------
484 
486  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
487 
488 #if FW_ENABLE_TEXT_LOGGING == 1
489 
491  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
492 
493 #endif
494 
496  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
497 
498  PRIVATE:
499 
500  // ----------------------------------------------------------------------
501  // Typed output ports
502  // ----------------------------------------------------------------------
503 
506 
509 
510  PRIVATE:
511 
512  // ----------------------------------------------------------------------
513  // Mutexes
514  // ----------------------------------------------------------------------
515 
517  Os::Mutex m_guardedPortMutex;
518 
519  };
520 
521 }
522 
523 #endif
bool isConnected_logOut_OutputPort(FwIndexType portNum)
Definition: Time.hpp:9
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
I32 FwEnumStoreType
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
An invalid frame was received (checksum mismatch)
An invalid frame was received (too short to be a frame)
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:26
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
FprimeDeframerComponentBase(const char *compName="")
Construct FprimeDeframerComponentBase object.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
Auto-generated base for FprimeDeframer component.
friend class FprimeDeframerTester
Friend class tester implementation to support white-box testing.
friend class FprimeDeframerTesterBase
Friend class tester to support autocoded test harness.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
An invalid frame was received (start word is wrong)
virtual ~FprimeDeframerComponentBase()
Destroy FprimeDeframerComponentBase object.
virtual void lock()
Lock the guarded mutex.
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.
PlatformIndexType FwIndexType
Type used to pass context info between components during framing/deframing.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
RateGroupDivider component implementation.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
virtual void unLock()
Unlock the guarded mutex.