diff --git a/src/lib/drivers/pn531_usb.c b/src/lib/drivers/pn531_usb.c index ce4788d..5f3c1cb 100644 --- a/src/lib/drivers/pn531_usb.c +++ b/src/lib/drivers/pn531_usb.c @@ -60,9 +60,12 @@ bool pn531_usb_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, s pn53x_usb_list_devices(&pnddDevices[0], szDevices, pszDeviceFound, idvendor, idproduct, PN531_USB_DRIVER_NAME); if(*pszDeviceFound == szDevices) + { + DBG("Found %d devices",*pszDeviceFound); return true; + } firstpass= *pszDeviceFound; - pn53x_usb_list_devices(&pnddDevices[firstpass], szDevices, pszDeviceFound, idvendor_alt, idproduct_alt, PN531_USB_DRIVER_NAME); + pn53x_usb_list_devices(&pnddDevices[firstpass], szDevices - firstpass, pszDeviceFound, idvendor_alt, idproduct_alt, PN531_USB_DRIVER_NAME); (*pszDeviceFound) += firstpass; DBG("Found %d devices",*pszDeviceFound); diff --git a/src/lib/drivers/pn533_usb.c b/src/lib/drivers/pn533_usb.c index 5a6982c..93eaea6 100644 --- a/src/lib/drivers/pn533_usb.c +++ b/src/lib/drivers/pn533_usb.c @@ -41,7 +41,7 @@ nfc_device_desc_t * pn533_usb_pick_device (void) } if (szN == 0) { - ERR("%s", "No device found"); + DBG("%s", "No device found"); return NULL; } } @@ -60,11 +60,15 @@ bool pn533_usb_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, s pn53x_usb_list_devices(&pnddDevices[0], szDevices, pszDeviceFound, idvendor, idproduct, PN533_USB_DRIVER_NAME); if(*pszDeviceFound == szDevices) + { + DBG("Found %d devices",*pszDeviceFound); return true; + } firstpass= *pszDeviceFound; - pn53x_usb_list_devices(&pnddDevices[firstpass], szDevices, pszDeviceFound, idvendor_alt, idproduct_alt, PN533_USB_DRIVER_NAME); + pn53x_usb_list_devices(&pnddDevices[firstpass], szDevices - firstpass, pszDeviceFound, idvendor_alt, idproduct_alt, PN533_USB_DRIVER_NAME); (*pszDeviceFound) += firstpass; + DBG("Found %d devices",*pszDeviceFound); if(*pszDeviceFound) return true; return false;