Subversion Repositories Projects

Rev

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