phidget.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 _PHIDGET_H_
19 #define _PHIDGET_H_
20 
21 #include <string>
22 #include <libphidgets/phidget21.h>
23 
24 class Phidget
25 {
26 public:
27  enum class SensingMode{EVENT=0, POLLING=1};
28 
29  ~Phidget();
30 
31  auto open(int serial_number) -> int;
32  auto close(int serial_number) -> int;
33  auto waitForAttachment(int timeout) -> int;
34  auto getDeviceType() -> std::string;
35  auto getDeviceName() -> std::string;
36  auto getDeviceLabel() -> std::string;
37  auto getLibraryVersion() -> std::string;
38  auto getDeviceSerialNumber() -> int;
39  auto getDeviceVersion() -> int;
40 
41  virtual auto update() -> void;
42 
43  static auto getErrorDescription(int errorCode) -> std::string;
44 
45 protected:
46  CPhidgetHandle* _phiHandle;
50 
51  Phidget(CPhidgetHandle * handle, SensingMode mode);
52 
53  virtual auto attachHandler() -> int;
54  virtual auto detachHandler() -> int;
55 };
56 #endif //_PHIDGET_H_
auto open(int serial_number) -> int
Definition: phidget.cpp:34
~Phidget()
Definition: phidget.cpp:28
auto waitForAttachment(int timeout) -> int
Definition: phidget.cpp:44
virtual auto detachHandler() -> int
Definition: phidget.cpp:110
auto close(int serial_number) -> int
Definition: phidget.cpp:39
SensingMode
Definition: phidget.h:27
auto getDeviceType() -> std::string
Definition: phidget.cpp:49
Phidget(CPhidgetHandle *handle, SensingMode mode)
Definition: phidget.cpp:23
auto getDeviceName() -> std::string
Definition: phidget.cpp:57
virtual auto update() -> void
Definition: phidget.cpp:116
CPhidgetHandle * _phiHandle
Definition: phidget.h:46
auto getLibraryVersion() -> std::string
Definition: phidget.cpp:73
static auto getErrorDescription(int errorCode) -> std::string
Definition: phidget.cpp:96
int _last_error
Definition: phidget.h:48
auto getDeviceSerialNumber() -> int
Definition: phidget.cpp:81
auto getDeviceVersion() -> int
Definition: phidget.cpp:89
SensingMode _sensMode
Definition: phidget.h:49
auto getDeviceLabel() -> std::string
Definition: phidget.cpp:65
int _serialNumber
Definition: phidget.h:47
virtual auto attachHandler() -> int
Definition: phidget.cpp:104


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