LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
id3readerunit.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#include <string>
8
9namespace logicalaccess
10{
11
42class LLA_READERS_PCSC_API ID3ReaderUnit : public PCSCReaderUnit
43{
44 public:
46 {
47 }
48
49 explicit ID3ReaderUnit(const std::string &name);
50
55 std::vector<std::shared_ptr<Chip>> getChipList() override;
56
63 std::shared_ptr<Chip> selectCard(std::shared_ptr<Chip>);
64
65 PCSCReaderUnitType getPCSCType() const override;
66
67 bool process_insertion(const std::string &cardType, unsigned int maxwait,
68 const ElapsedTimeCounter &elapsed) override;
69#ifndef SWIG
70 using PCSCReaderUnit::connect;
71#endif
72 bool connect(PCSCShareMode share_mode) override;
73
74 void disconnect() override;
75
76 protected:
77 std::shared_ptr<CardProbe> createCardProbe() override;
78
84 std::shared_ptr<Chip> selectCard(uint8_t idx);
85
92 bool select_correct_card();
93
97 void power_card(bool power_on);
98
102 ByteVector getAtr(int idx);
103
111 std::vector<CL1356PlusUtils::Info> listCards();
112
119 void unfreeze();
120
127 std::vector<std::shared_ptr<Chip>> chips_;
128
134 {
135 public:
136 explicit APDUWrapperGuard(ID3ReaderUnit *reader);
138
139 private:
141 {
142 ByteVector adaptCommand(const ByteVector &command) override;
143
144 ByteVector adaptAnswer(const ByteVector &answer) override;
145 };
146
148
149 // Previous adapter. Restored on object destruction.
150 std::shared_ptr<ReaderCardAdapter> adapter_;
151 };
152};
153}
Definition: utils.hpp:26
Definition: id3readerunit.hpp:134
ID3ReaderUnit * reader_
Definition: id3readerunit.hpp:147
std::shared_ptr< ReaderCardAdapter > adapter_
Definition: id3readerunit.hpp:150
Definition: id3readerunit.hpp:43
std::vector< std::shared_ptr< Chip > > chips_
Definition: id3readerunit.hpp:127
virtual ~ID3ReaderUnit()
Definition: id3readerunit.hpp:45
The PC/SC reader unit class.
Definition: pcscreaderunit.hpp:23
A reader/card adapter base class. It provide an abstraction layer between the card and the reader to ...
Definition: readercardadapter.hpp:20
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9
PCSCReaderUnitType
The reader unit types.
Definition: pcscreaderunitconfiguration.hpp:54
PCSCShareMode
Share mode enumeration.
Definition: pcscreaderunitconfiguration.hpp:35
PC/SC Reader unit.
Reader/card adapter.