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

A default LibUSB reader/card adapter class. More...

#include <libusbreadercardadapter.hpp>

Inheritance diagram for logicalaccess::LibUSBReaderCardAdapter:
logicalaccess::ISO7816ReaderCardAdapter logicalaccess::ReaderCardAdapter

Public Member Functions

 LibUSBReaderCardAdapter ()
 
virtual ~LibUSBReaderCardAdapter ()
 Destructor.
 
std::vector< unsigned char > adaptCommand (const std::vector< unsigned char > &command) override
 Adapt the command to send to the reader.
 
std::vector< unsigned char > adaptAnswer (const std::vector< unsigned char > &answer) override
 Adapt the asnwer received from the reader.
 
std::vector< unsigned char > sendCommand (const std::vector< unsigned char > &command, long timeout=3000) override
 
- Public Member Functions inherited from logicalaccess::ISO7816ReaderCardAdapter
virtual ISO7816Response sendAPDUCommand (const ByteVector &data)
 Send an APDU command to the reader.
 
virtual ISO7816Response sendAPDUCommand (unsigned char cla, unsigned char ins, unsigned char p1, unsigned char p2, unsigned char lc, const ByteVector &data, unsigned char le)
 Send an APDU command to the reader.
 
virtual ISO7816Response sendAPDUCommand (unsigned char cla, unsigned char ins, unsigned char p1, unsigned char p2, unsigned char lc, const ByteVector &data)
 Send an APDU command to the reader.
 
virtual ISO7816Response sendAPDUCommand (unsigned char cla, unsigned char ins, unsigned char p1, unsigned char p2, const ByteVector &data)
 Send an APDU command to the reader.
 
virtual ISO7816Response sendAPDUCommand (unsigned char cla, unsigned char ins, unsigned char p1, unsigned char p2, unsigned char lc, unsigned char le)
 Send an APDU command to the reader without data.
 
virtual ISO7816Response sendAPDUCommand (unsigned char cla, unsigned char ins, unsigned char p1, unsigned char p2, unsigned char le)
 Send an APDU command to the reader without data.
 
virtual ISO7816Response sendAPDUCommand (unsigned char cla, unsigned char ins, unsigned char p1, unsigned char p2)
 Send an APDU command to the reader without data.
 
virtual ISO7816Response sendExtendedAPDUCommand (unsigned char cla, unsigned char ins, unsigned char p1, unsigned char p2, unsigned short lc, const ByteVector &data)
 Send an extended APDU command to the reader.
 
virtual ISO7816Response sendExtendedAPDUCommand (unsigned char cla, unsigned char ins, unsigned char p1, unsigned char p2, unsigned short lc, const ByteVector &data, unsigned short le)
 Send an extended APDU command to the reader.
 
ByteVector adaptCommand (const ByteVector &command) override
 Adapt the command to send to the reader.
 
ByteVector adaptAnswer (const ByteVector &answer) override
 Adapt the answer received from the reader.
 
void setCrypto (std::shared_ptr< ISO24727Crypto > crypto)
 
- Public Member Functions inherited from logicalaccess::ReaderCardAdapter
virtual ~ReaderCardAdapter ()
 
 ReaderCardAdapter ()
 
virtual ByteVector adaptCommand (const ByteVector &command)
 Adapt the command to send to the reader.
 
virtual ByteVector adaptAnswer (const ByteVector &answer)
 Adapt the answer received from the reader.
 
std::shared_ptr< DataTransportgetDataTransport () const
 Get the data transport.
 
void setDataTransport (std::shared_ptr< DataTransport > dataTransport)
 Set the data transport.
 
virtual ByteVector sendCommand (const ByteVector &command, long timeout=-1)
 Send a command to the reader.
 
virtual std::shared_ptr< ResultCheckergetResultChecker () const
 Get the result checker.
 
virtual void setResultChecker (std::shared_ptr< ResultChecker > checker)
 Set the result checker.
 

Additional Inherited Members

- Protected Attributes inherited from logicalaccess::ReaderCardAdapter
std::shared_ptr< DataTransportd_dataTransport
 The data transport.
 
std::shared_ptr< ResultCheckerd_ResultChecker
 The result checker.
 

Detailed Description

A default LibUSB reader/card adapter class.

Constructor & Destructor Documentation

◆ LibUSBReaderCardAdapter()

logicalaccess::LibUSBReaderCardAdapter::LibUSBReaderCardAdapter ( )

\ brief Constructor.

◆ ~LibUSBReaderCardAdapter()

logicalaccess::LibUSBReaderCardAdapter::~LibUSBReaderCardAdapter ( )
virtual

Destructor.

Member Function Documentation

◆ adaptAnswer()

std::vector< unsigned char > logicalaccess::LibUSBReaderCardAdapter::adaptAnswer ( const std::vector< unsigned char > &  answer)
override

Adapt the asnwer received from the reader.

Parameters
answerThe answer received.
Returns
The adapted answer received.

◆ adaptCommand()

std::vector< unsigned char > logicalaccess::LibUSBReaderCardAdapter::adaptCommand ( const std::vector< unsigned char > &  command)
override

Adapt the command to send to the reader.

Parameters
commandThe command to send.
Returns
The adapted command to send.

◆ sendCommand()

std::vector< unsigned char > logicalaccess::LibUSBReaderCardAdapter::sendCommand ( const std::vector< unsigned char > &  command,
long  timeout = 3000 
)
override

We override this because a 0 byte return is valid with libusb.


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