From 71eda315c70c9acdd69b84bcea9e83c5edacfde0 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 31 Jan 2014 22:33:05 +0100 Subject: [PATCH] nfc_initiator_target_is_present(): Fix MFC support on PN532 --- libnfc/chips/pn53x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 9781a2a..df0aec1 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1804,10 +1804,12 @@ static int pn53x_ISO14443A_MFC_is_present(struct nfc_device *pnd) ret = pn53x_Diagnose06(pnd); } else { // Limitation: re-select will lose authentication of already authenticated sector - // TODO: buggy when card is removed on Tikitag + // Limitation: NP_INFINITE_SELECT will be left as FALSE (we cannot restore as we don't know what was the original state) uint8_t pbtInitiatorData[12]; size_t szInitiatorData = 0; iso14443_cascade_uid(CHIP_DATA(pnd)->current_target->nti.nai.abtUid, CHIP_DATA(pnd)->current_target->nti.nai.szUidLen, pbtInitiatorData, &szInitiatorData); + if ((ret = pn53x_set_property_bool(pnd, NP_INFINITE_SELECT, false)) < 0) + return ret; if ((ret = pn53x_initiator_select_passive_target_ext(pnd, CHIP_DATA(pnd)->current_target->nm, pbtInitiatorData, szInitiatorData, NULL, 300)) == 1) { ret = NFC_SUCCESS; } else if ((ret == 0) || (ret == NFC_ETIMEOUT)) {