From 5d753827c18bb56bf2d9eb6d94002bd6b31a693f Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Tue, 12 Oct 2010 14:05:28 +0000 Subject: [PATCH] Add a nfc-utils fonction (not in API) to display nfc_target_type_t as string --- examples/nfc-utils.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ examples/nfc-utils.h | 2 ++ 2 files changed, 56 insertions(+) diff --git a/examples/nfc-utils.c b/examples/nfc-utils.c index 166f978..c11c7d1 100644 --- a/examples/nfc-utils.c +++ b/examples/nfc-utils.c @@ -212,6 +212,60 @@ print_nfc_dep_info (const nfc_dep_info_t ndi) } } +void print_nfc_target_type( const nfc_target_type_t ntt ) +{ + switch (ntt) { + case NTT_GENERIC_PASSIVE_106: + printf ("Generic passive 106 kbps (ISO/IEC14443-4A, mifare, DEP)\n"); + break; + case NTT_GENERIC_PASSIVE_212: + printf ("Generic passive 212 kbps (FeliCa, DEP)\n"); + break; + case NTT_GENERIC_PASSIVE_424: + printf ("Generic passive 424 kbps (FeliCa, DEP)\n"); + break; + case NTT_ISO14443B_106: + printf ("Passive 106 kbps ISO/IEC14443-4B\n"); + break; + case NTT_JEWEL_106: + printf ("Innovision Jewel tag\n"); + break; + case NTT_MIFARE: + printf ("mifare card\n"); + break; + case NTT_FELICA_212: + printf ("FeliCa 212 kbps card\n"); + break; + case NTT_FELICA_424: + printf ("FeliCa 424 kbps card\n"); + break; + case NTT_ISO14443A_106: + printf ("Passive 106 kbps ISO/IEC14443-4A\n"); + break; + case NTT_ISO14443B_TCL_106: + printf ("Passive 106 kbps ISO/IEC14443-4B with TCL flag\n"); + break; + case NTT_DEP_PASSIVE_106: + printf ("DEP passive 106 kbps\n"); + break; + case NTT_DEP_PASSIVE_212: + printf ("DEP passive 212 kbps\n"); + break; + case NTT_DEP_PASSIVE_424: + printf ("DEP passive 424 kbps\n"); + break; + case NTT_DEP_ACTIVE_106: + printf ("DEP active 106 kbps\n"); + break; + case NTT_DEP_ACTIVE_212: + printf ("DEP active 212 kbps\n"); + break; + case NTT_DEP_ACTIVE_424: + printf ("DEP active 424 kbps\n"); + break; + } +} + /** * @brief Tries to parse arguments to find device descriptions. * @return Returns the list of found device descriptions. diff --git a/examples/nfc-utils.h b/examples/nfc-utils.h index 46472f3..a842c77 100644 --- a/examples/nfc-utils.h +++ b/examples/nfc-utils.h @@ -40,6 +40,8 @@ void print_nfc_felica_info (const nfc_felica_info_t nfi); void print_nfc_jewel_info (const nfc_jewel_info_t nji); void print_nfc_dep_info (const nfc_dep_info_t ndi); +void print_nfc_target_type( const nfc_target_type_t ntt ); + nfc_device_desc_t *parse_device_desc (int argc, const char *argv[], size_t * szFound); #endif