summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/usbhost/usbhost.h4
-rw-r--r--libusbhost/usbhost.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h
index d26e93175..4350ec103 100644
--- a/include/usbhost/usbhost.h
+++ b/include/usbhost/usbhost.h
@@ -156,6 +156,10 @@ char* usb_device_get_manufacturer_name(struct usb_device *device);
*/
char* usb_device_get_product_name(struct usb_device *device);
+/* Returns the version number for the USB device.
+ */
+int usb_device_get_version(struct usb_device *device);
+
/* Returns the USB serial number for the USB device.
* Call free() to free the result when you are done with it.
*/
diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c
index 684f40133..40b8b9f9f 100644
--- a/libusbhost/usbhost.c
+++ b/libusbhost/usbhost.c
@@ -498,6 +498,12 @@ char* usb_device_get_product_name(struct usb_device *device)
return usb_device_get_string(device, desc->iProduct);
}
+int usb_device_get_version(struct usb_device *device)
+{
+ struct usb_device_descriptor *desc = (struct usb_device_descriptor *)device->desc;
+ return desc->bcdUSB;
+}
+
char* usb_device_get_serial(struct usb_device *device)
{
struct usb_device_descriptor *desc = (struct usb_device_descriptor *)device->desc;