phidget.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *   http://www.apache.org/licenses/LICENSE-2.0
00009 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016  
00017 
00018 #ifndef _PHIDGET_H_
00019 #define _PHIDGET_H_
00020 
00021 #include <string>
00022 #include <libphidgets/phidget21.h>
00023 
00024 class Phidget
00025 {
00026 public:
00027         enum class SensingMode{EVENT=0, POLLING=1};
00028 
00029         ~Phidget();
00030 
00031         auto open(int serial_number) -> int;
00032         auto close(int serial_number) -> int;
00033         auto waitForAttachment(int timeout) -> int;
00034         auto getDeviceType() -> std::string;
00035         auto getDeviceName() -> std::string;
00036         auto getDeviceLabel() -> std::string;
00037         auto getLibraryVersion() -> std::string;
00038         auto getDeviceSerialNumber() -> int;
00039         auto getDeviceVersion() -> int;
00040 
00041         virtual auto update() -> void;
00042 
00043         static auto getErrorDescription(int errorCode) -> std::string;
00044 
00045 protected:
00046         CPhidgetHandle* _phiHandle;
00047         int _serialNumber;
00048         int _last_error;
00049         SensingMode _sensMode;
00050 
00051         Phidget(CPhidgetHandle * handle, SensingMode mode);
00052 
00053         virtual auto attachHandler() -> int;
00054         virtual auto detachHandler() -> int;
00055 };
00056 #endif //_PHIDGET_H_


cob_phidgets
Author(s): Florian Weisshardt
autogenerated on Sat Jun 8 2019 21:02:14