Representation of a package of data that gets transmitted e.g.
More...
#include <Imt.Base.Lib.Remoting/DataFrame.h>
Representation of a package of data that gets transmitted e.g.
over a serial connection.
◆ DataFrame()
imt::base::lib::remoting::DataFrame::DataFrame |
( |
| ) |
|
|
explicit |
◆ ~DataFrame()
virtual imt::base::lib::remoting::DataFrame::~DataFrame |
( |
| ) |
|
|
virtual |
◆ append()
bool imt::base::lib::remoting::DataFrame::append |
( |
uint8_t const |
ch | ) |
|
Appends a character at the end of this data frame.
- Parameters
-
- Returns
- True if the character could be added.
◆ appendCRC16()
bool imt::base::lib::remoting::DataFrame::appendCRC16 |
( |
uint16_t const |
initialCrcValue = 0xFFFFU | ) |
|
Calculates and appends a 2 byte crc.
- Parameters
-
initialCrcValue | seed value for the CRC16 calculation |
- Returns
- True if the CRC could be calculated and appended.
◆ checkCRC16()
bool imt::base::lib::remoting::DataFrame::checkCRC16 |
( |
uint16_t const |
initialCrcValue = 0xFFFFU | ) |
const |
Checks if the crc 16 is valid.
- Parameters
-
initialCrcValue | seed value for the CRC16 calculation |
- Returns
- True if the check succeeded, false otherwise
◆ clear()
void imt::base::lib::remoting::DataFrame::clear |
( |
| ) |
|
◆ getCapacity()
size_t imt::base::lib::remoting::DataFrame::getCapacity |
( |
| ) |
const |
Returns the maximum capacity of this data frame.
- Returns
- maximum capacity of this data frame
◆ getData()
uint8_t const* imt::base::lib::remoting::DataFrame::getData |
( |
| ) |
const |
Returns a pointer to the first character of the frame.
- Returns
- pointer to the first character of the frame
◆ getSize()
size_t imt::base::lib::remoting::DataFrame::getSize |
( |
| ) |
const |
|
inline |
Returns the current size of the data frame.
- Returns
- current size of the data frame
◆ init()
void imt::base::lib::remoting::DataFrame::init |
( |
DataFrame const & |
source | ) |
|
◆ removeCharacter()
bool imt::base::lib::remoting::DataFrame::removeCharacter |
( |
uint8_t & |
ch | ) |
|
Removes a character from the end of this data frame.
- Parameters
-
ch | The character to remove |
- Returns
- false if buffer was empty.
◆ removeCRC16()
bool imt::base::lib::remoting::DataFrame::removeCRC16 |
( |
| ) |
|
Checks and removes a 2 byte crc.
- Returns
- False if size of data frame is too small
◆ setData()
bool imt::base::lib::remoting::DataFrame::setData |
( |
uint8_t const *const |
pData, |
|
|
uint32_t const |
dataSize |
|
) |
| |
Sets data.
- Parameters
-
pData | Pointer to the data buffer to be set |
dataSize | Size of the data buffer |
- Returns
- True if the capacity was sufficient and the data could be written.
The documentation for this class was generated from the following file:
- C:/src/imt/Imt.Base-cpp/Imt.Base/Imt.Base.Lib.Remoting/DataFrame.h