struct usb_bus bus struct usb_device dev usb_init initialize libusb us

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
struct usb_bus *bus;
struct usb_device *dev;
usb_init(); // initialize libusb
usb_find_busses();
usb_find_devices();
for(bus=usb_get_busses(); bus; bus=bus->next){
for(dev=bus->devices; dev; dev=dev->next){
// use dev->descriptor to identify device here
}
}