LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
iso7816readerunit.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_ISO7816READERUNIT_HPP
8#define LOGICALACCESS_ISO7816READERUNIT_HPP
9
14
15namespace logicalaccess
16{
17class Chip;
18class SAMChip;
19class ISO7816ReaderProvider;
20
24class LLA_READERS_ISO7816_API ISO7816ReaderUnit : public ReaderUnit
25{
26 public:
27 explicit ISO7816ReaderUnit(std::string rpt);
28
29 virtual ~ISO7816ReaderUnit();
39 bool waitInsertion(unsigned int /*maxwait*/) override
40 {
41 return true;
42 }
43
52 bool waitRemoval(unsigned int /*maxwait*/) override
53 {
54 return true;
55 }
56
61 bool isConnected() override
62 {
63 return true;
64 }
65
70 void setCardType(std::string /*cardType*/) override
71 {
72 }
73
78 std::shared_ptr<Chip> getSingleChip() override;
79
84 std::vector<std::shared_ptr<Chip>> getChipList() override;
85
93 bool connect() override
94 {
95 return true;
96 }
97
101 void disconnect() override
102 {
103 }
104
105 virtual void connectToSAM();
106
111 bool connectToReader() override;
112
113 virtual void disconnectFromSAM();
114
118 void disconnectFromReader() override;
119
120 virtual void reloadReaderConfiguration();
121
126 virtual void setContext(const std::string &context);
127
132 virtual std::string getContext();
133
138 std::string getName() const override
139 {
140 return "";
141 }
142
147 std::string getReaderSerialNumber() override
148 {
149 return "";
150 }
151
152 std::shared_ptr<CardProbe> createCardProbe() override
153 {
154 return nullptr;
155 }
156
160 virtual std::shared_ptr<SAMChip> getSAMChip();
161
165 virtual void setSAMChip(std::shared_ptr<SAMChip> t);
166
170 virtual std::shared_ptr<ISO7816ReaderUnit> getSAMReaderUnit();
171
175 virtual void setSAMReaderUnit(std::shared_ptr<ISO7816ReaderUnit> t);
176
177 protected:
178 std::shared_ptr<ResultChecker> createDefaultResultChecker() const override;
179
184 std::shared_ptr<ISO7816ReaderProvider> getISO7816ReaderProvider() const;
185
190 std::shared_ptr<ISO7816ReaderUnitConfiguration> getISO7816Configuration()
191 {
192 return std::dynamic_pointer_cast<ISO7816ReaderUnitConfiguration>(
193 getConfiguration());
194 }
195
196 bool reconnect(int action) override;
197
201 std::shared_ptr<SAMChip> d_sam_chip;
202
206 std::shared_ptr<ISO7816ReaderUnit> d_sam_readerunit;
207
211 std::string d_client_context;
212
217};
218}
219
220#endif
The ISO7816 reader unit class.
Definition: iso7816readerunit.hpp:25
std::shared_ptr< ISO7816ReaderUnitConfiguration > getISO7816Configuration()
Get the ISO7816 reader unit configuration.
Definition: iso7816readerunit.hpp:190
bool isConnected() override
Check if the card is connected.
Definition: iso7816readerunit.hpp:61
std::string d_sam_client_context
The sam client context.
Definition: iso7816readerunit.hpp:216
bool connect() override
Connect to the card.
Definition: iso7816readerunit.hpp:93
bool waitInsertion(unsigned int) override
Wait for a card insertion.
Definition: iso7816readerunit.hpp:39
std::shared_ptr< ISO7816ReaderUnit > d_sam_readerunit
The SAM ReaderUnit used SAM Authentication.
Definition: iso7816readerunit.hpp:206
std::string getReaderSerialNumber() override
Get a string hexadecimal representation of the reader serial number.
Definition: iso7816readerunit.hpp:147
void disconnect() override
Disconnect from the card.
Definition: iso7816readerunit.hpp:101
void setCardType(std::string) override
Set the forced card type.
Definition: iso7816readerunit.hpp:70
std::string getName() const override
Get the reader unit name.
Definition: iso7816readerunit.hpp:138
std::shared_ptr< CardProbe > createCardProbe() override
Definition: iso7816readerunit.hpp:152
bool waitRemoval(unsigned int) override
Wait for a card removal.
Definition: iso7816readerunit.hpp:52
std::string d_client_context
The client context.
Definition: iso7816readerunit.hpp:211
std::shared_ptr< SAMChip > d_sam_chip
The SAM chip.
Definition: iso7816readerunit.hpp:201
The card types.
Definition: readerunit.hpp:42
Definition: asn1.hpp:9
Reader memory key storage description.
Reader unit.