DJI Mobile SDK Documentation

      class DJIBatteryState

      @interface DJIBatteryState : NSObject
      Header:DJIBatteryState.h
      Inherits From:NSObject
      Description:

      Supported by both smart and non-smart batteries, this class keeps track of the real-time state of the battery. Non-smart batteries only support the following properties:

      Class Members:

      Battery Properties

      Charge
      property
      property fullChargeCapacity
      @property(nonatomic, readonly) NSUInteger fullChargeCapacity
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamFullChargeCapacity
      Description:

      Returns 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 fullChargeCapacity will decrease.

      property chargeRemaining
      @property(nonatomic, readonly) NSUInteger chargeRemaining
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamChargeRemaining
      Description:

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

      property chargeRemainingInPercent
      @property(nonatomic, readonly) NSUInteger chargeRemainingInPercent
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamChargeRemainingInPercent
      Description:

      Returns the percentage of battery energy left with range [0, 100].

      property isBeingCharged
      @property(nonatomic, readonly) BOOL isBeingCharged
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamIsBeingCharged
      Description:

      YES if the battery is being charged.

      property isInSingleBatteryMode
      @property(nonatomic, readonly) BOOL isInSingleBatteryMode
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamIsInSingleBatteryMode
      Description:

      YES if only one battery is inserted 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/starboard slot.

      property selfHeatingState
      @property(nonatomic, readwrite) DJIBatterySelfHeatingState selfHeatingState
      Header:DJIBatteryState.h
      Description:

      The state of the battery's auto heating feature. It is DJIBatterySelfHeatingStateUnknown if the battery does not support this feature.

      See Also:

      DJIBatterySelfHeatingState

      Design Capacity
      property
      property designCapacity
      @property(nonatomic, readonly) NSUInteger designCapacity
      Header:DJIBatteryState.h
      Description:

      Returns the design capacity of the battery in mAh (milliamp hours). It is the ideal capacity when the battery is new. This value will not change over time. It is only supported by smart battery.

      Electrical
      property
      property voltage
      @property(nonatomic, readonly) NSUInteger voltage
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamVoltage
      Description:

      Returns the current battery voltage (mV).

      property
      property current
      @property(nonatomic, readonly) NSInteger current
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamCurrent
      Description:

      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.

      property cellVoltageLevel
      @property(nonatomic, readonly) DJIBatteryCellVoltageLevel cellVoltageLevel
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamCellVoltageLevel
      Description:

      Current cell voltage level of the battery. It is only supported when the connected product is stand-alone A3 or N3.

      See Also:

      DJIBatteryCellVoltageLevel

      Lifetime
      property
      property lifetimeRemaining
      @property(nonatomic, readonly) NSUInteger lifetimeRemaining
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamLifetimeRemainingInPercent
      Description:

      Returns the battery's remaining lifetime as a percentage, with range [0, 100]. A new battery will be close to 100%. As a battery experiences charge/discharge cycles, the value will go down. In unsupported products, this value will always be 0. These products are Phantom 4 Pro, Inspire 2, and Phantom 4 Advanced.

      property
      property temperature
      @property(nonatomic, readonly) double temperature
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamTemperature
      Description:

      Returns the battery's temperature, in Celsius, with range [-128, 127] degrees.

      property numberOfDischarges
      @property(nonatomic, readonly) NSUInteger numberOfDischarges
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamNumberOfDischarges
      Description:

      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.


      enum DJIBatteryCellVoltageLevel
      typedef NS_ENUM (uint8_t, DJIBatteryCellVoltageLevel)
      Header:DJIBatteryState.h
      SDK Key:DJIBatteryKey.DJIBatteryParamCellVoltageLevel
      Description:

      Battery cell voltage level threshold. Different thresholds will initiate different aircraft behaviors or operations. Level 3 is the lowest level. It is only supported when the connected product is stand-alone A3 and N3.

      Enum Members:
      DJIBatteryCellVoltageLevel0The cell voltage is at a safe level; the aircraft can fly normally.
      DJIBatteryCellVoltageLevel1The cell voltage is equal to or lower than threshold Level 1. At this level the Level 1 operation will be executed. The threshold value and operation for Level 1 can be configured by the user.
      DJIBatteryCellVoltageLevel2The cell voltage is equal to or lower than threshold Level 2. At this level the Level 2 operation will be executed. The threshold value and operation for Level 2 can be configured by the user.
      DJIBatteryCellVoltageLevel3The cell voltage is equal to or lower than Level 3. At this level, the aircraft will start landing. The threshold for Level 3 cannot be configured by the user and is fixed at 3400mV.
      DJIBatteryCellVoltageLevelUnknownThe cell voltage level is unknown.