From 260123716172d33f44bdc0e4e5422554d139215c Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Wed, 9 May 2012 00:47:30 +0100 Subject: Imported Upstream version 2.1.8.20120507 --- csocketevents.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'csocketevents.c') 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