diff options
author | Uri Lublin <uril@redhat.com> | 2013-03-24 14:31:17 +0200 |
---|---|---|
committer | Uri Lublin <uril@redhat.com> | 2013-04-04 11:36:39 +0300 |
commit | 6a3206479f1822a31619d282a7caf544e0cfe440 (patch) | |
tree | ad43662c3cb28eee547275f9e9739b084119f2a5 /gtk | |
parent | a0cadd9a56e051388e78a3dff3f25cf8c78dd86c (diff) |
win-usb-dev: make VID and PID available via get_property (Windows)
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/win-usb-dev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/win-usb-dev.c b/gtk/win-usb-dev.c index c188807..0bccc7c 100644 --- a/gtk/win-usb-dev.c +++ b/gtk/win-usb-dev.c @@ -60,6 +60,8 @@ struct _GUdevDeviceInfo { gchar sclass[4]; gchar sbus[4]; gchar saddr[4]; + gchar svid[8]; + gchar spid[8]; }; struct _GUdevDevicePrivate @@ -313,6 +315,8 @@ static gboolean get_usb_dev_info(libusb_device *dev, GUdevDeviceInfo *udevinfo) snprintf(udevinfo->sclass, sizeof(udevinfo->sclass), "%d", udevinfo->class); snprintf(udevinfo->sbus, sizeof(udevinfo->sbus), "%d", udevinfo->bus); snprintf(udevinfo->saddr, sizeof(udevinfo->saddr), "%d", udevinfo->addr); + snprintf(udevinfo->svid, sizeof(udevinfo->svid), "%d", udevinfo->vid); + snprintf(udevinfo->spid, sizeof(udevinfo->spid), "%d", udevinfo->pid); return TRUE; } @@ -466,6 +470,10 @@ const gchar *g_udev_device_get_property(GUdevDevice *udev, const gchar *property return udevinfo->saddr; } else if (g_strcmp0(property, "DEVTYPE") == 0) { return "usb_device"; + } else if (g_strcmp0(property, "VID") == 0) { + return udevinfo->svid; + } else if (g_strcmp0(property, "PID") == 0) { + return udevinfo->spid; } g_warn_if_reached(); |