aboutsummaryrefslogtreecommitdiffstats
path: root/csocketevents.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 /csocketevents.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--csocketevents.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/csocketevents.c b/csocketevents.c
index 9291994..6ad4ca1 100644
--- a/csocketevents.c
+++ b/csocketevents.c
@@ -2003,6 +2003,7 @@ void network_phidget_event_handler(const char *key, const char *val, unsigned in
CPhidget_clearStatusFlag(&phid->status, PHIDGET_DETACHING_FLAG, NULL);
phid->deviceIDSpec = 0;
+ phid->deviceUID = 0;
ZEROMEM(&phid->attr, sizeof(CPhidgetAttr));
if(phid->specificDevice != PHIDGETOPEN_LABEL)
ZEROMEM(phid->label, MAX_LABEL_STORAGE);
@@ -2032,6 +2033,9 @@ void network_phidget_event_handler(const char *key, const char *val, unsigned in
{
LOG(PHIDGET_LOG_VERBOSE, "Got all initkeys, run attach - %d/%d", phid->keyCount, phid->initKeys);
+ //Set UID
+ phid->deviceUID = CPhidget_getUID(phid->deviceIDSpec, phid->deviceVersion);
+
CPhidget_setStatusFlag(&phid->status, PHIDGET_ATTACHED_FLAG, &phid->lock);
SET_RUNNING_EVENT(phid)
@@ -2114,6 +2118,7 @@ void network_manager_event_handler(const char *key, const char *val, unsigned in
phid->serialNumber = serialNumber;
phid->deviceIDSpec = (unsigned short)strtol(deviceIDSpec, NULL, 10);
phid->deviceVersion = strtol(version, NULL, 10);
+ phid->deviceUID = CPhidget_getUID(phid->deviceIDSpec, phid->deviceVersion);
phid->specificDevice = PHIDGETOPEN_SERIAL; //so it actually compares the serial
for(i = 1;i<PHIDGET_DEVICE_COUNT;i++)