list_passive_targets: fixed for TypeB on LoGO

This commit is contained in:
Philippe Teuwen 2011-05-03 19:22:28 +00:00
parent 9231f47123
commit f2cb0eaa6e

View file

@ -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;