diff options
author | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2006-10-04 10:23:54 +0000 |
---|---|---|
committer | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2006-10-04 10:23:54 +0000 |
commit | 2f426580fa990c1e190d09f9d6a4a7fc9b6d25c3 (patch) | |
tree | 7a79f2de68c4c377490f48de0fd99e09af69588b | |
parent | 7ace9ffe10a8cfe73f7357598e2d5699c9ce607d (diff) |
- make openpcd driver work with most recent openpcd dumbreader firmware
- make openpcd driver work if it is called after some other usb driver
was initialized
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1893 e0336214-984f-0b4b-a45f-81c69e1f0ede
-rw-r--r-- | src/rfid_reader_openpcd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rfid_reader_openpcd.c b/src/rfid_reader_openpcd.c index b964165..51852f0 100644 --- a/src/rfid_reader_openpcd.c +++ b/src/rfid_reader_openpcd.c @@ -116,12 +116,13 @@ static struct usb_device *find_opcd_device(void) struct usb_device *dev; for (dev = bus->devices; dev; dev = dev->next) { int i; + printf("usb: %4x:%4x\n", dev->descriptor.idVendor, + dev->descriptor.idProduct); for (i = 0; i < ARRAY_SIZE(opcd_usb_ids); i++) { const struct usb_id *id = &opcd_usb_ids[i]; + printf("%x:%x\n", id->vid, id->pid); if (dev->descriptor.idVendor == id->vid && - dev->descriptor.idProduct == id->pid && - dev->descriptor.bNumConfigurations == 1 && - dev->config->iConfiguration == 0) + dev->descriptor.idProduct == id->pid) return dev; } } @@ -321,9 +322,9 @@ openpcd_open(void *data) rcv_hdr = (struct openpcd_hdr *)rcv_buf; usb_init(); - if (!usb_find_busses()) + if (usb_find_busses() < 0) return NULL; - if (!usb_find_devices()) + if (usb_find_devices() < 0) return NULL; dev = find_opcd_device(); |