A connector has a PacketFactory which converts a raw byte stream into a known packet type.
More...
#include <BaosPacketFactory.h>
|
| 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...
|
|
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
BaosPacketFactory::BaosPacketFactory |
( |
| ) |
|
BaosPacketFactory::~BaosPacketFactory |
( |
| ) |
|
|
virtual |
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: