From cf9af4ee49991082a06903d012fda5215c052234 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Wed, 18 Aug 2010 13:13:14 +0000 Subject: [PATCH] nfc-list example now use nfc_initiator_list_passive_targets() function. --- examples/nfc-list.c | 64 +++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/examples/nfc-list.c b/examples/nfc-list.c index 3e00620..7d9493e 100644 --- a/examples/nfc-list.c +++ b/examples/nfc-list.c @@ -47,7 +47,6 @@ #define MAX_TARGET_COUNT 16 static nfc_device_t* pnd; -static byte_t abtFelica[5] = { 0x00, 0xff, 0xff, 0x00, 0x00 }; int main(int argc, const char* argv[]) { @@ -133,45 +132,54 @@ int main(int argc, const char* argv[]) printf("Connected to NFC reader: %s\n",pnd->acName); + // List ISO14443A targets if (nfc_initiator_list_passive_targets(pnd, NM_ISO14443A_106, anti, MAX_TARGET_COUNT, &szTargetFound )) { size_t n; - printf("%zu ISO14443A passive targets was found:\n", szTargetFound); + printf("%zu ISO14443A passive target(s) was found%s\n", szTargetFound, (szTargetFound==0)?".\n":":"); for(n=0; n0) - { - printf(" INF: "); print_hex(nti.nbi.abtInf,nti.nbi.szInfLen); + // List Felica tags + if (nfc_initiator_list_passive_targets(pnd, NM_FELICA_212, anti, MAX_TARGET_COUNT, &szTargetFound )) { + size_t n; + printf("%zu Felica (212 kbps) passive target(s) was found%s\n", szTargetFound, (szTargetFound==0)?".\n":":"); + for(n=0; n