From 2fb1de34f42e19b37d2a1352209c627ef0f362ea Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 12 Oct 2010 16:04:40 +0000 Subject: [PATCH] pn53x_usb: try to recover device if usb read fails, solves partly Issue 122 --- libnfc/drivers/pn53x_usb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnfc/drivers/pn53x_usb.c b/libnfc/drivers/pn53x_usb.c index 191417d..dcadc72 100644 --- a/libnfc/drivers/pn53x_usb.c +++ b/libnfc/drivers/pn53x_usb.c @@ -327,6 +327,8 @@ pn53x_usb_transceive (nfc_device_t * pnd, const byte_t * pbtTx, const size_t szT if (ret < 0) { DBG ("usb_bulk_read failed with error %d", ret); pnd->iLastError = DEIO; + // try to interrupt current device state + pn53x_usb_ack(pnd); return false; } #ifdef DEBUG @@ -340,6 +342,8 @@ pn53x_usb_transceive (nfc_device_t * pnd, const byte_t * pbtTx, const size_t szT if (ret < 0) { DBG ("usb_bulk_read failed with error %d", ret); pnd->iLastError = DEIO; + // try to interrupt current device state + pn53x_usb_ack(pnd); return false; } #ifdef DEBUG