Class for representing data frame.
More...
#include <dataframe.h>
Class for representing data frame.
◆ DataFrame()
Constructor.
- Parameters
-
frame | pointer to existing byte array |
size | size of buffer frame |
◆ AddFloat()
bool DataFrame::AddFloat |
( |
float |
f | ) |
|
add float value to data frame. Float value is encoded to 4 bytes according IEEE 754
- Parameters
-
d | variable added to data frame |
- Returns
- true, if it is success
◆ AddInt16()
bool DataFrame::AddInt16 |
( |
int16_t |
d | ) |
|
add 2 bytes length signed variable to data frame
- Parameters
-
d | variable added to data frame |
- Returns
- true, if it is success
◆ AddInt32()
bool DataFrame::AddInt32 |
( |
int32_t |
d | ) |
|
add 4 bytes length signed variable to data frame
- Parameters
-
d | variable added to data frame |
- Returns
- true, if it is success
◆ AddInt8()
bool DataFrame::AddInt8 |
( |
int8_t |
d | ) |
|
add one byte signed variable to data frame
- Parameters
-
d | variable added to data frame |
- Returns
- true, if it is success
◆ AddUint16()
bool DataFrame::AddUint16 |
( |
uint16_t |
d | ) |
|
add 2 Bytes length variable to dataframe
- Parameters
-
d | variable added to data frame |
- Returns
- true, if it is success
◆ AddUint32()
bool DataFrame::AddUint32 |
( |
uint32_t |
d | ) |
|
add 4 Bytes long variable to dataframe
- Parameters
-
d | variable added to data frame |
- Returns
- true, if it is success
◆ AddUint8()
bool DataFrame::AddUint8 |
( |
uint8_t |
d | ) |
|
Add one byte to data frame.
- Returns
- true, if it is success
◆ Commit()
uint8_t DataFrame::Commit |
( |
void |
| ) |
|
Commit the creation of the packet.
- add to second position (frame[1]) length of packet
- compute CRC of packet
- Returns
- real length of packet (including CRC byte)
◆ getError()
Return error status from data processing.
- Returns
- 0 - no error, 1 - internal buffer overflow. The buffer have to be increased in user code.
◆ GetFrame()
uint8_t * DataFrame::GetFrame |
( |
void |
| ) |
|
Return pointer to data frame.
- Returns
- resulting packet
◆ Init()
void DataFrame::Init |
( |
void |
| ) |
|
Initialize packet.
- set the header of packet
- reserver 1st byte to length of frame
The documentation for this class was generated from the following files: