annotate service/rfid_pn532/nfc-nim/nfc.h @ 395:3852a10a088f

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