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 "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Time/Time.hpp"
12 #include "Fw/Tlm/TlmBuffer.hpp"
15 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 
21 namespace Fw {
22 
25  class TlmPortBuffer :
27  {
28 
29  public:
30 
31  // ----------------------------------------------------------------------
32  // Public constants for TlmPortBuffer
33  // ----------------------------------------------------------------------
34 
37  static constexpr FwSizeType CAPACITY =
38  sizeof(FwChanIdType) +
41 
42  public:
43 
44  // ----------------------------------------------------------------------
45  // Public member functions for TlmPortBuffer
46  // ----------------------------------------------------------------------
47 
50 
51  }
52 
53  private:
54 
55  // ----------------------------------------------------------------------
56  // Private member variables
57  // ----------------------------------------------------------------------
58 
59  U8 m_buff[CAPACITY];
60 
61  };
62 
66 
67  public:
68 
69  // ----------------------------------------------------------------------
70  // Public constructors for TlmPortSerializer
71  // ----------------------------------------------------------------------
72 
75 
76  public:
77 
78  // ----------------------------------------------------------------------
79  // Public member functions for TlmPortSerializer
80  // ----------------------------------------------------------------------
81 
84  Fw::SerialBufferBase& _buffer
85  );
86 
87  public:
88 
89  // ----------------------------------------------------------------------
90  // Public static functions for TlmPortSerializer
91  // ----------------------------------------------------------------------
92 
95  FwChanIdType id,
96  Fw::Time& timeTag,
97  Fw::TlmBuffer& val,
98  Fw::SerialBufferBase& _buffer
99  );
100 
101  public:
102 
103  // ----------------------------------------------------------------------
104  // Public member variables for TlmPortSerializer
105  // ----------------------------------------------------------------------
106 
110 
111  };
112 
113 #if !FW_DIRECT_PORT_CALLS
114 
117  class InputTlmPort :
118  public Fw::InputPortBase
119  {
120 
121  public:
122 
123  // ----------------------------------------------------------------------
124  // Public types for InputTlmPort
125  // ----------------------------------------------------------------------
126 
128  typedef void (*CompFuncPtr)(
129  Fw::PassiveComponentBase* callComp,
130  FwIndexType portNum,
131  FwChanIdType id,
132  Fw::Time& timeTag,
133  Fw::TlmBuffer& val
134  );
135 
136  public:
137 
138  // ----------------------------------------------------------------------
139  // Public constructors for InputTlmPort
140  // ----------------------------------------------------------------------
141 
143  InputTlmPort();
144 
145  public:
146 
147  // ----------------------------------------------------------------------
148  // Public member functions for InputTlmPort
149  // ----------------------------------------------------------------------
150 
152  void init();
153 
155  void addCallComp(
156  Fw::PassiveComponentBase* callComp,
157  CompFuncPtr funcPtr
158  );
159 
161  void invoke(
162  FwChanIdType id,
163  Fw::Time& timeTag,
164  Fw::TlmBuffer& val
165  );
166 
167  private:
168 
169  // ----------------------------------------------------------------------
170  // Private member functions for InputTlmPort
171  // ----------------------------------------------------------------------
172 
173 #if FW_PORT_SERIALIZATION == 1
174 
177  Fw::SerializeStatus invokeSerial(
178  Fw::LinearBufferBase& _buffer
179  );
180 
181 #endif
182 
183  private:
184 
185  // ----------------------------------------------------------------------
186  // Private member variables for InputTlmPort
187  // ----------------------------------------------------------------------
188 
190  CompFuncPtr m_func;
191 
192  };
193 
197  public Fw::OutputPortBase
198  {
199 
200  public:
201 
202  // ----------------------------------------------------------------------
203  // Public constructors for OutputTlmPort
204  // ----------------------------------------------------------------------
205 
207  OutputTlmPort();
208 
209  public:
210 
211  // ----------------------------------------------------------------------
212  // Public member functions for OutputTlmPort
213  // ----------------------------------------------------------------------
214 
216  void init();
217 
219  void addCallPort(
220  InputTlmPort* callPort
221  );
222 
224  void invoke(
225  FwChanIdType id,
226  Fw::Time& timeTag,
227  Fw::TlmBuffer& val
228  ) const;
229 
230  private:
231 
232  // ----------------------------------------------------------------------
233  // Private member variables for OutputTlmPort
234  // ----------------------------------------------------------------------
235 
237  InputTlmPort* m_port;
238 
239  };
240 
241 #endif
242 
243 }
244 
245 #endif
TlmPortBuffer()
Constructor.
Definition: TlmPortAc.hpp:49
PlatformSizeType FwSizeType
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:95
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
The port callback function type.
Definition: TlmPortAc.hpp:128
static Fw::SerializeStatus serializePortArgs(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
Definition: TlmPortAc.cpp:50
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
void init()
Initialization function.
Definition: TlmPortAc.cpp:89
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
Definition: TlmPortAc.cpp:30
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
InputTlmPort()
Constructor.
Definition: TlmPortAc.cpp:77
SerializeStatus
forward declaration for string
TlmPortSerializer()
Constructor.
Definition: TlmPortAc.cpp:17
FwIdType FwChanIdType
The type of a telemetry channel identifier.
OutputTlmPort()
Constructor.
Definition: TlmPortAc.cpp:159
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
static constexpr FwSizeType CAPACITY
Definition: TlmPortAc.hpp:37
Fw::TlmBuffer m_val
Definition: TlmPortAc.hpp:109
PlatformIndexType FwIndexType
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Definition: TlmPortAc.cpp:109
Implementation of malloc based allocator.