On Tue, 15 Feb 2005, Uwe Bonnes wrote: > Alan> That's right. It is possible to submit them and have them queued, > Alan> by using USBDEVFS_SUBMITURB (asynchronous submission). > > The Google Hits for USBDEVFS_SUBMITURB are not very helpfull to me, the > libusb usage of USBDEVFS_SUBMITURB in usb_urb_transfer() seems to > incorporate a wait and I also don't see how I can use if for control > messages. > > Is there any understandable example for queued control messages for user > applications? Can I count on queued messages to be executed in order ?
I'm not familiar with libusb, so I can't tell you how to use it to queue your URBs. However the ioctl interface direct into usbfs is pretty easy to understand, although I don't know of any programming examples for it either. You pass a pointer to a struct usbdevfs_urb (see <linux/usbdevice_fs.h>) to the USBDEVFS_SUBMITURB ioctl. If you specify a signal number, your program will be sent that signal when the URB completes. Send the same pointer to the USBDEVFS_DISCARDURB ioctl to cancel the URB before it has completed, and to either USBDEVFS_REAPURB or USBDEVFS_REAPURBNDELAY to retrieve the results of the URB. (Note that if you cancel an URB it will still complete -- with an error -- and you must still call REAPURB or REAPURBNDELAY.) Queued messages are always sent to the device in order. Alan Stern ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users
