F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TlmPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TlmPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Tlm port
5 // ======================================================================
6 
7 #ifndef Fw_TlmPortAc_HPP
8 #define Fw_TlmPortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
14 #include "Fw/FPrimeBasicTypes.hpp"
17 #include "Fw/Time/Time.hpp"
18 #include "Fw/Tlm/TlmBuffer.hpp"
20 #include "Fw/Types/String.hpp"
22 
23 namespace Fw {
24 
27  class InputTlmPort :
28  public Fw::InputPortBase
29  {
30 
31  public:
32 
33  // ----------------------------------------------------------------------
34  // Constants
35  // ----------------------------------------------------------------------
36 
37  enum {
40  sizeof(FwChanIdType) +
43  };
44 
45  public:
46 
47  // ----------------------------------------------------------------------
48  // Types
49  // ----------------------------------------------------------------------
50 
52  typedef void (*CompFuncPtr)(
53  Fw::PassiveComponentBase* callComp,
54  FwIndexType portNum,
55  FwChanIdType id,
56  Fw::Time& timeTag,
57  Fw::TlmBuffer& val
58  );
59 
60  public:
61 
62  // ----------------------------------------------------------------------
63  // Input Port Member functions
64  // ----------------------------------------------------------------------
65 
67  InputTlmPort();
68 
70  void init();
71 
73  void addCallComp(
74  Fw::PassiveComponentBase* callComp,
75  CompFuncPtr funcPtr
76  );
77 
79  void invoke(
80  FwChanIdType id,
81  Fw::Time& timeTag,
82  Fw::TlmBuffer& val
83  );
84 
85  private:
86 
87 #if FW_PORT_SERIALIZATION == 1
88 
90  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
91 
92 #endif
93 
94  private:
95 
96  // ----------------------------------------------------------------------
97  // Member variables
98  // ----------------------------------------------------------------------
99 
101  CompFuncPtr m_func;
102 
103  };
104 
108  public Fw::OutputPortBase
109  {
110 
111  public:
112 
113  // ----------------------------------------------------------------------
114  // Output Port Member functions
115  // ----------------------------------------------------------------------
116 
118  OutputTlmPort();
119 
121  void init();
122 
124  void addCallPort(
125  InputTlmPort* callPort
126  );
127 
129  void invoke(
130  FwChanIdType id,
131  Fw::Time& timeTag,
132  Fw::TlmBuffer& val
133  ) const;
134 
135  private:
136 
137  // ----------------------------------------------------------------------
138  // Member variables
139  // ----------------------------------------------------------------------
140 
142  InputTlmPort* m_port;
143 
144  };
145 
146 }
147 
148 #endif
Definition: Time.hpp:9
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:62
U32 FwChanIdType
The type of a telemetry channel identifier.
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
The port callback function type.
Definition: TlmPortAc.hpp:52
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void init()
Initialization function.
Definition: TlmPortAc.cpp:56
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
InputTlmPort()
Constructor.
Definition: TlmPortAc.cpp:48
SerializeStatus
forward declaration for string
The size of the serial representations of the port arguments.
Definition: TlmPortAc.hpp:39
OutputTlmPort()
Constructor.
Definition: TlmPortAc.cpp:136
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
PlatformIndexType FwIndexType
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Definition: TlmPortAc.cpp:76