diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h index 57d9c37e9..ccc12b1c4 100644 --- a/include/usbhost/usbhost.h +++ b/include/usbhost/usbhost.h @@ -109,6 +109,8 @@ uint16_t usb_device_get_vendor_id(struct usb_device *device); /* Returns the USB product ID from the device descriptor for the USB device */ uint16_t usb_device_get_product_id(struct usb_device *device); +const struct usb_device_descriptor* usb_device_get_device_descriptor(struct usb_device *device); + /* Sends a control message to the specified device on endpoint zero */ int usb_device_send_control(struct usb_device *device, int requestType, diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c index 93c6dd3a8..6bdeebf23 100644 --- a/libusbhost/usbhost.c +++ b/libusbhost/usbhost.c @@ -325,6 +325,11 @@ uint16_t usb_device_get_product_id(struct usb_device *device) return __le16_to_cpu(desc->idProduct); } +const struct usb_device_descriptor* usb_device_get_device_descriptor(struct usb_device *device) +{ + return (struct usb_device_descriptor*)device->desc; +} + int usb_device_send_control(struct usb_device *device, int requestType, int request,