From ae99d155b5e5e1a9ae747603dd180c916a8624b1 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Fri, 9 Apr 2010 22:08:17 +0000 Subject: [PATCH] Make nfc-list rely on the libnfcutils.a convenience library and call nfc_initiator_select_tag(). --- examples/Makefile.am | 3 ++- examples/nfc-list.c | 10 ++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index c5e4108..75f5eec 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -20,7 +20,8 @@ nfc_anticol_SOURCES = nfc-anticol.c nfc_anticol_LDADD = $(top_builddir)/libnfc/libnfc.la nfc_list_SOURCES = nfc-list.c -nfc_list_LDADD = $(top_builddir)/libnfc/libnfc.la +nfc_list_LDADD = $(top_builddir)/libnfc/libnfc.la \ + $(top_builddir)/examples/libnfcutils.a nfc_mfultralight_SOURCES = nfc-mfultralight.c mifareultag.h nfc_mfultralight_LDADD = $(top_builddir)/libnfc/libnfc.la diff --git a/examples/nfc-list.c b/examples/nfc-list.c index 79469e9..b641bfb 100644 --- a/examples/nfc-list.c +++ b/examples/nfc-list.c @@ -41,6 +41,7 @@ #include #include +#include "nfc-utils.h" #include "bitutils.h" #define MAX_DEVICE_COUNT 16 @@ -128,14 +129,7 @@ int main(int argc, const char* argv[]) if (nfc_initiator_select_tag(pnd,NM_ISO14443A_106,NULL,0,&nti)) { printf("The following (NFC) ISO14443A tag was found:\n\n"); - printf(" ATQA (SENS_RES): "); print_hex(nti.nai.abtAtqa,2); - printf(" UID (NFCID%c): ",(nti.nai.abtUid[0]==0x08?'3':'1')); print_hex(nti.nai.abtUid,nti.nai.szUidLen); - printf(" SAK (SEL_RES): "); print_hex(&nti.nai.btSak,1); - if (nti.nai.szAtsLen) - { - printf(" ATS (ATR): "); - print_hex(nti.nai.abtAts,nti.nai.szAtsLen); - } + print_nfc_iso14443a_info (nti.nai); } // Poll for a Felica tag