Dataflow Runtime API  3.0.1.0
Public Member Functions | List of all members
imt::base::lib::remoting::DataFrame Class Reference

Representation of a package of data that gets transmitted e.g. More...

#include <Imt.Base.Lib.Remoting/DataFrame.h>

Public Member Functions

 DataFrame (void)
 Constructor. More...
 
virtual ~DataFrame (void)
 Destructor. More...
 
void init (const DataFrame &source)
 Initiae DataFrame with another DataFrame. More...
 
size_t getSize (void) const
 Returns the current size of the data frame. More...
 
size_t getCapacity (void) const
 Returns the maximum capacity of this data frame. More...
 
void clear (void)
 Clears the content of this DataFrame. More...
 
const uint8_tgetData (void) const
 Returns a pointer to the first character of the frame. More...
 
void append (const uint8_t ch)
 Appends a character at the end of this data frame. More...
 
void setData (const uint8_t *const pData, const uint32_t dataSize)
 Sets data. More...
 
bool removeCharacter (uint8_t &ch)
 Removes a character from the end of this data frame. More...
 
void appendCRC16 (const uint16_t initialCrcValue=0xFFFFU)
 Calculates and appends a 2 byte crc. More...
 
bool checkCRC16 (const uint16_t initialCrcValue=0xFFFFU) const
 Checks if the crc 16 is valid. More...
 
bool removeCRC16 (void)
 Checks and removes a 2 byte crc. More...
 

Detailed Description

Representation of a package of data that gets transmitted e.g.

over a serial connection.

Constructor & Destructor Documentation

◆ DataFrame()

imt::base::lib::remoting::DataFrame::DataFrame ( void  )
explicit

Constructor.

◆ ~DataFrame()

virtual imt::base::lib::remoting::DataFrame::~DataFrame ( void  )
virtual

Destructor.

Member Function Documentation

◆ append()

void imt::base::lib::remoting::DataFrame::append ( const uint8_t  ch)

Appends a character at the end of this data frame.

Parameters
chThe character to add

◆ appendCRC16()

void imt::base::lib::remoting::DataFrame::appendCRC16 ( const uint16_t  initialCrcValue = 0xFFFFU)

Calculates and appends a 2 byte crc.

Parameters
initialCrcValueseed value for the CRC16 calculation

◆ checkCRC16()

bool imt::base::lib::remoting::DataFrame::checkCRC16 ( const uint16_t  initialCrcValue = 0xFFFFU) const

Checks if the crc 16 is valid.

Parameters
initialCrcValueseed value for the CRC16 calculation
Returns
bool True if the check succeeded, false otherwise

◆ clear()

void imt::base::lib::remoting::DataFrame::clear ( void  )

Clears the content of this DataFrame.

◆ getCapacity()

size_t imt::base::lib::remoting::DataFrame::getCapacity ( void  ) const

Returns the maximum capacity of this data frame.

Returns
maximum capacity of this data frame

◆ getData()

const uint8_t* imt::base::lib::remoting::DataFrame::getData ( void  ) 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 ( void  ) 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 ( const DataFrame source)

Initiae DataFrame with another DataFrame.

Parameters
sourceThe DataFrame to initiate this

◆ removeCharacter()

bool imt::base::lib::remoting::DataFrame::removeCharacter ( uint8_t ch)

Removes a character from the end of this data frame.

Parameters
chThe character to remove
Returns
false if buffer was empty.

◆ removeCRC16()

bool imt::base::lib::remoting::DataFrame::removeCRC16 ( void  )

Checks and removes a 2 byte crc.

Returns
False if size of data frame is too small

◆ setData()

void imt::base::lib::remoting::DataFrame::setData ( const uint8_t *const  pData,
const uint32_t  dataSize 
)

Sets data.

Parameters
pDataPointer to the data buffer to be set
dataSizeSize of the data buffer

The documentation for this class was generated from the following file: