libnfc  1.4.2
nfc-utils.h
Go to the documentation of this file.
00001 /*-
00002  * Public platform independent Near Field Communication (NFC) library examples
00003  * 
00004  * Copyright (C) 2009, Roel Verdult
00005  * Copyright (C) 2010, Romuald Conty, Romain Tartière
00006  * 
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions are met:
00009  *  1) Redistributions of source code must retain the above copyright notice,
00010  *  this list of conditions and the following disclaimer. 
00011  *  2 )Redistributions in binary form must reproduce the above copyright
00012  *  notice, this list of conditions and the following disclaimer in the
00013  *  documentation and/or other materials provided with the distribution.
00014  *
00015  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00016  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00017  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00018  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00019  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00020  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00021  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00023  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00024  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00025  * POSSIBILITY OF SUCH DAMAGE.
00026  * 
00027  * Note that this license only applies on the examples, NFC library itself is under LGPL
00028  *
00029  */
00030 
00036 #ifndef _EXAMPLES_NFC_UTILS_H_
00037 #  define _EXAMPLES_NFC_UTILS_H_
00038 
00039 #  include <stdlib.h>
00040 #  include <string.h>
00041 
00042 byte_t  oddparity (const byte_t bt);
00043 void    oddparity_byte_ts (const byte_t * pbtData, const size_t szLen, byte_t * pbtPar);
00044 
00045 void    print_hex (const byte_t * pbtData, const size_t szLen);
00046 void    print_hex_bits (const byte_t * pbtData, const size_t szBits);
00047 void    print_hex_par (const byte_t * pbtData, const size_t szBits, const byte_t * pbtDataPar);
00048 
00049 void    print_nfc_iso14443a_info (const nfc_iso14443a_info_t nai, bool verbose);
00050 void    print_nfc_iso14443b_info (const nfc_iso14443b_info_t nbi, bool verbose);
00051 void    print_nfc_felica_info (const nfc_felica_info_t nfi, bool verbose);
00052 void    print_nfc_jewel_info (const nfc_jewel_info_t nji, bool verbose);
00053 void    print_nfc_dep_info (const nfc_dep_info_t ndi, bool verbose);
00054 
00055 void    print_nfc_target (const nfc_target_t nt, bool verbose);
00056 
00057 nfc_device_desc_t *parse_args (int argc, const char *argv[], size_t * szFound, bool * verbose);
00058 
00059 #endif