Skip to main content

API for saving battery parameters, including the battery voltage, capacity, current, temperature, and battery power.

class  BatteryState

method getVoltageCells

  int[] getVoltageCells();

Description: Returns the battery pack voltage.

Input parameter: none.

Output parameter: the battery pack voltage.

Relevant parameter none.

method getVoltage

  float getVoltage();

Description: Obtains the total voltage of the battery (the sum of the voltages of all cells from cell1 to cell)

Input parameter: none.

Output parameter: the total voltage of the battery.

Relevant parameter none.

method getCapacity

  float getCapacity();

Description: Obtains the remaining battery capacity.

Input parameter: none.

Output parameter: the remaining battery capacity.

Relevant parameter none.

method getRemainTime

  float getRemainTime();

Description: Obtains the remaining flight time. The return value is in minutes.

Input parameter: none.

Output parameter: the remaining flight time.

Relevant parameter none.

method getCurrent

  float getCurrent();

Description: Obtains the battery current.

Input parameter: none.

Output parameter: the battery current.

Relevant parameter none.

method getTemperature

  float getTemperature();

Description: Obtains the battery temperature.

Input parameter: none.

Output parameter: the battery temperature.

Relevant parameter none.

method getDesignedCapacity

  float getDesignedCapacity();

Description: Obtains the designed capacity of the battery.

Input parameter: none.

Output parameter: the designed capacity of the battery.

Relevant parameter none.

method getBatteryWarning

BatteryWarning getBatteryWarning();

Description: Obtains the battery warning status.

Input parameter: none.

Output parameter: the battery warning status.

Relevant parameter none.

method getRemainingPercent

int getRemainingPercent();

Description: Obtains the remaining battery percentage.

Input parameter: none.

Output parameter: the remaining battery percentage.

Relevant parameter none.

Relevant parameter none.