diff --git a/examples/nfc-poll.c b/examples/nfc-poll.c index cb1afa9..6d64c32 100644 --- a/examples/nfc-poll.c +++ b/examples/nfc-poll.c @@ -148,6 +148,12 @@ main(int argc, const char *argv[]) } else { printf("No target found.\n"); } + + printf("Waiting for card removing..."); + while (0 == (res = nfc_initiator_target_is_present(pnd, NULL))) {} + nfc_perror(pnd, "nfc_initiator_target_is_present"); + printf("done.\n"); + nfc_close(pnd); nfc_exit(context); exit(EXIT_SUCCESS); diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 540e39d..7d4d5de 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1800,7 +1800,11 @@ pn53x_initiator_target_is_present(struct nfc_device *pnd, const nfc_target *pnt) //TODO MFC Mini (atqa0004/sak09) fails on PN533 ret = pn53x_Diagnose06(pnd); } else { - ret = NFC_EDEVNOTSUPP; + if((ret = pn53x_initiator_select_passive_target_ext(pnd, CHIP_DATA(pnd)->current_target->nm, CHIP_DATA(pnd)->current_target->nti.nai.abtUid, CHIP_DATA(pnd)->current_target->nti.nai.szUidLen, NULL, 50)) == 1) { + ret = NFC_SUCCESS; + } else if ((ret == 0) || (ret == NFC_ETIMEOUT)) { + ret = NFC_ETGRELEASED; + } } } else { // unknown