Lets search continuing to find other USB readers if any in PN531 and PN533 USB drivers.
This commit is contained in:
parent
790fc0da1e
commit
9526d5debc
2 changed files with 4 additions and 14 deletions
|
@ -131,18 +131,13 @@ dev_info* pn531_connect(const nfc_device_desc_t* pndd)
|
||||||
dsp.pudh = usb_open(dev);
|
dsp.pudh = usb_open(dev);
|
||||||
|
|
||||||
get_end_points(dev,&dsp);
|
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)
|
if(usb_claim_interface(dsp.pudh,0) < 0)
|
||||||
{
|
{
|
||||||
DBG("Can't claim interface");
|
DBG("Can't claim interface");
|
||||||
usb_close(dsp.pudh);
|
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
|
// Allocate memory for the device info and specification, fill it and return the info
|
||||||
pdsp = malloc(sizeof(dev_spec_pn531));
|
pdsp = malloc(sizeof(dev_spec_pn531));
|
||||||
|
|
|
@ -129,18 +129,13 @@ dev_info* pn533_connect(const nfc_device_desc_t* pndd)
|
||||||
dsp.pudh = usb_open(dev);
|
dsp.pudh = usb_open(dev);
|
||||||
|
|
||||||
get_end_points(dev,&dsp);
|
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)
|
if(usb_claim_interface(dsp.pudh,0) < 0)
|
||||||
{
|
{
|
||||||
DBG("Can't claim interface");
|
DBG("Can't claim interface");
|
||||||
usb_close(dsp.pudh);
|
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
|
// Allocate memory for the device info and specification, fill it and return the info
|
||||||
pdsp = malloc(sizeof(dev_spec_pn533));
|
pdsp = malloc(sizeof(dev_spec_pn533));
|
||||||
|
|
Loading…
Add table
Reference in a new issue