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_
Phidget::~Phidget
~Phidget()
Definition: phidget.cpp:28
Phidget::getDeviceName
auto getDeviceName() -> std::string
Definition: phidget.cpp:57
Phidget::attachHandler
virtual auto attachHandler() -> int
Definition: phidget.cpp:104
Phidget::getErrorDescription
static auto getErrorDescription(int errorCode) -> std::string
Definition: phidget.cpp:96
Phidget::_serialNumber
int _serialNumber
Definition: phidget.h:47
Phidget::SensingMode::POLLING
@ POLLING
Phidget::waitForAttachment
auto waitForAttachment(int timeout) -> int
Definition: phidget.cpp:44
Phidget::detachHandler
virtual auto detachHandler() -> int
Definition: phidget.cpp:110
Phidget::close
auto close(int serial_number) -> int
Definition: phidget.cpp:39
Phidget::getDeviceVersion
auto getDeviceVersion() -> int
Definition: phidget.cpp:89
Phidget::open
auto open(int serial_number) -> int
Definition: phidget.cpp:34
Phidget::Phidget
Phidget(CPhidgetHandle *handle, SensingMode mode)
Definition: phidget.cpp:23
Phidget::SensingMode::EVENT
@ EVENT
Phidget::getDeviceLabel
auto getDeviceLabel() -> std::string
Definition: phidget.cpp:65
Phidget::_phiHandle
CPhidgetHandle * _phiHandle
Definition: phidget.h:46
Phidget::_last_error
int _last_error
Definition: phidget.h:48
Phidget::getDeviceSerialNumber
auto getDeviceSerialNumber() -> int
Definition: phidget.cpp:81
Phidget::getDeviceType
auto getDeviceType() -> std::string
Definition: phidget.cpp:49
Phidget::getLibraryVersion
auto getLibraryVersion() -> std::string
Definition: phidget.cpp:73
Phidget
Definition: phidget.h:24
Phidget::_sensMode
SensingMode _sensMode
Definition: phidget.h:49
Phidget::update
virtual auto update() -> void
Definition: phidget.cpp:116
Phidget::SensingMode
SensingMode
Definition: phidget.h:27


cob_phidgets
Author(s): Florian Weisshardt
autogenerated on Wed Nov 8 2023 03:47:41