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 "FpConfig.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"
23 
24 namespace Svc {
25 
33  {
34 
35  // ----------------------------------------------------------------------
36  // Friend classes
37  // ----------------------------------------------------------------------
38 
41 
42  PROTECTED:
43 
44  // ----------------------------------------------------------------------
45  // Constants
46  // ----------------------------------------------------------------------
47 
49  enum {
51  };
52 
54  enum {
58  };
59 
61  enum {
64  };
65 
67  enum {
72  };
73 
74  public:
75 
76  // ----------------------------------------------------------------------
77  // Component initialization
78  // ----------------------------------------------------------------------
79 
81  void init(
82  FwEnumStoreType instance = 0
83  );
84 
85  public:
86 
87  // ----------------------------------------------------------------------
88  // Getters for typed input ports
89  // ----------------------------------------------------------------------
90 
95  FwIndexType portNum
96  );
97 
98  public:
99 
100  // ----------------------------------------------------------------------
101  // Connect input ports to special output ports
102  // ----------------------------------------------------------------------
103 
106  FwIndexType portNum,
107  Fw::InputLogPort* port
108  );
109 
110 #if FW_ENABLE_TEXT_LOGGING == 1
111 
113  void set_logTextOut_OutputPort(
114  FwIndexType portNum,
115  Fw::InputLogTextPort* port
116  );
117 
118 #endif
119 
122  FwIndexType portNum,
123  Fw::InputTimePort* port
124  );
125 
126  public:
127 
128  // ----------------------------------------------------------------------
129  // Connect typed input ports to typed output ports
130  // ----------------------------------------------------------------------
131 
134  FwIndexType portNum,
136  );
137 
140  FwIndexType portNum,
142  );
143 
144 #if FW_PORT_SERIALIZATION
145 
146  public:
147 
148  // ----------------------------------------------------------------------
149  // Connect serial input ports to special output ports
150  // ----------------------------------------------------------------------
151 
154  FwIndexType portNum,
155  Fw::InputSerializePort* port
156  );
157 
158 #if FW_ENABLE_TEXT_LOGGING == 1
159 
161  void set_logTextOut_OutputPort(
162  FwIndexType portNum,
163  Fw::InputSerializePort* port
164  );
165 
166 #endif
167 
170  FwIndexType portNum,
171  Fw::InputSerializePort* port
172  );
173 
174 #endif
175 
176 #if FW_PORT_SERIALIZATION
177 
178  public:
179 
180  // ----------------------------------------------------------------------
181  // Connect serial input ports to typed output ports
182  // ----------------------------------------------------------------------
183 
186  FwIndexType portNum,
187  Fw::InputSerializePort* port
188  );
189 
192  FwIndexType portNum,
193  Fw::InputSerializePort* port
194  );
195 
196 #endif
197 
198  PROTECTED:
199 
200  // ----------------------------------------------------------------------
201  // Component construction and destruction
202  // ----------------------------------------------------------------------
203 
206  const char* compName = ""
207  );
208 
211 
212  PROTECTED:
213 
214  // ----------------------------------------------------------------------
215  // Getters for numbers of typed input ports
216  // ----------------------------------------------------------------------
217 
222 
223  PROTECTED:
224 
225  // ----------------------------------------------------------------------
226  // Getters for numbers of special output ports
227  // ----------------------------------------------------------------------
228 
233 
234 #if FW_ENABLE_TEXT_LOGGING == 1
235 
239  FwIndexType getNum_logTextOut_OutputPorts() const;
240 
241 #endif
242 
247 
248  PROTECTED:
249 
250  // ----------------------------------------------------------------------
251  // Getters for numbers of typed output ports
252  // ----------------------------------------------------------------------
253 
258 
263 
264  PROTECTED:
265 
266  // ----------------------------------------------------------------------
267  // Connection status queries for special output ports
268  // ----------------------------------------------------------------------
269 
274  FwIndexType portNum
275  );
276 
277 #if FW_ENABLE_TEXT_LOGGING == 1
278 
282  bool isConnected_logTextOut_OutputPort(
283  FwIndexType portNum
284  );
285 
286 #endif
287 
292  FwIndexType portNum
293  );
294 
295  PROTECTED:
296 
297  // ----------------------------------------------------------------------
298  // Connection status queries for typed output ports
299  // ----------------------------------------------------------------------
300 
305  FwIndexType portNum
306  );
307 
312  FwIndexType portNum
313  );
314 
315  PROTECTED:
316 
317  // ----------------------------------------------------------------------
318  // Handlers to implement for typed input ports
319  // ----------------------------------------------------------------------
320 
322  virtual void framedIn_handler(
323  FwIndexType portNum,
324  Fw::Buffer& data,
325  Fw::Buffer& context
326  ) = 0;
327 
328  PROTECTED:
329 
330  // ----------------------------------------------------------------------
331  // Port handler base-class functions for typed input ports
332  //
333  // Call these functions directly to bypass the corresponding ports
334  // ----------------------------------------------------------------------
335 
338  FwIndexType portNum,
339  Fw::Buffer& data,
340  Fw::Buffer& context
341  );
342 
343  PROTECTED:
344 
345  // ----------------------------------------------------------------------
346  // Invocation functions for typed output ports
347  // ----------------------------------------------------------------------
348 
351  FwIndexType portNum,
352  Fw::Buffer& fwBuffer
353  );
354 
356  void deframedOut_out(
357  FwIndexType portNum,
358  Fw::Buffer& data,
359  Fw::Buffer& context
360  );
361 
362  PROTECTED:
363 
364  // ----------------------------------------------------------------------
365  // Event logging functions
366  // ----------------------------------------------------------------------
367 
372 
376  void log_WARNING_HI_InvalidStartWord() const;
377 
382 
386  void log_WARNING_HI_InvalidChecksum() const;
387 
388  PROTECTED:
389 
390  // ----------------------------------------------------------------------
391  // Time
392  // ----------------------------------------------------------------------
393 
397  Fw::Time getTime();
398 
399  PROTECTED:
400 
401  // ----------------------------------------------------------------------
402  // Mutex operations for guarded ports
403  //
404  // You can override these operations to provide more sophisticated
405  // synchronization
406  // ----------------------------------------------------------------------
407 
409  virtual void lock();
410 
412  virtual void unLock();
413 
414  PRIVATE:
415 
416  // ----------------------------------------------------------------------
417  // Calls for messages received on typed input ports
418  // ----------------------------------------------------------------------
419 
421  static void m_p_framedIn_in(
422  Fw::PassiveComponentBase* callComp,
423  FwIndexType portNum,
424  Fw::Buffer& data,
425  Fw::Buffer& context
426  );
427 
428  PRIVATE:
429 
430  // ----------------------------------------------------------------------
431  // Typed input ports
432  // ----------------------------------------------------------------------
433 
436 
437  PRIVATE:
438 
439  // ----------------------------------------------------------------------
440  // Special output ports
441  // ----------------------------------------------------------------------
442 
444  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
445 
446 #if FW_ENABLE_TEXT_LOGGING == 1
447 
449  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
450 
451 #endif
452 
454  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
455 
456  PRIVATE:
457 
458  // ----------------------------------------------------------------------
459  // Typed output ports
460  // ----------------------------------------------------------------------
461 
463  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
464 
467 
468  PRIVATE:
469 
470  // ----------------------------------------------------------------------
471  // Mutexes
472  // ----------------------------------------------------------------------
473 
475  Os::Mutex m_guardedPortMutex;
476 
477  };
478 
479 }
480 
481 #endif
bool isConnected_logOut_OutputPort(FwIndexType portNum)
Definition: Time.hpp:9
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
bool isConnected_deframedOut_OutputPort(FwIndexType portNum)
void framedIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, Fw::Buffer &context)
Handler base-class function for input port framedIn.
void set_deframedOut_OutputPort(FwIndexType portNum, Fw::InputDataWithContextPort *port)
Connect port to deframedOut[portNum].
An invalid frame was received (checksum mismatch)
An invalid frame was received (too short to be a frame)
I32 FwEnumStoreType
Definition: FpConfig.h:64
friend class FprimeDeframerComponentBaseFriend
Friend class for white-box testing.
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
void init()
Object initializer.
Definition: ObjBase.cpp:26
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
FprimeDeframerComponentBase(const char *compName="")
Construct FprimeDeframerComponentBase object.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
Auto-generated base for FprimeDeframer component.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
An invalid frame was received (start word is wrong)
C++-compatible configuration header for fprime configuration.
virtual ~FprimeDeframerComponentBase()
Destroy FprimeDeframerComponentBase object.
virtual void lock()
Lock the guarded mutex.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
void deframedOut_out(FwIndexType portNum, Fw::Buffer &data, Fw::Buffer &context)
Invoke output port deframedOut.
Fw::InputDataWithContextPort * get_framedIn_InputPort(FwIndexType portNum)
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
virtual void framedIn_handler(FwIndexType portNum, Fw::Buffer &data, Fw::Buffer &context)=0
Handler for input port framedIn.
virtual void unLock()
Unlock the guarded mutex.