From: Danny R. <dk...@ra...> - 2004-06-23 17:58:05
|
Johannes Erdfelt wrote: > On Tue, Jun 22, 2004, Danny Rathjens <dk...@ra...> wrote: > >>I wrote an app that uses usb_interrupt_read to read card data >>from a card swipe device. I wanted to clear any existing data >>before accepting a new swipe so I made a loop that called >>usb_interrupt_read with a timeout of 10 milliseconds until >>it times out. Then I want to get the current card swipe, >>which means I call usb_interrupt_read again with a timeout of >>30 seconds(and then a bunch more to get rest of track data). >> >>My problem is that the call to usb_interrupt_read with a >>timout of 30 seconds is returning immediately with a timeout. >>It seems as if the timeout status has been cached somehow. >>Calling usb_clear_halt did not help. >> >>My somewhat kludgy solution was to release the interface, >>close the usb_dev_handle, re-open the device, re-claim >>the interface, re-set altinterface, and then make the >>usb_interrupt_read call with a 30 second timeout. >> >>Any idea how to do this in a less kludgy manner? Oh yeah, >>I also tried sleeping for a bit in between clearing the >>buffered swipe and attempting to read the new one. > > > What version of libusb are you using? There was a bug at one time that > would result in that behaviour. > > Have you tried the version out of CVS? > Thanks for the reply. I am using libusb-0.1.8 with linux-2.4.26. I shall check out the CVS version. -- _.,-*~`^'~*-,._ Danny Rathjens _.,-*~`^'~*-,._ FireCast: Rock solid kiosk software: http://wirespring.com |