ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / Examples / Linux / Navigation / Sources / common / mobile_config.h
1 /**
2  * @file mobile_config.h
3  * @author aurelien.morelle@parrot.fr
4  * @date 2006/05/02
5  */
6
7 #ifndef _MOBILE_CONFIG_H_
8 #define _MOBILE_CONFIG_H_
9
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <string.h>
13 #include <math.h>
14
15 #include <errno.h>
16 #include <unistd.h>
17 #include <fcntl.h>
18 #include <sys/time.h>
19 #include <time.h>
20
21 #include "UI/ardrone_ini.h"
22 #include <ardrone_api.h>
23 #include <VP_Os/vp_os_signal.h>
24 #include <VP_Api/vp_api_picture.h>
25
26 #ifndef STREAM_WIDTH
27 #define STREAM_WIDTH QVGA_WIDTH
28 #endif
29 #ifndef STREAM_HEIGHT
30 #define STREAM_HEIGHT QVGA_HEIGHT
31 #endif
32 /**
33  * \typdef  _DA_THREAD_STATES_
34  * \brief drone_acquisition thread states.
35 */
36 typedef struct _mobile_config_
37 {
38   int width;
39   int height;
40   int exit_required;
41
42   int new_frame;
43
44   vp_os_mutex_t *picture_mutex;
45   vp_os_mutex_t *key_mutex;
46   vp_os_mutex_t *exit_mutex;
47
48   char addr[19];
49
50   int sock;
51   int at_socket;
52
53   int speed;
54   int angle;
55
56   int *speed_list;
57
58   int up_pressed;
59   int down_pressed;
60   int left_pressed;
61   int right_pressed;
62
63   void (*manage_gamepad_state)(void);
64
65   int joydev;
66   int (* pool_events)(struct _mobile_config_ *cfg);
67
68   Controller_info *default_control;
69   GList *devices;
70
71   FILE *sample_file;
72
73   int rssi;
74
75   int ihm_curve_alloc_OK;
76
77 #ifdef DRONE_XBEE_LINK
78   int XBee_transmit_enabled;
79 #endif
80 } mobile_config_t;
81
82
83
84 int mobile_init_config(mobile_config_t *cfg);
85 void mobile_exit_config(mobile_config_t *cfg);
86
87 int pool_events(mobile_config_t *cfg);
88
89 int test_exit(mobile_config_t *cfg);
90 int do_exit(mobile_config_t *cfg);
91
92 #endif //! _MOBILE_CONFIG_H_
93