Lets search continuing to find other USB readers if any in PN531 and PN533 USB drivers.

This commit is contained in:
Romuald Conty 2009-11-20 15:39:52 +00:00
parent 790fc0da1e
commit 9526d5debc
2 changed files with 4 additions and 14 deletions

View file

@ -131,18 +131,13 @@ dev_info* pn531_connect(const nfc_device_desc_t* pndd)
dsp.pudh = usb_open(dev);
get_end_points(dev,&dsp);
if(usb_set_configuration(dsp.pudh,1) < 0)
{
DBG("Set config failed");
usb_close(dsp.pudh);
return INVALID_DEVICE_INFO;
}
if(usb_claim_interface(dsp.pudh,0) < 0)
{
DBG("Can't claim interface");
usb_close(dsp.pudh);
return INVALID_DEVICE_INFO;
// don't return yet as there might be other readers on USB bus
continue;
}
// Allocate memory for the device info and specification, fill it and return the info
pdsp = malloc(sizeof(dev_spec_pn531));

View file

@ -129,18 +129,13 @@ dev_info* pn533_connect(const nfc_device_desc_t* pndd)
dsp.pudh = usb_open(dev);
get_end_points(dev,&dsp);
if(usb_set_configuration(dsp.pudh,1) < 0)
{
DBG("Setting config failed");
usb_close(dsp.pudh);
return INVALID_DEVICE_INFO;
}
if(usb_claim_interface(dsp.pudh,0) < 0)
{
DBG("Can't claim interface");
usb_close(dsp.pudh);
return INVALID_DEVICE_INFO;
// don't return yet as there might be other readers on USB bus
continue;
}
// Allocate memory for the device info and specification, fill it and return the info
pdsp = malloc(sizeof(dev_spec_pn533));