25 CPhidget_set_OnAttach_Handler((CPhidgetHandle)
_iKitHandle,
27 CPhidgetInterfaceKit_set_OnOutputChange_Handler(_iKitHandle,
32 CPhidgetInterfaceKit_set_OnInputChange_Handler(_iKitHandle,
34 _last_error = CPhidgetInterfaceKit_set_OnSensorChange_Handler(
136 int ratiometric = -1;
189 int serialNo, version, numInputs, numOutputs;
190 int numSensors, triggerVal, ratiometric,
i;
191 const char *ptr, *name;
193 CPhidget_getDeviceName((CPhidgetHandle)
_iKitHandle, &name);
194 CPhidget_getDeviceType((CPhidgetHandle)_iKitHandle, &ptr);
195 CPhidget_getSerialNumber((CPhidgetHandle)_iKitHandle, &serialNo);
196 CPhidget_getDeviceVersion((CPhidgetHandle)_iKitHandle, &version);
198 CPhidgetInterfaceKit_getInputCount(_iKitHandle, &numInputs);
199 CPhidgetInterfaceKit_getOutputCount(_iKitHandle, &numOutputs);
200 CPhidgetInterfaceKit_getSensorCount(_iKitHandle, &numSensors);
201 CPhidgetInterfaceKit_getRatiometric(_iKitHandle, &ratiometric);
203 printf(
"%s %d attached!\n", name, serialNo);
206 printf(
"Serial Number: %d\tVersion: %d\n", serialNo, version);
207 printf(
"Num Digital Inputs: %d\tNum Digital Outputs: %d\n", numInputs, numOutputs);
208 printf(
"Num Sensors: %d\n", numSensors);
209 printf(
"Ratiometric: %d\n", ratiometric);
211 for(i = 0; i < numSensors; i++)
213 CPhidgetInterfaceKit_getSensorChangeTrigger (_iKitHandle, i, &triggerVal);
215 printf(
"Sensor#: %d > Sensitivity Trigger: %d\n", i, triggerVal);
224 const char *device_name;
226 CPhidget_getDeviceName ((CPhidgetHandle)
_iKitHandle, &device_name);
227 CPhidget_getSerialNumber((CPhidgetHandle)_iKitHandle, &serial_number);
228 printf(
"%s Serial number %d detached!\n", device_name, serial_number);
249 return ((
PhidgetIK*) userptr)->attachHandler();
253 void *userPtr,
int index,
int inputState) ->
int 255 return ((
PhidgetIK*) userPtr)->inputChangeHandler(index, inputState);
259 void *userPtr,
int index,
int outputState) ->
int 261 return ((
PhidgetIK*) userPtr)->outputChangeHandler(index, outputState);
265 void *userPtr,
int index,
int sensorValue) ->
int 267 return ((
PhidgetIK*) userPtr)->sensorChangeHandler(index, sensorValue);
272 printf(
"PhidgetIK::update()");
auto getInputCount() -> int
auto setSensorChangeTrigger(int index, int trigger) -> int
virtual int detachHandler()
auto getDataRateMax(int index) -> int
auto getOutputState(int index) -> int
virtual int attachHandler()
virtual int inputChangeHandler(int index, int inputState)
CPhidgetInterfaceKitHandle _iKitHandle
auto open(int serial_number) -> int
auto getDataRate(int index) -> int
auto getSensorValue(int index) -> int
auto getRatiometric() -> int
auto setRatiometric(int ratiometric) -> int
static auto sensorChangeDelegate(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int sensorValue) -> int
auto getDataRateMin(int index) -> int
auto getOutputCount() -> int
virtual int outputChangeHandler(int index, int outputState)
auto getSensorChangeTrigger(int index) -> int
auto getSensorRawValue(int index) -> int
auto getSensorCount() -> int
auto setDataRate(int index, int datarate) -> int
static auto attachDelegate(CPhidgetHandle phid, void *userptr) -> int
auto init(int serial_number) -> int
PhidgetIK(SensingMode mode)
static auto inputChangeDelegate(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int inputState) -> int
auto setOutputState(int index, int state) -> int
virtual auto update() -> void
static auto outputChangeDelegate(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int outputState) -> int
auto getInputState(int index) -> int
virtual int sensorChangeHandler(int index, int sensorValue)