initiator_select_passive_target(): now supports all speeds for ISO14443-4A tags

This commit is contained in:
Philippe Teuwen 2014-03-11 00:13:26 +01:00
parent 108de27c1b
commit ddde2dd8f2

View file

@ -1143,7 +1143,7 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
} else { } else {
const pn53x_modulation pm = pn53x_nm_to_pm(nm); const pn53x_modulation pm = pn53x_nm_to_pm(nm);
if (PM_UNDEFINED == pm) { if ((PM_UNDEFINED == pm)||(NBR_UNDEFINED == nm.nbr)) {
pnd->last_error = NFC_EINVARG; pnd->last_error = NFC_EINVARG;
return pnd->last_error; return pnd->last_error;
} }
@ -1158,6 +1158,14 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
if ((res = pn53x_decode_target_data(abtTargetsData + 1, szTargetsData - 1, CHIP_DATA(pnd)->type, nm.nmt, &(nttmp.nti))) < 0) { if ((res = pn53x_decode_target_data(abtTargetsData + 1, szTargetsData - 1, CHIP_DATA(pnd)->type, nm.nmt, &(nttmp.nti))) < 0) {
return res; return res;
} }
if (nm.nbr != NBR_106) {
uint8_t pncmd_inpsl[4] = { InPSL, 0x01 };
pncmd_inpsl[2] = nm.nbr - 1;
pncmd_inpsl[3] = nm.nbr - 1;
if ((res = pn53x_transceive(pnd, pncmd_inpsl, sizeof(pncmd_inpsl), NULL, 0, 0)) < 0) {
return res;
}
}
} }
if (pn53x_current_target_new(pnd, &nttmp) == NULL) { if (pn53x_current_target_new(pnd, &nttmp) == NULL) {
pnd->last_error = NFC_ESOFT; pnd->last_error = NFC_ESOFT;