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
commit260123716172d33f44bdc0e4e5422554d139215c (patch)
tree840e8e6387b96bd6f9afe3ffebc19c781a112f1b /csocketevents.c
parent0b624384cd52be20e61284551d832b499d7b7707 (diff)
downloadlibphidget21-upstream/2.1.8.20120507.tar.gz
Imported Upstream version 2.1.8.20120507upstream/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++)