-
Notifications
You must be signed in to change notification settings - Fork 0
/
Phidget.h
41 lines (34 loc) · 979 Bytes
/
Phidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <string>
#include "phidget21.h"
using namespace std;
namespace phidgets {
class Phidget
{
public:
Phidget(void);
virtual ~Phidget(void);
int CCONV open(void);
int CCONV close();
int CCONV waitForAttachment(int timeout);
string getDeviceType();
string getDeviceName();
string getDeviceLabel();
string getLibraryVersion();
double getAcceleration();
int getDeviceSerialNumber();
int getDeviceVersion();
static string getErrorDescription(int errorCode);
protected:
CPhidgetHandle handle_;
void init(CPhidgetHandle handle);
virtual void registerHandlers();
virtual void attachHandler();
virtual void detachHandler();
virtual void errorHandler(int error);
private:
static int CCONV AttachHandler(CPhidgetHandle handle, void *userptr);
static int CCONV DetachHandler(CPhidgetHandle handle, void *userptr);
static int CCONV ErrorHandler (CPhidgetHandle handle, void *userptr, int ErrorCode, const char *unknown);
};
}