EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoChunkMessage Class Reference

Representing part of an message. More...

#include <eoChunkMessage.h>

Inheritance diagram for eoChunkMessage:
Collaboration diagram for eoChunkMessage:

Public Member Functions

 eoChunkMessage (const eoChunkMessage &other)
 Copy Constructor. More...
 
eoReturn CopyFrom (eoAbstractMessage const &msg)
 
eoReturn CopyDataFrom (const uint8_t *const src, const uint8_t len)
 Copies len bytes of data to the internal buffer. More...
 
bool IsReceived () const
 Checks if the chunk of the message has been received. More...
 
 eoChunkMessage (uint16_t size)
 Constructor with defined size.
 
- Public Member Functions inherited from eoAbstractMessage
virtual eoReturn SetDataLength (uint16_t dataLen, bool reallocate=false)
 
virtual uint16_t GetDataLength () const
 
uint16_t GetMaxLength () const
 

Additional Inherited Members

- Public Attributes inherited from eoAbstractMessage
uint8_t * data
 Data Pointer.
 
uint16_t dataLength
 Payload data length.
 
uint16_t maxLength
 
- Protected Member Functions inherited from eoAbstractMessage
 eoAbstractMessage (uint16_t size=1)
 

Detailed Description

Representing part of an message.

this class describes the part of a chained message, this is used in the ChainedMessage to store the storage parts

Constructor & Destructor Documentation

◆ eoChunkMessage()

eoChunkMessage::eoChunkMessage ( const eoChunkMessage other)

Copy Constructor.

As the eoChained message is used inside a vector and every instance needs an own databuffer a copy constructor is used!

Parameters
other

Member Function Documentation

◆ CopyDataFrom()

eoReturn eoChunkMessage::CopyDataFrom ( const uint8_t *const  src,
const uint8_t  len 
)

Copies len bytes of data to the internal buffer.

This function will reallocalate the memory itself. The len bytes of data from the src will be copied

Parameters
srcSource data
lenx bytes to copy
Returns

◆ CopyFrom()

eoReturn eoChunkMessage::CopyFrom ( eoAbstractMessage const &  msg)

Copies from a message the data, the received flag will be set to true afterwards

Parameters
msgan eoMessage to copy from
Returns
EO_OK or error

◆ IsReceived()

bool eoChunkMessage::IsReceived ( ) const
inline

Checks if the chunk of the message has been received.

Returns
bool param