diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h index 4350ec103..88b5b4406 100644 --- a/include/usbhost/usbhost.h +++ b/include/usbhost/usbhost.h @@ -219,6 +219,9 @@ int usb_device_bulk_transfer(struct usb_device *device, int length, unsigned int timeout); +/** Reset USB bus for the device */ +int usb_device_reset(struct usb_device *device); + /* Creates a new usb_request. */ struct usb_request *usb_request_new(struct usb_device *dev, const struct usb_endpoint_descriptor *ep_desc); diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c index b8e32154f..299fdc475 100644 --- a/libusbhost/usbhost.c +++ b/libusbhost/usbhost.c @@ -617,6 +617,11 @@ int usb_device_bulk_transfer(struct usb_device *device, return ioctl(device->fd, USBDEVFS_BULK, &ctrl); } +int usb_device_reset(struct usb_device *device) +{ + return ioctl(device->fd, USBDEVFS_RESET); +} + struct usb_request *usb_request_new(struct usb_device *dev, const struct usb_endpoint_descriptor *ep_desc) {