1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

tools/lib: atusb can now be selected by bus/device or by bus-port path

Examples:

  usb:1/6	select logical device 6 on bus 1
  usb:1-3.1.4	starting at bus 1, choose ports 3, 1, and 4

- usbopen.c (initialize, open_usb): moved libusb initialization to
  separate function, to allow for sharing
- usbopen.h (restrict_usb_path), usbopen.c (restricted_path, open_usb,
  restrict_usb_dev, restrict_usb_by_dev, read_num, restrict_usb_by_port,
  restrict_usb_path): added mechanism to restrict USB path
- atusb.c (atusb_open): if an argument is given, call restrict_usb_path
  with it
This commit is contained in:
Werner Almesberger
2011-04-10 09:51:30 -03:00
parent a75edf0cc0
commit fc1ad9fffd
3 changed files with 139 additions and 7 deletions

View File

@@ -54,6 +54,8 @@ static void *atusb_open(const char *arg)
{
usb_dev_handle *dev;
if (arg)
restrict_usb_path(arg);
dev = open_usb(USB_VENDOR, USB_PRODUCT);
if (dev) {
error = 0;