-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlogitechg29.h
56 lines (50 loc) · 1.3 KB
/
logitechg29.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef LOGITECHG29_H
#define LOGITECHG29_H
#define SUCESS 1
#define Fail -1
#include "logitechg29_global.h"
struct JoyStick//only for series communication
{
JoyStick() {}
int Wheel;//wheel
int Acc;//acc
int brake;//brake
int clutch;//seperation and reunion
bool buttom_up;
bool buttom_down;
bool buttom_left;
bool buttom_right;
int shiftgears;//0x00 mid 0x04forward 0x08 backward
};
struct Actual_JoyStick_CrlData//this data is used for controling
{
Actual_JoyStick_CrlData() {}
float Wheel;//wheel
int Acc;//acc
int brake;//brake
int clutch;//seperation and reunion
bool buttom_up;
bool buttom_down;
bool buttom_left;
bool buttom_right;
int shiftgears;//forward:1 Null: 0 backward:-1
};
class LOGITECHG29SHARED_EXPORT LogitechG29
{
public:
//function
LogitechG29();//we will init the G29 in this construct function
int Init();
~LogitechG29(){hid_close(handle);}//close the IO file
int ReadDate();//return < 0 fail read from G29 handle
//data and struct
JoyStick StickData;//use it to get the data from G29
int res;
unsigned char buf[256];
#define MAX_STR 255
wchar_t wstr[MAX_STR];
hid_device *handle;
int i;
struct hid_device_info *devs, *cur_dev;
};
#endif // LOGITECHG29_H