From 5c206b78150ef6ac69a6c83aa5bc6a7daa27c4e4 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Wed, 18 Aug 2010 13:10:21 +0000 Subject: [PATCH] Improve ISO14443B support of nfc_initiator_list_passive_targets() function. --- libnfc/nfc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libnfc/nfc.c b/libnfc/nfc.c index b1a8893..3cb5fa0 100644 --- a/libnfc/nfc.c +++ b/libnfc/nfc.c @@ -528,8 +528,15 @@ nfc_initiator_list_passive_targets(nfc_device_t* pnd, const nfc_modulation_t nmI // Let the reader only try once to find a target nfc_configure (pnd, NDO_INFINITE_SELECT, false); - - while (nfc_initiator_select_passive_target (pnd, nmInitModulation, NULL, 0, &nti)) { + byte_t* pbtInitData = NULL; + size_t szInitDataLen = 0; + + if(nmInitModulation == NM_ISO14443B_106) { + // Application Family Identifier (AFI) must equals 0x00 in order to wakeup all ISO14443-B PICCs (see ISO/IEC 14443-3) + pbtInitData = (byte_t*)"\x00"; + szInitDataLen = 1; + } + while (nfc_initiator_select_passive_target (pnd, nmInitModulation, pbtInitData, szInitDataLen, &nti)) { nfc_initiator_deselect_target(pnd); if(szTargets > szTargetFound) {