LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
logicalaccess::PCSCDataTransport Class Reference

An PCSC data transport class. More...

#include <pcscdatatransport.hpp>

Inheritance diagram for logicalaccess::PCSCDataTransport:
logicalaccess::DataTransport logicalaccess::XmlSerializable logicalaccess::PCSCControlDataTransport

Public Member Functions

 PCSCDataTransport ()
 Constructor.
 
virtual ~PCSCDataTransport ()
 Destructor.
 
std::string getTransportType () const override
 Get the transport type of this instance.
 
bool connect () override
 
void disconnect () override
 
bool isConnected () override
 
std::shared_ptr< PCSCReaderUnitgetPCSCReaderUnit () const
 Get the PC/SC reader unit.
 
std::string getName () const override
 Get the data transport endpoint name.
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize the current object to XML.
 
void unSerialize (boost::property_tree::ptree &node) override
 UnSerialize a XML node to the current object.
 
std::string getDefaultXmlNodeName () const override
 Get the default Xml Node name for this object.
 
void send (const ByteVector &data) override
 
ByteVector receive (long int timeout) override
 
- Public Member Functions inherited from logicalaccess::DataTransport
virtual ~DataTransport ()=default
 
virtual std::shared_ptr< ReaderUnitgetReaderUnit () 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.
 
- Public Member Functions inherited from logicalaccess::XmlSerializable
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.
 

Static Public Member Functions

static void CheckCardError (unsigned int errorFlag)
 Check the card error and throw exception if needed.
 
- Static Public Member Functions inherited from logicalaccess::XmlSerializable
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.
 

Protected Attributes

bool d_isConnected
 
ByteVector d_response
 
- Protected Attributes inherited from logicalaccess::DataTransport
std::weak_ptr< ReaderUnitd_ReaderUnit
 The reader unit.
 
ByteVector d_lastResult
 The last result.
 
ByteVector d_lastCommand
 The last command.
 

Additional Inherited Members

virtual void send (const ByteVector &data)=0
 
virtual ByteVector receive (long int timeout)=0
 
- Static Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 

Detailed Description

An PCSC data transport class.

Constructor & Destructor Documentation

◆ PCSCDataTransport()

logicalaccess::PCSCDataTransport::PCSCDataTransport ( )

Constructor.

◆ ~PCSCDataTransport()

logicalaccess::PCSCDataTransport::~PCSCDataTransport ( )
virtual

Destructor.

Member Function Documentation

◆ CheckCardError()

void logicalaccess::PCSCDataTransport::CheckCardError ( unsigned int  errorFlag)
static

Check the card error and throw exception if needed.

Parameters
errorFlagThe error flag.

◆ connect()

bool logicalaccess::PCSCDataTransport::connect ( )
overridevirtual
Parameters
Connectto the transport layer.
Returns
True on success, false otherwise.

Implements logicalaccess::DataTransport.

◆ disconnect()

void logicalaccess::PCSCDataTransport::disconnect ( )
overridevirtual
Parameters
Disconnectfrom the transport layer.

Implements logicalaccess::DataTransport.

◆ getDefaultXmlNodeName()

std::string logicalaccess::PCSCDataTransport::getDefaultXmlNodeName ( ) const
overridevirtual

Get the default Xml Node name for this object.

Returns
The Xml node name.

Implements logicalaccess::XmlSerializable.

◆ getName()

std::string logicalaccess::PCSCDataTransport::getName ( ) const
overridevirtual

Get the data transport endpoint name.

Returns
The data transport endpoint name.

Implements logicalaccess::DataTransport.

◆ getPCSCReaderUnit()

std::shared_ptr< PCSCReaderUnit > logicalaccess::PCSCDataTransport::getPCSCReaderUnit ( ) const
inline

Get the PC/SC reader unit.

Returns
The PC/SC reader unit.

◆ getTransportType()

std::string logicalaccess::PCSCDataTransport::getTransportType ( ) const
inlineoverridevirtual

Get the transport type of this instance.

Returns
The transport type.

Implements logicalaccess::DataTransport.

◆ isConnected()

bool logicalaccess::PCSCDataTransport::isConnected ( )
overridevirtual

\briaf Get if connected to the transport layer.

Returns
True if connected, false otherwise.

Implements logicalaccess::DataTransport.

◆ receive()

ByteVector logicalaccess::PCSCDataTransport::receive ( long int  timeout)
overridevirtual

◆ send()

void logicalaccess::PCSCDataTransport::send ( const ByteVector data)
overridevirtual

◆ serialize()

void logicalaccess::PCSCDataTransport::serialize ( boost::property_tree::ptree &  parentNode)
overridevirtual

Serialize the current object to XML.

Parameters
parentNodeThe parent node.

Implements logicalaccess::XmlSerializable.

◆ unSerialize()

void logicalaccess::PCSCDataTransport::unSerialize ( boost::property_tree::ptree &  node)
overridevirtual

UnSerialize a XML node to the current object.

Parameters
nodeThe XML node.

Implements logicalaccess::XmlSerializable.

Member Data Documentation

◆ d_isConnected

bool logicalaccess::PCSCDataTransport::d_isConnected
protected

◆ d_response

ByteVector logicalaccess::PCSCDataTransport::d_response
protected

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