F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CmdResponsePortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CmdResponsePortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for CmdResponse port
5 // ======================================================================
6 
7 #ifndef Fw_CmdResponsePortAc_HPP
8 #define Fw_CmdResponsePortAc_HPP
9 
11 #include "Fw/FPrimeBasicTypes.hpp"
14 #if !FW_DIRECT_PORT_CALLS
18 #endif
19 
20 namespace Fw {
21 
26  {
27 
28  public:
29 
30  // ----------------------------------------------------------------------
31  // Public constants for CmdResponsePortBuffer
32  // ----------------------------------------------------------------------
33 
36  static constexpr FwSizeType CAPACITY =
37  sizeof(FwOpcodeType) +
38  sizeof(U32) +
40 
41  public:
42 
43  // ----------------------------------------------------------------------
44  // Public member functions for CmdResponsePortBuffer
45  // ----------------------------------------------------------------------
46 
49 
50  }
51 
52  private:
53 
54  // ----------------------------------------------------------------------
55  // Private member variables
56  // ----------------------------------------------------------------------
57 
58  U8 m_buff[CAPACITY];
59 
60  };
61 
65 
66  public:
67 
68  // ----------------------------------------------------------------------
69  // Public constructors for CmdResponsePortSerializer
70  // ----------------------------------------------------------------------
71 
74 
75  public:
76 
77  // ----------------------------------------------------------------------
78  // Public member functions for CmdResponsePortSerializer
79  // ----------------------------------------------------------------------
80 
83  Fw::SerialBufferBase& _buffer
84  );
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Public static functions for CmdResponsePortSerializer
90  // ----------------------------------------------------------------------
91 
94  FwOpcodeType opCode,
95  U32 cmdSeq,
96  const Fw::CmdResponse& response,
97  Fw::SerialBufferBase& _buffer
98  );
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Public member variables for CmdResponsePortSerializer
104  // ----------------------------------------------------------------------
105 
107  U32 m_cmdSeq;
109 
110  };
111 
112 #if !FW_DIRECT_PORT_CALLS
113 
117  public Fw::InputPortBase
118  {
119 
120  public:
121 
122  // ----------------------------------------------------------------------
123  // Public types for InputCmdResponsePort
124  // ----------------------------------------------------------------------
125 
127  typedef void (*CompFuncPtr)(
128  Fw::PassiveComponentBase* callComp,
129  FwIndexType portNum,
130  FwOpcodeType opCode,
131  U32 cmdSeq,
132  const Fw::CmdResponse& response
133  );
134 
135  public:
136 
137  // ----------------------------------------------------------------------
138  // Public constructors for InputCmdResponsePort
139  // ----------------------------------------------------------------------
140 
143 
144  public:
145 
146  // ----------------------------------------------------------------------
147  // Public member functions for InputCmdResponsePort
148  // ----------------------------------------------------------------------
149 
151  void init();
152 
154  void addCallComp(
155  Fw::PassiveComponentBase* callComp,
156  CompFuncPtr funcPtr
157  );
158 
160  void invoke(
161  FwOpcodeType opCode,
162  U32 cmdSeq,
163  const Fw::CmdResponse& response
164  );
165 
166  private:
167 
168  // ----------------------------------------------------------------------
169  // Private member functions for InputCmdResponsePort
170  // ----------------------------------------------------------------------
171 
172 #if FW_PORT_SERIALIZATION == 1
173 
176  Fw::SerializeStatus invokeSerial(
177  Fw::LinearBufferBase& _buffer
178  );
179 
180 #endif
181 
182  private:
183 
184  // ----------------------------------------------------------------------
185  // Private member variables for InputCmdResponsePort
186  // ----------------------------------------------------------------------
187 
189  CompFuncPtr m_func;
190 
191  };
192 
196  public Fw::OutputPortBase
197  {
198 
199  public:
200 
201  // ----------------------------------------------------------------------
202  // Public constructors for OutputCmdResponsePort
203  // ----------------------------------------------------------------------
204 
207 
208  public:
209 
210  // ----------------------------------------------------------------------
211  // Public member functions for OutputCmdResponsePort
212  // ----------------------------------------------------------------------
213 
215  void init();
216 
218  void addCallPort(
219  InputCmdResponsePort* callPort
220  );
221 
223  void invoke(
224  FwOpcodeType opCode,
225  U32 cmdSeq,
226  const Fw::CmdResponse& response
227  ) const;
228 
229  private:
230 
231  // ----------------------------------------------------------------------
232  // Private member variables for OutputCmdResponsePort
233  // ----------------------------------------------------------------------
234 
236  InputCmdResponsePort* m_port;
237 
238  };
239 
240 #endif
241 
242 }
243 
244 #endif
static Fw::SerializeStatus serializePortArgs(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
FwIdType FwOpcodeType
The type of a command opcode.
PlatformSizeType FwSizeType
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
The port callback function type.
Enum representing a command response.
InputCmdResponsePort()
Constructor.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke a port interface.
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
CmdResponsePortBuffer()
Constructor.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
static constexpr FwSizeType CAPACITY
void init()
Initialization function.
The size of the serial representation.
PlatformIndexType FwIndexType
void init()
Initialization function.
Implementation of malloc based allocator.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.