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 | |||
130 | ligi | 16 | |
17 | // for configuration file parsing |
||
18 | #include "config.h" |
||
19 | // for measuring |
||
20 | #include "statistics.h" |
||
127 | ligi | 21 | // for understanding the FC |
22 | #include "fc.h" |
||
23 | #include "bluetooth_handler.h" |
||
130 | ligi | 24 | #include "evdev_handler.h" |
127 | ligi | 25 | |
26 | #include <stdio.h> |
||
27 | #include <stdlib.h> |
||
28 | #include <fcntl.h> |
||
29 | |||
30 | |||
31 | #include "lib/x52/x52.h" |
||
32 | |||
33 | #include <sys/socket.h> |
||
34 | |||
35 | |||
36 | #include <sys/time.h> |
||
37 | |||
38 | |||
39 | |||
40 | |||
41 | |||
130 | ligi | 42 | |
127 | ligi | 43 | #include <errno.h> |
44 | #include <sys/types.h> |
||
45 | #include <netinet/in.h> |
||
46 | #include <unistd.h>//for close() for socket |
||
47 | |||
48 | |||
49 | int act_nick=0; |
||
50 | int act_roll=0; |
||
51 | int act_gier=0; |
||
52 | int act_gas=0; |
||
53 | int act_mode=0; |
||
54 | |||
130 | ligi | 55 | |
56 | |||
57 | #define FALSE 0 |
||
58 | #define TRUE 1 |
||
59 | |||
127 | ligi | 60 | #define JOY_DEV "/dev/input/js0" |
61 | |||
62 | |||
63 | |||
64 | |||
65 | #define STATEID_SCANNING 0 |
||
66 | #define STATEID_CONNECTING 1 |
||
67 | |||
130 | ligi | 68 | |
127 | ligi | 69 | #define BUTTON_SELECT 26 |
70 | #define BUTTON_DOWN 28 |
||
71 | #define BUTTON_UP 27 |
||
72 | |||
73 | |||
74 | // #define AXIS_ROLL 0 |
||
75 | // #define AXIS_NICK 1 |
||
76 | // #define AXIS_GIER 5 |
||
77 | // #define AXIS_GAS 2 |
||
78 | |||
79 | |||
80 | |||
81 | // for x52 |
||
82 | /* |
||
83 | #define AXIS_ROLL 4 |
||
84 | #define AXIS_NICK 3 |
||
85 | #define AXIS_GIER 5 |
||
86 | #define AXIS_GAS 2 |
||
87 | |||
88 | #define INVERT_ROLL -1 |
||
89 | #define INVERT_NICK -1 |
||
90 | #define INVERT_GIER 1 |
||
91 | #define INVERT_GAS -1 |
||
92 | */ |
||
93 | |||
94 | #define AXIS_ROLL 0 |
||
95 | #define AXIS_NICK 1 |
||
96 | #define AXIS_GIER 3 |
||
97 | #define AXIS_GAS 2 |
||
98 | |||
99 | #define INVERT_ROLL 1 |
||
100 | #define INVERT_NICK -1 |
||
101 | #define INVERT_GIER 1 |
||
102 | #define INVERT_GAS -1 |
||
103 | |||
104 | |||
105 | #define INPUT_NONE 0 |
||
106 | #define INPUT_JOYDEV 1 |
||
107 | #define INPUT_EVDEV 2 |