public class

DJIBatteryState

extends Object
java.lang.Object
   ↳ dji.common.battery.DJIBatteryState

Class Overview

DJIBatteryState is used to keep track of the real-time state of the battery. It is supported by both smart and non-smart batteries. However for non-smart batteries, only some of the properties are valid: - When the connected product is A3 and N3, only `currentVoltage` and `cellVoltageLevel` are valid. - When the connected product is A2, only `currentVoltage` is valid.

Summary

Public Constructors
DJIBatteryState()
Default constructor for DJIBatteryState.
Public Methods
int getBatteryEnergyRemainingPercent()
Returns the percentage of battery power left.
float getBatteryTemperature()
Returns the temperature of battery in Centigrade, with the range [-128 to 127].
int getCurrentCurrent()
Returns the real time current draw of the battery (mA).
int getCurrentEnergy()
Returns the remaining energy stored in the battery in mAh (milliamp hours).
int getCurrentVoltage()
Returns the current battery voltage (mV).
int getFullChargeEnergy()
Returns the the total amount of energy, in mAh (milliamp hours), stored in the battery when the battery is fully charged.
int getLifetimeRemainingPercent()
Returns the percentage of remaining lifetime value of the battery.
int getNumberOfDischarge()
Returns the total number of discharges the battery has gone through over its lifetime.
boolean isBeingCharged()
true if the battery is being charged.
boolean isInSingleBatteryMode()
true if only one battery is inserted to slot on the the right or starboard side of the aircraft.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DJIBatteryState ()

Default constructor for DJIBatteryState.

Public Methods

public int getBatteryEnergyRemainingPercent ()

Returns the percentage of battery power left. The range of this value is [0 - 100].

public float getBatteryTemperature ()

Returns the temperature of battery in Centigrade, with the range [-128 to 127].

public int getCurrentCurrent ()

Returns the real time current draw of the battery (mA). A negative value means the battery is being discharged, and a positive value means it is being charged.

public int getCurrentEnergy ()

Returns the remaining energy stored in the battery in mAh (milliamp hours).

public int getCurrentVoltage ()

Returns the current battery voltage (mV).

public int getFullChargeEnergy ()

Returns the the total amount of energy, in mAh (milliamp hours), stored in the battery when the battery is fully charged. The energy of the battery at full charge changes over time as the battery continues to get used. Over time, as the battery continues to be recharged, the value of fullChargeEnergy will decrease.

public int getLifetimeRemainingPercent ()

Returns the percentage of remaining lifetime value of the battery. The range of this value is [0 - 100].

public int getNumberOfDischarge ()

Returns the total number of discharges the battery has gone through over its lifetime. The total number of discharges includes discharges that happen through normal use and discharges that are manually set.

public boolean isBeingCharged ()

true if the battery is being charged. It is only supported by Osmo Mobile.

public boolean isInSingleBatteryMode ()

true if only one battery is inserted to slot on the the right or starboard side of the aircraft. The aircraft can still take off but the flight time will be shorter. It is only supported by Inspire 2. Inspire 2 must always have a battery in the right or starboard slot.