33 #include <libphidget22/phidget22.h>
42 bool is_hub_port_device,
43 std::function<
void(
int,
int)> input_handler)
45 PhidgetReturnCode ret;
47 PhidgetDigitalInputHandle di_handle;
49 ret = PhidgetDigitalInput_create(&di_handle);
50 if (ret != EPHIDGET_OK)
53 "Failed to create DigitalInput handle for determining channel "
58 PhidgetHandle handle =
reinterpret_cast<PhidgetHandle
>(di_handle);
61 is_hub_port_device, 0);
63 ret = Phidget_getDeviceChannelCount(handle, PHIDCHCLASS_DIGITALINPUT,
68 if (ret != EPHIDGET_OK)
70 throw Phidget22Error(
"Failed to get DigitalInput device channel count",
77 dis_[i] = std::make_unique<DigitalInput>(
78 serial_number, hub_port, is_hub_port_device, i, input_handler);
93 return dis_.at(index)->getInputValue();