35 #include <libphidget22/phidget22.h>
44 bool is_hub_port_device,
45 std::function<
void(
int,
double)> input_handler)
47 PhidgetReturnCode ret;
49 PhidgetCurrentInputHandle ai_handle;
51 ret = PhidgetCurrentInput_create(&ai_handle);
52 if (ret != EPHIDGET_OK)
55 "Failed to create CurrentInput handle for determining channel "
60 PhidgetHandle handle =
reinterpret_cast<PhidgetHandle
>(ai_handle);
63 is_hub_port_device, 0);
65 ret = Phidget_getDeviceChannelCount(handle, PHIDCHCLASS_CURRENTINPUT,
70 if (ret != EPHIDGET_OK)
72 throw Phidget22Error(
"Failed to get CurrentInput device channel count",
79 cis_[i] = std::make_unique<CurrentInput>(
80 serial_number, hub_port, is_hub_port_device, i, input_handler);
95 return cis_.at(index)->getSensorValue();
100 cis_.at(index)->setDataInterval(data_interval_ms);