in the Phidget22 API I'm trying to get all the channels (basically, I'd like to recreate the phidget tree UI from my side, ie enumerate all the phidget devices & channels on the system.).
I have the following code:
Code: Select all
PhidgetManager_create(&m_hdl);
PhidgetManager_setOnAttachHandler(
m_hdl,
[] (PhidgetManagerHandle phidm, void *ptr, PhidgetHandle phid) {
...
},
this);
PhidgetManager_setOnDetachHandler(...);
PhidgetManager_open(m_hdl);
For instance, by calling all the various Phidget_getWhatever on the handles I get from the callback, functions I could get :
Code: Select all
Device Name | Serial | Status | Device class | Device ID
---------------------------------------------------------------------------
PhidgetSpatial 3/3/3 Basic | 296969 | 0 | PHIDCLASS_SPATIAL | PHIDID_1042
PhidgetSpatial 3/3/3 Basic | 296969 | 0 | PHIDCLASS_SPATIAL | PHIDID_1042
PhidgetSpatial 3/3/3 Basic | 296969 | 0 | PHIDCLASS_SPATIAL | PHIDID_1042
PhidgetSpatial 3/3/3 Basic | 296969 | 0 | PHIDCLASS_SPATIAL | PHIDID_1042
* 6-Port USB VINT Hub Phidget (PHIDCLASS_HUB)
* 4x Digital Input Phidget (PHIDCLASS_VINT)
* Thumbstick Phidget (also PHIDCLASS_VINT, because it's plugged on it ? or all VINT phidgets share this class ?)
* Wheatstone Bridge Phidget (also PHIDCLASS_VINT)
Calling Phidget_getChildDevices on the PhidgetHandle gives me an error 8 (EPHIDGET_FAULT, "Address Issue").
So basically, how can I get from the PhidgetManager-originating PhidgetHandles, the actual Phidget objects, and know their position in the hierarchy of hubs ?
Thanks