F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  const ComBuffer& operator=(const ComBuffer& other);
34 
35  NATIVE_UINT_TYPE getBuffCapacity(void) const; // !< returns capacity, not current size, of buffer
36  U8* getBuffAddr(void);
37  const U8* getBuffAddr(void) const;
38 
39  private:
40  U8 m_data[FW_COM_BUFFER_MAX_SIZE]; // packet data buffer
41  };
42 
43 }
44 
45 #endif
Fw::ComBuffer::getBuffCapacity
NATIVE_UINT_TYPE getBuffCapacity(void) const
returns capacity, not current size, of buffer
Definition: ComBuffer.cpp:28
Fw::ComBuffer::operator=
const ComBuffer & operator=(const ComBuffer &other)
Definition: ComBuffer.cpp:22
Fw::ComBuffer::SERIALIZED_SIZE
@ SERIALIZED_SIZE
Definition: ComBuffer.hpp:26
Fw::ComBuffer::~ComBuffer
virtual ~ComBuffer()
Definition: ComBuffer.cpp:14
Fw::SerializeBufferBase
Definition: Serializable.hpp:43
Serializable.hpp
Fw::ComBuffer::getBuffAddr
U8 * getBuffAddr(void)
gets buffer address for data filling
Definition: ComBuffer.cpp:36
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
Fw::ComBuffer::SERIALIZED_TYPE_ID
@ SERIALIZED_TYPE_ID
Definition: ComBuffer.hpp:25
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
FpConfig.hpp
ISF configuration file.
FW_COM_BUFFER_MAX_SIZE
#define FW_COM_BUFFER_MAX_SIZE
Max size of Fw::Com buffer.
Definition: FpConfig.hpp:220
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
Definition: BufferGetPortAc.cpp:6
Fw::ComBuffer::ComBuffer
ComBuffer()
Definition: ComBuffer.cpp:11