395
|
1 /*-
|
|
2 * Free/Libre Near Field Communication (NFC) library
|
|
3 *
|
|
4 * Libnfc historical contributors:
|
|
5 * Copyright (C) 2009 Roel Verdult
|
|
6 * Copyright (C) 2009-2013 Romuald Conty
|
|
7 * Copyright (C) 2010-2012 Romain Tartière
|
|
8 * Copyright (C) 2010-2013 Philippe Teuwen
|
|
9 * Copyright (C) 2012-2013 Ludovic Rousseau
|
|
10 * See AUTHORS file for a more comprehensive list of contributors.
|
|
11 * Additional contributors of this file:
|
|
12 *
|
|
13 * This program is free software: you can redistribute it and/or modify it
|
|
14 * under the terms of the GNU Lesser General Public License as published by the
|
|
15 * Free Software Foundation, either version 3 of the License, or (at your
|
|
16 * option) any later version.
|
|
17 *
|
|
18 * This program is distributed in the hope that it will be useful, but WITHOUT
|
|
19 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
20 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
21 * more details.
|
|
22 *
|
|
23 * You should have received a copy of the GNU Lesser General Public License
|
|
24 * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
25 */
|
|
26
|
|
27 #ifdef C2NIM
|
|
28 #define nfcLib "libnfc.so.5.0.1"
|
|
29 # mangle uint8_t uint8
|
|
30 # mangle uint32_t uint32
|
|
31 # prefix nfc_
|
|
32 # dynlib nfcLib
|
|
33 # cdecl
|
|
34 #endif
|
|
35
|
|
36 /**
|
|
37 * @file nfc.h
|
|
38 * @brief libnfc interface
|
|
39 *
|
|
40 * Provide all usefull functions (API) to handle NFC devices.
|
|
41 */
|
|
42
|
|
43
|
|
44 # include <sys/time.h>
|
|
45
|
|
46 # include <stdint.h>
|
|
47 # include <stdbool.h>
|
|
48
|
|
49
|
|
50 /*-
|
|
51 * Free/Libre Near Field Communication (NFC) library
|
|
52 *
|
|
53 * Libnfc historical contributors:
|
|
54 * Copyright (C) 2009 Roel Verdult
|
|
55 * Copyright (C) 2009-2013 Romuald Conty
|
|
56 * Copyright (C) 2010-2012 Romain Tartière
|
|
57 * Copyright (C) 2010-2013 Philippe Teuwen
|
|
58 * Copyright (C) 2012-2013 Ludovic Rousseau
|
|
59 * See AUTHORS file for a more comprehensive list of contributors.
|
|
60 * Additional contributors of this file:
|
|
61 *
|
|
62 * This program is free software: you can redistribute it and/or modify it
|
|
63 * under the terms of the GNU Lesser General Public License as published by the
|
|
64 * Free Software Foundation, either version 3 of the License, or (at your
|
|
65 * option) any later version.
|
|
66 *
|
|
67 * This program is distributed in the hope that it will be useful, but WITHOUT
|
|
68 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
69 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
70 * more details.
|
|
71 *
|
|
72 * You should have received a copy of the GNU Lesser General Public License
|
|
73 * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
74 */
|
|
75 /**
|
|
76 * @file nfc-types.h
|
|
77 * @brief Define NFC types
|
|
78 */
|
|
79
|
|
80
|
|
81 #include <stddef.h>
|
|
82 #include <stdint.h>
|
|
83 #include <stdbool.h>
|
|
84 #include <stdio.h>
|
|
85
|
|
86
|
|
87 #define NFC_BUFSIZE_CONNSTRING 1024
|
|
88
|
|
89
|
|
90 /**
|
|
91 * NFC context
|
|
92 */
|
|
93 struct nfc_context;
|
|
94 typedef struct nfc_context nfc_context;
|
|
95
|
|
96 /**
|
|
97 * NFC device
|
|
98 */
|
|
99 struct nfc_device;
|
|
100 typedef struct nfc_device nfc_device;
|
|
101
|
|
102 /**
|
|
103 * NFC device driver
|
|
104 */
|
|
105 struct nfc_driver;
|
|
106 typedef struct nfc_driver nfc_driver;
|
|
107
|
|
108 /**
|
|
109 * Connection string
|
|
110 */
|
|
111 typedef char nfc_connstring[NFC_BUFSIZE_CONNSTRING];
|
|
112
|
|
113 /**
|
|
114 * Properties
|
|
115 */
|
|
116 typedef enum {
|
|
117 /**
|
|
118 * Default command processing timeout
|
|
119 * Property value's (duration) unit is ms and 0 means no timeout (infinite).
|
|
120 * Default value is set by driver layer
|
|
121 */
|
|
122 NP_TIMEOUT_COMMAND,
|
|
123 /**
|
|
124 * Timeout between ATR_REQ and ATR_RES
|
|
125 * When the device is in initiator mode, a target is considered as mute if no
|
|
126 * valid ATR_RES is received within this timeout value.
|
|
127 * Default value for this property is 103 ms on PN53x based devices.
|
|
128 */
|
|
129 NP_TIMEOUT_ATR,
|
|
130 /**
|
|
131 * Timeout value to give up reception from the target in case of no answer.
|
|
132 * Default value for this property is 52 ms).
|
|
133 */
|
|
134 NP_TIMEOUT_COM,
|
|
135 /** Let the PN53X chip handle the CRC bytes. This means that the chip appends
|
|
136 * the CRC bytes to the frames that are transmitted. It will parse the last
|
|
137 * bytes from received frames as incoming CRC bytes. They will be verified
|
|
138 * against the used modulation and protocol. If an frame is expected with
|
|
139 * incorrect CRC bytes this option should be disabled. Example frames where
|
|
140 * this is useful are the ATQA and UID+BCC that are transmitted without CRC
|
|
141 * bytes during the anti-collision phase of the ISO14443-A protocol. */
|
|
142 NP_HANDLE_CRC,
|
|
143 /** Parity bits in the network layer of ISO14443-A are by default generated and
|
|
144 * validated in the PN53X chip. This is a very convenient feature. On certain
|
|
145 * times though it is useful to get full control of the transmitted data. The
|
|
146 * proprietary MIFARE Classic protocol uses for example custom (encrypted)
|
|
147 * parity bits. For interoperability it is required to be completely
|
|
148 * compatible, including the arbitrary parity bits. When this option is
|
|
149 * disabled, the functions to communicating bits should be used. */
|
|
150 NP_HANDLE_PARITY,
|
|
151 /** This option can be used to enable or disable the electronic field of the
|
|
152 * NFC device. */
|
|
153 NP_ACTIVATE_FIELD,
|
|
154 /** The internal CRYPTO1 co-processor can be used to transmit messages
|
|
155 * encrypted. This option is automatically activated after a successful MIFARE
|
|
156 * Classic authentication. */
|
|
157 NP_ACTIVATE_CRYPTO1,
|
|
158 /** The default configuration defines that the PN53X chip will try indefinitely
|
|
159 * to invite a tag in the field to respond. This could be desired when it is
|
|
160 * certain a tag will enter the field. On the other hand, when this is
|
|
161 * uncertain, it will block the application. This option could best be compared
|
|
162 * to the (NON)BLOCKING option used by (socket)network programming. */
|
|
163 NP_INFINITE_SELECT,
|
|
164 /** If this option is enabled, frames that carry less than 4 bits are allowed.
|
|
165 * According to the standards these frames should normally be handles as
|
|
166 * invalid frames. */
|
|
167 NP_ACCEPT_INVALID_FRAMES,
|
|
168 /** If the NFC device should only listen to frames, it could be useful to let
|
|
169 * it gather multiple frames in a sequence. They will be stored in the internal
|
|
170 * FIFO of the PN53X chip. This could be retrieved by using the receive data
|
|
171 * functions. Note that if the chip runs out of bytes (FIFO = 64 bytes long),
|
|
172 * it will overwrite the first received frames, so quick retrieving of the
|
|
173 * received data is desirable. */
|
|
174 NP_ACCEPT_MULTIPLE_FRAMES,
|
|
175 /** This option can be used to enable or disable the auto-switching mode to
|
|
176 * ISO14443-4 is device is compliant.
|
|
177 * In initiator mode, it means that NFC chip will send RATS automatically when
|
|
178 * select and it will automatically poll for ISO14443-4 card when ISO14443A is
|
|
179 * requested.
|
|
180 * In target mode, with a NFC chip compliant (ie. PN532), the chip will
|
|
181 * emulate a 14443-4 PICC using hardware capability */
|
|
182 NP_AUTO_ISO14443_4,
|
|
183 /** Use automatic frames encapsulation and chaining. */
|
|
184 NP_EASY_FRAMING,
|
|
185 /** Force the chip to switch in ISO14443-A */
|
|
186 NP_FORCE_ISO14443_A,
|
|
187 /** Force the chip to switch in ISO14443-B */
|
|
188 NP_FORCE_ISO14443_B,
|
|
189 /** Force the chip to run at 106 kbps */
|
|
190 NP_FORCE_SPEED_106,
|
|
191 } nfc_property;
|
|
192
|
|
193 // Compiler directive, set struct alignment to 1 uint8_t for compatibility
|
|
194 # pragma pack(1)
|
|
195
|
|
196 /**
|
|
197 * @enum nfc_dep_mode
|
|
198 * @brief NFC D.E.P. (Data Exchange Protocol) active/passive mode
|
|
199 */
|
|
200 typedef enum {
|
|
201 NDM_UNDEFINED = 0,
|
|
202 NDM_PASSIVE,
|
|
203 NDM_ACTIVE,
|
|
204 } nfc_dep_mode;
|
|
205
|
|
206 /**
|
|
207 * @struct nfc_dep_info
|
|
208 * @brief NFC target information in D.E.P. (Data Exchange Protocol) see ISO/IEC 18092 (NFCIP-1)
|
|
209 */
|
|
210 typedef struct {
|
|
211 /** NFCID3 */
|
|
212 uint8_t abtNFCID3[10];
|
|
213 /** DID */
|
|
214 uint8_t btDID;
|
|
215 /** Supported send-bit rate */
|
|
216 uint8_t btBS;
|
|
217 /** Supported receive-bit rate */
|
|
218 uint8_t btBR;
|
|
219 /** Timeout value */
|
|
220 uint8_t btTO;
|
|
221 /** PP Parameters */
|
|
222 uint8_t btPP;
|
|
223 /** General Bytes */
|
|
224 uint8_t abtGB[48];
|
|
225 size_t szGB;
|
|
226 /** DEP mode */
|
|
227 nfc_dep_mode ndm;
|
|
228 } nfc_dep_info;
|
|
229
|
|
230 /**
|
|
231 * @struct nfc_iso14443a_info
|
|
232 * @brief NFC ISO14443A tag (MIFARE) information
|
|
233 */
|
|
234 typedef struct {
|
|
235 uint8_t abtAtqa[2];
|
|
236 uint8_t btSak;
|
|
237 size_t szUidLen;
|
|
238 uint8_t abtUid[10];
|
|
239 size_t szAtsLen;
|
|
240 uint8_t abtAts[254]; // Maximal theoretical ATS is FSD-2, FSD=256 for FSDI=8 in RATS
|
|
241 } nfc_iso14443a_info;
|
|
242
|
|
243 /**
|
|
244 * @struct nfc_felica_info
|
|
245 * @brief NFC FeLiCa tag information
|
|
246 */
|
|
247 typedef struct {
|
|
248 size_t szLen;
|
|
249 uint8_t btResCode;
|
|
250 uint8_t abtId[8];
|
|
251 uint8_t abtPad[8];
|
|
252 uint8_t abtSysCode[2];
|
|
253 } nfc_felica_info;
|
|
254
|
|
255 /**
|
|
256 * @struct nfc_iso14443b_info
|
|
257 * @brief NFC ISO14443B tag information
|
|
258 */
|
|
259 typedef struct {
|
|
260 /** abtPupi store PUPI contained in ATQB (Answer To reQuest of type B) (see ISO14443-3) */
|
|
261 uint8_t abtPupi[4];
|
|
262 /** abtApplicationData store Application Data contained in ATQB (see ISO14443-3) */
|
|
263 uint8_t abtApplicationData[4];
|
|
264 /** abtProtocolInfo store Protocol Info contained in ATQB (see ISO14443-3) */
|
|
265 uint8_t abtProtocolInfo[3];
|
|
266 /** ui8CardIdentifier store CID (Card Identifier) attributted by PCD to the PICC */
|
|
267 uint8_t ui8CardIdentifier;
|
|
268 } nfc_iso14443b_info;
|
|
269
|
|
270 /**
|
|
271 * @struct nfc_iso14443bi_info
|
|
272 * @brief NFC ISO14443B' tag information
|
|
273 */
|
|
274 typedef struct {
|
|
275 /** DIV: 4 LSBytes of tag serial number */
|
|
276 uint8_t abtDIV[4];
|
|
277 /** Software version & type of REPGEN */
|
|
278 uint8_t btVerLog;
|
|
279 /** Config Byte, present if long REPGEN */
|
|
280 uint8_t btConfig;
|
|
281 /** ATR, if any */
|
|
282 size_t szAtrLen;
|
|
283 uint8_t abtAtr[33];
|
|
284 } nfc_iso14443bi_info;
|
|
285
|
|
286 /**
|
|
287 * @struct nfc_iso14443b2sr_info
|
|
288 * @brief NFC ISO14443-2B ST SRx tag information
|
|
289 */
|
|
290 typedef struct {
|
|
291 uint8_t abtUID[8];
|
|
292 } nfc_iso14443b2sr_info;
|
|
293
|
|
294 /**
|
|
295 * @struct nfc_iso14443b2ct_info
|
|
296 * @brief NFC ISO14443-2B ASK CTx tag information
|
|
297 */
|
|
298 typedef struct {
|
|
299 uint8_t abtUID[4];
|
|
300 uint8_t btProdCode;
|
|
301 uint8_t btFabCode;
|
|
302 } nfc_iso14443b2ct_info;
|
|
303
|
|
304 /**
|
|
305 * @struct nfc_jewel_info
|
|
306 * @brief NFC Jewel tag information
|
|
307 */
|
|
308 typedef struct {
|
|
309 uint8_t btSensRes[2];
|
|
310 uint8_t btId[4];
|
|
311 } nfc_jewel_info;
|
|
312
|
|
313 /**
|
|
314 * @union nfc_target_info
|
|
315 * @brief Union between all kind of tags information structures.
|
|
316 */
|
|
317 typedef union {
|
|
318 nfc_iso14443a_info nai;
|
|
319 nfc_felica_info nfi;
|
|
320 nfc_iso14443b_info nbi;
|
|
321 nfc_iso14443bi_info nii;
|
|
322 nfc_iso14443b2sr_info nsi;
|
|
323 nfc_iso14443b2ct_info nci;
|
|
324 nfc_jewel_info nji;
|
|
325 nfc_dep_info ndi;
|
|
326 } nfc_target_info;
|
|
327
|
|
328 /**
|
|
329 * @enum nfc_baud_rate
|
|
330 * @brief NFC baud rate enumeration
|
|
331 */
|
|
332 typedef enum {
|
|
333 NBR_UNDEFINED = 0,
|
|
334 NBR_106,
|
|
335 NBR_212,
|
|
336 NBR_424,
|
|
337 NBR_847,
|
|
338 } nfc_baud_rate;
|
|
339
|
|
340 /**
|
|
341 * @enum nfc_modulation_type
|
|
342 * @brief NFC modulation type enumeration
|
|
343 */
|
|
344 typedef enum {
|
|
345 NMT_ISO14443A = 1,
|
|
346 NMT_JEWEL,
|
|
347 NMT_ISO14443B,
|
|
348 NMT_ISO14443BI, // pre-ISO14443B aka ISO/IEC 14443 B' or Type B'
|
|
349 NMT_ISO14443B2SR, // ISO14443-2B ST SRx
|
|
350 NMT_ISO14443B2CT, // ISO14443-2B ASK CTx
|
|
351 NMT_FELICA,
|
|
352 NMT_DEP,
|
|
353 } nfc_modulation_type;
|
|
354
|
|
355 /**
|
|
356 * @enum nfc_mode
|
|
357 * @brief NFC mode type enumeration
|
|
358 */
|
|
359 typedef enum {
|
|
360 N_TARGET,
|
|
361 N_INITIATOR,
|
|
362 } nfc_mode;
|
|
363
|
|
364 /**
|
|
365 * @struct nfc_modulation
|
|
366 * @brief NFC modulation structure
|
|
367 */
|
|
368 typedef struct {
|
|
369 nfc_modulation_type nmt;
|
|
370 nfc_baud_rate nbr;
|
|
371 } nfc_modulation;
|
|
372
|
|
373 /**
|
|
374 * @struct nfc_target
|
|
375 * @brief NFC target structure
|
|
376 */
|
|
377 typedef struct {
|
|
378 nfc_target_info nti;
|
|
379 nfc_modulation nm;
|
|
380 } nfc_target;
|
|
381
|
|
382 // Reset struct alignment to default
|
|
383 # pragma pack()
|
|
384
|
|
385
|
|
386 /* Library initialization/deinitialization */
|
|
387 void nfc_init(nfc_context **context);
|
|
388 void nfc_exit(nfc_context *context);
|
|
389 int nfc_register_driver(const nfc_driver *driver);
|
|
390
|
|
391 /* NFC Device/Hardware manipulation */
|
|
392 nfc_device *nfc_open(nfc_context *context, const nfc_connstring connstring);
|
|
393 void nfc_close(nfc_device *pnd);
|
|
394 int nfc_abort_command(nfc_device *pnd);
|
|
395 size_t nfc_list_devices(nfc_context *context, nfc_connstring connstrings[], size_t connstrings_len);
|
|
396 int nfc_idle(nfc_device *pnd);
|
|
397
|
|
398 /* NFC initiator: act as "reader" */
|
|
399 int nfc_initiator_init(nfc_device *pnd);
|
|
400 int nfc_initiator_init_secure_element(nfc_device *pnd);
|
|
401 int nfc_initiator_select_passive_target(nfc_device *pnd, const nfc_modulation nm, const uint8_t *pbtInitData, const size_t szInitData, nfc_target *pnt);
|
|
402 int nfc_initiator_list_passive_targets(nfc_device *pnd, const nfc_modulation nm, nfc_target ant[], const size_t szTargets);
|
|
403 int nfc_initiator_poll_target(nfc_device *pnd, const nfc_modulation *pnmTargetTypes, const size_t szTargetTypes, const uint8_t uiPollNr, const uint8_t uiPeriod, nfc_target *pnt);
|
|
404 int nfc_initiator_select_dep_target(nfc_device *pnd, const nfc_dep_mode ndm, const nfc_baud_rate nbr, const nfc_dep_info *pndiInitiator, nfc_target *pnt, const int timeout);
|
|
405 int nfc_initiator_poll_dep_target(nfc_device *pnd, const nfc_dep_mode ndm, const nfc_baud_rate nbr, const nfc_dep_info *pndiInitiator, nfc_target *pnt, const int timeout);
|
|
406 int nfc_initiator_deselect_target(nfc_device *pnd);
|
|
407 int nfc_initiator_transceive_bytes(nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, uint8_t *pbtRx, const size_t szRx, int timeout);
|
|
408 int nfc_initiator_transceive_bits(nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar, uint8_t *pbtRx, const size_t szRx, uint8_t *pbtRxPar);
|
|
409 int nfc_initiator_transceive_bytes_timed(nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, uint8_t *pbtRx, const size_t szRx, uint32_t *cycles);
|
|
410 int nfc_initiator_transceive_bits_timed(nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar, uint8_t *pbtRx, const size_t szRx, uint8_t *pbtRxPar, uint32_t *cycles);
|
|
411 int nfc_initiator_target_is_present(nfc_device *pnd, const nfc_target *pnt);
|
|
412
|
|
413 /* NFC target: act as tag (i.e. MIFARE Classic) or NFC target device. */
|
|
414 int nfc_target_init(nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, const size_t szRx, int timeout);
|
|
415 int nfc_target_send_bytes(nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, int timeout);
|
|
416 int nfc_target_receive_bytes(nfc_device *pnd, uint8_t *pbtRx, const size_t szRx, int timeout);
|
|
417 int nfc_target_send_bits(nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar);
|
|
418 int nfc_target_receive_bits(nfc_device *pnd, uint8_t *pbtRx, const size_t szRx, uint8_t *pbtRxPar);
|
|
419
|
|
420 /* Error reporting */
|
|
421 const char *nfc_strerror(const nfc_device *pnd);
|
|
422 int nfc_strerror_r(const nfc_device *pnd, char *buf, size_t buflen);
|
|
423 void nfc_perror(const nfc_device *pnd, const char *s);
|
|
424 int nfc_device_get_last_error(const nfc_device *pnd);
|
|
425
|
|
426 /* Special data accessors */
|
|
427 const char *nfc_device_get_name(nfc_device *pnd);
|
|
428 const char *nfc_device_get_connstring(nfc_device *pnd);
|
|
429 int nfc_device_get_supported_modulation(nfc_device *pnd, const nfc_mode mode, const nfc_modulation_type **const supported_mt);
|
|
430 int nfc_device_get_supported_baud_rate(nfc_device *pnd, const nfc_modulation_type nmt, const nfc_baud_rate **const supported_br);
|
|
431
|
|
432 /* Properties accessors */
|
|
433 int nfc_device_set_property_int(nfc_device *pnd, const nfc_property property, const int value);
|
|
434 int nfc_device_set_property_bool(nfc_device *pnd, const nfc_property property, const bool bEnable);
|
|
435
|
|
436 /* Misc. functions */
|
|
437 void iso14443a_crc(uint8_t *pbtData, size_t szLen, uint8_t *pbtCrc);
|
|
438 void iso14443a_crc_append(uint8_t *pbtData, size_t szLen);
|
|
439 void iso14443b_crc(uint8_t *pbtData, size_t szLen, uint8_t *pbtCrc);
|
|
440 void iso14443b_crc_append(uint8_t *pbtData, size_t szLen);
|
|
441 uint8_t *iso14443a_locate_historical_bytes(uint8_t *pbtAts, size_t szAts, size_t *pszTk);
|
|
442
|
|
443 void nfc_free(void *p);
|
|
444 const char *nfc_version(void);
|
|
445 int nfc_device_get_information_about(nfc_device *pnd, char **buf);
|
|
446
|
|
447 /* String converter functions */
|
|
448 const char *str_nfc_modulation_type(const nfc_modulation_type nmt);
|
|
449 const char *str_nfc_baud_rate(const nfc_baud_rate nbr);
|
|
450 int str_nfc_target(char **buf, const nfc_target *pnt, bool verbose);
|
|
451
|
|
452 /* Error codes */
|
|
453 /** @ingroup error
|
|
454 * @hideinitializer
|
|
455 * Success (no error)
|
|
456 */
|
|
457 #define NFC_SUCCESS 0
|
|
458 /** @ingroup error
|
|
459 * @hideinitializer
|
|
460 * Input / output error, device may not be usable anymore without re-open it
|
|
461 */
|
|
462 #define NFC_EIO -1
|
|
463 /** @ingroup error
|
|
464 * @hideinitializer
|
|
465 * Invalid argument(s)
|
|
466 */
|
|
467 #define NFC_EINVARG -2
|
|
468 /** @ingroup error
|
|
469 * @hideinitializer
|
|
470 * Operation not supported by device
|
|
471 */
|
|
472 #define NFC_EDEVNOTSUPP -3
|
|
473 /** @ingroup error
|
|
474 * @hideinitializer
|
|
475 * No such device
|
|
476 */
|
|
477 #define NFC_ENOTSUCHDEV -4
|
|
478 /** @ingroup error
|
|
479 * @hideinitializer
|
|
480 * Buffer overflow
|
|
481 */
|
|
482 #define NFC_EOVFLOW -5
|
|
483 /** @ingroup error
|
|
484 * @hideinitializer
|
|
485 * Operation timed out
|
|
486 */
|
|
487 #define NFC_ETIMEOUT -6
|
|
488 /** @ingroup error
|
|
489 * @hideinitializer
|
|
490 * Operation aborted (by user)
|
|
491 */
|
|
492 #define NFC_EOPABORTED -7
|
|
493 /** @ingroup error
|
|
494 * @hideinitializer
|
|
495 * Not (yet) implemented
|
|
496 */
|
|
497 #define NFC_ENOTIMPL -8
|
|
498 /** @ingroup error
|
|
499 * @hideinitializer
|
|
500 * Target released
|
|
501 */
|
|
502 #define NFC_ETGRELEASED -10
|
|
503 /** @ingroup error
|
|
504 * @hideinitializer
|
|
505 * Error while RF transmission
|
|
506 */
|
|
507 #define NFC_ERFTRANS -20
|
|
508 /** @ingroup error
|
|
509 * @hideinitializer
|
|
510 * MIFARE Classic: authentication failed
|
|
511 */
|
|
512 #define NFC_EMFCAUTHFAIL -30
|
|
513 /** @ingroup error
|
|
514 * @hideinitializer
|
|
515 * Software error (allocation, file/pipe creation, etc.)
|
|
516 */
|
|
517 #define NFC_ESOFT -80
|
|
518 /** @ingroup error
|
|
519 * @hideinitializer
|
|
520 * Device's internal chip error
|
|
521 */
|
|
522 #define NFC_ECHIP -90
|
|
523
|