Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
127 | ligi | 1 | /************************************************** |
2 | * |
||
3 | * |
||
4 | * Riddim |
||
5 | * Remote Interactive Digital Drone Interface Mashup |
||
6 | * |
||
7 | * 2008 Marcus -LiGi- Bueschleb |
||
8 | * |
||
9 | * |
||
10 | **************************************************/ |
||
11 | |||
12 | // for config file parsing |
||
13 | #include <confuse.h> |
||
14 | #include <string.h> |
||
15 | |||
16 | // for understanding the FC |
||
17 | #include "fc.h" |
||
18 | #include "bluetooth_handler.h" |
||
19 | |||
20 | #include <stdio.h> |
||
21 | #include <stdlib.h> |
||
22 | #include <fcntl.h> |
||
23 | |||
24 | |||
25 | #include "lib/x52/x52.h" |
||
26 | |||
27 | #include <sys/socket.h> |
||
28 | |||
29 | |||
30 | #include <sys/time.h> |
||
31 | #include <bluetooth/rfcomm.h> |
||
32 | |||
33 | |||
34 | #include <linux/joystick.h> |
||
35 | |||
36 | |||
37 | |||
38 | #include <errno.h> |
||
39 | |||
40 | #include <sys/types.h> |
||
41 | #include <netinet/in.h> |
||
42 | #include <unistd.h>//for close() for socket |
||
43 | |||
44 | |||
45 | int act_nick=0; |
||
46 | int act_roll=0; |
||
47 | int act_gier=0; |
||
48 | int act_gas=0; |
||
49 | int act_mode=0; |
||
50 | |||
51 | #define JOY_DEV "/dev/input/js0" |
||
52 | |||
53 | |||
54 | |||
55 | |||
56 | #define STATEID_SCANNING 0 |
||
57 | #define STATEID_CONNECTING 1 |
||
58 | |||
59 | #define BUTTON_SELECT 26 |
||
60 | #define BUTTON_DOWN 28 |
||
61 | #define BUTTON_UP 27 |
||
62 | |||
63 | |||
64 | // #define AXIS_ROLL 0 |
||
65 | // #define AXIS_NICK 1 |
||
66 | // #define AXIS_GIER 5 |
||
67 | // #define AXIS_GAS 2 |
||
68 | |||
69 | |||
70 | |||
71 | // for x52 |
||
72 | /* |
||
73 | #define AXIS_ROLL 4 |
||
74 | #define AXIS_NICK 3 |
||
75 | #define AXIS_GIER 5 |
||
76 | #define AXIS_GAS 2 |
||
77 | |||
78 | #define INVERT_ROLL -1 |
||
79 | #define INVERT_NICK -1 |
||
80 | #define INVERT_GIER 1 |
||
81 | #define INVERT_GAS -1 |
||
82 | */ |
||
83 | |||
84 | #define AXIS_ROLL 0 |
||
85 | #define AXIS_NICK 1 |
||
86 | #define AXIS_GIER 3 |
||
87 | #define AXIS_GAS 2 |
||
88 | |||
89 | #define INVERT_ROLL 1 |
||
90 | #define INVERT_NICK -1 |
||
91 | #define INVERT_GIER 1 |
||
92 | #define INVERT_GAS -1 |
||
93 | |||
94 | |||
95 | #define INPUT_NONE 0 |
||
96 | #define INPUT_JOYDEV 1 |
||
97 | #define INPUT_EVDEV 2 |