What does usb_bulk_read() return when it fails?
What error string does usb_strerror() return?
> Hi, folks:
>
> I'm writing a small program sampling datas from a USB device.
>
> In one thread, I read USB data with the following line:
> size = usb_bulk_read(apu_usb_dev, 0x81, buf, 320, 20);
>
> In another thread, I check the availablity of that USB device by calling the
> following function fired by a timer for every 3 seconds.
>
> int APU_USB_Ready(LPARAM lParam)
> {
> struct usb_bus * bus ;
> struct usb_device * dev ;
>
> usb_find_devices();
> for (bus = usb_get_busses(); bus ; bus = bus -> next) {
> for (dev = bus -> devices; dev; dev = dev -> next) {
> if (dev -> descriptor.idVendor == 0x5345 &&
> dev -> descriptor.idProduct == 0x1234)
> return 1 ;
> }
> }
> return 0 ;
> }
>
> It works for 20-40 minutes, then suddenly, size, the return value of usb_bulk_read()
> would get something less than zero, and the USB line is stalled. I checking the online
> manual of usb_bulk_read() and couldn't get much information there.
>
> Removed the call of APU_USB_Ready(), the program kept running for more than 5 hours without
> getting any "less than 0" error from usb_bulk_read().
>
> Is this a known problem?
>
> Thanks
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
|