Skip to main content

AUTELBattery

class AUTELBattery

describe:This class includs battery related functions, it is also able to get real-time battery status.

@interface AUTELBattery : NSObject

property designedVolume

@property(nonatomic, readonly) NSInteger designedVolume;

describe:Designed capacity of battery (mAh).


property fullChargeVolume

@property(nonatomic, readonly) NSInteger fullChargeVolume;

describe:Full charge capacity of battery (mAh).


property currentElectricity

@property(nonatomic, readonly) float currentElectricity;

describe:Current electricity volume of battery (mAh).


property currentVoltage

@property(nonatomic, readonly) float currentVoltage;

describe:The current voltage of battery (mV).


property currentCurrent

@property(nonatomic) float currentCurrent;

describe:Current current of battery. A negative value indicates that the battery is in discharge.


property remainPowerPercent

@property(nonatomic, readonly) NSInteger remainPowerPercent;

describe:Remain power percentage of battery.


property batteryTemperature

@property(nonatomic, readonly) float batteryTemperature;

describe:The temperature of battery between -128 to 127 (Centigrade).


property isBatteryOverheated

@property(nonatomic) BOOL isBatteryOverheated;

describe:Returns Yes if battery overheated else No.


property isBatteryLowTemperature

@property(nonatomic) BOOL isBatteryLowTemperature;

describe:Returns Yes if battery has low temperature else No.


property isBatteryVoltageDiff

@property(nonatomic) BOOL isBatteryVoltageDiff;

describe:Whether the battery cell voltage is unbalanced


property numberOfDischarge

@property(nonatomic, readonly) NSInteger numberOfDischarge;

describe:Total number of battery discharge time.


property voltageOfCells

@property(nonatomic, readonly) NSArray *voltageOfCells;

describe:Current voltage of battery cells.


property version

@property(nonatomic, readonly) NSString *version;

describe:Firmware version of battery.


property drone

@property (weak, nonatomic, readonly) AUTELDrone *drone;

describe:Returns a instance of AUTELDrone . drone.battery is the same as self.


property delegate

@property (weak, nonatomic) id<AUTELBatteryDelegate> delegate;

describe:delegate of battery. AUTELBatteryDelegate


property delegateSec

@property (weak, nonatomic) id<AUTELBatteryDelegate> delegateSec;

describe:another delegate of battery. AUTELBatteryDelegate


method updateBatteryInfo

- (void)updateBatteryInfo:(AUTELCompletionBlock)block;

describe:Update battery's information once, if Succeeded, the property value of battery will be update.

input parameter

block:completion block AUTELCompletionBlock


method getSelfDischargeDayWithCompletion

- (void)getSelfDischargeDayWithCompletion:(void(^)(uint8_t days, NSError *err))block;

describe:Get the number of days that the smart battery starts to self discharge

input parameter

block:Completion block. This block includes 2 parameters. One is the number of days, another one is error which indicates error message. Error retuns nil if this function applies successfully.


method setSelfDischargeDay:withCompletion

- (void)setSelfDischargeDay:(uint8_t)days withCompletion:(AUTELCompletionBlock)block;

describe:Set the number of days that the smart battery starts to self discharge

input parameter

days:the number of days that the smart battery starts to self discharge

block:completion block AUTELCompletionBlock


method getWarningInformationRecordsWithCompletion

- (void)getWarningInformationRecordsWithCompletion:(void (^)(NSArray *history, NSError *error))block;

describe:Gets the battery's warning history. The Autel battery keeps the history for the past 20 days. The history variable in the block stores objects of type

state: 1. Charging overcurrent 2.Discharge overcurrent 3. Charging over temperature 4. Discharge overtemperature 5. overload protection 6.QMAX Not updated

input parameter

block:Completion block. This block includes 2 parameters. One is the battery's warning history, another one is error which indicates error message. Error retuns nil if this function applies successfully.


method getBatterySNWithCompletion

- (void)getBatterySNWithCompletion:(void (^)(NSString *batterySN, NSError *error))block;

describe:Query battery serial number

input parameter

block:Completion block. This block includes 2 parameters. One is the battery's serial number, another one is error which indicates error message. Error retuns nil if this function applies successfully.


method getBateryInfo

- (void)getBateryInfo:(void (^)(NSDictionary *info, NSError *error))block;

describe:Get battery information

input parameter

block:Completion block. This block includes 2 parameters. One is the battery information, another one is error which indicates error message. Error retuns nil if this function applies successfully.


class AUTELBatteryState

describe:This class defines battery related information

