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

Class which contains a Packet. More...

#include <eoPacket.h>

Public Member Functions

 eoPacket ()
 
 eoPacket (uint8_t *dataBuffer, uint16_t size)
 
 eoPacket (uint16_t size)
 
 eoPacket (const eoPacket &packet)
 
uint16_t getBufferSize () const
 
uint8_t copyTo (eoPacket &packet)
 

Public Attributes

uint8_t * data
 
uint16_t dataLength
 
uint8_t optionalLength
 
uint8_t type
 

Detailed Description

Class which contains a Packet.

Packets are used for the communication with the connected EnOcean Device via ESP3. linuxPacketStream_example.cpp

Examples:
linuxPacketStream_example.cpp, and packetStream_example.cpp.

Constructor & Destructor Documentation

◆ eoPacket() [1/4]

eoPacket::eoPacket ( )

The base constructor for Packet will allocate 550bytes for the internal dataBuffer. 550bytes is enough for ESP 3 (1.17), if you need more or less you can always use Packet(uint16_t size);

◆ eoPacket() [2/4]

eoPacket::eoPacket ( uint8_t *  dataBuffer,
uint16_t  size 
)

This constructor allows the User to set the dataBuffer Pointer as he wants The dataBuffer, will not be deleted in this case, in the destructor.

Parameters
dataBufferPointer to dataBuffer
sizesize of the buffer

◆ eoPacket() [3/4]

eoPacket::eoPacket ( uint16_t  size)

This constructor automatically allocates size bytes as dataBuffer

Parameters
sizebytes to allocate

◆ eoPacket() [4/4]

eoPacket::eoPacket ( const eoPacket packet)

This is copy constructor automatically allocates size bytes as dataBuffer

Parameters
packetbytes to allocate

Member Function Documentation

◆ copyTo()

uint8_t eoPacket::copyTo ( eoPacket packet)

Copies the content of this eoPacket to packet.

Returns
EO_OK
OUT_OF_RANGE if the packet.bufferSize is smaller than this eoPacket.dataLength+optionalLength

◆ getBufferSize()

uint16_t eoPacket::getBufferSize ( ) const

Returns the size of the buffer

Returns
Buffer size

Member Data Documentation

◆ data

uint8_t* eoPacket::data

Direct access to DataBuffer, can be unsafe only use it if you know what you do!

Examples:
linuxPacketStream_example.cpp, packetStream_example.cpp, and vld_example.cpp.

◆ dataLength

uint16_t eoPacket::dataLength

Sets or get the DataLength of the Packet

Examples:
linuxPacketStream_example.cpp, and packetStream_example.cpp.

◆ optionalLength

uint8_t eoPacket::optionalLength

Sets or get the Optional DataLength of the Packet

Examples:
linuxPacketStream_example.cpp, and packetStream_example.cpp.

◆ type

uint8_t eoPacket::type