From c53c5128315123d6a7974921d5221fd415c1b4d0 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Wed, 13 Oct 2010 11:49:34 +0000 Subject: [PATCH] Change some nfc_target_type_t to insist on the ISO/IEC 14443-4 compliance --- examples/nfc-poll.c | 6 +++--- examples/nfc-utils.c | 6 +++--- include/nfc/nfc-types.h | 12 ++++++------ libnfc/chips/pn53x.c | 8 ++++---- libnfc/nfc.c | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/nfc-poll.c b/examples/nfc-poll.c index 29982d6..5e4dd90 100644 --- a/examples/nfc-poll.c +++ b/examples/nfc-poll.c @@ -72,7 +72,7 @@ main (int argc, const char *argv[]) const byte_t btPollNr = 20; const byte_t btPeriod = 2; - const nfc_target_type_t nttArray[5] = {NTT_GENERIC_PASSIVE_106, NTT_GENERIC_PASSIVE_212, NTT_GENERIC_PASSIVE_424, NTT_ISO14443B_106, NTT_JEWEL_106}; + const nfc_target_type_t nttArray[5] = {NTT_GENERIC_PASSIVE_106, NTT_GENERIC_PASSIVE_212, NTT_GENERIC_PASSIVE_424, NTT_ISO14443_4B_106, NTT_JEWEL_106}; const size_t szTargetTypes = 5; nfc_target_t antTargets[2]; @@ -129,11 +129,11 @@ main (int argc, const char *argv[]) printf ("(FeliCa 212 kbps card), targetData:\n"); print_nfc_felica_info (antTargets[n].nti.nfi); break; - case NTT_ISO14443A_106: + case NTT_ISO14443_4A_106: printf ("(Passive 106 kbps ISO/IEC 14443-4A card), targetData:\n"); print_nfc_iso14443a_info (antTargets[n].nti.nai); break; - case NTT_ISO14443B_TCL_106: + case NTT_ISO14443_4B_TCL_106: printf ("(Passive 106 kbps ISO/IEC 14443-4B card), targetData:\n"); print_nfc_iso14443b_info (antTargets[n].nti.nbi); break; diff --git a/examples/nfc-utils.c b/examples/nfc-utils.c index c11c7d1..47f3e75 100644 --- a/examples/nfc-utils.c +++ b/examples/nfc-utils.c @@ -224,7 +224,7 @@ void print_nfc_target_type( const nfc_target_type_t ntt ) case NTT_GENERIC_PASSIVE_424: printf ("Generic passive 424 kbps (FeliCa, DEP)\n"); break; - case NTT_ISO14443B_106: + case NTT_ISO14443_4B_106: printf ("Passive 106 kbps ISO/IEC14443-4B\n"); break; case NTT_JEWEL_106: @@ -239,10 +239,10 @@ void print_nfc_target_type( const nfc_target_type_t ntt ) case NTT_FELICA_424: printf ("FeliCa 424 kbps card\n"); break; - case NTT_ISO14443A_106: + case NTT_ISO14443_4A_106: printf ("Passive 106 kbps ISO/IEC14443-4A\n"); break; - case NTT_ISO14443B_TCL_106: + case NTT_ISO14443_4B_TCL_106: printf ("Passive 106 kbps ISO/IEC14443-4B with TCL flag\n"); break; case NTT_DEP_PASSIVE_106: diff --git a/include/nfc/nfc-types.h b/include/nfc/nfc-types.h index 2bde941..5270cd5 100644 --- a/include/nfc/nfc-types.h +++ b/include/nfc/nfc-types.h @@ -302,19 +302,19 @@ typedef enum { /** Generic passive 424 kbps (FeliCa, DEP) */ NTT_GENERIC_PASSIVE_424 = 0x02, /** Passive 106 kbps ISO/IEC14443-4B */ - NTT_ISO14443B_106 = 0x03, + NTT_ISO14443_4B_106 = 0x03, /** Innovision Jewel tag */ NTT_JEWEL_106 = 0x04, - /** mifare card */ + /** Mifare card */ NTT_MIFARE = 0x10, /** FeliCa 212 kbps card */ NTT_FELICA_212 = 0x11, /** FeliCa 424 kbps card */ NTT_FELICA_424 = 0x12, - /** Passive 106 kbps ISO/IEC14443-4A */ - NTT_ISO14443A_106 = 0x20, - /** Passive 106 kbps ISO/IEC14443-4B with TCL flag */ - NTT_ISO14443B_TCL_106 = 0x23, + /** Passive 106 kbps ISO/IEC 14443-4A */ + NTT_ISO14443_4A_106 = 0x20, + /** Passive 106 kbps ISO/IEC 14443-4B with TCL flag */ + NTT_ISO14443_4B_TCL_106 = 0x23, /** DEP passive 106 kbps */ NTT_DEP_PASSIVE_106 = 0x40, /** DEP passive 212 kbps */ diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 2b4121a..e767cf1 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -377,7 +377,7 @@ pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_ switch (ntt) { case NTT_MIFARE: case NTT_GENERIC_PASSIVE_106: - case NTT_ISO14443A_106: + case NTT_ISO14443_4A_106: // We skip the first byte: its the target number (Tg) pbtRawData++; @@ -415,8 +415,8 @@ pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_ } break; - case NTT_ISO14443B_106: - case NTT_ISO14443B_TCL_106: + case NTT_ISO14443_4B_106: + case NTT_ISO14443_4B_TCL_106: // We skip the first byte: its the target number (Tg) pbtRawData++; @@ -1073,7 +1073,7 @@ pn53x_target_init (nfc_device_t * pnd, const nfc_target_mode_t ntm, const nfc_ta switch(nt.ntt) { case NTT_MIFARE: case NTT_GENERIC_PASSIVE_106: - case NTT_ISO14443A_106: { + case NTT_ISO14443_4A_106: { // Set ATQA (SENS_RES) abtMifareParams[0] = nt.nti.nai.abtAtqa[1]; abtMifareParams[1] = nt.nti.nai.abtAtqa[0]; diff --git a/libnfc/nfc.c b/libnfc/nfc.c index cbf9ccd..15d4064 100644 --- a/libnfc/nfc.c +++ b/libnfc/nfc.c @@ -350,7 +350,7 @@ nfc_initiator_select_passive_target (nfc_device_t * pnd, break; case NM_ISO14443B_106: - if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_ISO14443B_106, pnti)) { + if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_ISO14443_4B_106, pnti)) { return false; } break;