diff --git a/libnfc/nfc.c b/libnfc/nfc.c index b55e241..1e95e09 100644 --- a/libnfc/nfc.c +++ b/libnfc/nfc.c @@ -390,6 +390,12 @@ nfc_initiator_list_passive_targets (nfc_device_t * pnd, while (nfc_initiator_select_passive_target (pnd, nm, pbtInitData, szInitDataLen, &nt)) { nfc_initiator_deselect_target (pnd); + // some readers have to reset the RF field (e.g. LoGO) so we stop if we see more than once the same tag + if (nm.nmt == NMT_ISO14443B && szTargetFound >= 1) { + if (0 == memcmp(nt.nti.nbi.abtPupi, ant[0].nti.nbi.abtPupi, sizeof (nt.nti.nbi.abtPupi))) { + break; + } + } if (szTargets > szTargetFound) { memcpy (&(ant[szTargetFound]), &nt, sizeof (nfc_target_t)); } else { @@ -398,7 +404,7 @@ nfc_initiator_list_passive_targets (nfc_device_t * pnd, szTargetFound++; // deselect has no effect on FeliCa and Jewel cards so we'll stop after one... if ((nm.nmt == NMT_FELICA) || (nm.nmt == NMT_JEWEL)) { - break; + break; } } *pszTargetFound = szTargetFound;