nfc_sys/
lib.rs

1#![allow(dead_code, non_camel_case_types, non_upper_case_globals, non_snake_case)]
2
3#[link(name = "nfc_sys", kind = "dylib")]
4
5extern crate libc;
6
7use self::libc::{uint8_t, uint32_t, size_t};
8
9#[derive(Copy, Clone)]
10#[repr(u32)]
11#[derive(Debug)]
12pub enum scan_type_enum {
13    NOT_INTRUSIVE = 0,
14    INTRUSIVE = 1,
15    NOT_AVAILABLE = 2,
16}
17#[repr(C)]
18#[derive(Copy, Clone)]
19#[derive(Debug)]
20pub struct nfc_driver {
21    pub name: *const ::std::os::raw::c_char,
22    pub scan_type: scan_type_enum,
23    pub scan: ::std::option::Option<unsafe extern "C" fn(context: *const nfc_context, connstrings: *mut nfc_connstring, connstrings_len: size_t) -> size_t>,
24    pub open: ::std::option::Option<unsafe extern "C" fn(context: *const nfc_context, connstring: nfc_connstring) -> *mut nfc_device>,
25    pub close: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device)>,
26
27    pub strerror: ::std::option::Option<unsafe extern "C" fn(pnd: *const nfc_device) -> *const ::std::os::raw::c_char>,
28
29    pub initiator_init: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device) -> ::std::os::raw::c_int>,
30    pub initiator_init_secure_element: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device) -> ::std::os::raw::c_int>,
31    pub initiator_select_passive_target: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, nm: nfc_modulation, pbtInitData: *const uint8_t, szInitData: size_t, pnt: *mut nfc_target) -> ::std::os::raw::c_int>,
32    pub initiator_poll_target: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pnmModulations: *const nfc_modulation, szModulations: size_t, uiPollNr: uint8_t, btPeriod: uint8_t, pnt: *mut nfc_target) -> ::std::os::raw::c_int>,
33    pub initiator_select_dep_target: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, ndm: nfc_dep_mode, nbr: nfc_baud_rate, pndiInitiator: *const nfc_dep_info, pnt: *mut nfc_target, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int>,
34    pub initiator_deselect_target: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device) -> ::std::os::raw::c_int>,
35    pub initiator_transceive_bytes: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTx: size_t, pbtRx: *mut uint8_t, szRx: size_t, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int>,
36    pub initiator_transceive_bits: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTxBits: size_t, pbtTxPar: *const uint8_t, pbtRx: *mut uint8_t, pbtRxPar: *mut uint8_t) -> ::std::os::raw::c_int>,
37    pub initiator_transceive_bytes_timed: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTx: size_t, pbtRx: *mut uint8_t, szRx: size_t, cycles: *mut uint32_t) -> ::std::os::raw::c_int>,
38    pub initiator_transceive_bits_timed: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTxBits: size_t, pbtTxPar: *const uint8_t, pbtRx: *mut uint8_t, pbtRxPar: *mut uint8_t, cycles: *mut uint32_t) -> ::std::os::raw::c_int>,
39    pub initiator_target_is_present: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pnt: *const nfc_target) -> ::std::os::raw::c_int>,
40
41    pub target_init: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pnt: *mut nfc_target, pbtRx: *mut uint8_t, szRx: size_t, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int>,
42    pub target_send_bytes: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTx: size_t, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int>,
43    pub target_receive_bytes: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pbtRx: *mut uint8_t, szRxLen: size_t, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int>,
44    pub target_send_bits: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTxBits: size_t, pbtTxPar: *const uint8_t) -> ::std::os::raw::c_int>,
45    pub target_receive_bits: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, pbtRx: *mut uint8_t, szRxLen: size_t, pbtRxPar: *mut uint8_t) -> ::std::os::raw::c_int>,
46
47    pub device_set_property_bool: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, property: nfc_property, bEnable: u8) -> ::std::os::raw::c_int>,
48    pub device_set_property_int: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, property: nfc_property, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int>,
49    pub get_supported_modulation: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, mode: nfc_mode, supported_mt: *mut *const nfc_modulation_type) -> ::std::os::raw::c_int>,
50    pub get_supported_baud_rate: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, mode: nfc_mode, nmt: nfc_modulation_type, supported_br: *mut *const nfc_baud_rate) -> ::std::os::raw::c_int>,
51    pub device_get_information_about: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device, buf: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int>,
52
53    pub abort_command: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device) -> ::std::os::raw::c_int>,
54    pub idle: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device) -> ::std::os::raw::c_int>,
55    pub powerdown: ::std::option::Option<unsafe extern "C" fn(pnd: *mut nfc_device) -> ::std::os::raw::c_int>,
56}
57impl ::std::default::Default for nfc_driver {
58    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
59}
60#[repr(C)]
61#[derive(Copy)]
62pub struct nfc_user_defined_device {
63    pub name: [::std::os::raw::c_char; 256usize],
64    pub connstring: nfc_connstring,
65    pub optional: u8,
66}
67impl ::std::clone::Clone for nfc_user_defined_device {
68    fn clone(&self) -> Self { *self }
69}
70impl ::std::default::Default for nfc_user_defined_device {
71    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
72}
73#[repr(C)]
74#[derive(Copy, Clone)]
75pub struct nfc_context {
76    pub allow_autoscan: u8,
77    pub allow_intrusive_scan: u8,
78    pub log_level: uint32_t,
79    pub user_defined_devices: [nfc_user_defined_device; 4usize],
80    pub user_defined_device_count: ::std::os::raw::c_uint,
81}
82impl ::std::default::Default for nfc_context {
83    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
84}
85#[repr(C)]
86#[derive(Copy)]
87pub struct nfc_device {
88    pub context: *const nfc_context,
89    pub driver: *const nfc_driver,
90    pub driver_data: *mut ::std::os::raw::c_void,
91    pub chip_data: *mut ::std::os::raw::c_void,
92    pub name: [::std::os::raw::c_char; 256usize],
93    pub connstring: nfc_connstring,
94    pub bCrc: u8,
95    pub bPar: u8,
96    pub bEasyFraming: u8,
97    pub bInfiniteSelect: u8,
98    pub bAutoIso14443_4: u8,
99    pub btSupportByte: uint8_t,
100    pub last_error: ::std::os::raw::c_int,
101}
102impl ::std::clone::Clone for nfc_device {
103    fn clone(&self) -> Self { *self }
104}
105impl ::std::default::Default for nfc_device {
106    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
107}
108
109pub type nfc_connstring = [::std::os::raw::c_char; 1024usize];
110#[derive(Copy, Clone)]
111#[repr(u32)]
112pub enum Enum_Unnamed1 {
113    NP_TIMEOUT_COMMAND = 0,
114    NP_TIMEOUT_ATR = 1,
115    NP_TIMEOUT_COM = 2,
116    NP_HANDLE_CRC = 3,
117    NP_HANDLE_PARITY = 4,
118    NP_ACTIVATE_FIELD = 5,
119    NP_ACTIVATE_CRYPTO1 = 6,
120    NP_INFINITE_SELECT = 7,
121    NP_ACCEPT_INVALID_FRAMES = 8,
122    NP_ACCEPT_MULTIPLE_FRAMES = 9,
123    NP_AUTO_ISO14443_4 = 10,
124    NP_EASY_FRAMING = 11,
125    NP_FORCE_ISO14443_A = 12,
126    NP_FORCE_ISO14443_B = 13,
127    NP_FORCE_SPEED_106 = 14,
128}
129pub type nfc_property = Enum_Unnamed1;
130#[derive(Copy, Clone)]
131#[repr(u32)]
132pub enum Enum_Unnamed2 { NDM_UNDEFINED = 0, NDM_PASSIVE = 1, NDM_ACTIVE = 2, }
133pub type nfc_dep_mode = Enum_Unnamed2;
134#[repr(C)]
135#[derive(Copy)]
136pub struct Struct_Unnamed3 {
137    pub abtNFCID3: [uint8_t; 10usize],
138    pub btDID: uint8_t,
139    pub btBS: uint8_t,
140    pub btBR: uint8_t,
141    pub btTO: uint8_t,
142    pub btPP: uint8_t,
143    pub abtGB: [uint8_t; 48usize],
144    pub szGB: size_t,
145    pub ndm: nfc_dep_mode,
146}
147impl ::std::clone::Clone for Struct_Unnamed3 {
148    fn clone(&self) -> Self { *self }
149}
150impl ::std::default::Default for Struct_Unnamed3 {
151    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
152}
153pub type nfc_dep_info = Struct_Unnamed3;
154#[repr(C, packed)]
155#[derive(Copy)]
156pub struct Struct_Unnamed4 {
157    pub abtAtqa: [uint8_t; 2usize],
158    pub btSak: uint8_t,
159    pub szUidLen: size_t,
160    pub abtUid: [uint8_t; 10usize],
161    pub szAtsLen: size_t,
162    pub abtAts: [uint8_t; 254usize],
163}
164impl ::std::clone::Clone for Struct_Unnamed4 {
165    fn clone(&self) -> Self { *self }
166}
167impl ::std::default::Default for Struct_Unnamed4 {
168    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
169}
170pub type nfc_iso14443a_info = Struct_Unnamed4;
171#[repr(C, packed)]
172#[derive(Copy, Clone)]
173pub struct Struct_Unnamed5 {
174    pub szLen: size_t,
175    pub btResCode: uint8_t,
176    pub abtId: [uint8_t; 8usize],
177    pub abtPad: [uint8_t; 8usize],
178    pub abtSysCode: [uint8_t; 2usize],
179}
180impl ::std::default::Default for Struct_Unnamed5 {
181    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
182}
183pub type nfc_felica_info = Struct_Unnamed5;
184#[repr(C, packed)]
185#[derive(Copy, Clone)]
186pub struct Struct_Unnamed6 {
187    pub abtPupi: [uint8_t; 4usize],
188    pub abtApplicationData: [uint8_t; 4usize],
189    pub abtProtocolInfo: [uint8_t; 3usize],
190    pub ui8CardIdentifier: uint8_t,
191}
192impl ::std::default::Default for Struct_Unnamed6 {
193    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
194}
195pub type nfc_iso14443b_info = Struct_Unnamed6;
196#[repr(C, packed)]
197#[derive(Copy)]
198pub struct Struct_Unnamed7 {
199    pub abtDIV: [uint8_t; 4usize],
200    pub btVerLog: uint8_t,
201    pub btConfig: uint8_t,
202    pub szAtrLen: size_t,
203    pub abtAtr: [uint8_t; 33usize],
204}
205impl ::std::clone::Clone for Struct_Unnamed7 {
206    fn clone(&self) -> Self { *self }
207}
208impl ::std::default::Default for Struct_Unnamed7 {
209    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
210}
211pub type nfc_iso14443bi_info = Struct_Unnamed7;
212#[repr(C, packed)]
213#[derive(Copy, Clone)]
214pub struct Struct_Unnamed8 {
215    pub abtUID: [uint8_t; 8usize],
216}
217impl ::std::default::Default for Struct_Unnamed8 {
218    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
219}
220pub type nfc_iso14443b2sr_info = Struct_Unnamed8;
221#[repr(C, packed)]
222#[derive(Copy, Clone)]
223pub struct Struct_Unnamed9 {
224    pub abtUID: [uint8_t; 4usize],
225    pub btProdCode: uint8_t,
226    pub btFabCode: uint8_t,
227}
228impl ::std::default::Default for Struct_Unnamed9 {
229    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
230}
231pub type nfc_iso14443b2ct_info = Struct_Unnamed9;
232#[repr(C, packed)]
233#[derive(Copy, Clone)]
234pub struct Struct_Unnamed10 {
235    pub btSensRes: [uint8_t; 2usize],
236    pub btId: [uint8_t; 4usize],
237}
238impl ::std::default::Default for Struct_Unnamed10 {
239    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
240}
241pub type nfc_jewel_info = Struct_Unnamed10;
242#[repr(C, packed)]
243//#[derive(Copy, Clone)]
244pub struct Union_Unnamed11 {
245    pub _bindgen_data_: [u8; 283usize],
246}
247impl Union_Unnamed11 {
248    pub unsafe fn nai(&mut self) -> *mut nfc_iso14443a_info {
249        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
250        ::std::mem::transmute(raw.offset(0))
251    }
252    pub unsafe fn nfi(&mut self) -> *mut nfc_felica_info {
253        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
254        ::std::mem::transmute(raw.offset(0))
255    }
256    pub unsafe fn nbi(&mut self) -> *mut nfc_iso14443b_info {
257        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
258        ::std::mem::transmute(raw.offset(0))
259    }
260    pub unsafe fn nii(&mut self) -> *mut nfc_iso14443bi_info {
261        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
262        ::std::mem::transmute(raw.offset(0))
263    }
264    pub unsafe fn nsi(&mut self) -> *mut nfc_iso14443b2sr_info {
265        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
266        ::std::mem::transmute(raw.offset(0))
267    }
268    pub unsafe fn nci(&mut self) -> *mut nfc_iso14443b2ct_info {
269        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
270        ::std::mem::transmute(raw.offset(0))
271    }
272    pub unsafe fn nji(&mut self) -> *mut nfc_jewel_info {
273        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
274        ::std::mem::transmute(raw.offset(0))
275    }
276    pub unsafe fn ndi(&mut self) -> *mut nfc_dep_info {
277        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
278        ::std::mem::transmute(raw.offset(0))
279    }
280}
281impl ::std::default::Default for Union_Unnamed11 {
282    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
283}
284pub type nfc_target_info = Union_Unnamed11;
285#[derive(Copy, Clone)]
286#[repr(u32)]
287pub enum nfc_baud_rate {
288    NBR_UNDEFINED = 0,
289    NBR_106 = 1,
290    NBR_212 = 2,
291    NBR_424 = 3,
292    NBR_847 = 4,
293}
294#[derive(Copy, Clone)]
295#[repr(u32)]
296pub enum nfc_modulation_type {
297    NMT_ISO14443A = 1,
298    NMT_JEWEL = 2,
299    NMT_ISO14443B = 3,
300    NMT_ISO14443BI = 4,
301    NMT_ISO14443B2SR = 5,
302    NMT_ISO14443B2CT = 6,
303    NMT_FELICA = 7,
304    NMT_DEP = 8,
305}
306#[derive(Copy, Clone)]
307#[repr(u32)]
308pub enum Enum_Unnamed14 { N_TARGET = 0, N_INITIATOR = 1, }
309pub type nfc_mode = Enum_Unnamed14;
310#[repr(C)]
311#[derive(Copy, Clone)]
312pub struct Struct_Unnamed15 {
313    pub nmt: nfc_modulation_type,
314    pub nbr: nfc_baud_rate,
315}
316impl ::std::default::Default for Struct_Unnamed15 {
317    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
318}
319pub type nfc_modulation = Struct_Unnamed15;
320#[repr(C, packed)]
321//#[derive(Copy, Clone)]
322pub struct Struct_Unnamed16 {
323    pub nti: nfc_target_info,
324    pub nm: nfc_modulation,
325}
326impl ::std::default::Default for Struct_Unnamed16 {
327    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
328}
329pub type nfc_target = Struct_Unnamed16;
330
331#[link(name = "nfc", kind = "dylib")]
332extern "C" {
333    pub fn nfc_context_new() -> *mut nfc_context;
334    pub fn nfc_context_free(context: *mut nfc_context);
335    pub fn nfc_device_new(context: *const nfc_context, connstring: nfc_connstring) -> *mut nfc_device;
336    pub fn nfc_device_free(dev: *mut nfc_device);
337    pub fn string_as_boolean(s: *const ::std::os::raw::c_char, value: *mut u8);
338    pub fn iso14443_cascade_uid(abtUID: *mut uint8_t, szUID: size_t, pbtCascadedUID: *mut uint8_t, pszCascadedUID: *mut size_t);
339    pub fn prepare_initiator_data(nm: nfc_modulation, ppbtInitiatorData: *mut *mut uint8_t, pszInitiatorData: *mut size_t);
340    pub fn connstring_decode(connstring: nfc_connstring, driver_name: *const ::std::os::raw::c_char, bus_name: *const ::std::os::raw::c_char, pparam1: *mut *mut ::std::os::raw::c_char, pparam2: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int;
341
342    pub fn nfc_init(context: *mut *mut nfc_context);
343    pub fn nfc_exit(context: *mut nfc_context);
344    pub fn nfc_register_driver(driver: *const nfc_driver) -> ::std::os::raw::c_int;
345
346    pub fn nfc_open(context: *mut nfc_context, connstring: *const nfc_connstring) -> *mut nfc_device;
347    pub fn nfc_close(pnd: *mut nfc_device);
348    pub fn nfc_abort_command(pnd: *mut nfc_device) -> ::std::os::raw::c_int;
349    pub fn nfc_list_devices(context: *mut nfc_context, connstrings: *mut nfc_connstring, connstrings_len: size_t) -> size_t;
350    pub fn nfc_idle(pnd: *mut nfc_device) -> ::std::os::raw::c_int;
351
352    pub fn nfc_initiator_init(pnd: *mut nfc_device) -> ::std::os::raw::c_int;
353    pub fn nfc_initiator_init_secure_element(pnd: *mut nfc_device) -> ::std::os::raw::c_int;
354    pub fn nfc_initiator_select_passive_target(pnd: *mut nfc_device, nm: nfc_modulation, pbtInitData: *const uint8_t, szInitData: size_t, pnt: *mut nfc_target) -> ::std::os::raw::c_int;
355    pub fn nfc_initiator_list_passive_targets(pnd: *mut nfc_device, nm: nfc_modulation, ant: *mut nfc_target, szTargets: size_t) -> ::std::os::raw::c_int;
356    pub fn nfc_initiator_poll_target(pnd: *mut nfc_device, pnmTargetTypes: *const nfc_modulation, szTargetTypes: size_t, uiPollNr: uint8_t, uiPeriod: uint8_t, pnt: *mut nfc_target) -> ::std::os::raw::c_int;
357    pub fn nfc_initiator_select_dep_target(pnd: *mut nfc_device, ndm: nfc_dep_mode, nbr: nfc_baud_rate, pndiInitiator: *const nfc_dep_info, pnt: *mut nfc_target, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
358    pub fn nfc_initiator_poll_dep_target(pnd: *mut nfc_device, ndm: nfc_dep_mode, nbr: nfc_baud_rate, pndiInitiator: *const nfc_dep_info, pnt: *mut nfc_target, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
359    pub fn nfc_initiator_deselect_target(pnd: *mut nfc_device) -> ::std::os::raw::c_int;
360    pub fn nfc_initiator_transceive_bytes(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTx: size_t, pbtRx: *mut uint8_t, szRx: size_t, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
361    pub fn nfc_initiator_transceive_bits(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTxBits: size_t, pbtTxPar: *const uint8_t, pbtRx: *mut uint8_t, szRx: size_t, pbtRxPar: *mut uint8_t) -> ::std::os::raw::c_int;
362    pub fn nfc_initiator_transceive_bytes_timed(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTx: size_t, pbtRx: *mut uint8_t, szRx: size_t, cycles: *mut uint32_t) -> ::std::os::raw::c_int;
363    pub fn nfc_initiator_transceive_bits_timed(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTxBits: size_t, pbtTxPar: *const uint8_t, pbtRx: *mut uint8_t, szRx: size_t, pbtRxPar: *mut uint8_t, cycles: *mut uint32_t) -> ::std::os::raw::c_int;
364    pub fn nfc_initiator_target_is_present(pnd: *mut nfc_device, pnt: *const nfc_target) -> ::std::os::raw::c_int;
365
366    pub fn nfc_target_init(pnd: *mut nfc_device, pnt: *mut nfc_target, pbtRx: *mut uint8_t, szRx: size_t, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
367    pub fn nfc_target_send_bytes(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTx: size_t, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
368    pub fn nfc_target_receive_bytes(pnd: *mut nfc_device, pbtRx: *mut uint8_t, szRx: size_t, timeout: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
369    pub fn nfc_target_send_bits(pnd: *mut nfc_device, pbtTx: *const uint8_t, szTxBits: size_t, pbtTxPar: *const uint8_t) -> ::std::os::raw::c_int;
370    pub fn nfc_target_receive_bits(pnd: *mut nfc_device, pbtRx: *mut uint8_t, szRx: size_t, pbtRxPar: *mut uint8_t) -> ::std::os::raw::c_int;
371
372    pub fn nfc_strerror(pnd: *const nfc_device) -> *const ::std::os::raw::c_char;
373    pub fn nfc_strerror_r(pnd: *const nfc_device, buf: *mut ::std::os::raw::c_char, buflen: size_t) -> ::std::os::raw::c_int;
374    pub fn nfc_perror(pnd: *const nfc_device, s: *const ::std::os::raw::c_char);
375
376    pub fn nfc_device_get_last_error(pnd: *const nfc_device) -> ::std::os::raw::c_int;
377    pub fn nfc_device_get_name(pnd: *mut nfc_device) -> *const ::std::os::raw::c_char;
378    pub fn nfc_device_get_connstring(pnd: *mut nfc_device) -> *const ::std::os::raw::c_char;
379    pub fn nfc_device_get_supported_modulation(pnd: *mut nfc_device, mode: nfc_mode, supported_mt: *mut *const nfc_modulation_type) -> ::std::os::raw::c_int;
380    pub fn nfc_device_get_supported_baud_rate(pnd: *mut nfc_device, nmt: nfc_modulation_type, supported_br: *mut *const nfc_baud_rate) -> ::std::os::raw::c_int;
381    pub fn nfc_device_get_supported_baud_rate_target_mode(pnd: *mut nfc_device, nmt: nfc_modulation_type, supported_br: *mut *const nfc_baud_rate) -> ::std::os::raw::c_int;
382    pub fn nfc_device_set_property_int(pnd: *mut nfc_device, property: nfc_property, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
383    pub fn nfc_device_set_property_bool(pnd: *mut nfc_device, property: nfc_property, bEnable: u8) -> ::std::os::raw::c_int;
384
385    pub fn iso14443a_crc(pbtData: *mut uint8_t, szLen: size_t, pbtCrc: *mut uint8_t);
386    pub fn iso14443a_crc_append(pbtData: *mut uint8_t, szLen: size_t);
387    pub fn iso14443b_crc(pbtData: *mut uint8_t, szLen: size_t, pbtCrc: *mut uint8_t);
388    pub fn iso14443b_crc_append(pbtData: *mut uint8_t, szLen: size_t);
389    pub fn iso14443a_locate_historical_bytes(pbtAts: *mut uint8_t, szAts: size_t, pszTk: *mut size_t) -> *mut uint8_t;
390
391    pub fn nfc_free(p: *mut ::std::os::raw::c_void);
392    pub fn nfc_version() -> *const ::std::os::raw::c_char;
393    pub fn nfc_device_get_information_about(pnd: *mut nfc_device, buf: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int;
394
395    pub fn str_nfc_modulation_type(nmt: nfc_modulation_type) -> *const ::std::os::raw::c_char;
396    pub fn str_nfc_baud_rate(nbr: nfc_baud_rate) -> *const ::std::os::raw::c_char;
397    pub fn str_nfc_target(buf: *mut *mut ::std::os::raw::c_char, pnt: *const nfc_target, verbose: u8) -> ::std::os::raw::c_int;
398}