Listing passive targets now quit earlier if szTargets count is reached and in that case, leave with the latest tag selected.
That's quite useful when you need to directly use 1 target because in contrast of nfc_initiator_select_passive_target, you don't need to prepare initiator data by hands
This commit is contained in:
parent
b5c634cb07
commit
d7e7979580
1 changed files with 4 additions and 4 deletions
|
@ -456,10 +456,6 @@ nfc_initiator_list_passive_targets(nfc_device *pnd,
|
||||||
prepare_initiator_data(nm, &pbtInitData, &szInitDataLen);
|
prepare_initiator_data(nm, &pbtInitData, &szInitDataLen);
|
||||||
|
|
||||||
while (nfc_initiator_select_passive_target(pnd, nm, pbtInitData, szInitDataLen, &nt) > 0) {
|
while (nfc_initiator_select_passive_target(pnd, nm, pbtInitData, szInitDataLen, &nt) > 0) {
|
||||||
nfc_initiator_deselect_target(pnd);
|
|
||||||
if (szTargets == szTargetFound) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
size_t i;
|
size_t i;
|
||||||
bool seen = false;
|
bool seen = false;
|
||||||
// Check if we've already seen this tag
|
// Check if we've already seen this tag
|
||||||
|
@ -473,6 +469,10 @@ nfc_initiator_list_passive_targets(nfc_device *pnd,
|
||||||
}
|
}
|
||||||
memcpy(&(ant[szTargetFound]), &nt, sizeof(nfc_target));
|
memcpy(&(ant[szTargetFound]), &nt, sizeof(nfc_target));
|
||||||
szTargetFound++;
|
szTargetFound++;
|
||||||
|
if (szTargets == szTargetFound) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
nfc_initiator_deselect_target(pnd);
|
||||||
// deselect has no effect on FeliCa and Jewel cards so we'll stop after one...
|
// deselect has no effect on FeliCa and Jewel cards so we'll stop after one...
|
||||||
// ISO/IEC 14443 B' cards are polled at 100% probability so it's not possible to detect correctly two cards at the same time
|
// ISO/IEC 14443 B' cards are polled at 100% probability so it's not possible to detect correctly two cards at the same time
|
||||||
if ((nm.nmt == NMT_FELICA) || (nm.nmt == NMT_JEWEL) || (nm.nmt == NMT_ISO14443BI) || (nm.nmt == NMT_ISO14443B2SR) || (nm.nmt == NMT_ISO14443B2CT)) {
|
if ((nm.nmt == NMT_FELICA) || (nm.nmt == NMT_JEWEL) || (nm.nmt == NMT_ISO14443BI) || (nm.nmt == NMT_ISO14443B2SR) || (nm.nmt == NMT_ISO14443B2CT)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue