aboutsummaryrefslogtreecommitdiffstats
path: root/linux/cusblinux.c
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-05-09 00:47:30 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2012-05-09 00:47:30 +0100
commit3d928d8dfe2d9af8b3d3ad2eb1d4b878d68704c4 (patch)
treeafd9aac45d87ca26cd83e5b176069195250a3d7f /linux/cusblinux.c
parentd070ed533fe8afdc672c6f04875f2c73f478c196 (diff)
parent260123716172d33f44bdc0e4e5422554d139215c (diff)
downloadlibphidget21-3d928d8dfe2d9af8b3d3ad2eb1d4b878d68704c4.tar.gz
Merge tag 'upstream/2.1.8.20120507'
Upstream version 2.1.8.20120507
Diffstat (limited to '')
-rw-r--r--linux/cusblinux.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/linux/cusblinux.c b/linux/cusblinux.c
index 3a12fca..5e4886c 100644
--- a/linux/cusblinux.c
+++ b/linux/cusblinux.c
@@ -9,6 +9,12 @@
#include "stdafx.h"
#include "cusb.h"
+#include <usb.h>
+
+int CUSBGetDeviceCapabilities(CPhidgetHandle phid, struct usb_device *dev, struct usb_dev_handle *udev);
+
+void CUSBUninit()
+{}
int CUSBCloseHandle(CPhidgetHandle phid) {
int ret = 0;
@@ -472,6 +478,7 @@ int CUSBBuildList(CPhidgetList **curList) {
CPhidget_setStatusFlag(&phid->status, PHIDGET_ATTACHED_FLAG, &phid->lock);
phid->deviceIDSpec = Phid_Device_Def[i].pdd_sdid;
+ phid->deviceUID = CPhidget_getUID(phid->deviceIDSpec, phid->deviceVersion);
phid->deviceDef = &Phid_Device_Def[i];
phid->deviceID = Phid_Device_Def[i].pdd_did;
phid->ProductID = dev->descriptor.idProduct;
@@ -634,7 +641,9 @@ int CUSBOpenHandle(CPhidgetHandle phid)
if (dev->descriptor.bcdDevice < 0x100)
phid->deviceVersion = dev->descriptor.bcdDevice * 100;
else
- phid->deviceVersion = ((dev->descriptor.bcdDevice >> 8) * 100) + ((dev->descriptor.bcdDevice & 0xff));
+ phid->deviceVersion = ((dev->descriptor.bcdDevice >> 8) * 100) + ((dev->descriptor.bcdDevice & 0xff));
+
+ phid->deviceUID = CPhidget_getUID(phid->deviceIDSpec, phid->deviceVersion);
phid->serialNumber = serial;
if((ret = CUSBGetDeviceCapabilities(phid, dev, udev)))