aboutsummaryrefslogtreecommitdiffstats
path: root/linux/cusblinux.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/cusblinux.c')
-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)))