33 #include <libphidget22/phidget22.h>
42 bool is_hub_port_device)
44 PhidgetReturnCode ret;
46 PhidgetDigitalOutputHandle do_handle;
48 ret = PhidgetDigitalOutput_create(&do_handle);
49 if (ret != EPHIDGET_OK)
52 "Failed to create DigitalOutput handle for determining channel "
57 PhidgetHandle handle =
reinterpret_cast<PhidgetHandle
>(do_handle);
60 is_hub_port_device, 0);
62 ret = Phidget_getDeviceChannelCount(handle, PHIDCHCLASS_DIGITALOUTPUT,
67 if (ret != EPHIDGET_OK)
69 throw Phidget22Error(
"Failed to get DigitalOutput device channel count",
76 dos_[i] = std::make_unique<DigitalOutput>(serial_number, hub_port,
77 is_hub_port_device, i);
92 dos_.at(index)->setOutputState(state);