diff options
author | Richard Hughes <richard@hughsie.com> | 2015-11-10 11:34:01 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-11-10 11:38:56 +0000 |
commit | 424700bb3aa643041f4b62efdd5f39f9a50924f4 (patch) | |
tree | 8cef8f132a172f6258ffc93334bcd69d3a290850 /gusb/gusb-device.c | |
parent | 0c5eb813279c67607e17dfd99087358d34c6c8f5 (diff) | |
download | gusb-424700bb3aa643041f4b62efdd5f39f9a50924f4.tar.gz |
Add g_usb_device_get_release()
This allows us to get access to the bcdDevice, typically a firmware version.
Diffstat (limited to 'gusb/gusb-device.c')
-rw-r--r-- | gusb/gusb-device.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c index 8d3b521..a8e6159 100644 --- a/gusb/gusb-device.c +++ b/gusb/gusb-device.c @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- * - * Copyright (C) 2010-2011 Richard Hughes <richard@hughsie.com> + * Copyright (C) 2010-2015 Richard Hughes <richard@hughsie.com> * Copyright (C) 2011 Hans de Goede <hdegoede@redhat.com> * Copyright (C) 2011 Debarshi Ray <debarshir@src.gnome.org> * @@ -1550,6 +1550,24 @@ g_usb_device_get_pid (GUsbDevice *device) } /** + * g_usb_device_get_release: + * @device: a #GUsbDevice + * + * Gets the BCD firmware version number for the device. + * + * Return value: a version number in BCD format. + * + * Since: 0.2.8 + **/ +guint16 +g_usb_device_get_release (GUsbDevice *device) +{ + g_return_val_if_fail (G_USB_IS_DEVICE (device), 0); + + return device->priv->desc.bcdDevice; +} + +/** * g_usb_device_get_vid_as_str: * @device: a #GUsbDevice * |