LibLogicalAccess
2.5.0
An Open Source RFID Library
|
A data transport base class. It provide an abstraction layer between the host and readers. More...
#include <datatransport.hpp>
Public Member Functions | |
virtual | ~DataTransport ()=default |
virtual std::shared_ptr< ReaderUnit > | getReaderUnit () const |
Get the reader unit. | |
virtual void | setReaderUnit (std::weak_ptr< ReaderUnit > unit) |
Set the reader unit. | |
virtual std::string | getTransportType () const =0 |
Get the transport type of this instance. | |
virtual bool | connect ()=0 |
Connect to the transport layer. | |
virtual void | disconnect ()=0 |
Disconnect from the transport layer. | |
virtual bool | isConnected ()=0 |
virtual std::string | getName () const =0 |
Get the data transport endpoint name. | |
virtual ByteVector | sendCommand (const ByteVector &command, long int timeout=-1) |
Send a command to the reader. | |
virtual ByteVector | getLastCommand () |
Get the last command. | |
virtual ByteVector | getLastResult () |
Get the last command result. | |
![]() | |
virtual | ~XmlSerializable ()=default |
virtual std::string | serialize () |
Serialize object to Xml Node string. | |
virtual std::string | serializeWithHeaders () |
Serialize object to Xml Node string, with xml headers. | |
virtual void | serialize (boost::property_tree::ptree &parentNode)=0 |
Serialize object to Xml Node. | |
virtual void | serializeToFile (const std::string &filename) |
Serialize object to a Xml file. | |
virtual void | unSerialize (boost::property_tree::ptree &node)=0 |
UnSerialize object from a Xml Node. | |
virtual void | unSerialize (const std::string &xmlstring, const std::string &rootNode) |
UnSerialize object from a Xml Node string. | |
virtual void | unSerialize (std::istream &is, const std::string &rootNode) |
UnSerialize object from a Xml node. | |
virtual void | unSerialize (boost::property_tree::ptree &node, const std::string &rootNode) |
UnSerialize object from a Xml node. | |
virtual void | unSerializeFromFile (const std::string &filename) |
UnSerialize object from a Xml file. | |
virtual std::string | getDefaultXmlNodeName () const =0 |
Get the default Xml Node name for this object. | |
Protected Member Functions | |
virtual void | send (const ByteVector &data)=0 |
virtual ByteVector | receive (long int timeout)=0 |
Protected Attributes | |
std::weak_ptr< ReaderUnit > | d_ReaderUnit |
The reader unit. | |
ByteVector | d_lastResult |
The last result. | |
ByteVector | d_lastCommand |
The last command. | |
Additional Inherited Members | |
![]() | |
static std::string | removeXmlDeclaration (const std::string &xmlstring) |
Remove Xml declaration from a xml string. | |
static ByteVector | formatHexString (std::string hexstr) |
Format hex string to hex string with space. | |
![]() | |
static unsigned long long | atoull (const std::string &str) |
A data transport base class. It provide an abstraction layer between the host and readers.
|
virtualdefault |
|
pure virtual |
Connect to the transport layer.
Implemented in logicalaccess::DummyDataTransport, logicalaccess::SerialPortDataTransport, logicalaccess::TCPDataTransport, logicalaccess::UDPDataTransport, logicalaccess::LibUSBDataTransport, and logicalaccess::PCSCDataTransport.
|
pure virtual |
Disconnect from the transport layer.
Implemented in logicalaccess::DummyDataTransport, logicalaccess::SerialPortDataTransport, logicalaccess::TCPDataTransport, logicalaccess::UDPDataTransport, logicalaccess::LibUSBDataTransport, and logicalaccess::PCSCDataTransport.
|
inlinevirtual |
Get the last command.
|
inlinevirtual |
Get the last command result.
|
pure virtual |
Get the data transport endpoint name.
Implemented in logicalaccess::DummyDataTransport, logicalaccess::SerialPortDataTransport, logicalaccess::TCPDataTransport, logicalaccess::UDPDataTransport, logicalaccess::LibUSBDataTransport, and logicalaccess::PCSCDataTransport.
|
inlinevirtual |
Get the reader unit.
|
pure virtual |
Get the transport type of this instance.
Implemented in logicalaccess::DummyDataTransport, logicalaccess::SerialPortDataTransport, logicalaccess::TCPDataTransport, logicalaccess::UDPDataTransport, logicalaccess::DeisterSerialPortDataTransport, logicalaccess::ElatecSerialPortDataTransport, logicalaccess::GunneboSerialPortDataTransport, logicalaccess::LibUSBDataTransport, logicalaccess::OSDPSerialPortDataTransport, logicalaccess::PCSCControlDataTransport, logicalaccess::PCSCDataTransport, and logicalaccess::STidSTRSerialPortDataTransport.
|
pure virtual |
\briaf Get if connected to the transport layer.
Implemented in logicalaccess::DummyDataTransport, logicalaccess::SerialPortDataTransport, logicalaccess::TCPDataTransport, logicalaccess::UDPDataTransport, logicalaccess::LibUSBDataTransport, and logicalaccess::PCSCDataTransport.
|
protectedpure virtual |
|
protectedpure virtual |
|
virtual |
Send a command to the reader.
command | The command buffer. |
timeout | The command timeout. |
|
inlinevirtual |
Set the reader unit.
unit | The reader unit. |
|
protected |
The last command.
|
protected |
The last result.
|
protected |
The reader unit.