diff options
Diffstat (limited to '')
-rw-r--r-- | csocketevents.c | 5 |
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++) |