mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-23 00:42:28 +02:00
tools/lib/: added mechanism to remove USB restrictions (enabling multiple sessions)
- usbopen.h (usb_unrestrict), usbusb.c (usb_unrestrict): drop ID and path restrictions - atusb.c (atusb_open): call usb_unrestrict to remove restrictions
This commit is contained in:
parent
4b07e5c894
commit
4190aded8c
@ -54,6 +54,7 @@ static void *atusb_open(const char *arg)
|
|||||||
{
|
{
|
||||||
usb_dev_handle *dev;
|
usb_dev_handle *dev;
|
||||||
|
|
||||||
|
usb_unrestrict();
|
||||||
if (arg)
|
if (arg)
|
||||||
restrict_usb_path(arg);
|
restrict_usb_path(arg);
|
||||||
dev = open_usb(USB_VENDOR, USB_PRODUCT);
|
dev = open_usb(USB_VENDOR, USB_PRODUCT);
|
||||||
|
@ -228,3 +228,11 @@ void restrict_usb_path(const char *path)
|
|||||||
else
|
else
|
||||||
restrict_usb_by_port(path);
|
restrict_usb_by_port(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void usb_unrestrict(void)
|
||||||
|
{
|
||||||
|
vendor = 0;
|
||||||
|
product = 0;
|
||||||
|
restricted_path = NULL;
|
||||||
|
}
|
||||||
|
@ -21,5 +21,6 @@
|
|||||||
usb_dev_handle *open_usb(uint16_t default_vendor, uint16_t default_product);
|
usb_dev_handle *open_usb(uint16_t default_vendor, uint16_t default_product);
|
||||||
void parse_usb_id(const char *id);
|
void parse_usb_id(const char *id);
|
||||||
void restrict_usb_path(const char *path);
|
void restrict_usb_path(const char *path);
|
||||||
|
void usb_unrestrict(void);
|
||||||
|
|
||||||
#endif /* !USB_OPEN_H */
|
#endif /* !USB_OPEN_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user