Fix nfc_initiator_poll_target without tag on PN532
When there is no tag on PN532 reader, the library incorrectly processed call result and returned NFC_ECHIP (chip error) instead of 0 (no targets found).
This commit is contained in:
parent
af8fe86b0d
commit
11a4e3cd7f
1 changed files with 3 additions and 0 deletions
|
@ -1226,6 +1226,9 @@ pn53x_initiator_poll_target(struct nfc_device *pnd,
|
||||||
if ((res = pn53x_InAutoPoll(pnd, apttTargetTypes, szTargetTypes, uiPollNr, uiPeriod, ntTargets, 0)) < 0)
|
if ((res = pn53x_InAutoPoll(pnd, apttTargetTypes, szTargetTypes, uiPollNr, uiPeriod, ntTargets, 0)) < 0)
|
||||||
return res;
|
return res;
|
||||||
switch (res) {
|
switch (res) {
|
||||||
|
case 0:
|
||||||
|
return pnd->last_error = NFC_SUCCESS;
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
*pnt = ntTargets[0];
|
*pnt = ntTargets[0];
|
||||||
if (pn53x_current_target_new(pnd, pnt) == NULL) {
|
if (pn53x_current_target_new(pnd, pnt) == NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue