libusbhost: Add accessor for the USB device descriptor
Change-Id: Ic3a54e2a06f3b4fa72f99b64025a911fbf525daf
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h
index 57d9c37..ccc12b1 100644
--- a/include/usbhost/usbhost.h
+++ b/include/usbhost/usbhost.h
@@ -109,6 +109,8 @@
/* 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 93c6dd3..6bdeebf 100644
--- a/libusbhost/usbhost.c
+++ b/libusbhost/usbhost.c
@@ -325,6 +325,11 @@
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,