From: Johannes E. <joh...@er...> - 2002-12-04 22:00:55
|
On Wed, Dec 04, 2002, Dencker <de...@ma...> wrote: > I would like to use libusb to write a USB device driver on Linux. I would really appreciate if you could help me with some questions. > > First I wonder if there are any good examples on how to use libusb, besides the "libusb Developers Guide". For me it is not obvious which functions to call, and in what order to call these functions. > > If I call the functions usb_init, usb_find_busses and usb_find_devices, the global variable *usb_busses will be initiated, but how do I for instance get the pointer to the usb_device struct required in order to call usb_open. I shouldn't find it myself from within the usb_bus struct, or ...? You'll need to scan the list to find the device you want. Take a look at the examples section in the documentation or testlibusb for some sample code. Just replace the inner part of the loop with the code to match the device you want to find. JE |