2 * @file ARDroneProtocols.h
4 * Copyright 2009 Parrot SA. All rights reserved.
5 * @author D HAEYER Frederic
8 #include "ARDroneTypes.h"
11 * Define a protocol to make it possible for the game engine to callback the Parrot library
13 @protocol ARDroneProtocolIn<NSObject>
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".
18 * @param inGame Boolean flag that indicates whether the library state shall change to "running" (YES) or "pause" (NO).
20 - (void)changeState:(BOOL)inGame;
23 * Send a command informaton.
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
29 - (void)executeCommandIn:(ARDRONE_COMMAND_IN_WITH_PARAM)commandIn fromSender:(id)sender refreshSettings:(BOOL)refresh;
32 * Send a default configuration for the application (must be sent before the navdata thread is launched)
34 * @key Config key to set the default value
35 * @value pointer to the application default value of the config key
37 - (void)setDefaultConfigurationForKey:(ARDRONE_CONFIG_KEYS)key withValue:(void *)value;
40 * Send a command informaton.
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.
46 - (void)executeCommandIn:(ARDRONE_COMMAND_IN)commandId withParameter:(void*)parameter fromSender:(id)sender __attribute__((deprecated));
49 * Check the state of the library.
51 * @return Boolean flag that indicates whether the library is running (YES) or paused (NO).
57 * Get the latest drone's navigation data.
59 * @param data Pointer to a navigation data structure.
61 - (void)navigationData:(ARDroneNavigationData*)data;
64 * Get the latest detection camera structure (rotation and translation).
66 * @param data Pointer to a detection camera structure.
68 - (void)detectionCamera:(ARDroneDetectionCamera*)camera;
71 * Get the latest drone camera structure (rotation and translation).
73 * @param data Pointer to a drone camera structure.
75 - (void)droneCamera:(ARDroneCamera*)camera;
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").
81 * @param data Pointer to an enemies data structure.
83 - (void)humanEnemiesData:(ARDroneEnemiesData*)data;
88 * Define a protocol to make it possible for the Parrot library to callback the game engine
90 @protocol ARDroneProtocolOut<NSObject>
93 * Send a command informaton.
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.
98 - (void)executeCommandOut:(ARDRONE_COMMAND_OUT)commandId withParameter:(void*)parameter fromSender:(id)sender;
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").
105 * @param data Pointer to an enemies data structure.
107 - (void)AIEnemiesData:(ARDroneEnemiesData*)data;