Skip to content

Commit

Permalink
initiator_select_passive_target(): now supports all speeds for ISO144…
Browse files Browse the repository at this point in the history
…43-4A tags
  • Loading branch information
doegox committed Mar 10, 2014
1 parent 108de27 commit ddde2dd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libnfc/chips/pn53x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
} else {

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;
return pnd->last_error;
}
Expand All @@ -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) {
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) {
pnd->last_error = NFC_ESOFT;
Expand Down

0 comments on commit ddde2dd

Please sign in to comment.