Represents a memory buffer containing a message.
More...
#include <erpc_message_buffer.hpp>
Represents a memory buffer containing a message.
The MessageBuffer object does not own the buffer memory. It simply provides an interface to accessing that memory in a convenient manner.
erpc::MessageBuffer::MessageBuffer |
( |
void |
| ) |
|
|
inline |
Constructor.
This function initializes object attributes.
erpc::MessageBuffer::MessageBuffer |
( |
uint8_t * |
buffer, |
|
|
uint16_t |
length |
|
) |
| |
|
inline |
Constructor.
This function initializes object attributes.
- Parameters
-
[in] | buffer | Pointer to buffer. |
[in] | length | Length of buffer. |
void erpc::MessageBuffer::set |
( |
uint8_t * |
buffer, |
|
|
uint16_t |
length |
|
) |
| |
|
inline |
This function set new buffer and his length.
This function set buffer to read/write data.
- Parameters
-
[in] | buffer | Pointer to another buffer to read/write data. |
[in] | length | Length of buffer. |
uint8_t* erpc::MessageBuffer::get |
( |
void |
| ) |
|
|
inline |
This function returns pointer to buffer to read/write.
- Returns
- Pointer to buffer to read/write.
const uint8_t* erpc::MessageBuffer::get |
( |
void |
| ) |
const |
|
inline |
This function returns pointer to buffer to read/write.
- Returns
- Pointer to buffer to read/write.
uint16_t erpc::MessageBuffer::getLength |
( |
void |
| ) |
const |
|
inline |
This function returns length of buffer.
- Returns
- Length of buffer.
uint16_t erpc::MessageBuffer::getUsed |
( |
void |
| ) |
const |
|
inline |
This function returns length of used space of buffer.
- Returns
- Length of used space of buffer.
uint16_t erpc::MessageBuffer::getFree |
( |
void |
| ) |
const |
|
inline |
This function returns length of free space of buffer.
- Returns
- Length of free space of buffer.
void MessageBuffer::setUsed |
( |
uint16_t |
used | ) |
|
This function sets length of used space of buffer.
- Parameters
-
[in] | used | Length of used space of buffer. |
erpc_status_t MessageBuffer::read |
( |
uint16_t |
offset, |
|
|
void * |
data, |
|
|
uint32_t |
length |
|
) |
| |
This function read data from local buffer.
- Parameters
-
[in] | offset | Offset in local buffer. |
[in,out] | data | Given buffer to save read data. |
[in] | length | Length of data to read. |
- Returns
- Status from reading data.
erpc_status_t MessageBuffer::write |
( |
uint16_t |
offset, |
|
|
const void * |
data, |
|
|
uint32_t |
length |
|
) |
| |
This function write data to local buffer.
- Parameters
-
[in] | offset | Offset in local buffer. |
[in,out] | data | Given buffer from which are copied data. |
[in] | length | Length of data to write. |
- Returns
- Status from reading data.
This function copy given message buffer to local instance.
- Parameters
-
[in] | other | MesageBuffer to copy. |
- Returns
- Status from reading data.
This function swap message buffer attributes between given instance and local instance.
- Parameters
-
[in] | other | MesageBuffer to swap. |
uint8_t& erpc::MessageBuffer::operator[] |
( |
int |
index | ) |
|
|
inline |
Array operator return value of buffer at given index.
- Parameters
-
[in] | index | Index in buffer. |
const uint8_t& erpc::MessageBuffer::operator[] |
( |
int |
index | ) |
const |
|
inline |
Array operator return value of buffer at given index.
- Parameters
-
[in] | index | Index in buffer. |
The documentation for this class was generated from the following files: