diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-05-09 00:47:30 +0100 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-05-09 00:47:30 +0100 |
commit | 3d928d8dfe2d9af8b3d3ad2eb1d4b878d68704c4 (patch) | |
tree | afd9aac45d87ca26cd83e5b176069195250a3d7f /csocketevents.c | |
parent | d070ed533fe8afdc672c6f04875f2c73f478c196 (diff) | |
parent | 260123716172d33f44bdc0e4e5422554d139215c (diff) | |
download | libphidget21-3d928d8dfe2d9af8b3d3ad2eb1d4b878d68704c4.tar.gz |
Merge tag 'upstream/2.1.8.20120507'
Upstream version 2.1.8.20120507
Diffstat (limited to 'csocketevents.c')
-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++) |