From fd30e63b800801ba203a64c08e8f027b7a992164 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 10 Feb 2014 00:01:34 +0100 Subject: [PATCH] nfc_initiator_target_is_present(): Fixes issue #267, second attempt --- libnfc/chips/pn53x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 4e22cf3..2243278 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1791,7 +1791,7 @@ static int pn53x_ISO14443A_4_is_present(struct nfc_device *pnd) log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "%s", "target_is_present(): Ping -4A"); if (CHIP_DATA(pnd)->type == PN533) { ret = pn53x_Diagnose06(pnd); - if ((ret == NFC_ETIMEOUT) && (CHIP_DATA(pnd)->type == PN533)) { + if ((ret == NFC_ETIMEOUT) || (ret == NFC_ETGRELEASED)) { // This happens e.g. when a JCOP31 is removed from PN533 // InRelease takes an abnormal time to reply so let's take care of it now with large timeout: const uint8_t abtCmd[] = { InRelease, 0x00 };