class DJIBatteryKey
描述:
DJIBatteryKey
提供了一组方法来管理电池的信息和实时状态。通过设置componentIndex来获取对应电池的信息和实时状态:0表示Pilot中的电池1、1表示Pilot中的电池2。 此类从MSDK 5.0开始支持
类成员:
基础信息
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 )
描述:
参数: Boolean true
表示电池已连接。 MSDK 5.0开始支持
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 )
描述:
参数: Integer 获取电池充满时的电池容量,单位:mAh。随着电池的持续使用,充满电时电池的容量会随着时间而减小。 MSDK 5.0开始支持
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 )
描述:
参数: Integer 获取电池剩余容量,单位:mAh。 MSDK 5.0开始支持
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 )
描述:
参数: Integer 获取电池剩余电量百分比。如果你需要获取所有电池的总电量百分比,可以通过设置不同的componentIndex获取到所有的电池剩余电量和电池容量进行计算获取。 TODO:这个获取到的百分比跟Key_Battery_ChargeRemaining/Key_Battery_FullChargeCapacity不一致,有点偏差,需要跟固件确认。 MSDK 5.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 )
描述:
参数: Double 获取电池温度,单位:摄氏度。范围区间:[-128, 127]。 MSDK 5.0开始支持
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 )
描述:
参数: Integer 获取电池总电压,单位:mV。 MSDK 5.0开始支持
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 )
描述:
参数: Integer 获取电池的实时电流消耗,单位:mA。 负值表示电池正在放电,正值表示正在充电。 MSDK 5.0开始支持
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 )
描述:
参数: Integer 获取电池在其生命周期内经历的总放电次数。放电总数包括通过正常使用发生的放电和手动设置的放电。 MSDK 5.0开始支持
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 )
描述:
参数: Integer 获取电池包含的电芯个数。 MSDK 5.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 )
描述:
参数: List 获取电池中包含的每个电芯的电压。单位:mV。 MSDK 5.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 )
描述:
参数: Date
获取电池生产日期。 MSDK 5.0开始支持
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 )
描述:
参数: String 获取电池序列号。 MSDK 5.0开始支持
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 )
描述:
参数: String 获取电池固件版本。 MSDK 5.0开始支持
基本设置
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 )
描述:
参数: Integer 设置和获取电池开始自放电天数,范围区间:[1, 10]。为了保证电池安全,当长时间放置电池的天数超过自放电天数时,电池会自动放电到安全放置电量。 MSDK 5.0开始支持
final KeyBatteryLEDsEnabled
static final DJIKeyInfo<BatteryLedsInfo> KeyBatteryLEDsEnabled = new DJIKeyInfo<>(componentType.value(),subComponentType.value(),"BatteryLEDsEnabled" , new DJIValueConverter<>(BatteryLedsInfo.class )).canGet (true ).canSet (true ).canListen (true ).canPerformAction (false ).setIsEvent (false )
描述:
参数: BatteryLedsInfo
设置和获取电池LED状态。只有把飞行器上所有电池的LED都关闭,才能把飞行器的电源LED指示灯设置为关闭。 TODO:csdk实现逻辑有点问题,aircraftLed和BatteryLed必须同时设置为true或者false,需要跟csdk同事对齐逻辑。 MSDK 5.0开始支持