Open ninja342 opened 3 years ago
Agent comment from Luce Luo in Zendesk ticket #43518:
Dear Customer,
Thank you for contacting DJI. To help us collect questions in detail, please fill in the form below and we will handle this ticket once we have received it. https://formcrafts.com/a/dji-developer-feedback-en
Thanks,
Luce Luo DJI Dev Team
This works for the Android SDK:
djiAircraft.getFlightController().getLEDsEnabledSettings(new CommonCallbacks.CompletionCallbackWith<LEDsSettings>() {
@Override
public void onSuccess(LEDsSettings ledsSettings) {
LEDsSettings.Builder builder = new LEDsSettings.Builder();
builder.frontLEDsOn(enabled);
builder.beaconsOn(ledsSettings.areBeaconsOn());
builder.rearLEDsOn(ledsSettings.areRearLEDsOn());
builder.statusIndicatorOn(true);
djiAircraft.getFlightController().setLEDsEnabledSettings(
builder.build(),
new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError error) {
if (error == null) {
Log.d(TAG, "LEDs settings successfully set");
} else {
Log.e(TAG, "Failed to set LEDs settings: " + error.getDescription());
}
}
}
);
I am using the code above to toogle front leds on and off but the code only works when leds off and it turns on the leds but after that it doesn't work for closing leds back even if error returns nil.