Subversion Repositories Projects

Rev

Rev 140 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 140 Rev 483
1
/**************************************************
1
/**************************************************
2
 *
2
 *
3
 *
3
 *
4
 * Riddim
4
 * Riddim
5
 * Remote Interactive Digital Drone Interface Mashup
5
 * Remote Interactive Digital Drone Interface Mashup
6
 *
6
 *
7
 * 2008 Marcus -LiGi- Bueschleb
7
 * 2008 Marcus -LiGi- Bueschleb
8
 *
8
 *
9
 *
9
 *
10
**************************************************/
10
**************************************************/
-
 
11
 
-
 
12
#if !defined(RIDDIM_H)
-
 
13
#define RIDDIM_H
-
 
14
 
-
 
15
 
-
 
16
 
-
 
17
#define RIDDIM_VERSION_MAJOR 0
-
 
18
#define RIDDIM_VERSION_MINOR 7
11
 
19
 
12
// for config file parsing
20
// for config file parsing
13
#include <confuse.h>
21
#include <confuse.h>
14
#include <string.h>
22
#include <string.h>
15
 
23
 
16
 
24
 
17
// for configuration file parsing
25
// for configuration file parsing
18
#include "config.h" 
26
#include "config.h" 
19
// for measuring
27
// for measuring
20
#include "statistics.h"
28
#include "statistics.h"
21
// for understanding the FC
29
// for understanding the FC
22
#include "fc.h"
30
#include "fc.h"
23
#include "bluetooth_handler.h"
31
#include "bluetooth_handler.h"
24
 
32
 
25
#include "evdev_handler.h"
33
#include "evdev_handler.h"
26
 
34
 
27
#include "joy_handler.h"
35
#include "joy_handler.h"
28
 
36
 
29
#include <stdio.h>
37
#include <stdio.h>
30
#include <stdlib.h>
38
#include <stdlib.h>
31
#include <fcntl.h>
39
#include <fcntl.h>
32
 
40
 
33
 
41
 
34
#include "lib/x52/x52.h"
42
#include "lib/x52/x52.h"
35
 
43
 
36
#include <sys/socket.h>
44
#include <sys/socket.h>
37
 
45
 
38
 
46
 
39
#include <sys/time.h>
47
#include <sys/time.h>
40
 
48
 
41
 
49
 
-
 
50
 
-
 
51
#include <sys/types.h>
-
 
52
#include <sys/dir.h>
-
 
53
#include <sys/param.h>
-
 
54
#include <stdio.h>
42
 
55
 
43
 
56
 
44
 
57
 
45
 
58
 
46
#include <errno.h>
59
#include <errno.h>
47
#include <sys/types.h>
60
#include <sys/types.h>
48
#include <netinet/in.h>
61
#include <netinet/in.h>
49
#include <unistd.h>//for close() for socket
62
#include <unistd.h>//for close() for socket
50
 
63
 
51
 
64
 
52
int act_nick=0;
65
int act_nick=0;
53
int act_roll=0;
66
int act_roll=0;
54
int act_gier=0;
67
int act_gier=0;
55
int act_gas=0;
68
int act_gas=0;
56
int act_mode=0;
69
int act_mode=0;
57
 
70
 
58
 
71
 
59
 
72
 
60
#define FALSE 0
73
#define FALSE 0
61
#define TRUE 1
74
#define TRUE 1
62
 
-
 
63
 
-
 
64
 
-
 
65
 
-
 
66
 
-
 
67
 
75
 
68
#define STATEID_SCANNING 0
76
#define STATEID_SCANNING 0
69
#define STATEID_CONNECTING 1
77
#define STATEID_CONNECTING 1
70
 
78
 
71
 
79
 
72
#define BUTTON_SELECT 26
80
#define BUTTON_SELECT 26
73
#define BUTTON_DOWN 28
81
#define BUTTON_DOWN 28
74
#define BUTTON_UP 27
82
#define BUTTON_UP 27
75
 
83
 
76
 
84
 
77
// #define AXIS_ROLL 0
85
// #define AXIS_ROLL 0
78
// #define AXIS_NICK 1
86
// #define AXIS_NICK 1
79
// #define AXIS_GIER 5
87
// #define AXIS_GIER 5
80
// #define AXIS_GAS  2
88
// #define AXIS_GAS  2
81
 
89
 
82
 
90
 
83
 
91
 
84
// for x52
92
// for x52
85
/*
93
/*
86
#define AXIS_ROLL 4
94
#define AXIS_ROLL 4
87
#define AXIS_NICK 3
95
#define AXIS_NICK 3
88
#define AXIS_GIER 5
96
#define AXIS_GIER 5
89
#define AXIS_GAS  2
97
#define AXIS_GAS  2
90
 
98
 
91
#define INVERT_ROLL -1
99
#define INVERT_ROLL -1
92
#define INVERT_NICK -1
100
#define INVERT_NICK -1
93
#define INVERT_GIER 1
101
#define INVERT_GIER 1
94
#define INVERT_GAS  -1
102
#define INVERT_GAS  -1
95
*/
103
*/
96
 
104
 
97
#define AXIS_ROLL 0
105
#define AXIS_ROLL 0
98
#define AXIS_NICK 1
106
#define AXIS_NICK 1
99
#define AXIS_GIER 3
107
#define AXIS_GIER 3
100
#define AXIS_GAS  2
108
#define AXIS_GAS  2
101
 
109
 
102
#define INVERT_ROLL 1
110
#define INVERT_ROLL 1
103
#define INVERT_NICK -1
111
#define INVERT_NICK -1
104
#define INVERT_GIER 1
112
#define INVERT_GIER 1
105
#define INVERT_GAS  -1
113
#define INVERT_GAS  -1
106
 
114
 
107
 
115
 
108
#define INPUT_NONE 0
116
#define INPUT_NONE 0
109
#define INPUT_JOYDEV 1
117
#define INPUT_JOYDEV 1
110
#define INPUT_EVDEV 2
118
#define INPUT_EVDEV 2
-
 
119
 
-
 
120
 
-
 
121
#endif
111
 
122