General information
The SDK will help you connect, pilot, receive stream, save and download medias (photo and video), send and play autopilot flight plans and update your drone. You can use it on the Rolling Spider, Cargos, Jumping Sumo, Jumping Sumo Evos, Bebop Drone and Bebop 2.
FreeFlight3 is using this SDK.
This SDK is mainly written is C, it provides libraries for Unix system, Android and iOS.
How to use
Creating a project
To use the sdk, you will need to add the libraries to your project. To get the libraries, you can either download the released ones, or build your own with the sources (see how to build the SDK).
iOS
- First, download the binaries: SDK version 3.9.2 iOS libs
- Unzip it.
- In the Project Navigator in XCode, click on your project. Then click on your Target and finally click on Build Settings.
In Header Search Paths, add a Any iOS Simulator SDK and a Any iOS SDK architecture (both for Debug and Release).
Then fill these architectures with:
For any simulator SDK:PATH_TO_THE_UNZIPPED_FOLDER/iOS-iphonesimulator/staging/usr/include
For any iOS SDK:PATH_TO_THE_UNZIPPED_FOLDER/iOS-iphoneos/staging/usr/include
In Library Search Paths, add a Any iOS Simulator SDK and a Any iOS SDK architecture (both for Debug and Release).
Then fill these architectures with:
For any simulator SDK:PATH_TO_THE_UNZIPPED_FOLDER/iOS-iphonesimulator/staging/usr/lib
For any iOS SDK:PATH_TO_THE_UNZIPPED_FOLDER/iOS-iphoneos/staging/usr/lib
In Other Linker Flags add
-larcommands -larcontroller -lardiscovery -larnetwork -larnetworkal -larsal -larstream -larstream2 -larmavlink -ljson -larmedia -larutils -lcurl -lardatatransfer -lcrypto -lssl -lz
You’re all set !
Android
- Open your app build.gradle file
- Add to the dependencies the following line
compile 'com.parrot:arsdk:3.9.2'
- Load the native libraries (see code on the right)
Load native libraries
// Not needed in C
// Not needed in Objective C
ARSDK.loadSDKLibs();
You’re all set, let’s start coding !
Use samples
To have a good overview of what you can do with the SDK, you can start by using and browsing the code of the samples we provide.
For that, simply clone the Sample repository:
git clone https://github.com/Parrot-Developers/Samples.git
There is one example for iOS, one for Android and a few for Unix.
The mobile samples use the following architecture:
They are standalone, this means that you can clone the sample repo and use them without compiling the SDK. To enable this, they will use the precompiled SDK libraries.
The mobile samples show you how to connect, pilot, take pictures, display video stream if available, and download medias from the drone.
They support the following drones:
- Bebop 2
- Bebop
- JumpingSumo
- Jumping Race
- Jumping Night
- MiniDrone Rolling Spider
- Airborne Cargo
- Airborne Night
What if you want to only build an app for the Bebop? Simply delete other files than:
- DeviceListActivity
- DroneDiscoverer
- BebopActivity
- BebopVideoView
- BebopDrone
- SDCardModule
As said before, each mobile sample can be used without having to build the SDK: it will use the precompiled libraries. But you can also use the sample with your own compiled SDK.
iOS
Use the precompiled SDK (hosted on Github):
Use the buildWithPrecompiledSDK configuration to use the precompiled libraries (Product->Scheme->Edit Scheme).
Please note that the first time you’ll build with the precompiled SDK, it will download the precompiled libraries from Github, this might take a while.
Use your own compiled SDK:
You can build this sample with Alchemy. In your <SDK>
execute this command:
./build.sh -p arsdk-ios -t build-sample -j
for iOS
./build.sh -p arsdk-ios_sim -t build-sample -j
for iOS simulator
If you prefer to build directly from XCode, use the buildWithLocalSDK configuration to use your localy compiled libraries (see go deeper to first compile your own SDK).
Android
Use the precompiled SDK (hosted on JCenter):
With Android Studio, open the settings.gradle located in SDKSample/buildWithPrecompiledSDK
.
Use your own compiled SDK:
You can build this sample with Alchemy. In your <SDK>
execute this command:
./build.sh -p arsdk-android -t build-sample
Otherwise, if you want to use Android Studio build, first execute this command in <SDK>
:
./build.sh -p arsdk-android -t build-jni
Then, in Android Studio, open the settings.gradle located in SDKSample/buildWithLocalSDK
.
Start coding
Here are the instruction about how to use the SDK to control the Bebop drone.
Discover the drones
First of all, you will need to discover the drones around you. To do that, we will use the libARDiscovery.
Start discovery:
// Not yet available in pure C
- (void)startDiscovery
{
[[ARDiscovery sharedInstance] start];
}
private ARDiscoveryService mArdiscoveryService;
private ServiceConnection mArdiscoveryServiceConnection;
private void initDiscoveryService()
{
// create the service connection
if (mArdiscoveryServiceConnection == null)
{
mArdiscoveryServiceConnection = new ServiceConnection()
{
@Override
public void onServiceConnected(ComponentName name, IBinder service)
{
mArdiscoveryService = ((ARDiscoveryService.LocalBinder) service).getService();
startDiscovery();
}
@Override
public void onServiceDisconnected(ComponentName name)
{
mArdiscoveryService = null;
}
};
}
if (mArdiscoveryService == null)
{
// if the discovery service doesn't exists, bind to it
Intent i = new Intent(getApplicationContext(), ARDiscoveryService.class);
getApplicationContext().bindService(i, mArdiscoveryServiceConnection, Context.BIND_AUTO_CREATE);
}
else
{
// if the discovery service already exists, start discovery
startDiscovery();
}
}
private void startDiscovery()
{
if (mArdiscoveryService != null)
{
mArdiscoveryService.start();
}
}
The libARDiscovery will let you know when BLE and Wifi devices have been found on network:
// Not yet available in pure C
- (void)registerReceivers
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(discoveryDidUpdateServices:) name:kARDiscoveryNotificationServicesDevicesListUpdated object:nil];
}
- (void)discoveryDidUpdateServices:(NSNotification *)notification
{
NSArray *deviceList = [[notification userInfo] objectForKey:kARDiscoveryServicesList];
// Do what you want with the device list (deviceList is an array of ARService*)
}
// your class should implement ARDiscoveryServicesDevicesListUpdatedReceiverDelegate
private void registerReceivers()
{
mArdiscoveryServicesDevicesListUpdatedReceiver = new ARDiscoveryServicesDevicesListUpdatedReceiver(this);
LocalBroadcastManager localBroadcastMgr = LocalBroadcastManager.getInstance(getApplicationContext());
localBroadcastMgr.registerReceiver(mArdiscoveryServicesDevicesListUpdatedReceiver, new IntentFilter(ARDiscoveryService.kARDiscoveryServiceNotificationServicesDevicesListUpdated));
}
@Override
public void onServicesDevicesListUpdated()
{
Log.d(TAG, "onServicesDevicesListUpdated ...");
if (mArdiscoveryService != null)
{
List<ARDiscoveryDeviceService> deviceList = mArdiscoveryService.getDeviceServicesArray();
// Do what you want with the device list
}
}
Once you have the ARService you want to use, transform it into an ARDiscoveryDevice (you will need it at the next step)
// No BLE support in C, so we use the device IP/Port
// product should only be a wifi product (no Rolling Spider)
ARDiscovery_Device_t* createDiscoveryDevice(eARDISCOVERY_PRODUCT product, const char *name, const char *ip, int port)
{
eARDISCOVERY_ERROR errorDiscovery = ARDISCOVERY_OK;
ARDiscovery_Device_t *device = NULL;
if (ip == NULL || port == 0)
{
fprintf(stderr, "Bad parameters");
return device;
}
if (product < ARDISCOVERY_PRODUCT_NSNETSERVICE || product >= ARDISCOVERY_PRODUCT_BLESERVICE)
{
fprintf(stderr, "Bad product (not a wifi product)");
return device;
}
device = ARDISCOVERY_Device_New(&errorDiscovery);
if (errorDiscovery == ARDISCOVERY_OK)
{
errorDiscovery = ARDISCOVERY_Device_InitWifi (device, product, name, port);
}
if (errorDiscovery != ARDISCOVERY_OK)
{
ARDISCOVERY_Device_Delete(&device);
}
return device;
}
// this should be called in background
- (ARDISCOVERY_Device_t *)createDiscoveryDeviceWithService:(ARService*)service
{
ARDISCOVERY_Device_t *device = NULL;
eARDISCOVERY_ERROR errorDiscovery = ARDISCOVERY_OK;
device = ARDISCOVERY_Device_New (&errorDiscovery);
if (errorDiscovery == ARDISCOVERY_OK)
{
// init the discovery device
if (service.product == ARDISCOVERY_PRODUCT_ARDRONE)
{
// need to resolve service to get the IP
BOOL resolveSucceeded = [self resolveService:service];
if (resolveSucceeded)
{
NSString *ip = [[ARDiscovery sharedInstance] convertNSNetServiceToIp:service];
int port = (int)[(NSNetService *)service.service port];
if (ip)
{
// create a Wifi discovery device
errorDiscovery = ARDISCOVERY_Device_InitWifi (device, service.product, [service.name UTF8String], [ip UTF8String], port);
}
else
{
NSLog(@"ip is null");
errorDiscovery = ARDISCOVERY_ERROR;
}
}
else
{
NSLog(@"Resolve error");
errorDiscovery = ARDISCOVERY_ERROR;
}
}
if (errorDiscovery != ARDISCOVERY_OK)
{
ARDISCOVERY_Device_Delete(&device);
}
}
return device;
}
#pragma mark resolveService
- (BOOL)resolveService:(ARService*)service
{
BOOL retval = NO;
_resolveSemaphore = dispatch_semaphore_create(0);
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(discoveryDidResolve:) name:kARDiscoveryNotificationServiceResolved object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(discoveryDidNotResolve:) name:kARDiscoveryNotificationServiceNotResolved object:nil];
[[ARDiscovery sharedInstance] resolveService:service];
// this semaphore will be signaled in discoveryDidResolve and discoveryDidNotResolve
dispatch_semaphore_wait(_resolveSemaphore, dispatch_time(DISPATCH_TIME_NOW, 10000000000));
NSString *ip = [[ARDiscovery sharedInstance] convertNSNetServiceToIp:service];
if (ip != nil)
{
retval = YES;
}
[[NSNotificationCenter defaultCenter] removeObserver:self name:kARDiscoveryNotificationServiceResolved object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kARDiscoveryNotificationServiceNotResolved object:nil];
_resolveSemaphore = nil;
return retval;
}
- (void)discoveryDidResolve:(NSNotification *)notification
{
dispatch_semaphore_signal(_resolveSemaphore);
}
- (void)discoveryDidNotResolve:(NSNotification *)notification
{
NSLog(@"Resolve failed");
dispatch_semaphore_signal(_resolveSemaphore);
}
private ARDiscoveryDevice createDiscoveryDevice(ARDiscoveryDeviceService service)
{
ARDiscoveryDevice device = null;
if ((service != null) &&
(ARDISCOVERY_PRODUCT_ENUM.ARDISCOVERY_PRODUCT_ARDRONE.equals(ARDiscoveryService.getProductFromProductID(service.getProductID()))))
{
try
{
device = new ARDiscoveryDevice();
ARDiscoveryDeviceNetService netDeviceService = (ARDiscoveryDeviceNetService) service.getDevice();
device.initWifi(ARDISCOVERY_PRODUCT_ENUM.ARDISCOVERY_PRODUCT_ARDRONE, netDeviceService.getName(), netDeviceService.getIp(), netDeviceService.getPort());
}
catch (ARDiscoveryException e)
{
e.printStackTrace();
Log.e(TAG, "Error: " + e.getError());
}
}
return device;
}
Clean everything:
// Not needed in pure C as we currently don't use ARDiscovery
- (void)unregisterReceivers
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:kARDiscoveryNotificationServicesDevicesListUpdated object:nil];
}
- (void)stopDiscovery
{
[[ARDiscovery sharedInstance] stop];
}
private void unregisterReceivers()
{
LocalBroadcastManager localBroadcastMgr = LocalBroadcastManager.getInstance(getApplicationContext());
localBroadcastMgr.unregisterReceiver(mArdiscoveryServicesDevicesListUpdatedReceiver);
}
private void closeServices()
{
Log.d(TAG, "closeServices ...");
if (mArdiscoveryService != null)
{
new Thread(new Runnable() {
@Override
public void run()
{
mArdiscoveryService.stop();
getApplicationContext().unbindService(mArdiscoveryServiceConnection);
mArdiscoveryService = null;
}
}).start();
}
}
Setup a device controller
The device controller is an object that will make the interface between the drone and you.
After having started the device controller, you should receive all its states and settings through the command received callback.
Create the device controller:
eARCONTROLLER_ERROR error = ARCONTROLLER_OK;
ARCONTROLLER_Device_t *deviceController = ARCONTROLLER_Device_New (discoveryDevice, &error);
eARCONTROLLER_ERROR error = ARCONTROLLER_OK;
ARCONTROLLER_Device_t *deviceController = ARCONTROLLER_Device_New (discoveryDevice, &error);
try
{
deviceController = new ARDeviceController (device);
}
catch (ARControllerException e)
{
e.printStackTrace();
}
Listen to the states changes:
error = ARCONTROLLER_Device_AddStateChangedCallback(deviceController, stateChanged, NULL);
// called when the state of the device controller has changed
void stateChanged (eARCONTROLLER_DEVICE_STATE newState, eARCONTROLLER_ERROR error, void *customData)
{
switch (newState)
{
case ARCONTROLLER_DEVICE_STATE_RUNNING:
break;
case ARCONTROLLER_DEVICE_STATE_STOPPED:
break;
case ARCONTROLLER_DEVICE_STATE_STARTING:
break;
case ARCONTROLLER_DEVICE_STATE_STOPPING:
break;
default:
break;
}
}
error = ARCONTROLLER_Device_AddStateChangedCallback(deviceController, stateChanged, (__bridge void *)(self));
// called when the state of the device controller has changed
void stateChanged (eARCONTROLLER_DEVICE_STATE newState, eARCONTROLLER_ERROR error, void *customData)
{
// SELF_TYPE is the class name of self
SELF_TYPE *selfCpy = (__bridge SELF_TYPE *)customData;
switch (newState)
{
case ARCONTROLLER_DEVICE_STATE_RUNNING:
break;
case ARCONTROLLER_DEVICE_STATE_STOPPED:
break;
case ARCONTROLLER_DEVICE_STATE_STARTING:
break;
case ARCONTROLLER_DEVICE_STATE_STOPPING:
break;
default:
break;
}
}
// your class should implement ARDeviceControllerListener
deviceController.addListener (this);
@Override
// called when the state of the device controller has changed
public void onStateChanged (ARDeviceController deviceController, ARCONTROLLER_DEVICE_STATE_ENUM newState, ARCONTROLLER_ERROR_ENUM error)
{
switch (newState)
{
case ARCONTROLLER_DEVICE_STATE_RUNNING:
break;
case ARCONTROLLER_DEVICE_STATE_STOPPED:
break;
case ARCONTROLLER_DEVICE_STATE_STARTING:
break;
case ARCONTROLLER_DEVICE_STATE_STOPPING:
break;
default:
break;
}
}
Listen to the commands received from the drone (example of the battery level received)
error = ARCONTROLLER_Device_AddCommandReceivedCallback(deviceController, onCommandReceived, NULL);
// called when a command has been received from the drone
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if (elementDictionary != NULL)
{
// if the command received is a battery state changed
if (commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED)
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
// get the command received in the device controller
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
// get the value
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED_PERCENT, arg);
if (arg != NULL)
{
uint8_t batteryLevel = arg->value.U8;
// do what you want with the battery level
}
}
}
// else if (commandKey == THE COMMAND YOU ARE INTERESTED IN)
}
}
error = ARCONTROLLER_Device_AddCommandReceivedCallback(deviceController, onCommandReceived, (__bridge void *)(self));
// called when a command has been received from the drone
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
SELF_TYPE *selfCpy = (__bridge SELF_TYPE *)customData;
if (elementDictionary != NULL)
{
// if the command received is a battery state changed
if (commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED)
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
// get the command received in the device controller
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
// get the value
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED_PERCENT, arg);
if (arg != NULL)
{
uint8_t batteryLevel = arg->value.U8;
// do what you want with the battery level
}
}
}
// else if (commandKey == THE COMMAND YOU ARE INTERESTED IN)
}
}
// your class should implement ARDeviceControllerListener
deviceController.addListener (this);
@Override
// called when a command has been received from the drone
public void onCommandReceived(ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary)
{
if (elementDictionary != null)
{
// if the command received is a battery state changed
if (commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED)
{
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null)
{
Integer batValue = (Integer) args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED_PERCENT);
// do what you want with the battery level
}
}
}
else
{
Log.e(TAG, "elementDictionary is null");
}
}
error = ARCONTROLLER_Device_SetVideoStreamCallbacks(_deviceController, configDecoderCallback, didReceiveFrameCallback, NULL , NULL);
static eARCONTROLLER_ERROR configDecoderCallback (ARCONTROLLER_Stream_Codec_t codec, void *customData)
{
// configure your decoder
// return ARCONTROLLER_OK if configuration went well
// otherwise, return ARCONTROLLER_ERROR. In that case,
// configDecoderCallback will be called again
}
static eARCONTROLLER_ERROR didReceiveFrameCallback (ARCONTROLLER_Frame_t *frame, void *customData)
{
// display the frame
// return ARCONTROLLER_OK if display went well
// otherwise, return ARCONTROLLER_ERROR. In that case,
// configDecoderCallback will be called again
}
// if you want the stream to be MP4 compilant (needed if you decode with iOS hardware decoder)
error = ARCONTROLLER_Device_SetVideoStreamMP4Compliant(_deviceController, 1);
error = ARCONTROLLER_Device_SetVideoStreamCallbacks(_deviceController, configDecoderCallback, didReceiveFrameCallback, NULL , (__bridge void *)(self));
static eARCONTROLLER_ERROR configDecoderCallback (ARCONTROLLER_Stream_Codec_t codec, void *customData)
{
SELF_TYPE *selfCpy = (__bridge SELF_TYPE *)customData;
// configure your decoder
// return ARCONTROLLER_OK if configuration went well
// otherwise, return ARCONTROLLER_ERROR. In that case,
// configDecoderCallback will be called again
}
static eARCONTROLLER_ERROR didReceiveFrameCallback (ARCONTROLLER_Frame_t *frame, void *customData)
{
SELF_TYPE *selfCpy = (__bridge SELF_TYPE *)customData;
// display the frame
// return ARCONTROLLER_OK if display went well
// otherwise, return ARCONTROLLER_ERROR. In that case,
// configDecoderCallback will be called again
}
// your class should implement ARDeviceControllerStreamListener
deviceController.addStreamListener(this);
@Override
public ARCONTROLLER_ERROR_ENUM configureDecoder(ARDeviceController deviceController, final ARControllerCodec codec) {
// configure your decoder
// return ARCONTROLLER_ERROR_ENUM.ARCONTROLLER_OK if display went well
// otherwise, return ARCONTROLLER_ERROR_ENUM.ARCONTROLLER_ERROR. In that case,
// configDecoderCallback will be called again
}
@Override
public ARCONTROLLER_ERROR_ENUM onFrameReceived(ARDeviceController deviceController, final ARFrame frame) {
// display the frame
// return ARCONTROLLER_ERROR_ENUM.ARCONTROLLER_OK if display went well
// otherwise, return ARCONTROLLER_ERROR_ENUM.ARCONTROLLER_ERROR. In that case,
// configDecoderCallback will be called again
}
@Override
public void onFrameTimeout(ARDeviceController deviceController) {}
error = ARCONTROLLER_Device_Start (deviceController);
error = ARCONTROLLER_Device_Start (deviceController);
if (error == ARCONTROLLER_OK)
{
_deviceController = deviceController;
}
ARCONTROLLER_ERROR_ENUM error = deviceController.start();
Cleanup when done:
// This function will wait until the device controller is stopped
void deleteDeviceController(ARCONTROLLER_Device_t *deviceController)
{
if (deviceController == NULL)
{
return;
}
eARCONTROLLER_ERROR error = ARCONTROLLER_OK;
eARCONTROLLER_DEVICE_STATE state = ARCONTROLLER_Device_GetState(deviceController, &error);
if ((error == ARCONTROLLER_OK) && (state != ARCONTROLLER_DEVICE_STATE_STOPPED))
{
// after that, stateChanged should be called soon
error = ARCONTROLLER_Device_Stop (_deviceController);
if (error == ARCONTROLLER_OK)
{
sem_wait(&someSemaphore);
}
else
{
fprintf(stderr, "- error:%s", ARCONTROLLER_Error_ToString(error));
}
}
// once the device controller is stopped, we can delete it
ARCONTROLLER_Device_Delete(&deviceController);
}
// dont forget to create the semaphore and to sem_post it in the case ARCONTROLLER_DEVICE_STATE_STOPPED of the stateChanged function
// DO NOT CALL ARCONTROLLER_Device_Delete FROM THE stateChanged FUNCTION !
- (void)deleteDeviceController
{
// in background
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
eARCONTROLLER_ERROR error = ARCONTROLLER_OK;
// if the device controller is not stopped, stop it
eARCONTROLLER_DEVICE_STATE state = ARCONTROLLER_Device_GetState(_deviceController, &error);
if ((error == ARCONTROLLER_OK) && (state != ARCONTROLLER_DEVICE_STATE_STOPPED))
{
// after that, stateChanged should be called soon
error = ARCONTROLLER_Device_Stop (_deviceController);
if (error == ARCONTROLLER_OK)
{
dispatch_semaphore_wait(_stateSem, DISPATCH_TIME_FOREVER);
}
else
{
NSLog(@"- error:%s", ARCONTROLLER_Error_ToString(error));
}
}
// once the device controller is stopped, we can delete it
if (_deviceController != NULL)
{
ARCONTROLLER_Device_Delete(&_deviceController);
}
});
}
// dont forget to add dispatch_semaphore_signal(pilotingViewController.stateSem); in the case ARCONTROLLER_DEVICE_STATE_STOPPED of the stateChanged function
ARCONTROLLER_ERROR_ENUM error = deviceController.stop();
Taking off
In order to make your drone take off you will need to ensure that its flying status is landed (even if you can send take off commands anyway, it just won’t take of if it not in landed state).
Then, you can send the take off command.
In response, your drone will send you a state change (if it has taken off): State Landed -> State TakingOff -> State Hovering (or Flying).
Take off
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE getFlyingState(ARCONTROLLER_Device_t *deviceController)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE flyingState = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_MAX;
eARCONTROLLER_ERROR error;
ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary = ARCONTROLLER_ARDrone3_GetCommandElements(deviceController->aRDrone3, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED, &error);
if (error == ARCONTROLLER_OK && elementDictionary != NULL)
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
// Get the value
HASH_FIND_STR(element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE, arg);
if (arg != NULL)
{
// Enums are stored as I32
flyingState = arg->value.I32;
}
}
}
return flyingState
}
void takeOff(ARCONTROLLER_Device_t *deviceController)
{
if (deviceController == NULL)
{
return;
}
if (getFlyingState(deviceController) == ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_LANDED)
{
deviceController->aRDrone3->sendPilotingTakeOff(deviceController->aRDrone3);
}
}
- (eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE)getFlyingState {
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE flyingState = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_MAX;
eARCONTROLLER_ERROR error;
// get the current flying state description
ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary = ARCONTROLLER_ARDrone3_GetCommandElements(_deviceController->aRDrone3, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED, &error);
if (error == ARCONTROLLER_OK && elementDictionary != NULL)
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
// get the value
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE, arg);
if (arg != NULL)
{
// Enums are I32
flyingState = arg->value.I32;
}
}
}
return flyingState;
}
- (void)takeoff
{
if ([self getFlyingState] == ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_LANDED)
{
_deviceController->aRDrone3->sendPilotingTakeOff(_deviceController->aRDrone3);
}
}
private ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM getPilotingState()
{
ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM flyingState = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM.eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_UNKNOWN_ENUM_VALUE;
if (deviceController != null)
{
try
{
ARControllerDictionary dict = deviceController.getCommandElements(ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED);
if (dict != null)
{
ARControllerArgumentDictionary<Object> args = dict.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null)
{
Integer flyingStateInt = (Integer) args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE);
flyingState = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM.getFromValue(flyingStateInt);
}
}
}
catch (ARControllerException e)
{
e.printStackTrace();
}
return flyingState;
}
}
private void takeoff()
{
if (ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM.ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_LANDED.equals(getPilotingState()))
{
ARCONTROLLER_ERROR_ENUM error = deviceController.getFeatureARDrone3().sendPilotingTakeOff();
if (!error.equals(ARCONTROLLER_ERROR_ENUM.ARCONTROLLER_OK))
{
ARSALPrint.e(TAG, "Error while sending take off: " + error);
}
}
}
The drone changes its state. Flying state should be ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_TAKINGOFF, then ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_HOVERING or ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_FLYING.
// called when a command has been received from the drone
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
// if the command received is a flying state changed
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
// get the command received in the device controller
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
// get the value
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE flyingState = arg->value.I32;
}
}
}
}
// called when a command has been received from the drone
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
// if the command received is a flying state changed
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
// get the command received in the device controller
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
// get the value
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE flyingState = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived(ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary)
{
if (elementDictionary != null)
{
if (commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED)
{
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null)
{
Integer flyingStateInt = (Integer) args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE);
ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM flyingState = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM.getFromValue(flyingStateInt);
}
}
}
else
{
Log.e(TAG, "elementDictionary is null");
}
}
After that, you can start piloting your drone.
Landing
When you’re done flying, you will need to land. This is how you do it: simply send the landing command.
void land(ARCONTROLLER_Device_t *deviceController)
{
if (deviceController == NULL)
{
return;
}
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE flyingState = getFlyingState(deviceController);
if (flyingState == ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_FLYING || flyingState == ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_HOVERING)
{
deviceController->aRDrone3->sendPilotingLanding(deviceController->aRDrone3);
}
}
- (void)land
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE flyingState = [self getFlyingState];
if (flyingState == ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_FLYING || flyingState == ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_HOVERING)
{
_deviceController->aRDrone3->sendPilotingLanding(_deviceController->aRDrone3);
}
}
private void land()
{
ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM flyingState = getPilotingState();
if (ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM.ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_HOVERING.equals(flyingState) ||
ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM.ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_HOVERING.equals(flyingState))
{
ARCONTROLLER_ERROR_ENUM error = deviceController.getFeatureARDrone3().sendPilotingLanding();
if (!error.equals(ARCONTROLLER_ERROR_ENUM.ARCONTROLLER_OK))
{
ARSALPrint.e(TAG, "Error while sending take off: " + error);
}
}
}
Piloting
The Bebop drone is piloted with angles. And the way you specifie these angles are in percentage of the max angle.
The piloting command is automatically sent by the device controller each 25ms.
If a disconnection appears, or if the commands are not received, the Bebop will set all its angle to 0 after 500ms for security reasons.
In the piloting command there are 6 params:
- Flag: 1 if the roll and pitch values should be taken in consideration. 0 otherwise
- Roll: roll angle percentage (from -100 to 100). Negative values go left, positive go right.
- Pitch: pitch angle percentage (from -100 to 100). Negative values go backward, positive go forward.
- Yaw: yaw speed percentage (calculated on the max rotation speed)(from -100 to 100). Negative values go left, positive go right.
- Gaz: gaz speed percentage (calculated on the max vertical speed)(from -100 to 100). Negative values go down, positive go up.
Here is how you set the piloting angles:
Make the drone moves forward (50% of its max angle)
deviceController->aRDrone3->setPilotingPCMDFlag(deviceController->aRDrone3, 1);
deviceController->aRDrone3->setPilotingPCMDPitch(deviceController->aRDrone3, 50);
_deviceController->aRDrone3->setPilotingPCMDFlag(_deviceController->aRDrone3, 1);
_deviceController->aRDrone3->setPilotingPCMDPitch(_deviceController->aRDrone3, 50);
deviceController.getFeatureARDrone3().setPilotingPCMDFlag((byte) 1);
deviceController.getFeatureARDrone3().setPilotingPCMDPitch((byte) 50);
Make the drone rotate to the right (50% of its max rotation speed)
deviceController->aRDrone3->setPilotingPCMDYaw(deviceController->aRDrone3, 50);
_deviceController->aRDrone3->setPilotingPCMDYaw(_deviceController->aRDrone3, 50);
deviceController.getFeatureARDrone3().setPilotingPCMDYaw((byte) 50);
Start video streaming
To start the video stream, you will need to send a command to the Bebop. When the frame are received, the callback you set at the initialisation of your device controller will be called.
Start video stream
deviceController->aRDrone3->sendMediaStreamingVideoEnable(deviceController->aRDrone3, 1);
_deviceController->aRDrone3->sendMediaStreamingVideoEnable(_deviceController- aRDrone3, 1);
deviceController.getFeatureARDrone3().sendMediaStreamingVideoEnable((byte)1);
Stop video stream
deviceController->aRDrone3->sendMediaStreamingVideoEnable(deviceController->aRDrone3, 0);
_deviceController->aRDrone3->sendMediaStreamingVideoEnable(_deviceController->aRDrone3, 0);
deviceController.getFeatureARDrone3().sendMediaStreamingVideoEnable((byte)0);
Taking a picture
The drone lets you take pictures.
Take a picture
deviceController->aRDrone3->sendMediaRecordPicture(deviceController->aRDrone3, 0);
_deviceController->aRDrone3->sendMediaRecordPicture(_deviceController->aRDrone3, 0);
deviceController.getFeatureARDrone3().sendMediaRecordPicture((byte)0);
Download pictures and videos
Once the picture or video has been taken, the Bebop stores it on its internal memory. Pictures are stored in internal_000/Bebop_Drone/media/
.
To get the pictures, you can:
- simply do a ftp request:
- port: 21
- login: “anonymous”
- no password
- use libARDataTransfer which provides an abstraction of the ftp
Please note that libARController is not including the data transfer for the moment, it will certainly in the future so this process will be simplified
Here is how to do it with libARDataTransfer.
libARDataTransfer lets you get a list of all stored medias quite quickly. It also provides you a way to enrich the list of medias with their thumbnails. It also gives you the ability to download the media.
First, you will need to create the data transfer manager
Declare vars
#define DEVICE_PORT 21
#define MEDIA_FOLDER "internal_000"
ARSAL_Thread_t threadRetreiveAllMedias; // the thread that will do the media retrieving
ARSAL_Thread_t threadGetThumbnails; // the thread that will download the thumbnails
ARSAL_Thread_t threadMediasDownloader; // the thread that will download medias
ARDATATRANSFER_Manager_t *manager; // the data transfer manager
ARUTILS_Manager_t *ftpListManager; // an ftp that will do the list
ARUTILS_Manager_t *ftpQueueManager; // an ftp that will do the download
#define DEVICE_PORT 21
#define MEDIA_FOLDER "internal_000"
@property (nonatomic, assign) ARSAL_Thread_t threadRetreiveAllMedias; // the thread that will do the media retrieving
@property (nonatomic, assign) ARSAL_Thread_t threadGetThumbnails; // the thread that will download the thumbnails
@property (nonatomic, assign) ARSAL_Thread_t threadMediasDownloader; // the thread that will download medias
@property (nonatomic, assign) ARDATATRANSFER_Manager_t *manager; // the data transfer manager
@property (nonatomic, assign) ARUTILS_Manager_t *ftpListManager; // an ftp that will do the list
@property (nonatomic, assign) ARUTILS_Manager_t *ftpQueueManager; // an ftp that will do the download
private static final int DEVICE_PORT = 21;
private static final String MEDIA_FOLDER = "internal_000";
private AsyncTask<Void, Float, ArrayList<ARMediaObject>> getMediaAsyncTask;
private AsyncTask<Void, Float, Void> getThumbnailAsyncTask;
private Handler mFileTransferThreadHandler;
private HandlerThread mFileTransferThread;
private boolean isRunning = false;
private boolean isDownloading = false;
private final Object lock = new Object();
private ARDataTransferManager dataTransferManager;
private ARUtilsManager ftpListManager;
private ARUtilsManager ftpQueueManager;
Create the data transfer manager
void createDataTransferManager()
{
const char *productIP = "192.168.42.1"; // TODO: get this address from libARController
eARDATATRANSFER_ERROR result = ARDATATRANSFER_OK;
manager = ARDATATRANSFER_Manager_New(&result);
if (result == ARDATATRANSFER_OK)
{
eARUTILS_ERROR ftpError = ARUTILS_OK;
ftpListManager = ARUTILS_Manager_New(&ftpError);
if(ftpError == ARUTILS_OK)
{
ftpQueueManager = ARUTILS_Manager_New(&ftpError);
}
if(ftpError == ARUTILS_OK)
{
ftpError = ARUTILS_Manager_InitWifiFtp(ftpListManager, productIP, DEVICE_PORT, ARUTILS_FTP_ANONYMOUS, "");
}
if(ftpError == ARUTILS_OK)
{
ftpError = ARUTILS_Manager_InitWifiFtp(ftpQueueManager, productIP, DEVICE_PORT, ARUTILS_FTP_ANONYMOUS, "");
}
if(ftpError != ARUTILS_OK)
{
result = ARDATATRANSFER_ERROR_FTP;
}
}
// NO ELSE
if (result == ARDATATRANSFER_OK)
{
const char *path = "the/path/to/store/downloaded/data"; // Change according to your needs, or put as an argument
result = ARDATATRANSFER_MediasDownloader_New(manager, ftpListManager, ftpQueueManager, MEDIA_FOLDER, path);
}
}
- (void)createDataTransferManager
{
NSString *productIP = @"192.168.42.1"; // TODO: get this address from libARController
eARDATATRANSFER_ERROR result = ARDATATRANSFER_OK;
_manager = ARDATATRANSFER_Manager_New(&result);
if (result == ARDATATRANSFER_OK)
{
eARUTILS_ERROR ftpError = ARUTILS_OK;
_ftpListManager = ARUTILS_Manager_New(&ftpError);
if(ftpError == ARUTILS_OK)
{
_ftpQueueManager = ARUTILS_Manager_New(&ftpError);
}
if(ftpError == ARUTILS_OK)
{
ftpError = ARUTILS_Manager_InitWifiFtp(_ftpListManager, [productIP UTF8String], DEVICE_PORT, ARUTILS_FTP_ANONYMOUS, "");
}
if(ftpError == ARUTILS_OK)
{
ftpError = ARUTILS_Manager_InitWifiFtp(_ftpQueueManager, [productIP UTF8String], DEVICE_PORT, ARUTILS_FTP_ANONYMOUS, "");
}
if(ftpError != ARUTILS_OK)
{
result = ARDATATRANSFER_ERROR_FTP;
}
}
// NO ELSE
if (result == ARDATATRANSFER_OK)
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = [paths lastObject];
result = ARDATATRANSFER_MediasDownloader_New(_manager, _ftpListManager, _ftpQueueManager, MEDIA_FOLDER, [path UTF8String]);
}
}
private void createDataTransferManager() {
String productIP = "192.168.42.1"; // TODO: get this address from libARController
ARDATATRANSFER_ERROR_ENUM result = ARDATATRANSFER_ERROR_ENUM.ARDATATRANSFER_OK;
try
{
dataTransferManager = new ARDataTransferManager();
}
catch (ARDataTransferException e)
{
e.printStackTrace();
result = ARDATATRANSFER_ERROR_ENUM.ARDATATRANSFER_ERROR;
}
if (result == ARDATATRANSFER_ERROR_ENUM.ARDATATRANSFER_OK)
{
try
{
ftpListManager = new ARUtilsManager();
ftpQueueManager = new ARUtilsManager();
ftpListManager.initWifiFtp(productIP, DEVICE_PORT, ARUtilsFtpConnection.FTP_ANONYMOUS, "");
ftpQueueManager.initWifiFtp(productIP, DEVICE_PORT, ARUtilsFtpConnection.FTP_ANONYMOUS, "");
}
catch (ARUtilsException e)
{
e.printStackTrace();
result = ARDATATRANSFER_ERROR_ENUM.ARDATATRANSFER_ERROR_FTP;
}
}
if (result == ARDATATRANSFER_ERROR_ENUM.ARDATATRANSFER_OK)
{
// direct to external directory
String externalDirectory = Environment.getExternalStorageDirectory().toString().concat("/ARSDKMedias/");
try
{
dataTransferManager.getARDataTransferMediasDownloader().createMediasDownloader(ftpListManager, ftpQueueManager, MEDIA_FOLDER, externalDirectory);
}
catch (ARDataTransferException e)
{
e.printStackTrace();
result = e.getError();
}
}
if (result == ARDATATRANSFER_ERROR_ENUM.ARDATATRANSFER_OK)
{
// create a thread for the download to run the download runnable
mFileTransferThread = new HandlerThread("FileTransferThread");
mFileTransferThread.start();
mFileTransferThreadHandler = new Handler(mFileTransferThread.getLooper());
}
if (result != ARDATATRANSFER_ERROR_ENUM.ARDATATRANSFER_OK)
{
// clean up here because an error happened
}
}
Then, we can get the list of all medias on the Bebop (without their thumbnail). This operation is quite quick.
Get the list of the medias
void startMediaListThread()
{
// first retrieve Medias without their thumbnails
ARSAL_Thread_Create(&threadRetreiveAllMedias, ARMediaStorage_retreiveAllMediasAsync, NULL);
}
static void* ARMediaStorage_retreiveAllMediasAsync(void* arg)
{
getAllMediaAsync();
return NULL;
}
void getAllMediaAsync()
{
eARDATATRANSFER_ERROR result = ARDATATRANSFER_OK;
int mediaListCount = 0;
if (result == ARDATATRANSFER_OK)
{
mediaListCount = ARDATATRANSFER_MediasDownloader_GetAvailableMediasSync(manager,0,&result);
if (result == ARDATATRANSFER_OK)
{
for (int i = 0 ; i < mediaListCount && result == ARDATATRANSFER_OK; i++)
{
ARDATATRANSFER_Media_t * mediaObject = ARDATATRANSFER_MediasDownloader_GetAvailableMediaAtIndex(manager, i, &result);
printf("Media %i: %s", i, mediaObject->name);
// Do what you want with this mediaObject
}
}
}
}
- (void)startMediaListThread
{
// first retrieve Medias without their thumbnails
ARSAL_Thread_Create(&_threadRetreiveAllMedias, ARMediaStorage_retreiveAllMediasAsync, (__bridge void *)self);
}
static void* ARMediaStorage_retreiveAllMediasAsync(void* arg)
{
PilotingViewController *self = (__bridge PilotingViewController *)(arg);
[self getAllMediaAsync];
return NULL;
}
- (void)getAllMediaAsync
{
eARDATATRANSFER_ERROR result = ARDATATRANSFER_OK;
int mediaListCount = 0;
if (result == ARDATATRANSFER_OK)
{
mediaListCount = ARDATATRANSFER_MediasDownloader_GetAvailableMediasSync(_manager,0,&result);
if (result == ARDATATRANSFER_OK)
{
for (int i = 0 ; i < mediaListCount && result == ARDATATRANSFER_OK; i++)
{
ARDATATRANSFER_Media_t * mediaObject = ARDATATRANSFER_MediasDownloader_GetAvailableMediaAtIndex(_manager, i, &result);
NSLog(@"Media %i: %s", i, mediaObject->name);
// Do what you want with this mediaObject
}
}
}
}
private void fetchMediasList() {
if (getMediaAsyncTask == null)
{
getMediaAsyncTask = new AsyncTask<Void, Float, ArrayList<ARMediaObject>>()
{
@Override
protected ArrayList<ARMediaObject> doInBackground(Void... params)
{
ArrayList<ARMediaObject> mediaList = null;
synchronized (lock)
{
ARDataTransferMediasDownloader mediasDownloader = null;
if (dataTransferManager != null)
{
mediasDownloader = dataTransferManager.getARDataTransferMediasDownloader();
}
if (mediasDownloader != null)
{
try
{
int mediaListCount = mediasDownloader.getAvailableMediasSync(false);
mediaList = new ArrayList<>(mediaListCount);
for (int i = 0; i < mediaListCount; i++)
{
ARDataTransferMedia currentMedia = mediasDownloader.getAvailableMediaAtIndex(i);
final ARMediaObject currentARMediaObject = new ARMediaObject();
currentARMediaObject.updateDataTransferMedia(getResources(), currentMedia);
mediaList.add(currentARMediaObject);
}
}
catch (ARDataTransferException e)
{
e.printStackTrace();
mediaList = null;
}
}
}
return mediaList;
}
@Override
protected void onPostExecute(ArrayList<ARMediaObject> arMediaObjects)
{
// Do what you want with the list of media object
}
};
}
if (getMediaAsyncTask.getStatus() != AsyncTask.Status.RUNNING) {
getMediaAsyncTask.execute();
}
}
Once the list is received, we can start downloading the thumbnail (not needed if you don’t display thumbnails).
Download thumbnails
void startMediaThumbnailDownloadThread()
{
// first retrieve Medias without their thumbnails
ARSAL_Thread_Create(&threadGetThumbnails, ARMediaStorage_retreiveMediaThumbnailsSync, NULL);
}
static void* ARMediaStorage_retreiveMediaThumbnailsSync(void* arg)
{
downloadThumbnails();
return NULL;
}
void downloadThumbnails()
{
ARDATATRANSFER_MediasDownloader_GetAvailableMediasAsync(manager, availableMediaCallback, NULL);
}
void availableMediaCallback (void* arg, ARDATATRANSFER_Media_t *media, int index)
{
if (NULL != arg)
{
// The thumbnail image data is available in the media->thumbnail pointer.
// The thumbnail data size is media->thumbnailSize
// Do what you want with the image
}
}
- (void)startMediaThumbnailDownloadThread
{
// first retrieve Medias without their thumbnails
ARSAL_Thread_Create(&_threadGetThumbnails, ARMediaStorage_retreiveMediaThumbnailsSync, (__bridge void *)self);
}
static void* ARMediaStorage_retreiveMediaThumbnailsSync(void* arg)
{
PilotingViewController *self = (__bridge PilotingViewController *)(arg);
[self downloadThumbnails];
return NULL;
}
- (void)downloadThumbnails
{
ARDATATRANSFER_MediasDownloader_GetAvailableMediasAsync(_manager, availableMediaCallback, (__bridge void *)self);
}
void availableMediaCallback (void* arg, ARDATATRANSFER_Media_t *media, int index)
{
if (NULL != arg)
{
PilotingViewController *self = (__bridge PilotingViewController *)(arg);
// you can alternatively call updateThumbnailWithARDATATRANSFER_Media_t if you use the ARMediaObjectDelegate
UIImage *newThumbnail = [UIImage imageWithData:[NSData dataWithBytes:media->thumbnail length:media->thumbnailSize]];
// Do what you want with the image
}
}
private void fetchThumbnails() {
if (getThumbnailAsyncTask == null)
{
getThumbnailAsyncTask = new AsyncTask<Void, Float, Void>()
{
@Override
protected Void doInBackground(Void... params)
{
synchronized (lock)
{
ARDataTransferMediasDownloader mediasDownloader = null;
if (dataTransferManager != null)
{
mediasDownloader = dataTransferManager.getARDataTransferMediasDownloader();
}
if (mediasDownloader != null)
{
try
{
// availableMediaListener is a ARDataTransferMediasDownloaderAvailableMediaListener (you can pass YourActivity.this if YourActivity implements this interface)
mediasDownloader.getAvailableMediasAsync(availableMediaListener, null);
}
catch (ARDataTransferException e)
{
e.printStackTrace();
}
}
}
return null;
}
@Override
protected void onPostExecute(Void param)
{
adapter.notifyDataSetChanged();
}
};
}
if (getThumbnailAsyncTask.getStatus() != AsyncTask.Status.RUNNING) {
getThumbnailAsyncTask.execute();
}
}
@Override
public void didMediaAvailable(Object arg, final ARDataTransferMedia media, final int index)
{
runOnUiThread(new Runnable()
{
@Override
public void run()
{
ARMediaObject mediaObject = getMediaAtIndex(index);
if (mediaObject != null)
{
mediaObject.updateThumbnailWithDataTransferMedia(getResources(), media);
// after that, you can retrieve the thumbnail through mediaObject.getThumbnail()
}
}
});
}
Next step is to download the medias.
Download medias
void downloadMedias(ARDATATRANSFER_Media_t *medias, int count)
{
eARDATATRANSFER_ERROR result = ARDATATRANSFER_OK;
for (int i = 0 ; i < count && result == ARDATATRANSFER_OK; i++)
{
ARDATATRANSFER_Media_t *media = medias[i];
result = ARDATATRANSFER_MediasDownloader_AddMediaToQueue(manager, media, medias_downloader_progress_callback, NULL, medias_downloader_completion_callback, NULL);
}
if (result == ARDATATRANSFER_OK)
{
if (threadMediasDownloader == NULL)
{
// if not already started, start download thread in background
ARSAL_Thread_Create(&threadMediasDownloader, ARDATATRANSFER_MediasDownloader_QueueThreadRun, manager);
}
}
}
void medias_downloader_progress_callback(void* arg, ARDATATRANSFER_Media_t *media, float percent)
{
// the media is downloading
}
void medias_downloader_completion_callback(void* arg, ARDATATRANSFER_Media_t *media, eARDATATRANSFER_ERROR error)
{
// the media is downloaded
}
- (void)downloadMedias:(ARDATATRANSFER_Media_t *)medias withCount:(int)count
{
eARDATATRANSFER_ERROR result = ARDATATRANSFER_OK;
for (int i = 0 ; i < count && result == ARDATATRANSFER_OK; i++)
{
ARDATATRANSFER_Media_t *media = medias[i];
result = ARDATATRANSFER_MediasDownloader_AddMediaToQueue(_manager, media, medias_downloader_progress_callback, (__bridge void *)(self), medias_downloader_completion_callback,(__bridge void*)self);
}
if (result == ARDATATRANSFER_OK)
{
if (_threadMediasDownloader == NULL)
{
// if not already started, start download thread in background
ARSAL_Thread_Create(&_threadMediasDownloader, ARDATATRANSFER_MediasDownloader_QueueThreadRun, _manager);
}
}
}
void medias_downloader_progress_callback(void* arg, ARDATATRANSFER_Media_t *media, float percent)
{
// the media is downloading
}
void medias_downloader_completion_callback(void* arg, ARDATATRANSFER_Media_t *media, eARDATATRANSFER_ERROR error)
{
// the media is downloaded
}
/**
* Add the medias to the transfer queue and, if needed, start the queue
* @param mediaToDl list of media index to download
*/
private void downloadMedias(ArrayList<Integer> mediaToDl)
{
ARDataTransferMediasDownloader mediasDownloader = null;
if (dataTransferManager != null)
{
mediasDownloader = dataTransferManager.getARDataTransferMediasDownloader();
}
if (mediasDownloader != null)
{
for (int i = 0; i < mediaToDl.size(); i++)
{
int mediaIndex = mediaToDl.get(i);
ARDataTransferMedia mediaObject = null;
try
{
mediaObject = dataTransferManager.getARDataTransferMediasDownloader().getAvailableMediaAtIndex(mediaIndex);
}
catch (ARDataTransferException e)
{
e.printStackTrace();
}
if (mediaObject != null)
{
try
{
mediasDownloader.addMediaToQueue(mediaObject, progressListener, null, completeListener, null);
}
catch (ARDataTransferException e)
{
e.printStackTrace();
}
}
}
if (!isRunning)
{
isRunning = true;
Runnable downloaderQueueRunnable = mediasDownloader.getDownloaderQueueRunnable();
mFileTransferThreadHandler.post(downloaderQueueRunnable);
}
}
isDownloading = true;
}
@Override
public void didMediaComplete(Object arg, ARDataTransferMedia media, ARDATATRANSFER_ERROR_ENUM error)
{
// the media is downloaded
}
@Override
public void didMediaProgress(Object arg, ARDataTransferMedia media, float percent)
{
// the media is downloading
}
Stop downloading medias
void cancelCurrentDownload() {
if (threadMediasDownloader != NULL)
{
ARDATATRANSFER_MediasDownloader_CancelQueueThread(manager);
ARSAL_Thread_Join(threadMediasDownloader, NULL);
ARSAL_Thread_Destroy(&threadMediasDownloader);
threadMediasDownloader = NULL;
}
}
- (void)cancelCurrentDownload {
if (_threadMediasDownloader != NULL)
{
ARDATATRANSFER_MediasDownloader_CancelQueueThread(_manager);
ARSAL_Thread_Join(_threadMediasDownloader, NULL);
ARSAL_Thread_Destroy(&_threadMediasDownloader);
_threadMediasDownloader = NULL;
}
}
private void cancelCurrentDownload()
{
dataTransferManager.getARDataTransferMediasDownloader().cancelQueueThread();
isDownloading = false;
isRunning = false;
}
When you don’t need the data transfer anymore, don’t forget to clean everything
Clean
void clean()
{
if (threadRetreiveAllMedias != NULL)
{
ARDATATRANSFER_MediasDownloader_CancelGetAvailableMedias(manager);
ARSAL_Thread_Join(threadRetreiveAllMedias, NULL);
ARSAL_Thread_Destroy(&threadRetreiveAllMedias);
threadRetreiveAllMedias = NULL;
}
if (threadGetThumbnails != NULL)
{
ARDATATRANSFER_MediasDownloader_CancelGetAvailableMedias(manager);
ARSAL_Thread_Join(threadGetThumbnails, NULL);
ARSAL_Thread_Destroy(&threadGetThumbnails);
threadGetThumbnails = NULL;
}
if (threadMediasDownloader != NULL)
{
ARDATATRANSFER_MediasDownloader_CancelQueueThread(manager);
ARSAL_Thread_Join(threadMediasDownloader, NULL);
ARSAL_Thread_Destroy(&threadMediasDownloader);
threadMediasDownloader = NULL;
}
ARDATATRANSFER_MediasDownloader_Delete(manager);
ARUTILS_Manager_CloseWifiFtp(ftpListManager);
ARUTILS_Manager_CloseWifiFtp(ftpQueueManager);
ARUTILS_Manager_Delete(&ftpListManager);
ARUTILS_Manager_Delete(&ftpQueueManager);
ARDATATRANSFER_Manager_Delete(&manager);
}
- (void)clean
{
if (_threadRetreiveAllMedias != NULL)
{
ARDATATRANSFER_MediasDownloader_CancelGetAvailableMedias(_manager);
ARSAL_Thread_Join(_threadRetreiveAllMedias, NULL);
ARSAL_Thread_Destroy(&_threadRetreiveAllMedias);
_threadRetreiveAllMedias = NULL;
}
if (_threadGetThumbnails != NULL)
{
ARDATATRANSFER_MediasDownloader_CancelGetAvailableMedias(_manager);
ARSAL_Thread_Join(_threadGetThumbnails, NULL);
ARSAL_Thread_Destroy(&_threadGetThumbnails);
_threadGetThumbnails = NULL;
}
if (_threadMediasDownloader != NULL)
{
ARDATATRANSFER_MediasDownloader_CancelQueueThread(_manager);
ARSAL_Thread_Join(_threadMediasDownloader, NULL);
ARSAL_Thread_Destroy(&_threadMediasDownloader);
_threadMediasDownloader = NULL;
}
ARDATATRANSFER_MediasDownloader_Delete(_manager);
ARUTILS_Manager_CloseWifiFtp(_ftpListManager);
ARUTILS_Manager_CloseWifiFtp(_ftpQueueManager);
ARUTILS_Manager_Delete(&_ftpListManager);
ARUTILS_Manager_Delete(&_ftpQueueManager);
ARDATATRANSFER_Manager_Delete(&_manager);
}
private void clean()
{
new Thread(new Runnable()
{
@Override
public void run()
{
cancelCurrentDownload();
if (dataTransferManager != null)
{
dataTransferManager.getARDataTransferMediasDownloader().cancelGetAvailableMedias();
}
if (getMediaAsyncTask != null && getMediaAsyncTask.getStatus() == AsyncTask.Status.RUNNING)
{
synchronized (lock)
{
getMediaAsyncTask.cancel(true);
}
}
if (getThumbnailAsyncTask != null && getThumbnailAsyncTask.getStatus() == AsyncTask.Status.RUNNING)
{
synchronized (lock)
{
getThumbnailAsyncTask.cancel(true);
}
}
if (ftpListManager != null)
{
ftpListManager.closeWifiFtp();
ftpListManager.dispose();
ftpListManager = null;
}
if (ftpQueueManager != null)
{
ftpQueueManager.closeWifiFtp();
ftpQueueManager.dispose();
ftpQueueManager = null;
}
if (dataTransferManager != null)
{
dataTransferManager.dispose();
dataTransferManager = null;
}
if (mFileTransferThread != null)
{
mFileTransferThread.quit();
mFileTransferThread = null;
}
}
}).start();
}
Commands and events
Bebop commands
Signal the remote that the controller will disconnect
Signal the remote that the controller will disconnect (deprecated):
deviceController->common->sendNetworkDisconnect(deviceController->common);
deviceController->common->sendNetworkDisconnect(deviceController->common);
deviceController.getFeatureCommon().sendNetworkDisconnect();
This command is deprecated, please don’t use it.
Get all product settings
Get all product settings:
deviceController->common->sendSettingsAllSettings(deviceController->common);
deviceController->common->sendSettingsAllSettings(deviceController->common);
deviceController.getFeatureCommon().sendSettingsAllSettings();
Get all product settings
Result:
The product will trigger all settings events. Such as CameraSettings, or product specific settings (such as the MaxAltitude for the Bebop.
Then, it will trigger AllSettingsChangedEnd.
Supported by all products
Please note that you should not send this command if you are using the libARController API as this library is handling the connection process for you.
Reset all settings
Reset all settings:
deviceController->common->sendSettingsReset(deviceController->common);
deviceController->common->sendSettingsReset(deviceController->common);
deviceController.getFeatureCommon().sendSettingsReset();
Reset all settings
Result:
All the new settings will be triggered. Such as CameraSettings, or product specific settings (such as the MaxAltitude for the Bebop.
Then, it will trigger ResetChanged.
Supported by all products
Set Product name
Set Product name:
deviceController->common->sendSettingsProductName(deviceController->common, (char *)name);
deviceController->common->sendSettingsProductName(deviceController->common, (char *)name);
deviceController.getFeatureCommon().sendSettingsProductName((String)name);
Set Product name.
Please note that the product name is also the SSID for the Wifi products. This SSID will only be changed after a reboot of the product.
- name (string): Product name
Result:
The name of the product is changed.
Then, it will trigger ProductNameChanged.
Supported by all products
Set country of controller
Set country of controller:
deviceController->common->sendSettingsCountry(deviceController->common, (char *)code);
deviceController->common->sendSettingsCountry(deviceController->common, (char *)code);
deviceController.getFeatureCommon().sendSettingsCountry((String)code);
Set country of controller
- code (string): Country code with ISO 3166 format
Result:
The country of the product is changed.
Then, it will trigger CountryChanged.
Supported by all products
Set Auto Country Settings
Set Auto Country Settings:
deviceController->common->sendSettingsAutoCountry(deviceController->common, (uint8_t)automatic);
deviceController->common->sendSettingsAutoCountry(deviceController->common, (uint8_t)automatic);
deviceController.getFeatureCommon().sendSettingsAutoCountry((byte)automatic);
Set Auto Country Setting.
If auto-country is set, the drone will guess its Wifi country by itself by checking other Wifi country around it.
- automatic (u8): Boolean : 0 : Manual / 1 : Auto
Result:
The auto-country of the product is changed.
Then, it will trigger AutoCountryChanged.
Supported by all products
Get all product states
Get all product states:
deviceController->common->sendCommonAllStates(deviceController->common);
deviceController->common->sendCommonAllStates(deviceController->common);
deviceController.getFeatureCommon().sendCommonAllStates();
Get all product states.
Result:
The product will trigger all its current states. Such as BatteryState, or product specific states (such as the flying state for the Bebop.
Then, it will trigger AllStatesChangedEnd.
Supported by all products
Please note that you should not send this command if you are using the libARController API as this library is handling the connection process for you.
Set current date of controller
Set current date of controller:
deviceController->common->sendCommonCurrentDate(deviceController->common, (char *)date);
deviceController->common->sendCommonCurrentDate(deviceController->common, (char *)date);
deviceController.getFeatureCommon().sendCommonCurrentDate((String)date);
Set current date of controller.
This date is taken by the drone as its own date. So medias and other files will be dated from this date.
- date (string): Date with ISO-8601 format
Result:
The date of the product is set.
Then, it will trigger CurrentDateChanged.
Supported by all products
Please note that you should not send this command if you are using the libARController API as this library is handling the connection process for you.
Set current time of controller
Set current time of controller:
deviceController->common->sendCommonCurrentTime(deviceController->common, (char *)time);
deviceController->common->sendCommonCurrentTime(deviceController->common, (char *)time);
deviceController.getFeatureCommon().sendCommonCurrentTime((String)time);
Set current time of controller.
This time is taken by the drone as its own time. So medias and other files will be dated from this time.
- time (string): Time with ISO-8601 format
Result:
The time of the product is set.
Then, it will trigger CurrentTimeChanged.
Supported by all products
Please note that you should not send this command if you are using the libARController API as this library is handling the connection process for you.
Reboot the drone
Reboot the drone:
deviceController->common->sendCommonReboot(deviceController->common);
deviceController->common->sendCommonReboot(deviceController->common);
deviceController.getFeatureCommon().sendCommonReboot();
Reboot the drone.
Result:
The drone will reboot.
Supported by all products
Switch off the drone when a overheat appeared
Switch off the drone when a overheat appeared (deprecated):
deviceController->common->sendOverHeatSwitchOff(deviceController->common);
deviceController->common->sendOverHeatSwitchOff(deviceController->common);
deviceController.getFeatureCommon().sendOverHeatSwitchOff();
This command is deprecated, please don’t use it.
Ventilate the drone when a overheat appeared
Ventilate the drone when a overheat appeared (deprecated):
deviceController->common->sendOverHeatVentilate(deviceController->common);
deviceController->common->sendOverHeatVentilate(deviceController->common);
deviceController.getFeatureCommon().sendOverHeatVentilate();
This command is deprecated, please don’t use it.
Tell the drone that the controller enters/leaves the piloting HUD
Tell the drone that the controller enters/leaves the piloting HUD:
deviceController->common->sendControllerIsPiloting(deviceController->common, (uint8_t)piloting);
deviceController->common->sendControllerIsPiloting(deviceController->common, (uint8_t)piloting);
deviceController.getFeatureCommon().sendControllerIsPiloting((byte)piloting);
Tell the drone that the controller enters/leaves the piloting HUD
- piloting (u8): 0 when the application is not in the piloting HUD, 1 when it enters the HUD.
Result:
If yes, the product will begin a new session (so it should send a new runId.
Also, on the JumpingSumos, if the video is in autorecord mode, it will start recording.
Supported by all products
Set indoor or outdoor wifi settings
Set indoor or outdoor wifi settings:
deviceController->common->sendWifiSettingsOutdoorSetting(deviceController->common, (uint8_t)outdoor);
deviceController->common->sendWifiSettingsOutdoorSetting(deviceController->common, (uint8_t)outdoor);
deviceController.getFeatureCommon().sendWifiSettingsOutdoorSetting((byte)outdoor);
Set indoor or outdoor wifi settings.
- outdoor (u8): 1 if it should use outdoor wifi settings, 0 otherwise
Result:
The product change its indoor/outdoor wifi settings.
Then, it will trigger OutdoorChanged.
According to the country (defined by SetAutoCountry or SetCountry) laws the drone might change its wifi band and channel. So a disconnection might appear.
Supported by all wifi products
Start an autonomous flight
Start an autonomous flight:
deviceController->common->sendMavlinkStart(deviceController->common, (char *)filepath, (eARCOMMANDS_COMMON_MAVLINK_START_TYPE)type);
deviceController->common->sendMavlinkStart(deviceController->common, (char *)filepath, (eARCOMMANDS_COMMON_MAVLINK_START_TYPE)type);
deviceController.getFeatureCommon().sendMavlinkStart((String)filepath, (ARCOMMANDS_COMMON_MAVLINK_START_TYPE_ENUM)type);
Start an autonomous flight
- filepath (string): autonomous flight file path from the mavlink ftp root
- type (enum): type of the played mavlink file
- flightPlan: Mavlink file for FlightPlan
- mapMyHouse: Mavlink file for MapMyHouse (not used)
- flightPlan: Mavlink file for FlightPlan
Result:
The autonomous flight will be started if all requirements are met. Requirements are :
- Product is calibrated
- Product should be in outdoor mode
- Product has fixed its GPS
If autonomous flight has been started, event MavlinkFilePlayingStateChanged is triggered with param state set to playing.
Otherwise, event MavlinkFilePlayingStateChanged is triggered with param state set to stopped and event MavlinkPlayErrorStateChanged is triggered with an explanation of the error.
Supported by
- Bebop since 2.0.29
- Bebop 2
Pause an autonomous flight
Pause an autonomous flight:
deviceController->common->sendMavlinkPause(deviceController->common);
deviceController->common->sendMavlinkPause(deviceController->common);
deviceController.getFeatureCommon().sendMavlinkPause();
Pause an autonomous flight (can be restarted with a start).
Result:
The currently playing autonomous flight will be paused.
Then, event MavlinkFilePlayingStateChanged is triggered with param state set to the current state of the autonomous flight (should be paused if everything went well).
Supported by
- Bebop since 2.0.29
- Bebop 2
Stop an autonomous flight
Stop an autonomous flight:
deviceController->common->sendMavlinkStop(deviceController->common);
deviceController->common->sendMavlinkStop(deviceController->common);
deviceController.getFeatureCommon().sendMavlinkStop();
Stop an autonomous flight
Result:
The currently playing autonomous flight will be stopped.
Then, event MavlinkFilePlayingStateChanged is triggered with param state set to the current state of the autonomous flight (should be stopped if everything went well).
Supported by
- Bebop since 2.0.29
- Bebop 2
Start or abort magnetometer calibration
Start or abort magnetometer calibration:
deviceController->common->sendCalibrationMagnetoCalibration(deviceController->common, (uint8_t)calibrate);
deviceController->common->sendCalibrationMagnetoCalibration(deviceController->common, (uint8_t)calibrate);
deviceController.getFeatureCommon().sendCalibrationMagnetoCalibration((byte)calibrate);
Start or abort magnetometer calibration.
- calibrate (u8): 1 if the calibration should be started, 0 if it should be aborted
Result:
The magnetometer calibration process is started or aborted.
Then, event MagnetoCalibrationStartedChanged is triggered.
If started, event MagnetoCalibrationStateChanged is triggered with the current calibration state: a list of all axis and their calibration states. It will also trigger MagnetoCalibrationAxisToCalibrateChanged, that will inform the controller about the current axis to calibrate.
Supported by
- Bebop
- Bebop 2
Set the controller position for a run
Set the controller position for a run:
deviceController->common->sendGPSControllerPositionForRun(deviceController->common, (double)latitude, (double)longitude);
deviceController->common->sendGPSControllerPositionForRun(deviceController->common, (double)latitude, (double)longitude);
deviceController.getFeatureCommon().sendGPSControllerPositionForRun((double)latitude, (double)longitude);
Set the controller position for a run. This command is used by all non gps products. Watch out, this command cannot be used with BLE products
This will let the product know the controller location for the flight/run. The location is typically used to geotag medias.
- latitude (double): Controller latitude in decimal degrees
- longitude (double): Controller longitude in decimal degrees
Supported by all Wifi products without GPS (such as the JumpingSumo)
Tell the product whether the controller is ready to start audio streaming.
Tell the product whether the controller is ready to start audio streaming.:
deviceController->common->sendAudioControllerReadyForStreaming(deviceController->common, (uint8_t)ready);
deviceController->common->sendAudioControllerReadyForStreaming(deviceController->common, (uint8_t)ready);
deviceController.getFeatureCommon().sendAudioControllerReadyForStreaming((byte)ready);
Tell the product whether the controller is ready to start audio streaming.
- ready (u8): Bit field for TX and RX ready.
bit 0 is 1 if controller is ready and wants to receive sound (Drone TX)
bit 1 is 1 if controller is ready and wants to send sound (Drone RX)
Supported by
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
Set instensity of lighting LEDs.
Set instensity of lighting LEDs.:
deviceController->common->sendHeadlightsIntensity(deviceController->common, (uint8_t)left, (uint8_t)right);
deviceController->common->sendHeadlightsIntensity(deviceController->common, (uint8_t)left, (uint8_t)right);
deviceController.getFeatureCommon().sendHeadlightsIntensity((byte)left, (byte)right);
Set instensity of lighting LEDs.
- left (u8): Set the left LED intensity value (0 through 255).
- right (u8): Set the right LED intensity value (0 through 255).
Result:
Intensity of the LEDs is changed.
Then, event HeadlightsStateIntensityChanged is triggered.
Supported by
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
Start a paramaterless animation.
Start a paramaterless animation.:
deviceController->common->sendAnimationsStartAnimation(deviceController->common, (eARCOMMANDS_COMMON_ANIMATIONS_STARTANIMATION_ANIM)anim);
deviceController->common->sendAnimationsStartAnimation(deviceController->common, (eARCOMMANDS_COMMON_ANIMATIONS_STARTANIMATION_ANIM)anim);
deviceController.getFeatureCommon().sendAnimationsStartAnimation((ARCOMMANDS_COMMON_ANIMATIONS_STARTANIMATION_ANIM_ENUM)anim);
Start a paramaterless animation.
- anim (enum): Animation to start.
- HEADLIGHTS_FLASH: Flash headlights.
- HEADLIGHTS_BLINK: Blink headlights.
- HEADLIGHTS_OSCILLATION: Oscillating headlights.
- SPIN: Spin animation.
- TAP: Tap animation.
- SLOW_SHAKE: Slow shake animation.
- METRONOME: Metronome animation.
- ONDULATION: Standing dance animation.
- SPIN_JUMP: Spin jump animation.
- SPIN_TO_POSTURE: Spin that end in standing posture, or in jumper if it was standing animation.
- SPIRAL: Spiral animation.
- SLALOM: Slalom animation.
- BOOST: Boost animation.
- HEADLIGHTS_FLASH: Flash headlights.
Result:
If possible, the product starts the requested animation.
Then, event AnimationsStateList is triggered.
Supported by
- Jumping Sumo
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
Stop a running animation
Stop a running animation:
deviceController->common->sendAnimationsStopAnimation(deviceController->common, (eARCOMMANDS_COMMON_ANIMATIONS_STOPANIMATION_ANIM)anim);
deviceController->common->sendAnimationsStopAnimation(deviceController->common, (eARCOMMANDS_COMMON_ANIMATIONS_STOPANIMATION_ANIM)anim);
deviceController.getFeatureCommon().sendAnimationsStopAnimation((ARCOMMANDS_COMMON_ANIMATIONS_STOPANIMATION_ANIM_ENUM)anim);
Stop a running animation.
- anim (enum): Animation to stop.
- HEADLIGHTS_FLASH: Flash headlights.
- HEADLIGHTS_BLINK: Blink headlights.
- HEADLIGHTS_OSCILLATION: Oscillating headlights.
- SPIN: Spin animation.
- TAP: Tap animation.
- SLOW_SHAKE: Slow shake animation.
- METRONOME: Metronome animation.
- ONDULATION: Standing dance animation.
- SPIN_JUMP: Spin jump animation.
- SPIN_TO_POSTURE: Spin that end in standing posture, or in jumper if it was standing animation.
- SPIRAL: Spiral animation.
- SLALOM: Slalom animation.
- BOOST: Boost animation.
- HEADLIGHTS_FLASH: Flash headlights.
Result:
If the requested animation was running, the product stops it.
Then, event AnimationsStateList is triggered.
Supported by
- Jumping Sumo
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
Stop all running animations
Stop all running animations:
deviceController->common->sendAnimationsStopAllAnimations(deviceController->common);
deviceController->common->sendAnimationsStopAllAnimations(deviceController->common);
deviceController.getFeatureCommon().sendAnimationsStopAllAnimations();
Stop all running animations.
You can get the list of the animations with AnimationsStateList.
Result:
All running animations are stopped.
Then, event AnimationsStateList is triggered.
Supported by
- Jumping Sumo
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
Set the current accessory configuration
Set the current accessory configuration:
deviceController->common->sendAccessoryConfig(deviceController->common, (eARCOMMANDS_COMMON_ACCESSORY_CONFIG_ACCESSORY)accessory);
deviceController->common->sendAccessoryConfig(deviceController->common, (eARCOMMANDS_COMMON_ACCESSORY_CONFIG_ACCESSORY)accessory);
deviceController.getFeatureCommon().sendAccessoryConfig((ARCOMMANDS_COMMON_ACCESSORY_CONFIG_ACCESSORY_ENUM)accessory);
Set the current accessory configuration.
- accessory (enum): Accessory configuration to set.
- NO_ACCESSORY: No accessory.
- STD_WHEELS: Standard wheels
- TRUCK_WHEELS: Truck wheels
- HULL: Hull
- HYDROFOIL: Hydrofoil
- NO_ACCESSORY: No accessory.
You can choose the accessory between all accessible for this product. You can get this list through event SupportedAccessoriesListChanged.
You can only set the accessory when the modification is enabled. You can know if it possible with the event AccessoryConfigModificationEnabled.
Result:
The product knows which accessory it is wearing.
Then, event AccessoryConfigChanged is triggered.
Supported by
- Jumping Sumo
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
- Hydrofoil
Set the max charge rate
Set the max charge rate (deprecated):
deviceController->common->sendChargerSetMaxChargeRate(deviceController->common, (eARCOMMANDS_COMMON_CHARGER_SETMAXCHARGERATE_RATE)rate);
deviceController->common->sendChargerSetMaxChargeRate(deviceController->common, (eARCOMMANDS_COMMON_CHARGER_SETMAXCHARGERATE_RATE)rate);
deviceController.getFeatureCommon().sendChargerSetMaxChargeRate((ARCOMMANDS_COMMON_CHARGER_SETMAXCHARGERATE_RATE_ENUM)rate);
This command is deprecated, please don’t use it.
The product will inform itself the controller about its charging type (see ChargingInfoChanged).
Do a flat trim
Do a flat trim:
deviceController->aRDrone3->sendPilotingFlatTrim(deviceController->aRDrone3);
deviceController->aRDrone3->sendPilotingFlatTrim(deviceController->aRDrone3);
deviceController.getFeatureARDrone3().sendPilotingFlatTrim();
Do a flat trim of the accelerometer/gyro. Could be useful when the drone is sliding in hover mode.
Result:
Accelero/Gyro are re-calibrated.
Then, event FlatTrimChanged is triggered.
Supported by
- Bebop
- Bebop 2
Take off
Take off:
deviceController->aRDrone3->sendPilotingTakeOff(deviceController->aRDrone3);
deviceController->aRDrone3->sendPilotingTakeOff(deviceController->aRDrone3);
deviceController.getFeatureARDrone3().sendPilotingTakeOff();
Ask the drone to take off
Result:
The drone takes off.
Then, eventFlyingStateChanged is triggered.
Supported by
- Bebop
- Bebop 2
Move the drone
Ask the drone to move around.:
deviceController->aRDrone3->sendPilotingPCMD(deviceController->aRDrone3, (uint8_t)flag, (int8_t)roll, (int8_t)pitch, (int8_t)yaw, (int8_t)gaz, (uint32_t)timestampAndSeqNum);
deviceController->aRDrone3->sendPilotingPCMD(deviceController->aRDrone3, (uint8_t)flag, (int8_t)roll, (int8_t)pitch, (int8_t)yaw, (int8_t)gaz, (uint32_t)timestampAndSeqNum);
deviceController.getFeatureARDrone3().sendPilotingPCMD((byte)flag, (byte)roll, (byte)pitch, (byte)yaw, (byte)gaz, (int)timestampAndSeqNum);
Ask the drone to move around.
- flag (u8): Boolean flag to activate roll/pitch movement
- roll (i8): Roll consign for the drone [-100;100]
- pitch (i8): Pitch consign for the drone [-100;100]
- yaw (i8): Yaw consign for the drone [-100;100]
- gaz (i8): Gaz consign for the drone [-100;100]
- psi (float): [NOT USED] - Magnetic north heading of the controlling device (deg) [-180;180]
This command should be sent on the non-acknowledged buffer as it is sent periodically (already done by the libARController).
The libARController is sending the command each 50ms.
Please note that you should call setPilotingPCMD and not sendPilotingPCMD because the libARController is handling the periodicity and the buffer on which it is sent.
Result:
The drone moves! Yaaaaay!
Event SpeedChanged, AttitudeChanged and PositionChanged (only if gps of the drone has fixed) are triggered.
Supported by
- Bebop
- Bebop 2
Ask the drone to land
Ask the drone to land:
deviceController->aRDrone3->sendPilotingLanding(deviceController->aRDrone3);
deviceController->aRDrone3->sendPilotingLanding(deviceController->aRDrone3);
deviceController.getFeatureARDrone3().sendPilotingLanding();
Ask the drone to land
Please note that if you put some positive gaz (in the PilotingCommand) during the landing, it will cancel it.
Result:
The drone lands.
Then, eventFlyingStateChanged is triggered.
Supported by
- Bebop
- Bebop 2
Put drone in emergency user state
Put drone in emergency user state:
deviceController->aRDrone3->sendPilotingEmergency(deviceController->aRDrone3);
deviceController->aRDrone3->sendPilotingEmergency(deviceController->aRDrone3);
deviceController.getFeatureARDrone3().sendPilotingEmergency();
Put drone in emergency user state
This command is sent on a dedicated high priority buffer which will infinitely retry to send it if the command is not delivered.
Result:
The drone immediatly switches off its motors.
Then, eventFlyingStateChanged is triggered.
Supported by
- Bebop
- Bebop 2
Ask the drone to fly to home
Ask the drone to fly to home:
deviceController->aRDrone3->sendPilotingNavigateHome(deviceController->aRDrone3, (uint8_t)start);
deviceController->aRDrone3->sendPilotingNavigateHome(deviceController->aRDrone3, (uint8_t)start);
deviceController.getFeatureARDrone3().sendPilotingNavigateHome((byte)start);
Ask the drone to fly to home to its home position (you can get it from HomeChanged)
The availability of the navigate home can be get from NavigateHomeStateChanged.
- start (u8): 1 to start the navigate home, 0 to stop it
Result:
The drone will fly back to its home position.
Then, eventNavigateHomeStateChanged is triggered. You can get a state pending if the drone is not ready to start its return home process but will do it as soon as it is possible.
Supported by
- Bebop
- Bebop 2
Set automatic take off mode
This command is deprecated, please don’t use it.
Move the drone to a relative position
Move the drone to a relative position (not implemented):
deviceController->aRDrone3->sendPilotingMoveBy(deviceController->aRDrone3, (float)dX, (float)dY, (float)dZ, (float)dPsi);
deviceController->aRDrone3->sendPilotingMoveBy(deviceController->aRDrone3, (float)dX, (float)dY, (float)dZ, (float)dPsi);
deviceController.getFeatureARDrone3().sendPilotingMoveBy((float)dX, (float)dY, (float)dZ, (float)dPsi);
Draft: this command is not implemented yet by the firmware
Move the drone to a relative position and rotate heading by a given angle
The frame is horizontal and relative to the current drone orientation:
X is front
Y is right
Z is down
The movement settings of the device are those set for the autonomous flight.
- dX (float): Wanted displacement along the front axis [m]
- dY (float): Wanted displacement along the right axis [m]
- dZ (float): Wanted displacement along the down axis [m]
- dPsi (float): Wanted rotation of heading [rad]
Result:
The drone will move of the given offsets.
Then, event MoveByEnd is triggered.
If you send a second command MoveBy, the drone will trigger a MoveByEnd with the offsets it managed to do before this command and the value of error set to interrupted.
Supported by
- Bebop
- Bebop 2
Make a flip
Make a flip:
deviceController->aRDrone3->sendAnimationsFlip(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION)direction);
deviceController->aRDrone3->sendAnimationsFlip(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION)direction);
deviceController.getFeatureARDrone3().sendAnimationsFlip((ARCOMMANDS_ARDRONE3_ANIMATIONS_FLIP_DIRECTION_ENUM)direction);
Make a flip
- direction (enum): Direction for the flip
- front: Flip direction front
- back: Flip direction back
- right: Flip direction right
- left: Flip direction left
- front: Flip direction front
Result:
The drone will make a flip if it has enough battery.
Supported by
- Bebop
- Bebop 2
Ask the drone to move camera.
Ask the drone to move camera.:
deviceController->aRDrone3->sendCameraOrientation(deviceController->aRDrone3, (int8_t)tilt, (int8_t)pan);
deviceController->aRDrone3->sendCameraOrientation(deviceController->aRDrone3, (int8_t)tilt, (int8_t)pan);
deviceController.getFeatureARDrone3().sendCameraOrientation((byte)tilt, (byte)pan);
Ask the drone to move camera.
- tilt (i8): Tilt camera consign for the drone (in degree)
The value is saturated by the drone.
Saturation value is sent by thre drone through CameraSettingsChanged command. - pan (i8): Pan camera consign for the drone (in degree)
The value is saturated by the drone.
Saturation value is sent by thre drone through CameraSettingsChanged command.
You can get min and max values for tilt and pan using CameraSettingsChanged.
Result:
The drone will move its camera.
Then, event CameraOrientationState is triggered.
Supported by
- Bebop
- Bebop 2
Record picture v1
Record picture v1:
deviceController->aRDrone3->sendMediaRecordPicture(deviceController->aRDrone3, (uint8_t)mass_storage_id);
deviceController->aRDrone3->sendMediaRecordPicture(deviceController->aRDrone3, (uint8_t)mass_storage_id);
deviceController.getFeatureARDrone3().sendMediaRecordPicture((byte)mass_storage_id);
This command is deprecated, please don’t use it.
Record video v1
Record video v1 (deprecated):
deviceController->aRDrone3->sendMediaRecordVideo(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD)record, (uint8_t)mass_storage_id);
deviceController->aRDrone3->sendMediaRecordVideo(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD)record, (uint8_t)mass_storage_id);
deviceController.getFeatureARDrone3().sendMediaRecordVideo((ARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD_ENUM)record, (byte)mass_storage_id);
This command is deprecated, please don’t use it.
Take picture
Take picture:
deviceController->aRDrone3->sendMediaRecordPictureV2(deviceController->aRDrone3);
deviceController->aRDrone3->sendMediaRecordPictureV2(deviceController->aRDrone3);
deviceController.getFeatureARDrone3().sendMediaRecordPictureV2();
Take picture
The type of picture taken is related to the picture setting.
You can set the picture format by sending the command SetPictureFormat. You can also get the current picture format with PictureFormatChanged.
Please note that the time required to take the picture is highly related to this format.
You can check if the picture taking is available with PictureStateChanged.
Also, please note that if your picture format is different from snapshot, picture taking will stop video recording (it will restart after the picture has been taken).
Result:
Event PictureStateChanged will be triggered with a state busy.
The drone will take a picture.
Then, when picture has been taken, event PictureEventChanged is triggered.
And normally PictureStateChanged will be triggered with a state ready.
Supported by
- Bebop since 2.0.1
- Bebop 2
Video record
Video record:
deviceController->aRDrone3->sendMediaRecordVideoV2(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEOV2_RECORD)record);
deviceController->aRDrone3->sendMediaRecordVideoV2(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEOV2_RECORD)record);
deviceController.getFeatureARDrone3().sendMediaRecordVideoV2((ARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEOV2_RECORD_ENUM)record);
Video record
- record (enum): Command to record video (or timelapse)
- stop: Stop the video recording
- start: Start the video recording
- stop: Stop the video recording
You can check if the video recording is available with VideoStateChanged.
This command can start a video (obvious huh?), but also a timelapse if the timelapse mode is set. You can check if the timelapse mode is set with the event TimelapseChanged.
Also, please note that if your picture format is different from snapshot, picture taking will stop video recording (it will restart after the picture has been taken).
Result:
The drone will begin or stop to record the video (or timelapse).
Then, event VideoStateChanged will be triggered.
Also, VideoEventChanged is triggered.
Supported by
- Bebop since 2.0.1
- Bebop 2
Scan wifi network
Scan wifi network:
deviceController->aRDrone3->sendNetworkWifiScan(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_NETWORK_WIFISCAN_BAND)band);
deviceController->aRDrone3->sendNetworkWifiScan(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_NETWORK_WIFISCAN_BAND)band);
deviceController.getFeatureARDrone3().sendNetworkWifiScan((ARCOMMANDS_ARDRONE3_NETWORK_WIFISCAN_BAND_ENUM)band);
Scan wifi network to get a list of all wifi networks found by the drone.
- band (enum): The band(s) : 2.4 Ghz, 5 Ghz, or both
- 2_4ghz: 2.4 GHz band
- 5ghz: 5 GHz band
- all: Both 2.4 and 5 GHz bands
- 2_4ghz: 2.4 GHz band
Result:
Event WifiScanListChanged is triggered with all networks found. When all networks have been sent, event AllWifiScanChanged is triggered.
Supported by
- Bebop
- Bebop 2
Get all available Wifi channels
Get all available Wifi channels:
deviceController->aRDrone3->sendNetworkWifiAuthChannel(deviceController->aRDrone3);
deviceController->aRDrone3->sendNetworkWifiAuthChannel(deviceController->aRDrone3);
deviceController.getFeatureARDrone3().sendNetworkWifiAuthChannel();
Get all available Wifi channels.
The list of available Wifi channels is related to the country of the drone. You can get this country with the event CountryChanged.
Result:
Event WifiAuthChannelListChanged is triggered with all authorized channels. When all channels have been sent, event AllWifiAuthChannelChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set Max Altitude
Set Max Altitude:
deviceController->aRDrone3->sendPilotingSettingsMaxAltitude(deviceController->aRDrone3, (float)current);
deviceController->aRDrone3->sendPilotingSettingsMaxAltitude(deviceController->aRDrone3, (float)current);
deviceController.getFeatureARDrone3().sendPilotingSettingsMaxAltitude((float)current);
Set Max Altitude.
- current (float): Current altitude max in m
The drone will not fly over this max altitude when it is in manual piloting. Please note that if you set a max altitude which is below the current drone altitude, the drone will no go to the max altitude. You can get the bounds in the event MaxAltitudeChanged.
Result:
The max altitude is set.
Then, event MaxAltitudeChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set Max Tilt
Set Max Tilt:
deviceController->aRDrone3->sendPilotingSettingsMaxTilt(deviceController->aRDrone3, (float)current);
deviceController->aRDrone3->sendPilotingSettingsMaxTilt(deviceController->aRDrone3, (float)current);
deviceController.getFeatureARDrone3().sendPilotingSettingsMaxTilt((float)current);
Set Max Tilt
- current (float): Current tilt max in degree
This represent the max inclination allowed by the drone. You can get the bounds with the commands MaxAltitudeChanged.
Result:
The max tilt is set.
Then, event MaxTiltChanged is triggered.
Supported by
- Bebop
- Bebop 2
Enable/Disable absolut control
Enable/Disable absolut control (deprecated):
deviceController->aRDrone3->sendPilotingSettingsAbsolutControl(deviceController->aRDrone3, (uint8_t)on);
deviceController->aRDrone3->sendPilotingSettingsAbsolutControl(deviceController->aRDrone3, (uint8_t)on);
deviceController.getFeatureARDrone3().sendPilotingSettingsAbsolutControl((byte)on);
This command is deprecated, please don’t use it.
Set the distance max of the drone
Set the distance max of the drone:
deviceController->aRDrone3->sendPilotingSettingsMaxDistance(deviceController->aRDrone3, (float)value);
deviceController->aRDrone3->sendPilotingSettingsMaxDistance(deviceController->aRDrone3, (float)value);
deviceController.getFeatureARDrone3().sendPilotingSettingsMaxDistance((float)value);
Set the distance max of the drone
- value (float): Current max distance in meter
You can get the bounds with the event MaxDistanceChanged.
If NoFlyOverMaxDistance is set to 1, the drone won’t fly over the given max distance. You can get this value through the event MaxDistanceLimitationBehaviourChanged.
Result:
The max distance is set.
Then, event MaxDistanceChanged is triggered.
Draft: this command is not implemented yet by the firmware
Supported by no products
Set the max distance limitation behaviour
Set the max distance limitation behaviour (not implemented):
deviceController->aRDrone3->sendPilotingSettingsNoFlyOverMaxDistance(deviceController->aRDrone3, (uint8_t)shouldNotFlyOver);
deviceController->aRDrone3->sendPilotingSettingsNoFlyOverMaxDistance(deviceController->aRDrone3, (uint8_t)shouldNotFlyOver);
deviceController.getFeatureARDrone3().sendPilotingSettingsNoFlyOverMaxDistance((byte)shouldNotFlyOver);
Set the max distance limitation behaviour
- shouldNotFlyOver (u8): 1 if the drone can’t fly further than max distance, 0 if no limitation on the drone should be done
You can get the current max distance with the event MaxDistanceChanged.
Draft: this command is not implemented yet by the firmware
Result:
The given behaviour is set on the drone. If it shouldn’t fly over the max distance, the drone won’t fly further the max distance.
Then, event MaxDistanceLimitationBehaviourChanged is triggered.
Supported by no products
Set the maximum horizontal speed used during autonomous flights
Set the maximum horizontal speed used during autonomous flights (not implemented):
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxHorizontalSpeed(deviceController->aRDrone3, (float)value);
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxHorizontalSpeed(deviceController->aRDrone3, (float)value);
deviceController.getFeatureARDrone3().sendPilotingSettingsSetAutonomousFlightMaxHorizontalSpeed((float)value);
Set the maximum horizontal speed used during autonomous flights.
Draft: this command is not implemented yet by the firmware
- value (float): maximum horizontal speed [m/s]
Result:
The max horizontal speed for autonomous flights is set.
Then, event AutonomousFlightMaxHorizontalSpeedChanged is triggered.
Supported by no products
Set the maximum vertical speed used by autonomous flights
Set the maximum vertical speed used by autonomous flights (not implemented):
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxVerticalSpeed(deviceController->aRDrone3, (float)value);
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxVerticalSpeed(deviceController->aRDrone3, (float)value);
deviceController.getFeatureARDrone3().sendPilotingSettingsSetAutonomousFlightMaxVerticalSpeed((float)value);
Set the maximum vertical speed used by autonomous flights.
Draft: this command is not implemented yet by the firmware
- value (float): maximum vertical speed [m/s]
Result:
The max vertical speed for autonomous flights is set.
Then, event AutonomousFlightMaxVerticalSpeedChanged is triggered.
Supported by no products
Set the maximum horizontal acceleration used by autonomous flights
Set the maximum horizontal acceleration used by autonomous flights (not implemented):
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxHorizontalAcceleration(deviceController->aRDrone3, (float)value);
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxHorizontalAcceleration(deviceController->aRDrone3, (float)value);
deviceController.getFeatureARDrone3().sendPilotingSettingsSetAutonomousFlightMaxHorizontalAcceleration((float)value);
Set the maximum horizontal acceleration used by autonomous flights.
Draft: this command is not implemented yet by the firmware
- value (float): maximum horizontal acceleration [m/s2]
Result:
The max horizontal acceleration for autonomous flights is set.
Then, event AutonomousFlightMaxHorizontalAccelerationChanged is triggered.
Supported by no products
Set the maximum vertical acceleration used during autonomous flights
Set the maximum vertical acceleration used during autonomous flights (not implemented):
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxVerticalAcceleration(deviceController->aRDrone3, (float)value);
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxVerticalAcceleration(deviceController->aRDrone3, (float)value);
deviceController.getFeatureARDrone3().sendPilotingSettingsSetAutonomousFlightMaxVerticalAcceleration((float)value);
Set the maximum vertical acceleration used during autonomous flights.
Draft: this command is not implemented yet by the firmware
- value (float): maximum vertical acceleration [m/s2]
Result:
The max vertical acceleration for autonomous flights is set.
Then, event AutonomousFlightMaxVerticalAccelerationChanged is triggered.
Supported by no products
Set the maximum yaw rotation speed used during autonomous flights
Set the maximum yaw rotation speed used during autonomous flights (not implemented):
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxRotationSpeed(deviceController->aRDrone3, (float)value);
deviceController->aRDrone3->sendPilotingSettingsSetAutonomousFlightMaxRotationSpeed(deviceController->aRDrone3, (float)value);
deviceController.getFeatureARDrone3().sendPilotingSettingsSetAutonomousFlightMaxRotationSpeed((float)value);
Set the maximum yaw rotation speed used during autonomous flights.
Draft: this command is not implemented yet by the firmware
- value (float): maximum yaw rotation speed [rad/s]
Result:
The max rotation speed for autonomous flights is set.
Then, event AutonomousFlightMaxRotationSpeedChanged is triggered.
Supported by no products
Set banked turn mode
Set banked turn mode:
deviceController->aRDrone3->sendPilotingSettingsBankedTurn(deviceController->aRDrone3, (uint8_t)value);
deviceController->aRDrone3->sendPilotingSettingsBankedTurn(deviceController->aRDrone3, (uint8_t)value);
deviceController.getFeatureARDrone3().sendPilotingSettingsBankedTurn((byte)value);
Enable / Disable Banked Turn mode.
When banked turn mode is enabled, the drone will use yaw values from the piloting command to infer with roll and pitch on the drone when its horizontal speed is not null.
- value (u8): 1 to enable, 0 to disable
Result:
The banked turn mode is enabled or disabled.
Then, event BankedTurnModeChanged is triggered.
Supported by
- Bebop since 3.2.0
- Bebop 2 since 3.2.0
Set Max Vertical speed
Set Max Vertical speed:
deviceController->aRDrone3->sendSpeedSettingsMaxVerticalSpeed(deviceController->aRDrone3, (float)current);
deviceController->aRDrone3->sendSpeedSettingsMaxVerticalSpeed(deviceController->aRDrone3, (float)current);
deviceController.getFeatureARDrone3().sendSpeedSettingsMaxVerticalSpeed((float)current);
Set Max Vertical speed
- current (float): Current max vertical speed in m/s
You can get bounds with event MaxVerticalSpeedChanged.
Result:
The max vertical speed is set.
Then, event MaxVerticalSpeedChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set Max Rotation speed
Set Max Rotation speed:
deviceController->aRDrone3->sendSpeedSettingsMaxRotationSpeed(deviceController->aRDrone3, (float)current);
deviceController->aRDrone3->sendSpeedSettingsMaxRotationSpeed(deviceController->aRDrone3, (float)current);
deviceController.getFeatureARDrone3().sendSpeedSettingsMaxRotationSpeed((float)current);
Set Max Rotation speed
- current (float): Current max rotation speed in degree/s
You can get bounds with event MaxRotationSpeedChanged.
Result:
The max rotation speed is set.
Then, event MaxRotationSpeedChanged is triggered.
Supported by
- Bebop
- Bebop 2
Presence of hull protection
Presence of hull protection:
deviceController->aRDrone3->sendSpeedSettingsHullProtection(deviceController->aRDrone3, (uint8_t)present);
deviceController->aRDrone3->sendSpeedSettingsHullProtection(deviceController->aRDrone3, (uint8_t)present);
deviceController.getFeatureARDrone3().sendSpeedSettingsHullProtection((byte)present);
Presence of hull protection
- present (u8): 1 if present, 0 if not present
Sending this command is not mandatory, it just helps the drone to modify its wind resistance and adapt its battery decrease model.
Result:
The presence of the hull is set.
Then, event HullProtectionChanged is triggered.
Supported by
- Bebop
- Bebop 2
Outdoor property
Outdoor property (deprecated):
deviceController->aRDrone3->sendSpeedSettingsOutdoor(deviceController->aRDrone3, (uint8_t)outdoor);
deviceController->aRDrone3->sendSpeedSettingsOutdoor(deviceController->aRDrone3, (uint8_t)outdoor);
deviceController.getFeatureARDrone3().sendSpeedSettingsOutdoor((byte)outdoor);
This command is deprecated, please don’t use it.
Set Max Pitch/Roll Rotation speed
Set Max Pitch/Roll Rotation speed:
deviceController->aRDrone3->sendSpeedSettingsMaxPitchRollRotationSpeed(deviceController->aRDrone3, (float)current);
deviceController->aRDrone3->sendSpeedSettingsMaxPitchRollRotationSpeed(deviceController->aRDrone3, (float)current);
deviceController.getFeatureARDrone3().sendSpeedSettingsMaxPitchRollRotationSpeed((float)current);
Set Max Pitch/Roll Rotation speed.
- current (float): Current max pitch/roll rotation speed in degree/s
Result:
The max pitch/roll rotation speed is set.
Then, event MaxPitchRollRotationSpeedChanged is triggered.
Supported by no products
Wifi selection
Wifi selection:
deviceController->aRDrone3->sendNetworkSettingsWifiSelection(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISELECTION_TYPE)type, (eARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISELECTION_BAND)band, (uint8_t)channel);
deviceController->aRDrone3->sendNetworkSettingsWifiSelection(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISELECTION_TYPE)type, (eARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISELECTION_BAND)band, (uint8_t)channel);
deviceController.getFeatureARDrone3().sendNetworkSettingsWifiSelection((ARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISELECTION_TYPE_ENUM)type, (ARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISELECTION_BAND_ENUM)band, (byte)channel);
Select or auto-select channel of choosen band.
- type (enum): The type of wifi selection (auto, manual)
- auto: Auto selection
- manual: Manual selection
- auto: Auto selection
- band (enum): The allowed band(s) : 2.4 Ghz, 5 Ghz, or all
- 2_4ghz: 2.4 GHz band
- 5ghz: 5 GHz band
- all: Both 2.4 and 5 GHz bands
- 2_4ghz: 2.4 GHz band
- channel (u8): The channel (not used in auto mode)
Result:
The wifi channel changes according to given parameters. Watch out, a disconnection might appear.
Then, event WifiSelectionChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set the wifi security
Set the wifi security:
deviceController->aRDrone3->sendNetworkSettingsWifiSecurity(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISECURITY_TYPE)type, (char *)key, (eARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISECURITY_KEYTYPE)keyType);
deviceController->aRDrone3->sendNetworkSettingsWifiSecurity(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISECURITY_TYPE)type, (char *)key, (eARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISECURITY_KEYTYPE)keyType);
deviceController.getFeatureARDrone3().sendNetworkSettingsWifiSecurity((ARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISECURITY_TYPE_ENUM)type, (String)key, (ARCOMMANDS_ARDRONE3_NETWORKSETTINGS_WIFISECURITY_KEYTYPE_ENUM)keyType);
Set the wifi security
- type (enum): The type of wifi security (open, wpa2)
- open: Wifi is not protected by any security (default)
- wpa2: Wifi is protected by wpa2
- open: Wifi is not protected by any security (default)
- key (string): The key to secure the network (empty if type is open)
- keyType (enum): Type of the key
- plain: Key is plain text, not encrypted
- plain: Key is plain text, not encrypted
The security is changed on the next boot.
Result:
The wifi security is set.
Then, event WifiSecurityChanged is triggered.
Supported by
- Bebop since 3.2.0
- Bebop 2 since 3.2.0
The format of the photo
The format of the photo:
deviceController->aRDrone3->sendPictureSettingsPictureFormatSelection(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_PICTUREFORMATSELECTION_TYPE)type);
deviceController->aRDrone3->sendPictureSettingsPictureFormatSelection(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_PICTUREFORMATSELECTION_TYPE)type);
deviceController.getFeatureARDrone3().sendPictureSettingsPictureFormatSelection((ARCOMMANDS_ARDRONE3_PICTURESETTINGS_PICTUREFORMATSELECTION_TYPE_ENUM)type);
The format of the photo
- type (enum): The type of photo format
- raw: Take raw image
- jpeg: Take a 4:3 jpeg photo
- snapshot: Take a 16:9 snapshot from camera
- jpeg_fisheye: Take jpeg fisheye image only
- raw: Take raw image
Please note that the time required to take the picture is highly related to this format.
Also, please note that if your picture format is different from snapshot, picture taking will stop video recording (it will restart after the picture has been taken).
Result:
The picture format is set.
Then, event PictureFormatChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set the white balance mode
Set the white balance mode:
deviceController->aRDrone3->sendPictureSettingsAutoWhiteBalanceSelection(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_AUTOWHITEBALANCESELECTION_TYPE)type);
deviceController->aRDrone3->sendPictureSettingsAutoWhiteBalanceSelection(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_AUTOWHITEBALANCESELECTION_TYPE)type);
deviceController.getFeatureARDrone3().sendPictureSettingsAutoWhiteBalanceSelection((ARCOMMANDS_ARDRONE3_PICTURESETTINGS_AUTOWHITEBALANCESELECTION_TYPE_ENUM)type);
Set the white balance mode.
- type (enum): The type auto white balance
- auto: Auto guess of best white balance params
- tungsten: Tungsten white balance
- daylight: Daylight white balance
- cloudy: Cloudy white balance
- cool_white: White balance for a flash
- auto: Auto guess of best white balance params
Result:
The balance is set.
Then, event WhiteBalanceModeChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set image exposure
Set image exposure:
deviceController->aRDrone3->sendPictureSettingsExpositionSelection(deviceController->aRDrone3, (float)value);
deviceController->aRDrone3->sendPictureSettingsExpositionSelection(deviceController->aRDrone3, (float)value);
deviceController.getFeatureARDrone3().sendPictureSettingsExpositionSelection((float)value);
Set image exposure.
- value (float): exposure value (bounds given by ExposureChanged arg min and max, by default [-3:3])
Bounds can be get with commands ExposureChanged.
Result:
The exposure is set.
Then, event ExposureChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set image saturation
Set image saturation:
deviceController->aRDrone3->sendPictureSettingsSaturationSelection(deviceController->aRDrone3, (float)value);
deviceController->aRDrone3->sendPictureSettingsSaturationSelection(deviceController->aRDrone3, (float)value);
deviceController.getFeatureARDrone3().sendPictureSettingsSaturationSelection((float)value);
Set image saturation.
- value (float): Saturation value (bounds given by SaturationChanged arg min and max, by default [-100:100])
Bounds can be get with commands SaturationChanged.
Result:
The saturation is set.
Then, event SaturationChanged is triggered.
Supported by
- Bebop
- Bebop 2
Configure timelapse mode
Configure timelapse mode:
deviceController->aRDrone3->sendPictureSettingsTimelapseSelection(deviceController->aRDrone3, (uint8_t)enabled, (float)interval);
deviceController->aRDrone3->sendPictureSettingsTimelapseSelection(deviceController->aRDrone3, (uint8_t)enabled, (float)interval);
deviceController.getFeatureARDrone3().sendPictureSettingsTimelapseSelection((byte)enabled, (float)interval);
Configure timelapse mode.
- enabled (u8): 1 if timelapse is enabled, 0 otherwise
- interval (float): interval in seconds for taking pictures
Watch out, this command only configure the timelapse mode. Once it is configured, you can start/stop the timelapse with the RecordVideo command.
Result:
The timelapse mode is configured (but not started).
Then, event TimelapseModeConfigurationChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set video autorecord
Set video autorecord:
deviceController->aRDrone3->sendPictureSettingsVideoAutorecordSelection(deviceController->aRDrone3, (uint8_t)enabled, (uint8_t)mass_storage_id);
deviceController->aRDrone3->sendPictureSettingsVideoAutorecordSelection(deviceController->aRDrone3, (uint8_t)enabled, (uint8_t)mass_storage_id);
deviceController.getFeatureARDrone3().sendPictureSettingsVideoAutorecordSelection((byte)enabled, (byte)mass_storage_id);
Set video autorecord.
- enabled (u8): 1 if video autorecord is enabled, 0 otherwise
- mass_storage_id (u8): Mass storage id to take video
If autorecord is set, video record will be automatically started when the drone takes off and stopped slightly after landing.
Result:
The autorecord mode is configured.
Then, event VideoAutorecordChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set Video stabilization mode
Set Video stabilization mode:
deviceController->aRDrone3->sendPictureSettingsVideoStabilizationMode(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEOSTABILIZATIONMODE_MODE)mode);
deviceController->aRDrone3->sendPictureSettingsVideoStabilizationMode(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEOSTABILIZATIONMODE_MODE)mode);
deviceController.getFeatureARDrone3().sendPictureSettingsVideoStabilizationMode((ARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEOSTABILIZATIONMODE_MODE_ENUM)mode);
Set Video stabilization mode
- mode (enum): Video stabilization mode
- roll_pitch: Video flat on roll and pitch
- pitch: Video flat on pitch only
- roll: Video flat on roll only
- none: Video follows drone angles
- roll_pitch: Video flat on roll and pitch
Result:
The video stabilization mode is configured.
Then, event VideoStabilizationModeChanged is triggered.
Supported by no products.
Set Video recording mode
Set Video recording mode:
deviceController->aRDrone3->sendPictureSettingsVideoRecordingMode(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEORECORDINGMODE_MODE)mode);
deviceController->aRDrone3->sendPictureSettingsVideoRecordingMode(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEORECORDINGMODE_MODE)mode);
deviceController.getFeatureARDrone3().sendPictureSettingsVideoRecordingMode((ARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEORECORDINGMODE_MODE_ENUM)mode);
Set Video recording mode
- mode (enum): Video recording mode
- quality: Maximize recording quality.
- time: Maximize recording time.
- quality: Maximize recording quality.
Result:
The video recording mode is modified.
Then, event VideoRecordingModeChanged is triggered.
Supported by
- Bebop since 3.3.0
- Bebop 2 since 3.3.0
Set Video framerate
Set Video framerate:
deviceController->aRDrone3->sendPictureSettingsVideoFramerate(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEOFRAMERATE_FRAMERATE)framerate);
deviceController->aRDrone3->sendPictureSettingsVideoFramerate(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEOFRAMERATE_FRAMERATE)framerate);
deviceController.getFeatureARDrone3().sendPictureSettingsVideoFramerate((ARCOMMANDS_ARDRONE3_PICTURESETTINGS_VIDEOFRAMERATE_FRAMERATE_ENUM)framerate);
Set Video framerate
- framerate (enum): Video framerate
- 24_FPS: 23.976 frames per second.
- 25_FPS: 25 frames per second.
- 30_FPS: 29.97 frames per second.
- 24_FPS: 23.976 frames per second.
Result:
The video framerate is modified.
Then, event VideoFramerateChanged is triggered.
Supported by
- Bebop since 3.3.0
- Bebop 2 since 3.3.0
Enable/disable video streaming.
Enable/disable video streaming.:
deviceController->aRDrone3->sendMediaStreamingVideoEnable(deviceController->aRDrone3, (uint8_t)enable);
deviceController->aRDrone3->sendMediaStreamingVideoEnable(deviceController->aRDrone3, (uint8_t)enable);
deviceController.getFeatureARDrone3().sendMediaStreamingVideoEnable((byte)enable);
Enable/disable video streaming.
- enable (u8): 1 to enable, 0 to disable.
Please note that on Bebop version less that 2.0.57 and Bebop 2 version less that 3.0.6 this command is not needed as the drone starts automatically the stream. To be fully compatible with future versions, you should in any cases send this command if you want to get the video stream.
Result:
The video stream is started or stopped.
Then, event VideoEnableChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set home location
Set home location (deprecated):
deviceController->aRDrone3->sendGPSSettingsSetHome(deviceController->aRDrone3, (double)latitude, (double)longitude, (double)altitude);
deviceController->aRDrone3->sendGPSSettingsSetHome(deviceController->aRDrone3, (double)latitude, (double)longitude, (double)altitude);
deviceController.getFeatureARDrone3().sendGPSSettingsSetHome((double)latitude, (double)longitude, (double)altitude);
This command is deprecated, please don’t use it.
Reset home location
Reset home location:
deviceController->aRDrone3->sendGPSSettingsResetHome(deviceController->aRDrone3);
deviceController->aRDrone3->sendGPSSettingsResetHome(deviceController->aRDrone3);
deviceController.getFeatureARDrone3().sendGPSSettingsResetHome();
Reset home location. The drone will choose its own home.
Result:
The home location is reset.
Then, event HomeLocationReset is triggered with the new home location.
Supported by
- Bebop
- Bebop 2
Send controller GPS location
Send controller GPS location:
deviceController->aRDrone3->sendGPSSettingsSendControllerGPS(deviceController->aRDrone3, (double)latitude, (double)longitude, (double)altitude, (double)horizontalAccuracy, (double)verticalAccuracy);
deviceController->aRDrone3->sendGPSSettingsSendControllerGPS(deviceController->aRDrone3, (double)latitude, (double)longitude, (double)altitude, (double)horizontalAccuracy, (double)verticalAccuracy);
deviceController.getFeatureARDrone3().sendGPSSettingsSendControllerGPS((double)latitude, (double)longitude, (double)altitude, (double)horizontalAccuracy, (double)verticalAccuracy);
Send controller GPS location
- latitude (double): GPS latitude in decimal degrees
- longitude (double): GPS longitude in decimal degrees
- altitude (double): GPS altitude in meters
- horizontalAccuracy (double): Horizontal Accuracy in meter ; equal -1 if no horizontal Accuracy
- verticalAccuracy (double): Vertical Accuracy in meter ; equal -1 if no vertical Accuracy
The user location might be used in case of return home, according to the home type and the accuracy of the given position. You can get the current home type with the event HomeTypeChosenChanged.
Result:
The user position is known by the drone.
Then, event HomeChanged is triggered with the new home location.
Supported by
- Bebop
- Bebop 2
Set preferred home type
Set user preference for the type of the home position:
deviceController->aRDrone3->sendGPSSettingsHomeType(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_GPSSETTINGS_HOMETYPE_TYPE)type);
deviceController->aRDrone3->sendGPSSettingsHomeType(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_GPSSETTINGS_HOMETYPE_TYPE)type);
deviceController.getFeatureARDrone3().sendGPSSettingsHomeType((ARCOMMANDS_ARDRONE3_GPSSETTINGS_HOMETYPE_TYPE_ENUM)type);
Set user preference for the type of the home position.
- type (enum): The type of the home position
- TAKEOFF: The drone will try to return to the take off position
- PILOT: The drone will try to return to the pilot position
- TAKEOFF: The drone will try to return to the take off position
Please note that this is only a preference. The actual type chosen is given by the event HomeTypeChosenChanged.
The availability of the choices can be given by the event HomeTypeAvailabilityChanged.
Result:
The user choice is known by the drone.
Then, event HomeTypeChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set the delay of the return home
Set the delay of the return home:
deviceController->aRDrone3->sendGPSSettingsReturnHomeDelay(deviceController->aRDrone3, (uint16_t)delay);
deviceController->aRDrone3->sendGPSSettingsReturnHomeDelay(deviceController->aRDrone3, (uint16_t)delay);
deviceController.getFeatureARDrone3().sendGPSSettingsReturnHomeDelay((short)delay);
Set the delay after which the drone will automatically try to return home after a disconnection.
- delay (u16): Delay in second
Result:
The delay of the return home is set.
Then, event ReturnHomeDelayChanged is triggered.
Supported by
- Bebop 2
Set the electric frequency
Set the electric frequency:
deviceController->aRDrone3->sendAntiflickeringElectricFrequency(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_ANTIFLICKERING_ELECTRICFREQUENCY_FREQUENCY)frequency);
deviceController->aRDrone3->sendAntiflickeringElectricFrequency(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_ANTIFLICKERING_ELECTRICFREQUENCY_FREQUENCY)frequency);
deviceController.getFeatureARDrone3().sendAntiflickeringElectricFrequency((ARCOMMANDS_ARDRONE3_ANTIFLICKERING_ELECTRICFREQUENCY_FREQUENCY_ENUM)frequency);
Set the electric frequency of the country determined by the position of the controller.
This is used to avoid the video flickering in auto mode. You can get the current antiflickering mode with the event AntiflickeringModeChanged.
- frequency (enum): Type of the electric frequency
- fiftyHertz: Electric frequency of the country is 50hz
- sixtyHertz: Electric frequency of the country is 60hz
- fiftyHertz: Electric frequency of the country is 50hz
Result:
The electric frequency is set.
Then, event ElectricFrequencyChanged is triggered.
Supported by
- Bebop
- Bebop 2
Set the anti flickering mode
Set the anti flickering mode:
deviceController->aRDrone3->sendAntiflickeringSetMode(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_ANTIFLICKERING_SETMODE_MODE)mode);
deviceController->aRDrone3->sendAntiflickeringSetMode(deviceController->aRDrone3, (eARCOMMANDS_ARDRONE3_ANTIFLICKERING_SETMODE_MODE)mode);
deviceController.getFeatureARDrone3().sendAntiflickeringSetMode((ARCOMMANDS_ARDRONE3_ANTIFLICKERING_SETMODE_MODE_ENUM)mode);
Set the anti flickering mode
- mode (enum): Mode of the anti flickering functionnality
- auto: Anti flickering based on the electric frequency previously sent
- FixedFiftyHertz: Anti flickering based on a fixed frequency of 50Hz
- FixedFiftyHertz: Anti flickering based on a fixed frequency of 60Hz
- auto: Anti flickering based on the electric frequency previously sent
If auto, the frequency taken in account is the one sent by SetElectricFrequency. You can get the current electric frequency with the event ElectricFrequencyChanged.
If auto, the drone will detect when flickers appears on the video and trigger the antiflickering.
Forcing the antiflickering (FixedFiftyHertz or FixedFiftyHertz) can reduce luminosity of the video.
Result:
The antiflickering mode is set.
Then, event AntiflickeringModeChanged is triggered.
Supported by
- Bebop
- Bebop 2
Bebop events
Signals the remote that the product will disconnect
Signals the remote that the product will disconnect
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_NETWORKEVENT_DISCONNECTION) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_NETWORKEVENT_DISCONNECTION_CAUSE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_NETWORKEVENT_DISCONNECTION_CAUSE cause = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_NETWORKEVENT_DISCONNECTION) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_NETWORKEVENT_DISCONNECTION_CAUSE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_NETWORKEVENT_DISCONNECTION_CAUSE cause = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_NETWORKEVENT_DISCONNECTION) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_NETWORKEVENT_DISCONNECTION_CAUSE_ENUM cause = ARCOMMANDS_COMMON_NETWORKEVENT_DISCONNECTION_CAUSE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_NETWORKEVENT_DISCONNECTION_CAUSE));
}
}
}
Signals the remote that the product will disconnect
This event is mainly triggered when the user presses on the power button of the product.
- cause (enum): Cause of the disconnection of the product
- off_button: The button off has been pressed
- unknown: Unknown generic cause
- off_button: The button off has been pressed
This event is a notification, you can’t retrieve it in the cache of the device controller.
Supported by
- Bebop since 2.0.3
- Bebop 2
All settings have been sent
All settings have been sent:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_ALLSETTINGSCHANGED) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_ALLSETTINGSCHANGED) && (elementDictionary != NULL))
{
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_ALLSETTINGSCHANGED) && (elementDictionary != null)){
}
}
All settings have been sent.
Please note that you should not care about this event if you are using the libARController API as this library is handling the connection process for you.
Supported by all products
All settings have been reset
All settings have been reset:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_RESETCHANGED) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_RESETCHANGED) && (elementDictionary != NULL))
{
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_RESETCHANGED) && (elementDictionary != null)){
}
}
All settings have been reset.
Triggered by SettingsReset.
Supported by all products
Product name changed
Product name changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTNAMECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTNAMECHANGED_NAME, arg);
if (arg != NULL)
{
char * name = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTNAMECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTNAMECHANGED_NAME, arg);
if (arg != NULL)
{
char * name = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTNAMECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String name = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTNAMECHANGED_NAME);
}
}
}
Product name changed
- name (string): Product name
Triggered by ProductName.
Supported by all products
Product versions
Product versions:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED_SOFTWARE, arg);
if (arg != NULL)
{
char * software = arg->value.String;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED_HARDWARE, arg);
if (arg != NULL)
{
char * hardware = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED_SOFTWARE, arg);
if (arg != NULL)
{
char * software = arg->value.String;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED_HARDWARE, arg);
if (arg != NULL)
{
char * hardware = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String software = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED_SOFTWARE);
String hardware = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTVERSIONCHANGED_HARDWARE);
}
}
}
Product versions
- software (string): Product software version
- hardware (string): Product hardware version
As the product version should not change during runtime, this will only be received during the connection process (triggered by the GetAllSettings).
Supported by all products
Product serial number
Product serial number:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALHIGHCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALHIGHCHANGED_HIGH, arg);
if (arg != NULL)
{
char * high = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALHIGHCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALHIGHCHANGED_HIGH, arg);
if (arg != NULL)
{
char * high = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALHIGHCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String high = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALHIGHCHANGED_HIGH);
}
}
}
Product serial number
- high (string): Serial high number (hexadecimal value)
As the product serial should not change during runtime, this will only be received during the connection process (triggered by the GetAllSettings).
Supported by all products
Product serial number
Product serial number:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALLOWCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALLOWCHANGED_LOW, arg);
if (arg != NULL)
{
char * low = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALLOWCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALLOWCHANGED_LOW, arg);
if (arg != NULL)
{
char * low = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALLOWCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String low = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_PRODUCTSERIALLOWCHANGED_LOW);
}
}
}
Product serial number
- low (string): Serial low number (hexadecimal value)
As the product serial should not change during runtime, this will only be received during the connection process (triggered by the GetAllSettings).
Supported by all products
Country changed
Country changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_COUNTRYCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_COUNTRYCHANGED_CODE, arg);
if (arg != NULL)
{
char * code = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_COUNTRYCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_COUNTRYCHANGED_CODE, arg);
if (arg != NULL)
{
char * code = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_COUNTRYCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String code = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_COUNTRYCHANGED_CODE);
}
}
}
Inform current Country set in product.
- code (string): Country code with ISO 3166 format, empty string means unknown country.
Triggered by SetCountry.
Supported by all wifi products
Auto Country setting changed
Auto Country setting changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_AUTOCOUNTRYCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_AUTOCOUNTRYCHANGED_AUTOMATIC, arg);
if (arg != NULL)
{
uint8_t automatic = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_AUTOCOUNTRYCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_AUTOCOUNTRYCHANGED_AUTOMATIC, arg);
if (arg != NULL)
{
uint8_t automatic = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_AUTOCOUNTRYCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte automatic = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_SETTINGSSTATE_AUTOCOUNTRYCHANGED_AUTOMATIC)).intValue();
}
}
}
Auto Country setting changed.
- automatic (u8): Boolean : 0 : Manual / 1 : Auto
Triggered by SetAutoCountry.
Supported by all wifi products
All product states have been sent
All product states have been sent:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_ALLSTATESCHANGED) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_ALLSTATESCHANGED) && (elementDictionary != NULL))
{
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_ALLSTATESCHANGED) && (elementDictionary != null)){
}
}
All product states have been sent.
Please note that you should not care about this event if you are using the libARController API as this library is handling the connection process for you.
Supported by all products
Battery state
Battery state:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED_PERCENT, arg);
if (arg != NULL)
{
uint8_t percent = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED_PERCENT, arg);
if (arg != NULL)
{
uint8_t percent = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte percent = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_BATTERYSTATECHANGED_PERCENT)).intValue();
}
}
}
Battery state
- percent (u8): Battery percentage
Triggered when the battery level changes.
Supported by all products
Mass storage state list
Mass storage state list:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED_MASS_STORAGE_ID, arg);
if (arg != NULL)
{
uint8_t mass_storage_id = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED_NAME, arg);
if (arg != NULL)
{
char * name = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED_MASS_STORAGE_ID, arg);
if (arg != NULL)
{
uint8_t mass_storage_id = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED_NAME, arg);
if (arg != NULL)
{
char * name = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
byte mass_storage_id = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED_MASS_STORAGE_ID)).intValue();
String name = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGESTATELISTCHANGED_NAME);
}
}
}
}
Mass storage state list
- mass_storage_id (u8): Mass storage id (unique)
- name (string): Mass storage name
Triggered when a new mass storage is inserted or ejected.
Supported by all products
Mass storage info state list
Mass storage info state list (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_MASS_STORAGE_ID, arg);
if (arg != NULL)
{
uint8_t mass_storage_id = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_SIZE, arg);
if (arg != NULL)
{
uint32_t size = arg->value.U32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_USED_SIZE, arg);
if (arg != NULL)
{
uint32_t used_size = arg->value.U32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_PLUGGED, arg);
if (arg != NULL)
{
uint8_t plugged = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_FULL, arg);
if (arg != NULL)
{
uint8_t full = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_INTERNAL, arg);
if (arg != NULL)
{
uint8_t internal = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_MASS_STORAGE_ID, arg);
if (arg != NULL)
{
uint8_t mass_storage_id = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_SIZE, arg);
if (arg != NULL)
{
uint32_t size = arg->value.U32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_USED_SIZE, arg);
if (arg != NULL)
{
uint32_t used_size = arg->value.U32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_PLUGGED, arg);
if (arg != NULL)
{
uint8_t plugged = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_FULL, arg);
if (arg != NULL)
{
uint8_t full = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_INTERNAL, arg);
if (arg != NULL)
{
uint8_t internal = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
byte mass_storage_id = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_MASS_STORAGE_ID)).intValue();
int size = (int)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_SIZE);
int used_size = (int)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_USED_SIZE);
byte plugged = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_PLUGGED)).intValue();
byte full = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_FULL)).intValue();
byte internal = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOSTATELISTCHANGED_INTERNAL)).intValue();
}
}
}
}
This event is deprecated.
Current date state
Current date state:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTDATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTDATECHANGED_DATE, arg);
if (arg != NULL)
{
char * date = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTDATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTDATECHANGED_DATE, arg);
if (arg != NULL)
{
char * date = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTDATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String date = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTDATECHANGED_DATE);
}
}
}
Current date state
- date (string): Date with ISO-8601 format
Triggered by SetCurrentDate.
Supported by all products
Please note that you should not care about this event if you are using the libARController API as this library is handling the connection process for you.
Current time state
Current time state:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTTIMECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTTIMECHANGED_TIME, arg);
if (arg != NULL)
{
char * time = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTTIMECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTTIMECHANGED_TIME, arg);
if (arg != NULL)
{
char * time = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTTIMECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String time = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_CURRENTTIMECHANGED_TIME);
}
}
}
Current time state
- time (string): Time with ISO-8601 format
Triggered by SetCurrentTime.
Supported by all products
Please note that you should not care about this event if you are using the libARController API as this library is handling the connection process for you.
Mass storage info remaining list (deprecated)
Mass storage info remaining list (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_FREE_SPACE, arg);
if (arg != NULL)
{
uint32_t free_space = arg->value.U32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_REC_TIME, arg);
if (arg != NULL)
{
uint16_t rec_time = arg->value.U16;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_PHOTO_REMAINING, arg);
if (arg != NULL)
{
uint32_t photo_remaining = arg->value.U32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_FREE_SPACE, arg);
if (arg != NULL)
{
uint32_t free_space = arg->value.U32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_REC_TIME, arg);
if (arg != NULL)
{
uint16_t rec_time = arg->value.U16;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_PHOTO_REMAINING, arg);
if (arg != NULL)
{
uint32_t photo_remaining = arg->value.U32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
int free_space = (int)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_FREE_SPACE);
short rec_time = (short)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_REC_TIME)).intValue();
int photo_remaining = (int)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_MASSSTORAGEINFOREMAININGLISTCHANGED_PHOTO_REMAINING);
}
}
}
}
This event is deprecated.
Wifi Signal state
Wifi Signal between controller and product state:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_WIFISIGNALCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_WIFISIGNALCHANGED_RSSI, arg);
if (arg != NULL)
{
int16_t rssi = arg->value.I16;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_WIFISIGNALCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_WIFISIGNALCHANGED_RSSI, arg);
if (arg != NULL)
{
int16_t rssi = arg->value.I16;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_WIFISIGNALCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
short rssi = (short)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_WIFISIGNALCHANGED_RSSI)).intValue();
}
}
}
Wifi Signal between controller and product state
- rssi (i16): RSSI of the signal between controller and the product (in dbm)
Triggered when the wifi link signal changed.
Supported by all wifi products
Sensors states list
Sensors states list:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORNAME, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORNAME sensorName = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORSTATE, arg);
if (arg != NULL)
{
uint8_t sensorState = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORNAME, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORNAME sensorName = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORSTATE, arg);
if (arg != NULL)
{
uint8_t sensorState = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
ARCOMMANDS_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORNAME_ENUM sensorName = ARCOMMANDS_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORNAME_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORNAME));
byte sensorState = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_SENSORSSTATESLISTCHANGED_SENSORSTATE)).intValue();
}
}
}
}
Sensors states list
- sensorName (enum): Sensor name
- IMU: Inertial Measurement Unit sensor
- barometer: Barometer sensor
- ultrasound: Ultrasonic sensor
- GPS: GPS sensor
- magnetometer: Magnetometer sensor
- vertical_camera: Vertical Camera sensor
- IMU: Inertial Measurement Unit sensor
- sensorState (u8): Sensor state (1 if the sensor is OK, 0 if the sensor is NOT OK)
Triggered at connection and when a sensor state changes.
Supported by
- Bebop since 2.0.3
- Bebop 2
- Jumping Sumo Evos
- Jumping Sumo
- Airborne Night
- Airborne Cargo
Get the product model
Get the product model:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_PRODUCTMODEL) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_PRODUCTMODEL_MODEL, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_COMMONSTATE_PRODUCTMODEL_MODEL model = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_PRODUCTMODEL) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_PRODUCTMODEL_MODEL, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_COMMONSTATE_PRODUCTMODEL_MODEL model = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_PRODUCTMODEL) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_COMMONSTATE_PRODUCTMODEL_MODEL_ENUM model = ARCOMMANDS_COMMON_COMMONSTATE_PRODUCTMODEL_MODEL_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_PRODUCTMODEL_MODEL));
}
}
}
Get the product model.
This can be used to customize the UI depending on the connected product.
- model (enum): The Model of the product.
- RS_TRAVIS: Travis (RS taxi) model.
- RS_MARS: Mars (RS space) model
- RS_SWAT: SWAT (RS SWAT) model
- RS_MCLANE: Mc Lane (RS police) model
- RS_BLAZE: Blaze (RS fire) model
- RS_ORAK: Orak (RS carbon hydrofoil) model
- RS_NEWZ: New Z (RS wooden hydrofoil) model
- JS_MARSHALL: Marshall (JS fire) model
- JS_DIESEL: Diesel (JS SWAT) model
- JS_BUZZ: Buzz (JS space) model
- JS_MAX: Max (JS F1) model
- JS_JETT: Jett (JS flames) model
- JS_TUKTUK: Tuk-Tuk (JS taxi) model
- RS_TRAVIS: Travis (RS taxi) model.
Triggered at the connection.
Supported by
- Jumping Sumo Evos
- Airborne Night
- Airborne Cargo
List of the countries known by the device
List of the countries known by the device:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN_LISTFLAGS, arg);
if (arg != NULL)
{
uint8_t listFlags = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN_COUNTRYCODES, arg);
if (arg != NULL)
{
char * countryCodes = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN_LISTFLAGS, arg);
if (arg != NULL)
{
uint8_t listFlags = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN_COUNTRYCODES, arg);
if (arg != NULL)
{
char * countryCodes = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
byte listFlags = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN_LISTFLAGS)).intValue();
String countryCodes = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_COMMONSTATE_COUNTRYLISTKNOWN_COUNTRYCODES);
}
}
}
}
List of the countries known by the device
- listFlags (u8): List entry attribute Bitfield.
0x01: First: indicate it’s the first element of the list.
0x02: Last: indicate it’s the last element of the list.
0x04: Empty: indicate the list is empty (implies First/Last). All other arguments should be ignored. - countryCodes (string): Following of country code with ISO 3166 format, separated by “;”.
Triggered at connection.
Not supported by any product
Overheat temperature reached
Overheat temperature reached (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATCHANGED) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATCHANGED) && (elementDictionary != NULL))
{
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATCHANGED) && (elementDictionary != null)){
}
}
This event is deprecated.
Overheat regulation state changed
Overheat regulation state changed (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATREGULATIONCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATREGULATIONCHANGED_REGULATIONTYPE, arg);
if (arg != NULL)
{
uint8_t regulationType = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATREGULATIONCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATREGULATIONCHANGED_REGULATIONTYPE, arg);
if (arg != NULL)
{
uint8_t regulationType = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATREGULATIONCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte regulationType = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_OVERHEATSTATE_OVERHEATREGULATIONCHANGED_REGULATIONTYPE)).intValue();
}
}
}
This event is deprecated.
Status of the wifi config
Status of the wifi config:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_WIFISETTINGSSTATE_OUTDOORSETTINGSCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_WIFISETTINGSSTATE_OUTDOORSETTINGSCHANGED_OUTDOOR, arg);
if (arg != NULL)
{
uint8_t outdoor = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_WIFISETTINGSSTATE_OUTDOORSETTINGSCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_WIFISETTINGSSTATE_OUTDOORSETTINGSCHANGED_OUTDOOR, arg);
if (arg != NULL)
{
uint8_t outdoor = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_WIFISETTINGSSTATE_OUTDOORSETTINGSCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte outdoor = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_WIFISETTINGSSTATE_OUTDOORSETTINGSCHANGED_OUTDOOR)).intValue();
}
}
}
Status of the wifi config : either indoor or outdoor
- outdoor (u8): 1 if it should use outdoor wifi settings, 0 otherwise
Triggered by OutdoorSetting.
Supported by all wifi products
Playing state of an automated flight
Playing state of an automated flight:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_FILEPATH, arg);
if (arg != NULL)
{
char * filepath = arg->value.String;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_TYPE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_TYPE type = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_FILEPATH, arg);
if (arg != NULL)
{
char * filepath = arg->value.String;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_TYPE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_TYPE type = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_STATE_ENUM state = ARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_STATE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_STATE));
String filepath = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_FILEPATH);
ARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_TYPE_ENUM type = ARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_TYPE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKFILEPLAYINGSTATECHANGED_TYPE));
}
}
}
Playing state of an automated flight
- state (enum): State of the mavlink
- playing: Mavlink file is playing
- stopped: Mavlink file is stopped (arg filepath and type are useless in this state)
- paused: Mavlink file is paused
- playing: Mavlink file is playing
- filepath (string): flight plan file path from the mavlink ftp root
- type (enum): type of the played mavlink file
- flightPlan: Mavlink file for FlightPlan
- mapMyHouse: Mavlink file for MapMyHouse (not used)
- flightPlan: Mavlink file for FlightPlan
Triggered by StartAutonomousFlight or PauseAutonomousFlight or StopAutonomousFlight or at the end of an automated flight.
Supported by
- Bebop since 2.0.29
- Bebop 2
Autonomous flight state error
Autonomous flight state error:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED_ERROR error = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED_ERROR error = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED_ERROR_ENUM error = ARCOMMANDS_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED_ERROR_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_MAVLINKSTATE_MAVLINKPLAYERRORSTATECHANGED_ERROR));
}
}
}
Autonomous flight state error
- error (enum): State of play error
- none: There is no error
- notInOutDoorMode: The drone is not in outdoor mode
- gpsNotFixed: The gps is not fixed
- notCalibrated: The magnetometer of the drone is not calibrated
- none: There is no error
Triggered by StartAutonomousFlight.
Supported by
- Bebop since 2.0.29
- Bebop 2
Sent when the state of the magneto calibration has changed
Sent when the state of the magneto calibration has changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_XAXISCALIBRATION, arg);
if (arg != NULL)
{
uint8_t xAxisCalibration = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_YAXISCALIBRATION, arg);
if (arg != NULL)
{
uint8_t yAxisCalibration = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_ZAXISCALIBRATION, arg);
if (arg != NULL)
{
uint8_t zAxisCalibration = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_CALIBRATIONFAILED, arg);
if (arg != NULL)
{
uint8_t calibrationFailed = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_XAXISCALIBRATION, arg);
if (arg != NULL)
{
uint8_t xAxisCalibration = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_YAXISCALIBRATION, arg);
if (arg != NULL)
{
uint8_t yAxisCalibration = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_ZAXISCALIBRATION, arg);
if (arg != NULL)
{
uint8_t zAxisCalibration = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_CALIBRATIONFAILED, arg);
if (arg != NULL)
{
uint8_t calibrationFailed = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte xAxisCalibration = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_XAXISCALIBRATION)).intValue();
byte yAxisCalibration = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_YAXISCALIBRATION)).intValue();
byte zAxisCalibration = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_ZAXISCALIBRATION)).intValue();
byte calibrationFailed = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTATECHANGED_CALIBRATIONFAILED)).intValue();
}
}
}
Sent when the state of the magneto calibration has changed
- xAxisCalibration (u8): State of the x axis (roll) calibration : 1 if calibration is done, 0 otherwise
- yAxisCalibration (u8): State of the y axis (pitch) calibration : 1 if calibration is done, 0 otherwise
- zAxisCalibration (u8): State of the z axis (yaw) calibration : 1 if calibration is done, 0 otherwise
- calibrationFailed (u8): 1 if calibration has failed, 0 otherwise. If this arg is 1, consider all previous arg as 0
Triggered by MagnetoCalibration when the calibration process is started and each time an axis calibration state changes.
Supported by
- Bebop
- Bebop 2
Status of the calibration requirement
Status of the calibration requirement:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONREQUIREDSTATE) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONREQUIREDSTATE_REQUIRED, arg);
if (arg != NULL)
{
uint8_t required = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONREQUIREDSTATE) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONREQUIREDSTATE_REQUIRED, arg);
if (arg != NULL)
{
uint8_t required = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONREQUIREDSTATE) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte required = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONREQUIREDSTATE_REQUIRED)).intValue();
}
}
}
Status of the calibration requirement
- required (u8): 1 if calibration is required, 0 if current calibration is still valid
Triggered when the calibration requirement changed.
Supported by
- Bebop
- Bebop 2
Current axis to calibrate changed
Current axis to calibrate changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED_AXIS, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED_AXIS axis = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED_AXIS, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED_AXIS axis = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED_AXIS_ENUM axis = ARCOMMANDS_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED_AXIS_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONAXISTOCALIBRATECHANGED_AXIS));
}
}
}
Current axis to calibrate changed
- axis (enum): The axis to calibrate
- xAxis: If the current calibration axis should be the x axis
- yAxis: If the current calibration axis should be the y axis
- zAxis: If the current calibration axis should be the z axis
- none: If none of the axis should be calibrated
- xAxis: If the current calibration axis should be the x axis
Triggered during the calibration process when the axis to calibrate changes.
Supported by
- Bebop
- Bebop 2
Status of the calibration process
Status of the calibration process:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTARTEDCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTARTEDCHANGED_STARTED, arg);
if (arg != NULL)
{
uint8_t started = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTARTEDCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTARTEDCHANGED_STARTED, arg);
if (arg != NULL)
{
uint8_t started = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTARTEDCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte started = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CALIBRATIONSTATE_MAGNETOCALIBRATIONSTARTEDCHANGED_STARTED)).intValue();
}
}
}
Status of the calibration process
- started (u8): 1 if calibration has started, 0 otherwise
Triggered by MagnetoCalibration when the calibration process is started and each time an axis calibration state changes.
Supported by
- Bebop
- Bebop 2
Status of the camera settings
Status of the camera settings:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_FOV, arg);
if (arg != NULL)
{
float fov = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_PANMAX, arg);
if (arg != NULL)
{
float panMax = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_PANMIN, arg);
if (arg != NULL)
{
float panMin = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_TILTMAX, arg);
if (arg != NULL)
{
float tiltMax = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_TILTMIN, arg);
if (arg != NULL)
{
float tiltMin = arg->value.Float;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_FOV, arg);
if (arg != NULL)
{
float fov = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_PANMAX, arg);
if (arg != NULL)
{
float panMax = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_PANMIN, arg);
if (arg != NULL)
{
float panMin = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_TILTMAX, arg);
if (arg != NULL)
{
float tiltMax = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_TILTMIN, arg);
if (arg != NULL)
{
float tiltMin = arg->value.Float;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
float fov = (float)((Double)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_FOV)).doubleValue();
float panMax = (float)((Double)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_PANMAX)).doubleValue();
float panMin = (float)((Double)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_PANMIN)).doubleValue();
float tiltMax = (float)((Double)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_TILTMAX)).doubleValue();
float tiltMin = (float)((Double)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CAMERASETTINGSSTATE_CAMERASETTINGSCHANGED_TILTMIN)).doubleValue();
}
}
}
Status of the camera settings
- fov (float): Value of the camera horizontal fov (in degree)
- panMax (float): Value of max pan (right pan) (in degree)
- panMin (float): Value of min pan (left pan) (in degree)
- tiltMax (float): Value of max tilt (top tilt) (in degree)
- tiltMin (float): Value of min tilt (bottom tilt) (in degree)
Triggered at connection.
Supported by
- Bebop
- Bebop 2
Autonomous flight availability changed
Autonomous flight availability changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_AVAILABILITYSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_AVAILABILITYSTATECHANGED_AVAILABILITYSTATE, arg);
if (arg != NULL)
{
uint8_t AvailabilityState = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_AVAILABILITYSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_AVAILABILITYSTATECHANGED_AVAILABILITYSTATE, arg);
if (arg != NULL)
{
uint8_t AvailabilityState = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_AVAILABILITYSTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte AvailabilityState = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_AVAILABILITYSTATECHANGED_AVAILABILITYSTATE)).intValue();
}
}
}
Autonomous flight availability changed.
- AvailabilityState (u8): Running a flightPlan file is available (1 running a flightPlan file is available, otherwise 0)
Triggered when the autonomous flight availability changes. This is linked to GPS fix, magneto calibration…
Supported by
- Bebop since 2.0.29
- Bebop 2
List of state of drone flightPlan components
List of state of drone flightPlan components:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_COMPONENT, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_COMPONENT component = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_STATE, arg);
if (arg != NULL)
{
uint8_t State = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_COMPONENT, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_COMPONENT component = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_STATE, arg);
if (arg != NULL)
{
uint8_t State = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
ARCOMMANDS_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_COMPONENT_ENUM component = ARCOMMANDS_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_COMPONENT_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_COMPONENT));
byte State = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANSTATE_COMPONENTSTATELISTCHANGED_STATE)).intValue();
}
}
}
}
List of state of drone flightPlan components
- component (enum): Drone FlightPlan component id (unique)
- GPS: GPS for Drone FlightPlan
- Calibration: Calibration for Drone FlightPlan
- Mavlink_File: Mavlink file for Drone FlightPlan
- TakeOff: Take off
- GPS: GPS for Drone FlightPlan
- State (u8): State of the FlightPlan component (1 FlightPlan component OK, otherwise 0)
Triggered when the required components for the autonomous flights changes. This is linked to GPS fix, magneto calibration…
Supported by
- Bebop since 2.0.29
- Bebop 2
Flight plan start error event
Flight plan start error event:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANEVENT_STARTINGERROREVENT) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANEVENT_STARTINGERROREVENT) && (elementDictionary != NULL))
{
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANEVENT_STARTINGERROREVENT) && (elementDictionary != null)){
}
}
Flight plan start error event.
Triggered by StartAutonomousFlight when an error occured.
This event is a notification, you can’t retrieve it in the cache of the device controller.
Supported by
- Bebop since 2.0.29
- Bebop 2
Flight plan bridled speed event
Flight plan bridled speed event:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANEVENT_SPEEDBRIDLEEVENT) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANEVENT_SPEEDBRIDLEEVENT) && (elementDictionary != NULL))
{
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_FLIGHTPLANEVENT_SPEEDBRIDLEEVENT) && (elementDictionary != null)){
}
}
Flight plan bridled speed event.
Triggered by StartAutonomousFlight when a speed specified in the mavlink file has been bridled by the drone.
This event is a notification, you can’t retrieve it in the cache of the device controller.
Supported by
- Bebop since 2.0.29
- Bebop 2
Controller libARCommands version
This event is not used.
SkyController libARCommands version
SkyController libARCommands version:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_SKYCONTROLLERLIBARCOMMANDSVERSION) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_SKYCONTROLLERLIBARCOMMANDSVERSION_VERSION, arg);
if (arg != NULL)
{
char * version = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_SKYCONTROLLERLIBARCOMMANDSVERSION) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_SKYCONTROLLERLIBARCOMMANDSVERSION_VERSION, arg);
if (arg != NULL)
{
char * version = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_SKYCONTROLLERLIBARCOMMANDSVERSION) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String version = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_SKYCONTROLLERLIBARCOMMANDSVERSION_VERSION);
}
}
}
SkyController libARCommands version
- version (string): version of libARCommands (“1.2.3.4” format)
Triggered at connection.
Supported by the SkyController
Device libARCommands version
Device libARCommands version:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_DEVICELIBARCOMMANDSVERSION) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_DEVICELIBARCOMMANDSVERSION_VERSION, arg);
if (arg != NULL)
{
char * version = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_DEVICELIBARCOMMANDSVERSION) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_DEVICELIBARCOMMANDSVERSION_VERSION, arg);
if (arg != NULL)
{
char * version = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_DEVICELIBARCOMMANDSVERSION) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String version = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ARLIBSVERSIONSSTATE_DEVICELIBARCOMMANDSVERSION_VERSION);
}
}
}
Device libARCommands version
- version (string): version of libARCommands (“1.2.3.4” format)
Triggered at connection.
Supported by all products
Notify the controller whether the audio streaming is running.
Notify the controller whether the audio streaming is running.:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_AUDIOSTATE_AUDIOSTREAMINGRUNNING) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_AUDIOSTATE_AUDIOSTREAMINGRUNNING_RUNNING, arg);
if (arg != NULL)
{
uint8_t running = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_AUDIOSTATE_AUDIOSTREAMINGRUNNING) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_AUDIOSTATE_AUDIOSTREAMINGRUNNING_RUNNING, arg);
if (arg != NULL)
{
uint8_t running = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_AUDIOSTATE_AUDIOSTREAMINGRUNNING) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte running = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_AUDIOSTATE_AUDIOSTREAMINGRUNNING_RUNNING)).intValue();
}
}
}
Notify the controller whether the audio streaming is running.
- running (u8): Bit field for TX and RX running
bit 0 is 1 if Drone TX is running
bit 1 is 1 if Drone RX is running
Triggered when the product modifies its audio management.
Supported by Jumping Sumo Evos
Notify the instensity values for headlight LEDs.
Notify the instensity values for headlight LEDs.:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED_LEFT, arg);
if (arg != NULL)
{
uint8_t left = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED_RIGHT, arg);
if (arg != NULL)
{
uint8_t right = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED_LEFT, arg);
if (arg != NULL)
{
uint8_t left = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED_RIGHT, arg);
if (arg != NULL)
{
uint8_t right = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte left = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED_LEFT)).intValue();
byte right = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_HEADLIGHTSSTATE_INTENSITYCHANGED_RIGHT)).intValue();
}
}
}
Notify the instensity values for headlight LEDs.
- left (u8): The intensity value for the left LED (0 through 255).
- right (u8): The intensity value for the right LED (0 through 255).
Triggered by SetHeadlightsIntensity.
Supported by Jumping Sumo Evos
List of animations state.
List of animations state.:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_ANIM, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_ANIM anim = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_STATE state = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_ERROR error = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_ANIM, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_ANIM anim = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_STATE state = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_ERROR error = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
ARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_ANIM_ENUM anim = ARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_ANIM_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_ANIM));
ARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_STATE_ENUM state = ARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_STATE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_STATE));
ARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_ERROR_ENUM error = ARCOMMANDS_COMMON_ANIMATIONSSTATE_LIST_ERROR_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ANIMATIONSSTATE_LIST_ERROR));
}
}
}
}
List of animations state.
- anim (enum): Animation type.
- HEADLIGHTS_FLASH: Flash headlights.
- HEADLIGHTS_BLINK: Blink headlights.
- HEADLIGHTS_OSCILLATION: Oscillating headlights.
- SPIN: Spin animation.
- TAP: Tap animation.
- SLOW_SHAKE: Slow shake animation.
- METRONOME: Metronome animation.
- ONDULATION: Standing dance animation.
- SPIN_JUMP: Spin jump animation.
- SPIN_TO_POSTURE: Spin that end in standing posture, or in jumper if it was standing animation.
- SPIRAL: Spiral animation.
- SLALOM: Slalom animation.
- BOOST: Boost animation.
- HEADLIGHTS_FLASH: Flash headlights.
- state (enum): State of the animation
- stopped: animation is stopped
- started: animation is started
- notAvailable: The animation is not available
- stopped: animation is stopped
- error (enum): Error to explain the state
- ok: No Error
- unknown: Unknown generic error
- ok: No Error
Triggered when the list of available animations changes and also when the state of an animation changes (can be triggered by StartAnimation, StopAnimation or StopAllAnimations).
Supported by
- Jumping Sumo
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
List of supported accessories
List of supported accessories:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED_ACCESSORY, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED_ACCESSORY accessory = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED_ACCESSORY, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED_ACCESSORY accessory = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
ARCOMMANDS_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED_ACCESSORY_ENUM accessory = ARCOMMANDS_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED_ACCESSORY_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_SUPPORTEDACCESSORIESLISTCHANGED_ACCESSORY));
}
}
}
}
List of supported accessories
- accessory (enum): Accessory configurations supported by the product.
- NO_ACCESSORY: No accessory.
- STD_WHEELS: Standard wheels
- TRUCK_WHEELS: Truck wheels
- HULL: Hull
- HYDROFOIL: Hydrofoil
- NO_ACCESSORY: No accessory.
Triggered at connection.
Supported by
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
- Hydrofoil
Accessory config response.
Accessory config response.:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_NEWACCESSORY, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_NEWACCESSORY newAccessory = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_ERROR error = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_NEWACCESSORY, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_NEWACCESSORY newAccessory = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_ERROR error = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_NEWACCESSORY_ENUM newAccessory = ARCOMMANDS_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_NEWACCESSORY_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_NEWACCESSORY));
ARCOMMANDS_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_ERROR_ENUM error = ARCOMMANDS_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_ERROR_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGCHANGED_ERROR));
}
}
}
Accessory config response.
- newAccessory (enum): Accessory configuration reported by firmware.
- UNCONFIGURED: No accessory configuration set. Controller needs to set one.
- NO_ACCESSORY: No accessory.
- STD_WHEELS: Standard wheels
- TRUCK_WHEELS: Truck wheels
- HULL: Hull
- HYDROFOIL: Hydrofoil
- UNCONFIGURED: No accessory configuration set. Controller needs to set one.
- error (enum): Error code.
- OK: No error. Accessory config change successful.
- UNKNOWN: Cannot change accessory configuration for some reason.
- FLYING: Cannot change accessory configuration while flying.
- OK: No error. Accessory config change successful.
Triggered by SetAccessory.
Supported by
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
- Hydrofoil
Possibility to modify the accessory configuration.
Possibility to modify the accessory configuration.:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGMODIFICATIONENABLED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGMODIFICATIONENABLED_ENABLED, arg);
if (arg != NULL)
{
uint8_t enabled = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGMODIFICATIONENABLED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGMODIFICATIONENABLED_ENABLED, arg);
if (arg != NULL)
{
uint8_t enabled = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGMODIFICATIONENABLED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte enabled = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_ACCESSORYSTATE_ACCESSORYCONFIGMODIFICATIONENABLED_ENABLED)).intValue();
}
}
}
Possibility to modify the accessory configuration.
- enabled (u8): 1 if the modification of the accessory Config is enabled, 0 otherwise
Triggered when the accessory modification state changes.
Supported by
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
- Hydrofoil
Get the max charge rate
Get the max charge rate (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED_RATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED_RATE rate = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED_RATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED_RATE rate = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED_RATE_ENUM rate = ARCOMMANDS_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED_RATE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_MAXCHARGERATECHANGED_RATE));
}
}
}
This event is deprecated.
Current charge state
Current charge state (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_STATUS, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_STATUS status = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_PHASE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_PHASE phase = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_STATUS, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_STATUS status = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_PHASE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_PHASE phase = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_STATUS_ENUM status = ARCOMMANDS_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_STATUS_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_STATUS));
ARCOMMANDS_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_PHASE_ENUM phase = ARCOMMANDS_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_PHASE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CURRENTCHARGESTATECHANGED_PHASE));
}
}
}
This event is deprecated.
Get last charge rate
Get last charge rate (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED_RATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED_RATE rate = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED_RATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED_RATE rate = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED_RATE_ENUM rate = ARCOMMANDS_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED_RATE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_LASTCHARGERATECHANGED_RATE));
}
}
}
This event is deprecated.
Information about the charge
Information about the charge:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_PHASE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_CHARGINGINFO_PHASE phase = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_RATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_CHARGINGINFO_RATE rate = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_INTENSITY, arg);
if (arg != NULL)
{
uint8_t intensity = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_FULLCHARGINGTIME, arg);
if (arg != NULL)
{
uint8_t fullChargingTime = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_PHASE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_CHARGINGINFO_PHASE phase = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_RATE, arg);
if (arg != NULL)
{
eARCOMMANDS_COMMON_CHARGERSTATE_CHARGINGINFO_RATE rate = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_INTENSITY, arg);
if (arg != NULL)
{
uint8_t intensity = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_FULLCHARGINGTIME, arg);
if (arg != NULL)
{
uint8_t fullChargingTime = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_COMMON_CHARGERSTATE_CHARGINGINFO_PHASE_ENUM phase = ARCOMMANDS_COMMON_CHARGERSTATE_CHARGINGINFO_PHASE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_PHASE));
ARCOMMANDS_COMMON_CHARGERSTATE_CHARGINGINFO_RATE_ENUM rate = ARCOMMANDS_COMMON_CHARGERSTATE_CHARGINGINFO_RATE_ENUM.getFromValue((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_RATE));
byte intensity = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_INTENSITY)).intValue();
byte fullChargingTime = (byte)((Integer)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_CHARGERSTATE_CHARGINGINFO_FULLCHARGINGTIME)).intValue();
}
}
}
Information about the charge.
- phase (enum): The current charging phase.
- UNKNOWN: The charge phase is unknown or irrelevant.
- CONSTANT_CURRENT_1: First phase of the charging process. The battery is charging with constant current.
- CONSTANT_CURRENT_2: Second phase of the charging process. The battery is charging with constant current, with a higher voltage than the first phase.
- CONSTANT_VOLTAGE: Last part of the charging process. The battery is charging with a constant voltage.
- CHARGED: The battery is fully charged.
- DISCHARGING: The battery is discharging; Other arguments refers to the last charge.
- UNKNOWN: The charge phase is unknown or irrelevant.
- rate (enum): The charge rate. If phase is DISCHARGING, refers to the last charge.
- UNKNOWN: The charge rate is not known.
- SLOW: Slow charge rate.
- MODERATE: Moderate charge rate.
- FAST: Fast charge rate.
- UNKNOWN: The charge rate is not known.
- intensity (u8): The charging intensity, in dA. (12dA = 1,2A) ; If phase is DISCHARGING, refers to the last charge. Equals to 0 if not known.
- fullChargingTime (u8): The full charging time estimated, in minute. If phase is DISCHARGING, refers to the last charge. Equals to 0 if not known.
Triggered when the device is charging or when the charging state changes.
Supported by
- Jumping Sumo Evo Race
- Jumping Sumo Evo Brick
- Airborne Night
- Airborne Cargo
- Hydrofoil
Run id changed
Run id changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_RUNSTATE_RUNIDCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_RUNSTATE_RUNIDCHANGED_RUNID, arg);
if (arg != NULL)
{
char * runId = arg->value.String;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_COMMON_RUNSTATE_RUNIDCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_COMMON_RUNSTATE_RUNIDCHANGED_RUNID, arg);
if (arg != NULL)
{
char * runId = arg->value.String;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_COMMON_RUNSTATE_RUNIDCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
String runId = (String)args.get(ARFeatureCommon.ARCONTROLLER_DICTIONARY_KEY_COMMON_RUNSTATE_RUNIDCHANGED_RUNID);
}
}
}
Run id changed
Run ids are uniquely identifying a run or a flight
- runId (string): Id of the run
The run id is used in the name of the medias taken during the flight. It is also used to identify the run/flight on Parrot Academy.
With this run id, you can get all medias that have been taken during the flight.
Triggered when the drone chooses a run id. This is usually done right after the take off.
Supported by
- Bebop 2 since 3.1.0
Picture record state V1
Picture state V1 (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED_STATE, arg);
if (arg != NULL)
{
uint8_t state = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED_MASS_STORAGE_ID, arg);
if (arg != NULL)
{
uint8_t mass_storage_id = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED_STATE, arg);
if (arg != NULL)
{
uint8_t state = arg->value.U8;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED_MASS_STORAGE_ID, arg);
if (arg != NULL)
{
uint8_t mass_storage_id = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte state = (byte)((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED_STATE)).intValue();
byte mass_storage_id = (byte)((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGED_MASS_STORAGE_ID)).intValue();
}
}
}
This event is deprecated.
Video record state v1
Video record state v1 (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_MASS_STORAGE_ID, arg);
if (arg != NULL)
{
uint8_t mass_storage_id = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_MASS_STORAGE_ID, arg);
if (arg != NULL)
{
uint8_t mass_storage_id = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_STATE_ENUM state = ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_STATE_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_STATE));
byte mass_storage_id = (byte)((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGED_MASS_STORAGE_ID)).intValue();
}
}
}
This event is deprecated.
Picture record state
Picture record state:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_ERROR error = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_ERROR error = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_STATE_ENUM state = ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_STATE_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_STATE));
ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_ERROR_ENUM error = ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_ERROR_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_PICTURESTATECHANGEDV2_ERROR));
}
}
}
State of device picture recording changed
- state (enum): State of device picture recording
- ready: The picture recording is ready
- busy: The picture recording is busy
- notAvailable: The picture recording is not available
- ready: The picture recording is ready
- error (enum): Error to explain the state
- ok: No Error
- unknown: Unknown generic error
- camera_ko: Picture camera is out of order
- memoryFull: Memory full ; cannot save one additional picture
- lowBattery: Battery is too low to start/keep recording.
- ok: No Error
Triggered by TakePicture or by a change in the picture state.
Supported by
- Bebop since 2.0.1
- Bebop 2
Video record state
Video record state:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_ERROR error = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_ERROR error = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_STATE_ENUM state = ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_STATE_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_STATE));
ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_ERROR_ENUM error = ARCOMMANDS_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_ERROR_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDSTATE_VIDEOSTATECHANGEDV2_ERROR));
}
}
}
State of device video recording changed
- state (enum): State of device video recording
- stopped: Video is stopped
- started: Video is started
- notAvailable: The video recording is not available
- stopped: Video is stopped
- error (enum): Error to explain the state
- ok: No Error
- unknown: Unknown generic error
- camera_ko: Video camera is out of order
- memoryFull: Memory full ; cannot save one additional video
- lowBattery: Battery is too low to start/keep recording.
- ok: No Error
Triggered by VideoRecord or by a change in the video state.
Supported by
- Bebop since 2.0.1
- Bebop 2
Event of picture recording
Event of picture recording:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_EVENT, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_EVENT event = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_ERROR error = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_EVENT, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_EVENT event = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_ERROR error = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_EVENT_ENUM event = ARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_EVENT_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_EVENT));
ARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_ERROR_ENUM error = ARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_ERROR_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_PICTUREEVENTCHANGED_ERROR));
}
}
}
Event of picture recording
- event (enum): Last event of picture recording
- taken: Picture taken and saved
- failed: Picture failed
- taken: Picture taken and saved
- error (enum): Error to explain the event
- ok: No Error
- unknown: Unknown generic error ; only when state is failed
- busy: Picture recording is busy ; only when state is failed
- notAvailable: Picture recording not available ; only when state is failed
- memoryFull: Memory full ; only when state is failed
- lowBattery: Battery is too low to record.
- ok: No Error
Triggered by TakePicture.
This event is a notification, you can’t retrieve it in the cache of the device controller.
Supported by
- Bebop since 2.0.1
- Bebop 2
Event of video recording
Event of video recording:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_EVENT, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_EVENT event = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_ERROR error = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_EVENT, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_EVENT event = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_ERROR error = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_EVENT_ENUM event = ARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_EVENT_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_EVENT));
ARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_ERROR_ENUM error = ARCOMMANDS_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_ERROR_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_MEDIARECORDEVENT_VIDEOEVENTCHANGED_ERROR));
}
}
}
Event of video recording
- event (enum): Event of video recording
- start: Video start
- stop: Video stop and saved
- failed: Video failed
- start: Video start
- error (enum): Error to explain the event
- ok: No Error
- unknown: Unknown generic error ; only when state is failed
- busy: Video recording is busy ; only when state is failed
- notAvailable: Video recording not available ; only when state is failed
- memoryFull: Memory full
- lowBattery: Battery is too low to record.
- autoStopped: Video was auto stopped
- ok: No Error
Triggered by VideoRecord or by a change in the video state.
This event is a notification, you can’t retrieve it in the cache of the device controller.
Supported by
- Bebop since 2.0.1
- Bebop 2
Drone acknowledges that flat trim was correctly processed
Drone acknowledges that flat trim was correctly processed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLATTRIMCHANGED) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLATTRIMCHANGED) && (elementDictionary != NULL))
{
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLATTRIMCHANGED) && (elementDictionary != null)){
}
}
Drone acknowledges that flat trim was correctly processed
Triggered by FlatTrim.
Supported by
- Bebop
- Bebop 2
Drone flying state changed
Drone flying state changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE state = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE state = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM state = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE));
}
}
}
Drone flying state changed
- state (enum): Drone flying state
- landed: Landed state
- takingoff: Taking off state
- hovering: Hovering state
- flying: Flying state
- landing: Landing state
- emergency: Emergency state
- landed: Landed state
Triggered when the flying state changes.
Supported by
- Bebop
- Bebop 2
Drone alert state changed
Drone alert state changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED_STATE state = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED_STATE state = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED_STATE_ENUM state = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED_STATE_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALERTSTATECHANGED_STATE));
}
}
}
Drone alert state changed
- state (enum): Drone alert state
- none: No alert
- user: User emergency alert
- cut_out: Cut out alert
- critical_battery: Critical battery alert
- low_battery: Low battery alert
- too_much_angle: The angle of the drone is too high
- none: No alert
Triggered when an alert happens on the drone.
Supported by
- Bebop
- Bebop 2
Navigating home state
Navigating home state:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_REASON, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_REASON reason = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_STATE, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_STATE state = arg->value.I32;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_REASON, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_REASON reason = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
ARCOMMANDS_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_STATE_ENUM state = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_STATE_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_STATE));
ARCOMMANDS_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_REASON_ENUM reason = ARCOMMANDS_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_REASON_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_NAVIGATEHOMESTATECHANGED_REASON));
}
}
}
Navigating home state
- state (enum): State of navigate home
- available: Navigate home is available
- inProgress: Navigate home is in progress
- unavailable: Navigate home is not available
- pending: Navigate home has been received, but its process is pending
- available: Navigate home is available
- reason (enum): Reason of the state
- userRequest: User requested a navigate home (available->inProgress)
- connectionLost: Connection between controller and product lost (available->inProgress)
- lowBattery: Low battery occurred (available->inProgress)
- finished: Navigate home is finished (inProgress->available)
- stopped: Navigate home has been stopped (inProgress->available)
- disabled: Navigate home disabled by product (inProgress->unavailable or available->unavailable)
- enabled: Navigate home enabled by product (unavailable->available)
- userRequest: User requested a navigate home (available->inProgress)
To be available, the gps should be fixed, magnetometer should be calibrated.
Triggered by NavigateHome or when the state of the return home changes.
Supported by
- Bebop
- Bebop 2
Drone position changed
Drone position changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LATITUDE, arg);
if (arg != NULL)
{
double latitude = arg->value.Double;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LONGITUDE, arg);
if (arg != NULL)
{
double longitude = arg->value.Double;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_ALTITUDE, arg);
if (arg != NULL)
{
double altitude = arg->value.Double;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LATITUDE, arg);
if (arg != NULL)
{
double latitude = arg->value.Double;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LONGITUDE, arg);
if (arg != NULL)
{
double longitude = arg->value.Double;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_ALTITUDE, arg);
if (arg != NULL)
{
double altitude = arg->value.Double;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
double latitude = (double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LATITUDE);
double longitude = (double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_LONGITUDE);
double altitude = (double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_POSITIONCHANGED_ALTITUDE);
}
}
}
Drone position changed
- latitude (double): Latitude position in decimal degrees (500.0 if not available)
- longitude (double): Longitude position in decimal degrees (500.0 if not available)
- altitude (double): Altitude in meters (from GPS)
Triggered regularly when the drone flies (if its gps has fixed).
Supported by
- Bebop
- Bebop 2
Drone speed changed
Drone speed changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDX, arg);
if (arg != NULL)
{
float speedX = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDY, arg);
if (arg != NULL)
{
float speedY = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDZ, arg);
if (arg != NULL)
{
float speedZ = arg->value.Float;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDX, arg);
if (arg != NULL)
{
float speedX = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDY, arg);
if (arg != NULL)
{
float speedY = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDZ, arg);
if (arg != NULL)
{
float speedZ = arg->value.Float;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
float speedX = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDX)).doubleValue();
float speedY = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDY)).doubleValue();
float speedZ = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_SPEEDCHANGED_SPEEDZ)).doubleValue();
}
}
}
Drone speed changed in the North East Down coordinates.
- speedX (float): Speed on the x axis (when drone moves forward, speed is > 0) (in m/s)
- speedY (float): Speed on the y axis (when drone moves to right, speed is > 0) (in m/s)
- speedZ (float): Speed on the z axis (when drone moves down, speed is > 0) (in m/s)
Triggered regularly when the drone flies.
Supported by
- Bebop
- Bebop 2
Drone attitude changed
Drone attitude changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_ROLL, arg);
if (arg != NULL)
{
float roll = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_PITCH, arg);
if (arg != NULL)
{
float pitch = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_YAW, arg);
if (arg != NULL)
{
float yaw = arg->value.Float;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_ROLL, arg);
if (arg != NULL)
{
float roll = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_PITCH, arg);
if (arg != NULL)
{
float pitch = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_YAW, arg);
if (arg != NULL)
{
float yaw = arg->value.Float;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
float roll = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_ROLL)).doubleValue();
float pitch = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_PITCH)).doubleValue();
float yaw = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ATTITUDECHANGED_YAW)).doubleValue();
}
}
}
Drone attitude changed
- roll (float): roll value (in radian)
- pitch (float): Pitch value (in radian)
- yaw (float): Yaw value (in radian)
Triggered regularly when the drone flies.
Supported by
- Bebop
- Bebop 2
Status automatic take off mode
Status of the drone3 automatic take off mode (deprecated):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AUTOTAKEOFFMODECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AUTOTAKEOFFMODECHANGED_STATE, arg);
if (arg != NULL)
{
uint8_t state = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AUTOTAKEOFFMODECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AUTOTAKEOFFMODECHANGED_STATE, arg);
if (arg != NULL)
{
uint8_t state = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AUTOTAKEOFFMODECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
byte state = (byte)((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_AUTOTAKEOFFMODECHANGED_STATE)).intValue();
}
}
}
This event is deprecated.
Drone altitude changed
Drone altitude changed:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED_ALTITUDE, arg);
if (arg != NULL)
{
double altitude = arg->value.Double;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED_ALTITUDE, arg);
if (arg != NULL)
{
double altitude = arg->value.Double;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
double altitude = (double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSTATE_ALTITUDECHANGED_ALTITUDE);
}
}
}
Drone altitude changed
- altitude (double): Altitude in meters
Triggered regularly when the drone flies.
Supported by
- Bebop
- Bebop 2
End of relative displacement of the drone
End of relative displacement of the drone (not implemented):
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DX, arg);
if (arg != NULL)
{
float dX = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DY, arg);
if (arg != NULL)
{
float dY = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DZ, arg);
if (arg != NULL)
{
float dZ = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DPSI, arg);
if (arg != NULL)
{
float dPsi = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGEVENT_MOVEBYEND_ERROR error = arg->value.I32;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
if (element != NULL)
{
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DX, arg);
if (arg != NULL)
{
float dX = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DY, arg);
if (arg != NULL)
{
float dY = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DZ, arg);
if (arg != NULL)
{
float dZ = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DPSI, arg);
if (arg != NULL)
{
float dPsi = arg->value.Float;
}
HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_ERROR, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_PILOTINGEVENT_MOVEBYEND_ERROR error = arg->value.I32;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND) && (elementDictionary != null)){
ARControllerArgumentDictionary<Object> args = elementDictionary.get(ARControllerDictionary.ARCONTROLLER_DICTIONARY_SINGLE_KEY);
if (args != null) {
float dX = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DX)).doubleValue();
float dY = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DY)).doubleValue();
float dZ = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DZ)).doubleValue();
float dPsi = (float)((Double)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DPSI)).doubleValue();
ARCOMMANDS_ARDRONE3_PILOTINGEVENT_MOVEBYEND_ERROR_ENUM error = ARCOMMANDS_ARDRONE3_PILOTINGEVENT_MOVEBYEND_ERROR_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_ERROR));
}
}
}
End of relative displacement of the drone
Draft: this event is not implemented yet by the firmware
The frame is horizontal and relative to the current drone orientation:
X is front
Y is right
Z is down
dX (float): Distance traveled along the front axis [m]
dY (float): Distance traveled along the right axis [m]
dZ (float): Distance traveled along the down axis [m]
dPsi (float): Applied angle on heading [rad]
error (enum): Error to explain the event
- ok: No Error ; The relative displacement
- unknown: Unknown generic error
- busy: The Device is busy ; command moveBy ignored
- notAvailable: Command moveBy is not available ; command moveBy ignored
- interrupted: Command moveBy interrupted
- ok: No Error ; The relative displacement
Triggered by the end of a MoveBy (error should be ok) or by a new command MoveBy (error should be interrupted).
This event is a notification, you can’t retrieve it in the cache of the device controller.
Supported by no products
Wifi scan results
Wifi scan results:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_SSID, arg);
if (arg != NULL)
{
char * ssid = arg->value.String;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_RSSI, arg);
if (arg != NULL)
{
int16_t rssi = arg->value.I16;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_BAND, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_BAND band = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_CHANNEL, arg);
if (arg != NULL)
{
uint8_t channel = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_SSID, arg);
if (arg != NULL)
{
char * ssid = arg->value.String;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_RSSI, arg);
if (arg != NULL)
{
int16_t rssi = arg->value.I16;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_BAND, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_BAND band = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_CHANNEL, arg);
if (arg != NULL)
{
uint8_t channel = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
String ssid = (String)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_SSID);
short rssi = (short)((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_RSSI)).intValue();
ARCOMMANDS_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_BAND_ENUM band = ARCOMMANDS_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_BAND_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_BAND));
byte channel = (byte)((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFISCANLISTCHANGED_CHANNEL)).intValue();
}
}
}
}
Wifi scan results.
- ssid (string): SSID of the AP
- rssi (i16): RSSI of the AP in dbm (negative value)
- band (enum): The band : 2.4 GHz or 5 GHz
- 2_4ghz: 2.4 GHz band
- 5ghz: 5 GHz band
- 2_4ghz: 2.4 GHz band
- channel (u8): Channel of the AP
Triggered for each wifi scanned after a WifiScan.
Supported by
- Bebop
- Bebop 2
State sent when all scanning result sent
State sent when all scanning result sent:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_ALLWIFISCANCHANGED) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_ALLWIFISCANCHANGED) && (elementDictionary != NULL))
{
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_ALLWIFISCANCHANGED) && (elementDictionary != null)){
}
}
State sent when all scanning result sent
Triggered after the last WifiScanResult has been sent.
Supported by
- Bebop
- Bebop 2
Authorized channel results
Authorized channel results:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_BAND, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_BAND band = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_CHANNEL, arg);
if (arg != NULL)
{
uint8_t channel = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_IN_OR_OUT, arg);
if (arg != NULL)
{
uint8_t in_or_out = arg->value.U8;
}
}
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED) && (elementDictionary != NULL))
{
ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictElement = NULL;
ARCONTROLLER_DICTIONARY_ELEMENT_t *dictTmp = NULL;
HASH_ITER(hh, elementDictionary, dictElement, dictTmp)
{
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_BAND, arg);
if (arg != NULL)
{
eARCOMMANDS_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_BAND band = arg->value.I32;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_CHANNEL, arg);
if (arg != NULL)
{
uint8_t channel = arg->value.U8;
}
HASH_FIND_STR (dictElement->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_IN_OR_OUT, arg);
if (arg != NULL)
{
uint8_t in_or_out = arg->value.U8;
}
}
}
}
@Override
public void onCommandReceived (ARDeviceController deviceController, ARCONTROLLER_DICTIONARY_KEY_ENUM commandKey, ARControllerDictionary elementDictionary) {
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ENUM.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED) && (elementDictionary != null)){
Iterator<ARControllerArgumentDictionary<Object>> itr = elementDictionary.values().iterator();
while (itr.hasNext()) {
ARControllerArgumentDictionary<Object> args = itr.next();
if (args != null) {
ARCOMMANDS_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_BAND_ENUM band = ARCOMMANDS_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_BAND_ENUM.getFromValue((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_BAND));
byte channel = (byte)((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_CHANNEL)).intValue();
byte in_or_out = (byte)((Integer)args.get(ARFeatureARDrone3.ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_WIFIAUTHCHANNELLISTCHANGED_IN_OR_OUT)).intValue();
}
}
}
}
Authorized channel results.
- band (enum): The band of this channel : 2.4 GHz or 5 GHz
- 2_4ghz: 2.4 GHz band
- 5ghz: 5 GHz band
- 2_4ghz: 2.4 GHz band
- channel (u8): The authorized channel.
- in_or_out (u8): Bit 0 is 1 if channel is authorized outside (0 otherwise) ; Bit 1 is 1 if channel is authorized inside (0 otherwise)
Triggered for each channels found after a GetAvailableChannels.
Supported by
- Bebop
- Bebop 2
Notify the end of the list of Authorized wifi Channel.
Notify the end of the list of Authorized wifi Channel.:
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary, void *customData)
{
if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_NETWORKSTATE_ALLWIFIAUTHCHANNELCHANGED) && (elementDictionary != NULL))
{
}
}
void onCommandReceived (eARCONTROLLER_DICTIONARY_KEY commandKey, ARCONTROLLER_DICTIONARY_ELEMENT_t *elementDictionary