LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
stidstrreadercardadapter.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_DEFAULTSTIDSTRREADERCARDADAPTER_HPP
8#define LOGICALACCESS_DEFAULTSTIDSTRREADERCARDADAPTER_HPP
9
12
13#include <string>
14#include <vector>
15
18
19namespace logicalaccess
20{
24typedef enum {
31 STID_CMD_RFIDCHIP = 0x06
33
37class LLA_READERS_STIDSTR_API STidSTRReaderCardAdapter : public ISO7816ReaderCardAdapter
38{
39 public:
46 bool iso7816 = false);
47
52
53 static const unsigned char SOF;
60 ByteVector adaptCommand(const ByteVector &command) override;
61
67 ByteVector adaptAnswer(const ByteVector &answer) override;
68
76 virtual ByteVector sendCommand(unsigned short commandCode, const ByteVector &command,
77 long int timeout = -1);
78
85 ByteVector sendCommand(const ByteVector &command, long timeout = -1) override;
86
92 ByteVector calculateHMAC(const ByteVector &buf) const;
93
94 protected:
95 std::shared_ptr<STidSTRReaderUnit> getSTidSTRReaderUnit() const;
96
103 ByteVector sendMessage(unsigned short commandCode, const ByteVector &command);
104
111 ByteVector receiveMessage(const ByteVector &data, unsigned char &statusCode);
112
117 void CheckError(unsigned char statusCode) const;
118
124 ByteVector getIV();
125
130
135
139 unsigned short d_lastCommandCode;
140
145};
146}
147
148#endif /* LOGICALACCESS_DEFAULTSTIDSTRREADERCARDADAPTER_H */
Buffer Helper class.
A default ISO7816 reader/card adapter class.
Definition: iso7816readercardadapter.hpp:20
A default STidSTR reader/card adapter class.
Definition: stidstrreadercardadapter.hpp:38
unsigned short d_lastCommandCode
The last command code sent.
Definition: stidstrreadercardadapter.hpp:139
ByteVector d_lastIV
The last IV to use.
Definition: stidstrreadercardadapter.hpp:144
static const unsigned char SOF
The start of message value.
Definition: stidstrreadercardadapter.hpp:53
bool d_iso7816
Use iso7816 / transparent mode.
Definition: stidstrreadercardadapter.hpp:134
STidCmdType d_adapterType
The adapter type.
Definition: stidstrreadercardadapter.hpp:129
Default ISO7816 reader/card adapter.
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Logging header.
Definition: asn1.hpp:9
STidCmdType
The STid command type.
Definition: stidstrreadercardadapter.hpp:24
@ STID_CMD_DESFIRE
Definition: stidstrreadercardadapter.hpp:27
@ STID_CMD_MIFARE_PLUS
Definition: stidstrreadercardadapter.hpp:28
@ STID_CMD_READER
Definition: stidstrreadercardadapter.hpp:25
@ STID_CMD_MIFARE_CLASSIC
Definition: stidstrreadercardadapter.hpp:26
@ STID_CMD_RESERVED
Definition: stidstrreadercardadapter.hpp:29
@ STID_CMD_MIFARE_ULTRALIGHTC
Definition: stidstrreadercardadapter.hpp:30
@ STID_CMD_RFIDCHIP
Definition: stidstrreadercardadapter.hpp:31
STidSTR Reader unit.