BAOS SDK  18.2.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
kdrive::baos::PacketFactory12 Class Reference

PacketFactory12. More...

#include <Protocol12.h>

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

Public Types

typedef std::shared_ptr< DataRequestDataRequestPtr
 

Public Member Functions

 PacketFactory12 ()
 
virtual ~PacketFactory12 ()
 
std::shared_ptr< connector::Packet > create (const unsigned char *buffer, std::size_t bufferLength) override
 To determine if a packet is an error response we check the length If the packet has a length of 5 bytes it is a potential error response However there are several valid responses that also have a length of 5 bytes So we additionally check the error code. More...
 
- Public Member Functions inherited from kdrive::baos::BaosPacketFactory
 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...
 

Static Public Member Functions

static DataRequestPtr createDataRequest ()
 

Additional Inherited Members

- Protected Member Functions inherited from kdrive::baos::BaosPacketFactory
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

PacketFactory12.

Member Typedef Documentation

Constructor & Destructor Documentation

PacketFactory12::PacketFactory12 ( )
PacketFactory12::~PacketFactory12 ( )
virtual

Member Function Documentation

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

To determine if a packet is an error response we check the length If the packet has a length of 5 bytes it is a potential error response However there are several valid responses that also have a length of 5 bytes So we additionally check the error code.

If it is non-zero and number of items is 0 we set it as a error response packet otherwise it gets processed as normal

DataRequest::Ptr PacketFactory12::createDataRequest ( )
static

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