LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
stidstrreaderunit.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_STIDSTRREADERUNIT_HPP
8#define LOGICALACCESS_STIDSTRREADERUNIT_HPP
9
12
13namespace logicalaccess
14{
18typedef enum {
19 STID_BR_9600 = 0x00,
23 STID_BR_115200 = 0x04
25
29typedef enum {
32 0x01,
34 STID_TS_RESET_ALL = 0x03
36
40class LLA_READERS_STIDSTR_API STidSTRReaderUnit : public ISO7816ReaderUnit
41{
42 public:
47
51 virtual ~STidSTRReaderUnit();
52
57 std::string getName() const override;
58
63 std::string getConnectedName() override;
64
69 void setCardType(std::string cardType) override;
70
80 bool waitInsertion(unsigned int maxwait) override;
81
90 bool waitRemoval(unsigned int maxwait) override;
91
97 std::shared_ptr<Chip> createChip(std::string type) override;
98
103 std::shared_ptr<Chip> getSingleChip() override;
104
109 std::vector<std::shared_ptr<Chip>> getChipList() override;
110
115 virtual std::shared_ptr<STidSTRReaderCardAdapter>
116 getDefaultSTidSTRReaderCardAdapter();
117
125 bool connect() override;
126
133 void disconnect() override;
134
139 bool isConnected() override;
140
145 bool connectToReader() override;
146
150 void disconnectFromReader() override;
151
156 ByteVector getPingCommand() const override;
157
162 std::string getReaderSerialNumber() override;
163
168 void serialize(boost::property_tree::ptree &parentNode) override;
169
174 void unSerialize(boost::property_tree::ptree &node) override;
175
176 std::shared_ptr<STidSTRReaderUnitConfiguration> getSTidSTRConfiguration();
177
182 std::shared_ptr<STidSTRReaderProvider> getSTidSTRReaderProvider() const;
183
188 std::shared_ptr<Chip> scan14443A();
189
194 std::shared_ptr<Chip> scanARaw();
195
200 std::shared_ptr<Chip> scan14443B();
201
209 ByteVector authenticateReader1(bool isHMAC);
210
217 ByteVector authenticateReader2(const ByteVector &data);
218
223 void ResetAuthenticate();
224
230 void ChangeReaderKeys(const ByteVector &key_hmac, const ByteVector &key_aes);
231
236 void setBaudRate(STidBaudrate baudrate);
237
242 void set485Address(unsigned char address);
243
248 {
252 unsigned char version;
253
258
262 unsigned char rs485Address;
263
267 float voltage;
268 };
269
274 STidSTRInformation getReaderInformaton();
275
285 void setAllowedCommModes(bool plainComm, bool signedComm, bool cipheredComm);
286
292 void setTamperSwitchSettings(bool useTamperSwitch, STidTamperSwitchBehavior behavior);
293
300 void getTamperSwitchInfos(bool &useTamperSwitch, STidTamperSwitchBehavior &behavior,
301 bool &swChanged);
302
306 void loadSKB();
307
313 {
314 return d_sessionKey_hmac;
315 }
316
322 {
323 return d_sessionKey_aes;
324 }
325
326 protected:
330 void authenticateHMAC();
331
335 void authenticateAES();
336
341
346};
347}
348
349#endif
The ISO7816 reader unit class.
Definition: iso7816readerunit.hpp:25
The STidSTR reader unit class.
Definition: stidstrreaderunit.hpp:41
ByteVector d_sessionKey_aes
The AES session key.
Definition: stidstrreaderunit.hpp:345
ByteVector d_sessionKey_hmac
The HMAC session key.
Definition: stidstrreaderunit.hpp:340
ByteVector getSessionKeyAES() const
The the AES session key.
Definition: stidstrreaderunit.hpp:321
ByteVector getSessionKeyHMAC() const
The the HMAC session key.
Definition: stidstrreaderunit.hpp:312
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9
STidTamperSwitchBehavior
The STid tamper switch behavior.
Definition: stidstrreaderunit.hpp:29
@ STID_TS_RESET_ALL
Definition: stidstrreaderunit.hpp:34
@ STID_TS_NOTHING
Definition: stidstrreaderunit.hpp:30
@ STID_TS_RESET_CONFIG
Definition: stidstrreaderunit.hpp:31
@ STID_TS_RESET_KEYS
Definition: stidstrreaderunit.hpp:33
STidBaudrate
The STid baudrates.
Definition: stidstrreaderunit.hpp:18
@ STID_BR_57600
Definition: stidstrreaderunit.hpp:22
@ STID_BR_115200
Definition: stidstrreaderunit.hpp:23
@ STID_BR_9600
Definition: stidstrreaderunit.hpp:19
@ STID_BR_38400
Definition: stidstrreaderunit.hpp:21
@ STID_BR_19200
Definition: stidstrreaderunit.hpp:20
STidSTR reader information.
Definition: stidstrreaderunit.hpp:248
unsigned char version
The reader version;.
Definition: stidstrreaderunit.hpp:252
unsigned char rs485Address
The RS485 reader address.
Definition: stidstrreaderunit.hpp:262
float voltage
The power voltage actually used on the reader.
Definition: stidstrreaderunit.hpp:267
STidBaudrate baudrate
The reader baudrate use for serial communication.
Definition: stidstrreaderunit.hpp:257