PacketFactory12.  
 More...
#include <Protocol12.h>
 | 
|   | 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...
  | 
|   | 
|   | 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...
  | 
|   | 
      
        
          | PacketFactory12::PacketFactory12  | 
          ( | 
           | ) | 
           | 
        
      
 
 
  
  
      
        
          | PacketFactory12::~PacketFactory12  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
 
  
  
      
        
          | 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 
 
 
The documentation for this class was generated from the following files: