From c0a38e6eb0c65ab36766932ff7f122de3ff9f4f9 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 5 May 2011 22:26:51 +0000 Subject: [PATCH] drivers: fix bug on receive: all pn53x_transceive after an error were flagged as erroneous --- libnfc/drivers/acr122.c | 1 + libnfc/drivers/pn53x_usb.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libnfc/drivers/acr122.c b/libnfc/drivers/acr122.c index 66fbd62..93bc025 100644 --- a/libnfc/drivers/acr122.c +++ b/libnfc/drivers/acr122.c @@ -354,6 +354,7 @@ acr122_receive (nfc_device_t * pnd, byte_t * pbtData, const size_t szData) memcpy (pbtData, DRIVER_DATA (pnd)->abtRx + 2, len); // Transmission went successful + pnd->iLastError = 0; return len; } diff --git a/libnfc/drivers/pn53x_usb.c b/libnfc/drivers/pn53x_usb.c index 7b4c7ce..6bf4ccf 100644 --- a/libnfc/drivers/pn53x_usb.c +++ b/libnfc/drivers/pn53x_usb.c @@ -443,7 +443,7 @@ read: pnd->iLastError = DEIO; // try to interrupt current device state pn53x_usb_ack(pnd); - return false; + return -1; } const byte_t pn53x_preamble[3] = { 0x00, 0x00, 0xff }; @@ -521,6 +521,7 @@ read: return -1; } // The PN53x command is done and we successfully received the reply + pnd->iLastError = 0; return len; }