ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ControlEngine / iPhone / Release / ARDroneProtocols.h
1 /**
2  * @file ARDroneProtocols.h
3  *
4  * Copyright 2009 Parrot SA. All rights reserved.
5  * @author D HAEYER Frederic
6  * @date 2009/10/26
7  */
8 #include "ARDroneTypes.h"
9
10 /**
11  * Define a protocol to make it possible for the game engine to callback the Parrot library
12  */
13 @protocol ARDroneProtocolIn<NSObject>
14 /**
15  * Change the state of the library.<br/>
16  * Note: It is the library sole responsability to handle change of states and modify its behavior; basically, it should pause some of the threads when "paused" then resume everything back to normal when "running".
17  *
18  * @param inGame Boolean flag that indicates whether the library state shall change to "running" (YES) or "pause" (NO).
19  */
20 - (void)changeState:(BOOL)inGame;
21
22 /**
23  * Send a command informaton.
24  *
25  * @commandIn Command structure : identifier, parameters, callback. (each sender has to define its own identifiers; the receiver has to check which sender is calling and react accordingly).
26  * @sender Pointer to the object that requests the change of state.
27  * @refresh If the menu settings should be refreshed at the end of the command
28  */
29 - (void)executeCommandIn:(ARDRONE_COMMAND_IN_WITH_PARAM)commandIn fromSender:(id)sender refreshSettings:(BOOL)refresh;
30
31 /**
32  * Send a default configuration for the application (must be sent before the navdata thread is launched)
33  *
34  * @key Config key to set the default value
35  * @value pointer to the application default value of the config key
36  */
37 - (void)setDefaultConfigurationForKey:(ARDRONE_CONFIG_KEYS)key withValue:(void *)value;
38
39 /**
40  * Send a command informaton.
41  *
42  * @commandId Command identification number (each sender has to define its own identifiers; the receiver has to check which sender is calling and react accordingly).
43  * @parameter parameter for the command
44  * @sender Pointer to the object that requests the change of state.
45  */
46 - (void)executeCommandIn:(ARDRONE_COMMAND_IN)commandId withParameter:(void*)parameter fromSender:(id)sender __attribute__((deprecated));
47
48 /**
49  * Check the state of the library.
50  *
51  * @return Boolean flag that indicates whether the library is running (YES) or paused (NO).
52  */
53 - (BOOL)checkState;
54
55 @optional
56 /**
57  * Get the latest drone's navigation data.
58  *
59  * @param data Pointer to a navigation data structure.
60  */
61 - (void)navigationData:(ARDroneNavigationData*)data;
62
63 /**
64  * Get the latest detection camera structure (rotation and translation).
65  *
66  * @param data Pointer to a detection camera structure.
67  */
68 - (void)detectionCamera:(ARDroneDetectionCamera*)camera;
69
70 /**
71  * Get the latest drone camera structure (rotation and translation).
72  *
73  * @param data Pointer to a drone camera structure.
74  */
75 - (void)droneCamera:(ARDroneCamera*)camera;
76
77 /**
78  * Exchange enemies data.<br/>
79  * Note: basically, data should be provided by the Parrot library when in multiplayer mode (enemy type = "HUMAN"), and by the game controller when in single player mode (enemy type = "AI").
80  *
81  * @param data Pointer to an enemies data structure.
82  */
83 - (void)humanEnemiesData:(ARDroneEnemiesData*)data;
84
85 @end
86
87 /**
88  * Define a protocol to make it possible for the Parrot library to callback the game engine
89  */
90 @protocol ARDroneProtocolOut<NSObject>
91
92 /**
93  * Send a command informaton.
94  *
95  * @commandId Command identification number (each sender has to define its own identifiers; the receiver has to check which sender is calling and react accordingly).
96  * @sender Pointer to the object that requests the change of state.
97  */
98 - (void)executeCommandOut:(ARDRONE_COMMAND_OUT)commandId withParameter:(void*)parameter fromSender:(id)sender;
99
100 @optional
101 /**
102  * Exchange AI enemies data.<br/>
103  * Note: basically, data should be provided by the Parrot library when in multiplayer mode (enemy type = "HUMAN"), and by the game controller when in single player mode (enemy type = "AI").
104  *
105  * @param data Pointer to an enemies data structure.
106  */
107 - (void)AIEnemiesData:(ARDroneEnemiesData*)data;
108
109 @end