From 9526d5debcf9575e61a3e0ca79b48f5e0ab913a3 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Fri, 20 Nov 2009 15:39:52 +0000 Subject: [PATCH] Lets search continuing to find other USB readers if any in PN531 and PN533 USB drivers. --- src/lib/drivers/pn531.c | 9 ++------- src/lib/drivers/pn533.c | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/lib/drivers/pn531.c b/src/lib/drivers/pn531.c index 1bde5b0..c8c1524 100644 --- a/src/lib/drivers/pn531.c +++ b/src/lib/drivers/pn531.c @@ -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)); diff --git a/src/lib/drivers/pn533.c b/src/lib/drivers/pn533.c index ae5353f..2b4719e 100644 --- a/src/lib/drivers/pn533.c +++ b/src/lib/drivers/pn533.c @@ -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));