F´ Flight Software - C/C++ Documentation  NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
ComBuffer.hpp
Go to the documentation of this file.
1 /*
2  * FwComBuffer.hpp
3  *
4  * Created on: May 24, 2014
5  * Author: tcanham
6  */
7 
8 /*
9  * Description:
10  * This object contains the ComBuffer type, used for sending and receiving packets from the ground
11  */
12 #ifndef FW_COM_BUFFER_HPP
13 #define FW_COM_BUFFER_HPP
14 
15 #include <FpConfig.hpp>
16 #include <Fw/Types/BasicTypes.hpp>
18 
19 namespace Fw {
20 
21  class ComBuffer : public SerializeBufferBase {
22  public:
23 
24  enum {
26  SERIALIZED_SIZE = FW_COM_BUFFER_MAX_SIZE + sizeof(FwBuffSizeType) // size of buffer + storage of size word
27  };
28 
29  ComBuffer(const U8 *args, NATIVE_UINT_TYPE size);
30  ComBuffer();
31  ComBuffer(const ComBuffer& other);
32  virtual ~ComBuffer();
33  ComBuffer& operator=(const ComBuffer& other);
34 
35  NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
36  U8* getBuffAddr();
37  const U8* getBuffAddr() const;
38 
39  private:
40  U8 m_bufferData[FW_COM_BUFFER_MAX_SIZE]; // packet data buffer
41  };
42 
43 }
44 
45 #endif
Fw::ComBuffer::~ComBuffer
virtual ~ComBuffer()
Definition: ComBuffer.cpp:14
Fw::SerializeBufferBase
Definition: Serializable.hpp:43
Serializable.hpp
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
Fw::ComBuffer::getBuffAddr
U8 * getBuffAddr()
gets buffer address for data filling
Definition: ComBuffer.cpp:36
Fw::ComBuffer::SERIALIZED_SIZE
@ SERIALIZED_SIZE
Definition: ComBuffer.hpp:26
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
FpConfig.hpp
ISF configuration file.
Fw::ComBuffer::SERIALIZED_TYPE_ID
@ SERIALIZED_TYPE_ID
Definition: ComBuffer.hpp:25
Fw::ComBuffer::operator=
ComBuffer & operator=(const ComBuffer &other)
Definition: ComBuffer.cpp:22
FW_COM_BUFFER_MAX_SIZE
#define FW_COM_BUFFER_MAX_SIZE
Max size of Fw::Com buffer.
Definition: FpConfig.hpp:221
BasicTypes.hpp
Declares ISF basic types.
FwBuffSizeType
#define FwBuffSizeType
Type representation for storing a buffer or string size.
Definition: FpConfig.hpp:79
Fw::ComBuffer
Definition: ComBuffer.hpp:21
Fw::ComBuffer::getBuffCapacity
NATIVE_UINT_TYPE getBuffCapacity() const
returns capacity, not current size, of buffer
Definition: ComBuffer.cpp:32
Fw
Definition: Buffer.cpp:21
Fw::ComBuffer::ComBuffer
ComBuffer()
Definition: ComBuffer.cpp:11