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.
staticfinal 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.
staticfinal 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.
staticfinal DJIKeyInfo<Long> KeyBatteryHighVoltageStorageTime = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"BatteryHighVoltageStorageTime", SingleValueConverter.LongConverter).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false).setInnerIdentifier("BatteryHighVoltageStorageSec")
Package:
dji.sdk.keyvalue.key
Description:
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.
staticfinal 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.
staticfinal 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.
staticfinal 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.
staticfinal DJIKeyInfo<Date> KeyBatteryManufacturedDate = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"BatteryManufacturedDate", new DJIValueConverter<>(Date.class)).canGet(true).canSet(false).canListen(true).canPerformAction(false).setIsEvent(false)
staticfinal 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.