public abstract class

DJIBattery

extends DJIBaseComponent
java.lang.Object
   ↳ dji.sdk.base.DJIBaseComponent
     ↳ dji.sdk.Battery.DJIBattery

Class Overview

This class manages the battery's information and real-time status of the connected product.

Summary

Nested Classes
class DJIBattery.DJIBatteryAggregationState Only supported by M600. 
interface DJIBattery.DJIBatteryAggregationStateUpdatedCallback This protocol provides a delegate method for you to update the battery's current state. 
class DJIBattery.DJIBatteryCell Class that contains battery cell voltage data. 
class DJIBattery.DJIBatteryState The DJIBatteryState is used to keep track of the real-time state of the battery. 
interface DJIBattery.DJIBatteryStateUpdateCallback This interface is for updating the battery state. 
class DJIBattery.DJIBatteryWarningInformation This class is used to keep a record of any unusual status for the battery in the past 30 days. 
Public Constructors
DJIBattery()
DJIBattery(int designedEnergy, int fullChargeEnergy, int currentEnergy, int currentVoltage, int currentCurrent, int lifetimeRemainingPercent, int batteryEnergyRemainingPercent, int batteryTemperature, int numberOfDischarge)
Public Methods
abstract void getCellVoltages(DJICompletionCallbackWith<List<DJIBattery.DJIBatteryCell>> callback)
Gets the battery's cell voltages using a list of objects of type DJIBatteryCell.
abstract void getCurrentWarningInformation(DJICompletionCallbackWith<DJIBattery.DJIBatteryWarningInformation> callback)
Gets the battery's current warning information, which is one of seven battery warning information, which can be found at the top of DJIBattery.
int getIndex()
Returns the index of the battery.
int getNumberOfCell()
Returns the number of battery cells.
abstract void getSelfDischargeDay(DJICompletionCallbackWith<Short> callback)
Gets the battery's custom self-discharge configuration.
void getSerialNumber(DJICompletionCallbackWith<String> callback)
Gets the serial number of the component.
void getVersion(DJICompletionCallbackWith<String> callback)
This method is deprecated. Please refer to getFirmwareVersion in DJIBaseComponent
abstract void getWarningInformationRecords(DJICompletionCallbackWith<List<DJIBattery.DJIBatteryWarningInformation>> callback)
Gets the battery's warning information records.
boolean isConnected()
This method could be used to detect whether the battery is connected.
boolean isSmartBattery()
Determines if the battery is a smart battery.
static void setBatteryAggregationStateUpdatedCallback(DJIBattery.DJIBatteryAggregationStateUpdatedCallback callback)
Sets the delegate to receive the battery aggregation information.
void setBatteryStateUpdateCallback(DJIBattery.DJIBatteryStateUpdateCallback callback)
Sets up the callback for updating the battery state.
abstract void setSelfDischargeDay(short day, DJIBaseComponent.DJICompletionCallback callback)
Sets the battery's custom self-discharge configuration in the range of [1, 10] days.
[Expand]
Inherited Methods
From class dji.sdk.base.DJIBaseComponent
From class java.lang.Object

Public Constructors

public DJIBattery ()

public DJIBattery (int designedEnergy, int fullChargeEnergy, int currentEnergy, int currentVoltage, int currentCurrent, int lifetimeRemainingPercent, int batteryEnergyRemainingPercent, int batteryTemperature, int numberOfDischarge)

Public Methods

public abstract void getCellVoltages (DJICompletionCallbackWith<List<DJIBattery.DJIBatteryCell>> callback)

Gets the battery's cell voltages using a list of objects of type DJIBatteryCell. For the Inspire 1, since the battery has 6 cells, the list will have 6 objects, one for each battery cell.

Parameters
callback Remote execution result callback.

public abstract void getCurrentWarningInformation (DJICompletionCallbackWith<DJIBattery.DJIBatteryWarningInformation> callback)

Gets the battery's current warning information, which is one of seven battery warning information, which can be found at the top of DJIBattery. Need to check isSmartBattery() method before using this method. Not supported by Osmo.

Parameters
callback Remote execution result callback.

public int getIndex ()

Returns the index of the battery. It is useful when the aircraft has multiple batteries. Index starts from 0. For products with only one battery, the index is 0. For Matrice 600, there are printed numbers on the battery boxes. DJIBattery instance with index 0 corresponds to battery compartment number 1.

Returns
  • an Integer.

public int getNumberOfCell ()

Returns the number of battery cells.

public abstract void getSelfDischargeDay (DJICompletionCallbackWith<Short> callback)

Gets the battery's custom self-discharge configuration. Call the isSmartBattery() method before using this method. Not supported by Osmo.

Parameters
callback Remote execution result error callback.

public void getSerialNumber (DJICompletionCallbackWith<String> callback)

Gets the serial number of the component. Note that this serial number does not match with the serial number found in the physical component.

Parameters
callback The execution callback with the value(s) returned.

public void getVersion (DJICompletionCallbackWith<String> callback)

This method is deprecated.
Please refer to getFirmwareVersion in DJIBaseComponent

Gets the battery's firmware version.

Parameters
callback Remote execution result callback.

public abstract void getWarningInformationRecords (DJICompletionCallbackWith<List<DJIBattery.DJIBatteryWarningInformation>> callback)

Gets the battery's warning information records. The DJI battery keeps the warning information records for the past 30 days using objects of type DJIBatteryWarningInformation. Call the isSmartBattery() method before using this method. Not supported by Osmo.

Parameters
callback Remote execution result callback.

public boolean isConnected ()

This method could be used to detect whether the battery is connected.

See Also

public boolean isSmartBattery ()

Determines if the battery is a smart battery.

Returns
  • true if battery is a smart battery, false otherwise.

public static void setBatteryAggregationStateUpdatedCallback (DJIBattery.DJIBatteryAggregationStateUpdatedCallback callback)

Sets the delegate to receive the battery aggregation information. Only supported by Matrice 600.

public void setBatteryStateUpdateCallback (DJIBattery.DJIBatteryStateUpdateCallback callback)

Sets up the callback for updating the battery state.

public abstract void setSelfDischargeDay (short day, DJIBaseComponent.DJICompletionCallback callback)

Sets the battery's custom self-discharge configuration in the range of [1, 10] days. For example, if the value for day is set to 10, the battery will discharge over the course of 10 days. Call the isSmartBattery() method before using this method. Not supported by Osmo.

Parameters
day Day for self-discharge
callback Remote execution result error callback.