BAOS SDK  18.2.0
Public Member Functions | Protected Member Functions | List of all members
kdrive::baos::BaosPacketFactory Class Reference

A connector has a PacketFactory which converts a raw byte stream into a known packet type. More...

#include <BaosPacketFactory.h>

Inheritance diagram for kdrive::baos::BaosPacketFactory:
kdrive::baos::PacketFactory12 kdrive::baos::PacketFactory2x

Public Member Functions

 BaosPacketFactory ()
 
virtual ~BaosPacketFactory ()
 
std::shared_ptr< connector::Packet > create (const unsigned char *buffer, std::size_t bufferLength) override
 Creates the packet type from a corresponding byte stream Actually, this simply returns an UnknownPacket and should be overridden by the specific protocol packet factory. More...
 

Protected Member Functions

std::shared_ptr< DataPacketcreateFromSubService (unsigned char subService, unsigned char errorCode)
 Creates a packet based on the subService command If errorCode represents an error, a ErrorResponse will be created. More...
 

Detailed Description

A connector has a PacketFactory which converts a raw byte stream into a known packet type.

There are several baos packet types defined in this library, such as the DataRequest, DataResponse, DatapointValueIndication and ServerItemIndication This class is responsible for decoding the byte stream and creating the corresponding packet container

Constructor & Destructor Documentation

BaosPacketFactory::BaosPacketFactory ( )
BaosPacketFactory::~BaosPacketFactory ( )
virtual

Member Function Documentation

Packet::Ptr BaosPacketFactory::create ( const unsigned char *  buffer,
std::size_t  bufferLength 
)
override

Creates the packet type from a corresponding byte stream Actually, this simply returns an UnknownPacket and should be overridden by the specific protocol packet factory.

DataPacket::Ptr BaosPacketFactory::createFromSubService ( unsigned char  subService,
unsigned char  errorCode 
)
protected

Creates a packet based on the subService command If errorCode represents an error, a ErrorResponse will be created.


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