ik.cpp
Go to the documentation of this file.
1 #include "phidgets_api/ik.h"
2 
3 namespace phidgets {
4 
6  Phidget(),
7  ik_handle_(0)
8 {
9  // create the handle
10  CPhidgetInterfaceKit_create(&ik_handle_);
11 
12  // pass handle to base class
13  Phidget::init((CPhidgetHandle)ik_handle_);
14 
15  // register base class callbacks
17 
18  // register ik data callback
19  CPhidgetInterfaceKit_set_OnSensorChange_Handler(ik_handle_, SensorHandler, this);
20 }
21 
22 
23 int IK::SensorHandler(CPhidgetInterfaceKitHandle /* ik */, void *userptr, int index, int sensorValue)
24 {
25  ((IK*)userptr)->sensorHandler(index, sensorValue);
26  return 0;
27 }
28 
29 void IK::sensorHandler(int index, int sensorValue)
30 {
31  printf("index: %d, value: %d\n", index, sensorValue);
32 }
33 
34 int IK::InputHandler(CPhidgetInterfaceKitHandle /* ik */, void *userptr, int index, int inputValue)
35 {
36  ((IK*)userptr)->inputHandler(index, inputValue);
37  return 0;
38 }
39 
40 void IK::inputHandler(int index, int inputValue)
41 {
42  printf("index: %d, value: %d\n", index, inputValue);
43 }
44 
45 } // namespace phidgets
virtual void registerHandlers()
Definition: phidget.cpp:16
static int SensorHandler(CPhidgetInterfaceKitHandle ik, void *userptr, int index, int sensorValue)
Definition: ik.cpp:23
CPhidgetInterfaceKitHandle ik_handle_
Definition: ik.h:16
Definition: ik.h:8
IK()
Definition: ik.cpp:5
virtual void inputHandler(int index, int inputValue)
Definition: ik.cpp:40
static int InputHandler(CPhidgetInterfaceKitHandle ik, void *userptr, int index, int inputValue)
Definition: ik.cpp:34
void init(CPhidgetHandle handle)
Definition: phidget.cpp:23
virtual void sensorHandler(int index, int sensorValue)
Definition: ik.cpp:29


phidgets_api
Author(s): Tully Foote, Ivan Dryanovski
autogenerated on Tue May 7 2019 03:19:24