LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
osdpchannel.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_OSDPCHANNEL_HPP
8#define LOGICALACCESS_OSDPCHANNEL_HPP
9
12
13namespace logicalaccess
14{
16{
17 OSDP_NOCMD = 0x00,
18 OSDP_ACK = 0x40, /* General Acknowledge, Nothing to Report */
19 OSDP_NAK = 0x41, /* Negative Acknowledge – SIO Comm Handler Error Response */
20 OSDP_PDID = 0x45, /* Device Identification Report */
21 OSDP_PDCAP = 0x46, /* Device Capabilities Report */
22 OSDP_LSTATR = 0x48, /* Local Status Report */
23 OSDP_ISTATR = 0x49, /* Input Status Report */
24 OSDP_OSTATR = 0x4a, /* Output Status Report */
25 OSDP_RSTATR = 0x4b, /* Reader Status Tamper Report */
26 OSDP_RAW = 0x50, /* Card Data Report, Raw Bit Array */
27 OSDP_FMT = 0x51, /* Card Data Report, Character Array */
28 OSDP_KEYPAD = 0x53, /* Keypad Data Report */
29 OSDP_COM = 0x54, /* Communication Configuration Report */
30 OSDP_BIOREADR = 0x57, /* Biometric Data */
31 OSDP_BIOMATCHR = 0x58, /* Biometric Match Result */
32 OSDP_POLL = 0x60, /* Poll */
33 OSDP_ID = 0x61, /* ID Report Request */
34 OSDP_CAP = 0x62, /* Peripheral Device Capabilities Request */
35 OSDP_DIAG = 0x63, /* Diagnostic Function Request */
36 OSDP_LSTAT = 0x64, /* Local Status Report Request */
37 OSDP_ISTAT = 0x65, /* Input Status Report Request */
38 OSDP_OSTAT = 0x66, /* Output Status Report Request */
39 OSDP_RSTAT = 0x67, /* Reader Status Tamper Report Request */
40 OSDP_OUT = 0x68, /* Output Control Command */
41 OSDP_LED = 0x69, /* Reader LED Control Command */
42 OSDP_BUZ = 0x6a, /* Reader Buzzer Control Command */
43 OSDP_TEXT = 0x6b, /* Reader Text Output Command */
44 OSDP_COMSET = 0x6e, /* Communication Configuration Command */
45 OSDP_DATA = 0x6f, /* Data Transfer Command */
46 OSDP_PROMPT = 0x71, /* Set Automatic Reader Prompt Strings */
47 OSDP_BIOREAD = 0x73, /* Scan and send biometric data */
48 OSDP_BIOMATCH = 0x74, /* Scan and match biometric data */
49 OSDP_KEYSET = 0x75, /* Encryption Key Set */
50 OSDP_CHLNG = 0x76, /* Challenge and Secure Session Initialization Request / Client's ID and Client's Random Number Reply */
51 OSDP_SCRYPT = 0x77, /* Server's Random Number and Server Cryptogram */
52 OSDP_RMAC_I = 0x78, /* Client Cryptogram Packet and the Initial R-MAC */
53 OSDP_BUSY = 0x79, /* PD Is Busy Reply */
54 OSDP_FTSTAT = 0x7a, /* File transfer status */
55 OSDP_ACURXSIZE = 0x7b, /* Maximum Acceptable Reply Size */
56 OSDP_FILETRANSFER = 0x7c, /* File transfer Command */
57 OSDP_MFG = 0x80, /* Manufacturer Specific Command / PIV Data Response */
58 OSDP_GENAUTHR = 0x81, /* Authentication response */
59 OSDP_CRAUTHR = 0x82, /* Response to challenge */
60 OSDP_MFGREP = 0x90, /* Manufacturer Specific Reply */
61 OSDP_XWR = 0xa1, /* Extended R/W commands */
62 OSDP_ABORT = 0xa2, /* Stop Multi Part Message */
63 OSDP_PIVDATA = 0xa3, /* Get PIV Data - Not fully implemented yet */
64 OSDP_GENAUTH = 0xa4, /* General Authenticate Fragment - Not implemented */
65 OSDP_CRAUTH = 0xa5, /* Authentication Challenge Fragment - Not implemented */
66 OSDP_KEEPACTIVE = 0xa7, /* Keep secure channel active */
67 OSDP_XRD = 0xb1 /* Extended R/W commands Reply */
68};
69
73class LLA_READERS_OSDP_API OSDPChannel
74{
75 public:
80
85 {
86 }
87
88
89 ByteVector createPackage();
90
91 void unPackage(ByteVector result);
92
93
94 void setAddress(unsigned char address)
95 {
96 m_address = address;
97 }
98
99 unsigned char getAddress() const
100 {
101 return m_address;
102 }
103
104 void setSequenceNumber(unsigned char sequenceNumber)
105 {
106 m_sequenceNumber = sequenceNumber;
107 }
108
109 unsigned char getSequenceNumber() const
110 {
111 return m_sequenceNumber;
112 }
113
115 {
116 m_data = data;
117 }
118
120 {
121 return m_data;
122 }
123
125 {
126 m_reply_type = replyType;
127 }
128
130 {
131 return m_reply_type;
132 }
133
134 bool isSCB;
135
137 {
138 return m_securityBlockType;
139 }
140
142 {
143 m_securityBlockType = securityBlockType;
144 }
145
147 {
148 m_securityBlockData = data;
149 }
150
152 {
153 return m_securityBlockData;
154 }
155
156 void setInstallMode(bool installMode)
157 {
158 m_installMode = installMode;
159 }
160
161 bool getInstallMode() const
162 {
163 return m_installMode;
164 }
165
166 std::shared_ptr<OSDPSecureChannel> getSecureChannel() const
167 {
168 return m_secureChannel;
169 }
170
171 void setSecureChannel(std::shared_ptr<OSDPSecureChannel> securechannel)
172 {
173 m_secureChannel = securechannel;
174 }
175
176 private:
177 unsigned char m_address;
178
179 unsigned char m_sequenceNumber;
180
182
184
186
188
190
191 std::shared_ptr<OSDPSecureChannel> m_secureChannel;
192};
193}
194
195#endif /* LOGICALACCESS_OSDPCHANNEL_HPP */
OSDP Channel class.
Definition: osdpchannel.hpp:74
unsigned char m_address
Definition: osdpchannel.hpp:177
bool m_installMode
Definition: osdpchannel.hpp:189
OSDPCommandsType getCommandsType() const
Definition: osdpchannel.hpp:129
ByteVector m_securityBlockData
Definition: osdpchannel.hpp:187
ByteVector & getData()
Definition: osdpchannel.hpp:119
void setSequenceNumber(unsigned char sequenceNumber)
Definition: osdpchannel.hpp:104
bool isSCB
Definition: osdpchannel.hpp:134
void setSecurityBlockType(OSDPSecureChannelType securityBlockType)
Definition: osdpchannel.hpp:141
ByteVector & getSecurityBlockData()
Definition: osdpchannel.hpp:151
std::shared_ptr< OSDPSecureChannel > getSecureChannel() const
Definition: osdpchannel.hpp:166
unsigned char getSequenceNumber() const
Definition: osdpchannel.hpp:109
void setCommandsType(OSDPCommandsType replyType)
Definition: osdpchannel.hpp:124
unsigned char getAddress() const
Definition: osdpchannel.hpp:99
void setData(ByteVector data)
Definition: osdpchannel.hpp:114
unsigned char m_sequenceNumber
Definition: osdpchannel.hpp:179
std::shared_ptr< OSDPSecureChannel > m_secureChannel
Definition: osdpchannel.hpp:191
void setSecureChannel(std::shared_ptr< OSDPSecureChannel > securechannel)
Definition: osdpchannel.hpp:171
OSDPCommandsType m_reply_type
Definition: osdpchannel.hpp:183
bool getInstallMode() const
Definition: osdpchannel.hpp:161
void setAddress(unsigned char address)
Definition: osdpchannel.hpp:94
OSDPSecureChannelType getSecurityBlockType() const
Definition: osdpchannel.hpp:136
~OSDPChannel()
Destructor.
Definition: osdpchannel.hpp:84
ByteVector m_data
Definition: osdpchannel.hpp:181
void setSecurityBlockData(ByteVector data)
Definition: osdpchannel.hpp:146
OSDPSecureChannelType m_securityBlockType
Definition: osdpchannel.hpp:185
void setInstallMode(bool installMode)
Definition: osdpchannel.hpp:156
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9
OSDPCommandsType
Definition: osdpchannel.hpp:16
@ OSDP_NAK
Definition: osdpchannel.hpp:19
@ OSDP_COMSET
Definition: osdpchannel.hpp:44
@ OSDP_LED
Definition: osdpchannel.hpp:41
@ OSDP_DATA
Definition: osdpchannel.hpp:45
@ OSDP_SCRYPT
Definition: osdpchannel.hpp:51
@ OSDP_BUZ
Definition: osdpchannel.hpp:42
@ OSDP_OSTAT
Definition: osdpchannel.hpp:38
@ OSDP_CAP
Definition: osdpchannel.hpp:34
@ OSDP_KEYPAD
Definition: osdpchannel.hpp:28
@ OSDP_POLL
Definition: osdpchannel.hpp:32
@ OSDP_LSTATR
Definition: osdpchannel.hpp:22
@ OSDP_FMT
Definition: osdpchannel.hpp:27
@ OSDP_PIVDATA
Definition: osdpchannel.hpp:63
@ OSDP_PROMPT
Definition: osdpchannel.hpp:46
@ OSDP_RMAC_I
Definition: osdpchannel.hpp:52
@ OSDP_CRAUTHR
Definition: osdpchannel.hpp:59
@ OSDP_ISTAT
Definition: osdpchannel.hpp:37
@ OSDP_OUT
Definition: osdpchannel.hpp:40
@ OSDP_BIOREADR
Definition: osdpchannel.hpp:30
@ OSDP_GENAUTHR
Definition: osdpchannel.hpp:58
@ OSDP_GENAUTH
Definition: osdpchannel.hpp:64
@ OSDP_ABORT
Definition: osdpchannel.hpp:62
@ OSDP_BIOMATCH
Definition: osdpchannel.hpp:48
@ OSDP_BIOMATCHR
Definition: osdpchannel.hpp:31
@ OSDP_FILETRANSFER
Definition: osdpchannel.hpp:56
@ OSDP_DIAG
Definition: osdpchannel.hpp:35
@ OSDP_CRAUTH
Definition: osdpchannel.hpp:65
@ OSDP_KEEPACTIVE
Definition: osdpchannel.hpp:66
@ OSDP_ACURXSIZE
Definition: osdpchannel.hpp:55
@ OSDP_XWR
Definition: osdpchannel.hpp:61
@ OSDP_OSTATR
Definition: osdpchannel.hpp:24
@ OSDP_MFG
Definition: osdpchannel.hpp:57
@ OSDP_CHLNG
Definition: osdpchannel.hpp:50
@ OSDP_ACK
Definition: osdpchannel.hpp:18
@ OSDP_COM
Definition: osdpchannel.hpp:29
@ OSDP_PDID
Definition: osdpchannel.hpp:20
@ OSDP_LSTAT
Definition: osdpchannel.hpp:36
@ OSDP_ID
Definition: osdpchannel.hpp:33
@ OSDP_BIOREAD
Definition: osdpchannel.hpp:47
@ OSDP_FTSTAT
Definition: osdpchannel.hpp:54
@ OSDP_ISTATR
Definition: osdpchannel.hpp:23
@ OSDP_RSTATR
Definition: osdpchannel.hpp:25
@ OSDP_RSTAT
Definition: osdpchannel.hpp:39
@ OSDP_NOCMD
Definition: osdpchannel.hpp:17
@ OSDP_KEYSET
Definition: osdpchannel.hpp:49
@ OSDP_TEXT
Definition: osdpchannel.hpp:43
@ OSDP_MFGREP
Definition: osdpchannel.hpp:60
@ OSDP_PDCAP
Definition: osdpchannel.hpp:21
@ OSDP_XRD
Definition: osdpchannel.hpp:67
@ OSDP_BUSY
Definition: osdpchannel.hpp:53
@ OSDP_RAW
Definition: osdpchannel.hpp:26
OSDPSecureChannelType
Definition: osdpsecurechannel.hpp:18
OSDP Secure Channel.
Reader unit.