phidgetik.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef _PHIDGETIK_H_
19 #define _PHIDGETIK_H_
20 
21 #include <cob_phidgets/phidget.h>
22 
23 class PhidgetIK: public Phidget
24 {
25 public:
26  PhidgetIK(SensingMode mode);
27  ~PhidgetIK();
28 
29  auto init(int serial_number) -> int;
30 
31  auto getInputCount() -> int;
32  auto getOutputCount() -> int;
33  auto getSensorCount() -> int;
34 
35  auto getInputState(int index) -> int;
36 
37  auto getOutputState(int index) -> int;
38  auto setOutputState(int index, int state) -> int;
39 
40  auto getSensorValue(int index) -> int;
41  auto getSensorRawValue(int index) -> int;
42 
43  auto getSensorChangeTrigger(int index) -> int;
44  auto setSensorChangeTrigger(int index, int trigger) -> int;
45 
46  auto getRatiometric() -> int;
47  auto setRatiometric(int ratiometric) -> int;
48 
49  auto getDataRate(int index) -> int;
50  auto setDataRate(int index, int datarate) -> int;
51 
52  auto getDataRateMax(int index) -> int;
53  auto getDataRateMin(int index) -> int;
54 
55  auto getError() -> int;
56 
57  virtual auto update() -> void;
58 
59 protected:
60  CPhidgetInterfaceKitHandle _iKitHandle;
61 
62  virtual int attachHandler();
63  virtual int detachHandler();
64 
65  virtual int inputChangeHandler(int index, int inputState);
66  virtual int outputChangeHandler(int index, int outputState);
67  virtual int sensorChangeHandler(int index, int sensorValue);
68 
69 private:
70  static auto attachDelegate(CPhidgetHandle phid, void *userptr) -> int;
71 
72  static auto inputChangeDelegate(CPhidgetInterfaceKitHandle phid,
73  void *userPtr, int index, int inputState) -> int;
74  static auto outputChangeDelegate(CPhidgetInterfaceKitHandle phid,
75  void *userPtr, int index, int outputState) -> int;
76  static auto sensorChangeDelegate(CPhidgetInterfaceKitHandle phid,
77  void *userPtr, int index, int sensorValue) -> int;
78 };
79 #endif //_PHIDGETIK_H_
auto getInputCount() -> int
Definition: phidgetik.cpp:49
auto setSensorChangeTrigger(int index, int trigger) -> int
Definition: phidgetik.cpp:129
virtual int detachHandler()
Definition: phidgetik.cpp:221
auto getDataRateMax(int index) -> int
Definition: phidgetik.cpp:164
auto getOutputState(int index) -> int
Definition: phidgetik.cpp:77
virtual int attachHandler()
Definition: phidgetik.cpp:187
virtual int inputChangeHandler(int index, int inputState)
Definition: phidgetik.cpp:232
CPhidgetInterfaceKitHandle _iKitHandle
Definition: phidgetik.h:60
auto getDataRate(int index) -> int
Definition: phidgetik.cpp:150
auto getSensorValue(int index) -> int
Definition: phidgetik.cpp:102
SensingMode
Definition: phidget.h:27
auto getRatiometric() -> int
Definition: phidgetik.cpp:134
auto setRatiometric(int ratiometric) -> int
Definition: phidgetik.cpp:144
static auto sensorChangeDelegate(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int sensorValue) -> int
Definition: phidgetik.cpp:264
auto getDataRateMin(int index) -> int
Definition: phidgetik.cpp:173
auto getOutputCount() -> int
Definition: phidgetik.cpp:68
virtual int outputChangeHandler(int index, int outputState)
Definition: phidgetik.cpp:237
auto getSensorChangeTrigger(int index) -> int
Definition: phidgetik.cpp:120
auto getSensorRawValue(int index) -> int
Definition: phidgetik.cpp:111
auto getSensorCount() -> int
Definition: phidgetik.cpp:93
auto setDataRate(int index, int datarate) -> int
Definition: phidgetik.cpp:159
static auto attachDelegate(CPhidgetHandle phid, void *userptr) -> int
Definition: phidgetik.cpp:247
auto init(int serial_number) -> int
Definition: phidgetik.cpp:44
PhidgetIK(SensingMode mode)
Definition: phidgetik.cpp:20
auto getError() -> int
Definition: phidgetik.cpp:182
static auto inputChangeDelegate(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int inputState) -> int
Definition: phidgetik.cpp:252
auto setOutputState(int index, int state) -> int
Definition: phidgetik.cpp:87
virtual auto update() -> void
Definition: phidgetik.cpp:270
static auto outputChangeDelegate(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int outputState) -> int
Definition: phidgetik.cpp:258
auto getInputState(int index) -> int
Definition: phidgetik.cpp:58
virtual int sensorChangeHandler(int index, int sensorValue)
Definition: phidgetik.cpp:242


cob_phidgets
Author(s): Florian Weisshardt
autogenerated on Wed Apr 7 2021 02:11:43