BAOS SDK v2  1.0.1
An SDK providing access to IP-BAOS devices through BAOS binary protocol version 2.x
PacketizerBase Class Referenceabstract

To find packets in the TCP byte stream a pattern and the following toatl packet length are used. More...

#include <baos/ip/TcpIO.h>

+ Inheritance diagram for PacketizerBase:

Public Types

using UPtr = std::unique_ptr< PacketizerBase >
 Alias for a std::unique_ptr to this class.
 

Public Member Functions

 PacketizerBase (const Buffer &startPattern, std::uint16_t sizePosition, std::uint16_t sizeBytes)
 Construct a new Packetizer Base object from a given pattern. More...
 
virtual bool packetize (const Buffer &buf, std::uint16_t bufferSize, std::int32_t &offset, std::uint16_t &length)=0
 

Protected Attributes

const Buffer startPattern_
 The pattern which marks the beginning of a packet in the byte stream.
 
const std::int32_t sizePosition_ {-1}
 The 0 based index of the total size information in packet.
 
const std::uint16_t sizeBytes_ {0}
 From how many bytes is the total size composed.
 

Detailed Description

To find packets in the TCP byte stream a pattern and the following toatl packet length are used.

Provides information about a specific pattern to find packets in the TCP stream

Constructor & Destructor Documentation

◆ PacketizerBase()

PacketizerBase ( const Buffer startPattern,
std::uint16_t  sizePosition,
std::uint16_t  sizeBytes 
)
inline

Construct a new Packetizer Base object from a given pattern.

Parameters
startPatternA Buffer containing the bytes which mark the beginning of a packet
sizePositionThe 0 based index of the total size information in packet
sizeBytesFrom how many bytes is the total size composed

Member Function Documentation

◆ packetize()

virtual bool packetize ( const Buffer buf,
std::uint16_t  bufferSize,
std::int32_t &  offset,
std::uint16_t &  length 
)
pure virtual
Parameters
bufreference to the buffer in which the packet should be found
bufferSizethe actual size of the buffer
offset[out] if a packet was found the start offset of it
length[out] if a packet was found the length of the packet(overall)
Returns
true if packet was found false otherwise

Implemented in KnxNetIPPacketizer.


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