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; }