ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / Examples / Linux / Navigation / Sources / UI / ardrone_ini.h
1 #ifndef _ARDRONE_INI_H_
2 #define _ARDRONE_INI_H_
3
4 #include <glib.h>
5 #include <libudev.h>
6 #include <linux/joystick.h>
7
8 #include <errno.h>
9 #include <fcntl.h>
10 #include <string.h>
11 #include <stddef.h>
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <unistd.h>
15 #include <glib.h>
16 #include <sys/types.h>
17 #include <dirent.h>
18 #include <sys/ioctl.h>
19
20 #include <libxml/encoding.h>
21 #include <libxml/xmlwriter.h>
22 #include <libxml/xmlreader.h>
23 #include <libxml/tree.h>
24 #include <libxml/parser.h>
25 #include <libxml/xpath.h>
26
27 #include "UI/ui.h"
28
29 #define FILENAME "ardrone.xml"
30
31 enum { NONE = 0, AXIS, HAT, BUTTON };
32
33 enum {
34   START = 0,
35   EMERGENCY,
36   PITCH_FRONT,
37   PITCH_BACK,
38   ROLL_LEFT,
39   ROLL_RIGHT,
40   YAW_LEFT,
41   YAW_RIGHT,
42   SPEED_UP,
43   SPEED_DOWN,
44   NUM_COMMAND
45 };
46
47 typedef struct {
48   int value;
49   int type;
50 } Control_Type;
51
52 extern input_device_t control_device;
53
54 C_RESULT open_control_device(void);
55 C_RESULT update_control_device(void);
56 C_RESULT close_control_device(void);
57
58 typedef struct {
59   int num_axis;
60   int num_buttons;
61   gchar *name;
62   gchar *filename;
63   int32_t serial;
64   gboolean def;
65   gboolean config;
66   Control_Type commands[NUM_COMMAND];
67 } Controller_info;
68
69 extern Controller_info *control;
70 extern Controller_info *default_control;
71 extern GList *devices;
72
73 gboolean search_devices(GList **list_controllers);
74 void create_ini();
75 void load_ini();
76 void save_init(Controller_info *def);
77
78 #endif // _ARDRONE_INI_H_
79