DJI Mobile SDK Documentation
      Package:dji.sdk.keyvalue.key
      Inherits From:DJIBatteryKey
      classSince MSDK 5.0.0

      BatteryKey

      BatteryKey provides a set of methods to manage aircraft battery information and the real-time status.

      Package dji.sdk.keyvalue.keyAndroid · Java / Kotlin

      BatteryKey provides a set of methods to manage aircraft battery information and the real-time status. Obtain the information and real-time status of the corresponding battery by setting componentIndex. Take M30 series aircraft as an example: 0 means battery 1(left) in the Pilot, 1 means battery 2(right) in the Pilot.

      Supported since MSDK 5.0.0

      Members

      15 members

      Method

      15

      Basic Information

      Connection Status
      method

      KeyConnection

      static final DJIKeyInfo<Boolean> KeyConnection = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"Connection", SingleValueConverter.BooleanConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Boolean

      true means that the battery on the aircraft is connected.

      Fully Charged
      method

      KeyFullChargeCapacity

      static final DJIKeyInfo<Integer> KeyFullChargeCapacity = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FullChargeCapacity", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Integer

      Get the battery capacity when the battery is fully charged. Unit: mAh. As the battery is continuously used, the capacity of the battery when fully charged will decrease over time.

      Remaining Battery
      method

      KeyChargeRemaining

      static final DJIKeyInfo<Integer> KeyChargeRemaining = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"ChargeRemaining", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Integer

      To get remaining battery capacity. Unit: mAh.

      Percentage of Remaining Battery
      method

      KeyChargeRemainingInPercent

      static final DJIKeyInfo<Integer> KeyChargeRemainingInPercent = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"ChargeRemainingInPercent", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Integer

      Get the percentage of remaining battery power. If you need to get the total power percentage of all batteries, you can get all the remaining battery power and battery capacity by setting different componentIndex for calculation.

      Store at High Battery Level
      method

      KeyBatteryHighVoltageStorageTime

      static final DJIKeyInfo<Long> KeyBatteryHighVoltageStorageTime = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"BatteryHighVoltageStorageTime", SingleValueConverter.LongConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("BatteryHighVoltageStorageSec")

      Parameter: Long

      Store at High Battery Level means storing battery when it has 90% or higher battery level. If high battery level storage time in total is less than 120 days in 12 months, battery can be charged for up to 400 cycles. Change Time to Battery Self-Discharge to adjust time of battery storage at high level.

      method

      KeyBatteryTemperature

      static final DJIKeyInfo<Double> KeyBatteryTemperature = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"BatteryTemperature", SingleValueConverter.DoubleConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Double

      Get the battery temperature. Unit: Celsius. Range interval: [-128, 127].

      Voltage
      method

      KeyVoltage

      static final DJIKeyInfo<Integer> KeyVoltage = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"Voltage", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Integer

      Get the voltage of a single battery. Unit: mV.

      Current
      method

      KeyCurrent

      static final DJIKeyInfo<Integer> KeyCurrent = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"Current", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Integer

      Get the real-time current consumption of the battery. Unit: mA. Negative values indicate that the battery is discharging, and positive values indicate that it is charging.

      Number of Discharges
      method

      KeyNumberOfDischarges

      static final DJIKeyInfo<Integer> KeyNumberOfDischarges = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"NumberOfDischarges", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Integer

      Gets the total number of discharges that a battery has experienced during its lifetime. The total number of discharges includes discharges that occur through normal use and those that are manually set.

      Cell Information
      method

      KeyNumberOfCells

      static final DJIKeyInfo<Integer> KeyNumberOfCells = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"NumberOfCells", SingleValueConverter.IntegerConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Integer

      Get the number of cells contained in the battery.

      method

      KeyCellVoltages

      static final DJIKeyInfo<List<Integer>> KeyCellVoltages = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"CellVoltages", new SingleValueConverter<>((Class)List.class,BatteryCellVoltages.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: List

      Get the voltage of each cell contained in the battery.Unit: mV.

      method

      KeyBatteryManufacturedDate

      static final DJIKeyInfo<Date> KeyBatteryManufacturedDate = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"BatteryManufacturedDate", new DJIValueConverter<>(Date.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Date

      Get the production date of battery.

      Note

      This interface is deprecated starting from MSDK 5.9.0.

      Serial Number
      method

      KeySerialNumber

      static final DJIKeyInfo<String> KeySerialNumber = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"SerialNumber", SingleValueConverter.StringConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: String

      Get the serial number of battery.

      Firmware Version
      method

      KeyFirmwareVersion

      static final DJIKeyInfo<String> KeyFirmwareVersion = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FirmwareVersion", SingleValueConverter.StringConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: String

      Get the firmware version of battery.


      Basic Setting

      method

      KeyBatterySelfDischargeInDays

      static final DJIKeyInfo<Integer> KeyBatterySelfDischargeInDays = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"BatterySelfDischargeInDays", SingleValueConverter.IntegerConverter).canGet(true).canSet(true).canListen(true).canPerformAction(false).setIsEvent(false)

      Parameter: Integer

      Set and get the battery self-discharge days. The range interval: [1, 10]. In order to ensure the safety of the battery, when the number of days of placing the battery for a long time exceeds the number of self-discharge days, the battery will automatically discharge to the safely placing power.

      On this page