2 * ardrone_tool_configuration.h
5 * Created by Frederic D'HAEYER on 13/09/10.
6 * Copyright 2010 Parrot SA. All rights reserved.
9 #ifndef _ARDRONE_TOOL_CONFIGURATION_H_
10 #define _ARDRONE_TOOL_CONFIGURATION_H_
11 #include <ardrone_api.h>
12 #include <VP_Os/vp_os_types.h>
13 #include <VP_Os/vp_os_signal.h>
14 #include <VP_Api/vp_api_thread_helper.h>
16 #include <ardrone_tool/Control/ardrone_control_ack.h>
17 #include <ardrone_tool/Control/ardrone_control_configuration.h>
19 #include <iniparser3.0b/src/iniparser.h>
21 #undef ARDRONE_CONFIG_KEY_IMM
22 #undef ARDRONE_CONFIG_KEY_REF
23 #undef ARDRONE_CONFIG_KEY_STR
24 #define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK)
25 #define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK)
26 #define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK)
27 #include <config_keys.h>
29 typedef void (*ardrone_tool_configuration_callback)(bool_t result);
31 typedef struct _ardrone_tool_configuration_data_t {
34 ardrone_at_configuration_set callback;
35 ARDRONE_CONTROL_MODE control_mode;
36 ardrone_tool_configuration_callback result_callback;
37 ardrone_control_event_t* event;
38 } ardrone_tool_configuration_data_t;
40 #define ARDRONE_TOOL_CONFIGURATION_ADDEVENT(NAME, VALUE, CALLBACK) ardrone_tool_configuration_addevent_##NAME(VALUE, CALLBACK)
41 #define ARDRONE_TOOL_CONFIGURATION_GET(CALLBACK) ardrone_tool_configuration_get(CALLBACK)
42 #define ARDRONE_TOOL_CUSTOM_CONFIGURATION_GET(CALLBACK) ardrone_tool_custom_configuration_get(CALLBACK)
44 #undef ARDRONE_CONFIG_KEY_IMM
45 #undef ARDRONE_CONFIG_KEY_REF
46 #undef ARDRONE_CONFIG_KEY_STR
47 #define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \
48 bool_t ardrone_tool_configuration_addevent_##NAME(C_TYPE_PTR value, ardrone_tool_configuration_callback result_callback);
49 #define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK)
50 #define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \
51 bool_t ardrone_tool_configuration_addevent_##NAME(C_TYPE_PTR value, ardrone_tool_configuration_callback result_callback);
52 #include <config_keys.h>
54 extern ardrone_config_t ardrone_control_config;
55 extern ardrone_config_t ardrone_control_config_default;
56 extern ardrone_config_t ardrone_application_default_config;
58 void ardrone_tool_reset_configuration(void);
59 void ardrone_tool_configuration_init(void);
60 void ardrone_tool_send_application_default(void);
61 void ardrone_tool_send_user_default(void);
62 void ardrone_tool_send_session_default(void);
63 bool_t ardrone_tool_configuration_get(ardrone_tool_configuration_callback result_callback);
64 bool_t ardrone_tool_custom_configuration_get(ardrone_tool_configuration_callback result_callback);
66 PROTO_THREAD_ROUTINE(ardrone_configuration, data);
68 #endif // _ARDRONE_TOOL_CONFIGURATION_H_