java.lang.Object | ||
↳ | dji.sdk.base.DJIBaseComponent | |
↳ | dji.sdk.Battery.DJIBattery |
This class manages the battery's information and real-time status of the connected product.
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 |
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.
callback | Remote execution result 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.
callback | Remote execution result callback. |
---|
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 the number of battery cells.
Gets the battery's custom self-discharge configuration. Call the isSmartBattery()
method before using this method. Not supported by Osmo.
callback | Remote execution result error 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.
callback | The execution callback with the value(s) returned. |
---|
This method is deprecated.
Please refer to getFirmwareVersion
in DJIBaseComponent
Gets the battery's firmware version.
callback | Remote execution result 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.
callback | Remote execution result callback. |
---|
This method could be used to detect whether the battery is connected.
Determines if the battery is a smart battery.
true
if battery is a smart battery, false
otherwise. Sets the delegate to receive the battery aggregation information. Only supported by Matrice 600.
Sets up the callback for updating the battery state.
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.
day | Day for self-discharge |
---|---|
callback | Remote execution result error callback. |