libnfc  1.4.2
nfc-utils.h
Go to the documentation of this file.
1 /*-
2  * Public platform independent Near Field Communication (NFC) library examples
3  *
4  * Copyright (C) 2009, Roel Verdult
5  * Copyright (C) 2010, Romuald Conty, Romain Tartière
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  * 1) Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  * 2 )Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  *
27  * Note that this license only applies on the examples, NFC library itself is under LGPL
28  *
29  */
30 
36 #ifndef _EXAMPLES_NFC_UTILS_H_
37 # define _EXAMPLES_NFC_UTILS_H_
38 
39 # include <stdlib.h>
40 # include <string.h>
41 
42 byte_t oddparity (const byte_t bt);
43 void oddparity_byte_ts (const byte_t * pbtData, const size_t szLen, byte_t * pbtPar);
44 
45 void print_hex (const byte_t * pbtData, const size_t szLen);
46 void print_hex_bits (const byte_t * pbtData, const size_t szBits);
47 void print_hex_par (const byte_t * pbtData, const size_t szBits, const byte_t * pbtDataPar);
48 
49 void print_nfc_iso14443a_info (const nfc_iso14443a_info_t nai, bool verbose);
50 void print_nfc_iso14443b_info (const nfc_iso14443b_info_t nbi, bool verbose);
51 void print_nfc_felica_info (const nfc_felica_info_t nfi, bool verbose);
52 void print_nfc_jewel_info (const nfc_jewel_info_t nji, bool verbose);
53 void print_nfc_dep_info (const nfc_dep_info_t ndi, bool verbose);
54 
55 void print_nfc_target (const nfc_target_t nt, bool verbose);
56 
57 nfc_device_desc_t *parse_args (int argc, const char *argv[], size_t * szFound, bool * verbose);
58 
59 #endif