How To Iterate Through All Available Phidget Devices
<< Back to the SharedPhidgets page
You need the PhidgetManager object to iterate through all the available Phidgets:
// PhidgetManager object
GroupLab.SharedPhidgets.PhidgetManager phidgetManager =
new GroupLab.SharedPhidgets.PhidgetManager();
// The devices
GroupLab.SharedPhidgets.PhidgetDevices devices =
phidgetManager.Devices;
// Iterate through the device list
foreach(GroupLab.SharedPhidgets.PhidgetDevice dev in devices)
{
// Here you can read all the attributes of the device
int serial = dev.SerialNumber;
string name = dev.Name;
string location = dev.Location;
string owner = dev.Owner;
string keywords = dev.Keywords;
float version = dev.Version;
}
GroupLab.SharedPhidgets.PhidgetManager phidgetManager =
new GroupLab.SharedPhidgets.PhidgetManager();
// The devices
GroupLab.SharedPhidgets.PhidgetDevices devices =
phidgetManager.Devices;
// Iterate through the device list
foreach(GroupLab.SharedPhidgets.PhidgetDevice dev in devices)
{
// Here you can read all the attributes of the device
int serial = dev.SerialNumber;
string name = dev.Name;
string location = dev.Location;
string owner = dev.Owner;
string keywords = dev.Keywords;
float version = dev.Version;
}