DJI Mobile SDK Documentation

      class BatteryKey

      @Keep
      class BatteryKey extends DJIBatteryKey
      Package:dji.sdk.keyvalue.key
      Inherits From:DJIBatteryKey
      Description:

      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. 0 means battery 1(left) in the Pilot, 1 means battery 2(right) in the Pilot.

      Supported since MSDK 5.0.0

      Class Members:

      Basic Information

      Connection Status
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: Boolean

      true means that the battery on the aircraft is connected.

      Supported since MSDK 5.0.0

      Fully Charged
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      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.

      Supported since MSDK 5.0.0

      Remaining Battery
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: Integer

      To get remaining battery capacity. Unit: mAh.

      Supported since MSDK 5.0.0

      Percentage of Remaining Battery
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      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.

      Supported since MSDK 5.0.0

      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: Double

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

      Supported since MSDK 5.0.0

      Voltage
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: Integer

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

      Supported since MSDK 5.0.0

      Current
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      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.

      Supported since MSDK 5.0.0

      Number of Discharges
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      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.

      Supported since MSDK 5.0.0

      Cell Information
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: Integer

      Get the number of cells contained in the battery.

      Supported since MSDK 5.0.0

      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: List

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

      Supported since MSDK 5.0.0

      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: Date

      Get the production date of battery.

      Supported since MSDK 5.0.0

      Serial Number
      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: String

      Get the serial number of battery.

      Supported since MSDK 5.0.0

      Firmware Version
      final KeyFirmwareVersion
      static final DJIKeyInfo<String> KeyFirmwareVersion = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"FirmwareVersion", SingleValueConverter.StringConverter).canGet(true).canSet(false).canListen(false).canPerformAction(false).setIsEvent(false)
      Package:dji.sdk.keyvalue.key
      Description:

      Parameter: String

      Get the firmware version of battery.

      Supported since MSDK 5.0.0


      Basic Setting

      final 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)
      Package:dji.sdk.keyvalue.key
      Description:

      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.

      Supported since MSDK 5.0.0