From 3dd2257b577f5848bcbfa231976264c38c56fe73 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Wed, 18 Aug 2010 12:50:40 +0000 Subject: [PATCH] Add print_nfc_felica_info() and print_nfc_iso14443b_info() functions to nfc-utils (used by examples) --- examples/nfc-utils.c | 16 ++++++++++++++++ examples/nfc-utils.h | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/examples/nfc-utils.c b/examples/nfc-utils.c index 46fe5c7..2626760 100644 --- a/examples/nfc-utils.c +++ b/examples/nfc-utils.c @@ -103,6 +103,22 @@ void print_nfc_iso14443a_info(const nfc_iso14443a_info_t nai) printf("\n"); } } +void print_nfc_felica_info(const nfc_felica_info_t nfi) +{ + printf(" ID (NFCID2): "); print_hex(nfi.abtId,8); + printf(" Parameter (PAD): "); print_hex(nfi.abtPad,8); +} + +void print_nfc_iso14443b_info(const nfc_iso14443b_info_t nbi) +{ + printf(" ATQB: "); print_hex(nbi.abtAtqb,12); + printf(" ID: "); print_hex(nbi.abtId,4); + printf(" CID: %02x\n",nbi.btCid); + if (nbi.szInfLen>0) { + printf(" INF: "); print_hex(nbi.abtInf,nbi.szInfLen); + } + printf(" PARAMS: %02x %02x %02x %02x\n",nbi.btParam1,nbi.btParam2,nbi.btParam3,nbi.btParam4); +} /** * @brief Tries to parse arguments to find device descriptions. diff --git a/examples/nfc-utils.h b/examples/nfc-utils.h index c672efd..aaacf93 100644 --- a/examples/nfc-utils.h +++ b/examples/nfc-utils.h @@ -31,7 +31,11 @@ void print_hex(const byte_t* pbtData, const size_t szLen); void print_hex_bits(const byte_t* pbtData, const size_t szBits); void print_hex_par(const byte_t* pbtData, const size_t szBits, const byte_t* pbtDataPar); + void print_nfc_iso14443a_info(const nfc_iso14443a_info_t nai); +void print_nfc_iso14443b_info(const nfc_iso14443b_info_t nbi); +void print_nfc_felica_info(const nfc_felica_info_t nfi); + nfc_device_desc_t* parse_device_desc(int argc, const char *argv[], size_t* szFound); #endif