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

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

#include <elatecreadercardadapter.hpp>

Inheritance diagram for logicalaccess::ElatecReaderCardAdapter:
logicalaccess::ReaderCardAdapter

Public Member Functions

 ElatecReaderCardAdapter ()
 Constructor.
 
virtual ~ElatecReaderCardAdapter ()
 Destructor.
 
ByteVector adaptCommand (const ByteVector &command) override
 Adapt the command to send to the reader.
 
ByteVector adaptAnswer (const ByteVector &answer) override
 Adapt the asnwer received from the reader.
 
virtual ByteVector sendCommand (unsigned char cmdcode, const ByteVector &command, long int timeout=2000)
 Send a command to the reader.
 
virtual ByteVector sendCommand (const ByteVector &command, long timeout=-1)
 Send a command to the reader.
 
- 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.
 

Static Protected Member Functions

static unsigned char calcChecksum (const ByteVector &buf)
 Calculate the buffer checksum.
 

Protected Attributes

unsigned char d_last_cmdcode
 The last command code used.
 
- 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 Elatec reader/card adapter class.

Constructor & Destructor Documentation

◆ ElatecReaderCardAdapter()

logicalaccess::ElatecReaderCardAdapter::ElatecReaderCardAdapter ( )

Constructor.

◆ ~ElatecReaderCardAdapter()

logicalaccess::ElatecReaderCardAdapter::~ElatecReaderCardAdapter ( )
virtual

Destructor.

Member Function Documentation

◆ adaptAnswer()

ByteVector logicalaccess::ElatecReaderCardAdapter::adaptAnswer ( const ByteVector answer)
overridevirtual

Adapt the asnwer received from the reader.

Parameters
answerThe answer received.
Returns
The adapted answer received.

Reimplemented from logicalaccess::ReaderCardAdapter.

◆ adaptCommand()

ByteVector logicalaccess::ElatecReaderCardAdapter::adaptCommand ( const ByteVector command)
overridevirtual

Adapt the command to send to the reader.

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

Reimplemented from logicalaccess::ReaderCardAdapter.

◆ calcChecksum()

unsigned char logicalaccess::ElatecReaderCardAdapter::calcChecksum ( const ByteVector buf)
staticprotected

Calculate the buffer checksum.

Parameters
bufThe buffer.
Returns
The checksum value.

◆ sendCommand() [1/2]

ByteVector logicalaccess::ReaderCardAdapter::sendCommand ( const ByteVector command,
long  timeout = -1 
)
virtual

Send a command to the reader.

Parameters
commandThe command buffer.
timeoutThe command timeout.
Returns
the result of the command.

Reimplemented from logicalaccess::ReaderCardAdapter.

◆ sendCommand() [2/2]

ByteVector logicalaccess::ElatecReaderCardAdapter::sendCommand ( unsigned char  cmdcode,
const ByteVector command,
long int  timeout = 2000 
)
virtual

Send a command to the reader.

Parameters
cmdcodeThe command code.
commandThe command buffer.
timeoutThe command timeout.
Returns
The result of the command.

Member Data Documentation

◆ d_last_cmdcode

unsigned char logicalaccess::ElatecReaderCardAdapter::d_last_cmdcode
protected

The last command code used.


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