@interface AUTELBatteryState : NSObject<NSCopying>

property designedVolume

@property(nonatomic, assign) NSInteger designedVolume;

describe:Designed capacity of battery (mAh).


property fullChargeVolume

@property(nonatomic, readonly) NSInteger fullChargeVolume;

describe:Full charge capacity of battery (mAh).


property currentElectricity

@property(nonatomic, readonly) float currentElectricity;

describe:Current electricity volume of battery (mAh).


property currentVoltage

@property(nonatomic, readonly) float currentVoltage;

describe:The current voltage of battery (mV).


property currentCurrent

@property(nonatomic) float currentCurrent;

describe:Current current of battery. A negative value indicates that the battery is in discharge.


property remainPowerPercent

@property(nonatomic, readonly) NSInteger remainPowerPercent;

describe:Remain power percentage of battery.


property remainingFlightTime

@property(nonatomic, assign) float remainingFlightTime;

describe:Remaining flight time


property batteryTemperature

@property(nonatomic, readonly) float batteryTemperature;

describe:The temperature of battery between -128 to 127 (Centigrade).


property isBatteryOverheated

@property(nonatomic) BOOL isBatteryOverheated;

describe:Returns Yes if battery overheated else No.


property isBatteryVoltageDiff

@property(nonatomic) BOOL isBatteryVoltageDiff;

describe:Returns Yes if the battery cell voltage imbalance else No


property numberOfDischarge

@property(nonatomic, readonly) NSInteger numberOfDischarge;

describe:Total number of battery discharge time.


property voltageOfCells

@property(nonatomic, copy) NSArray<NSNumber *> *voltageOfCells;

describe:Current voltage of battery cells.


property maxError

@property(nonatomic, assign) uint32_t maxError;

describe:maxError


property safeState

@property(nonatomic, strong) AUTELBatterySafeState *safeState;

describe:Safe State, only for module B gimbal, if App connected to x-start, this property will be nil. AUTELBatterySafeState


class AUTELBatterySafeState

describe:This class defines battery safety status information

@interface AUTELBatterySafeState : NSObject<NSCopying>

property rawBatteryValue

@property(nonatomic, assign) int64_t rawBatteryValue;

describe:battery value


property isWillShutDown

@property(nonatomic, assign) BOOL isWillShutDown;

describe:is Battery about to shut down


property isCoulometerHitch

@property(nonatomic, assign) BOOL isCoulometerHitch;

describe:is Coulometer hitch


property isCellVoltageDifference

@property(nonatomic, assign) BOOL isCellVoltageDifference;

describe:is Voltage difference alarm


property isLowTemperature

@property(nonatomic, assign) BOOL isLowTemperature;

describe:is the Battery temperature too low


property isCriticallyLowTemperature

@property(nonatomic, assign) BOOL isCriticallyLowTemperature;

describe:is the Battery temperature critically low


property isOverheated

@property(nonatomic, assign) BOOL isOverheated;

describe:is overheated


property isCellLowVoltageCompensated

@property(nonatomic, assign) BOOL isCellLowVoltageCompensated;

describe:is the cell low voltage compensated


property isDischargeShortCircuitLatch

@property(nonatomic, assign) BOOL isDischargeShortCircuitLatch;

describe:is Discharge short circuit Latch


property isCellOvervoltage

@property(nonatomic, assign) BOOL isCellOvervoltage;

describe:Is the cell voltage too high


property isCellLowVoltage

@property(nonatomic, assign) BOOL isCellLowVoltage;

describe:is cell low voltage


property isShortCircuit

@property(nonatomic, assign) BOOL isShortCircuit;

describe:is short circuit


property isOverload

@property(nonatomic, assign) BOOL isOverload;

describe:is overload


protocol AUTELBatteryDelegate

describe:This protocol defines a proxy method for updating the current status of batteries in real time

@protocol AUTELBatteryDelegate <NSObject>

property isBatteryLowTemperature

@property(nonatomic) BOOL isBatteryLowTemperature;

describe:Returns Yes if battery has low temperature else No.


property isBatteryCriticallyLowTemperature

@property(nonatomic, assign) BOOL isBatteryCriticallyLowTemperature;

describe:Is the battery temperature too low


method battery:didUpdataState

- (void)battery:(AUTELBattery *)battery didUpdataState:(AUTELBatteryState *)state NS_SWIFT_NAME(battery(_:didUpdataState:));

describe:The protocol method updates the battery status.

input parameter

batteryAUTELBattery,Describes the battery object.

stateAUTELBatteryState,Describe the battery status.