minor fixes to pn531/pn533 list routines and some more debugging

This commit is contained in:
Adam Laurie 2009-12-07 22:18:32 +00:00
parent 112b4c45e4
commit 6f353013fd
2 changed files with 10 additions and 3 deletions

View file

@ -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);

View file

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