2011-04-10 13:43:42 +03:00
|
|
|
/*
|
|
|
|
* lib/usbopen.h - Common USB device lookup and open code
|
|
|
|
*
|
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
2011-04-10 15:51:30 +03:00
|
|
|
* Written 2008-2011 by Werner Almesberger
|
|
|
|
* Copyright 2008-2011 Werner Almesberger
|
2011-04-10 13:43:42 +03:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef USB_OPEN_H
|
|
|
|
#define USB_OPEN_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <usb.h>
|
|
|
|
|
|
|
|
|
|
|
|
usb_dev_handle *open_usb(uint16_t default_vendor, uint16_t default_product);
|
|
|
|
void parse_usb_id(const char *id);
|
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
2011-04-10 15:51:30 +03:00
|
|
|
void restrict_usb_path(const char *path);
|
2011-04-10 16:55:49 +03:00
|
|
|
void usb_unrestrict(void);
|
2011-04-10 13:43:42 +03:00
|
|
|
|
|
|
|
#endif /* !USB_OPEN_H */
|