BatteryInfo

Since: BlackBerry 10.0.0

#include <bb/device/BatteryInfo>

To link against this class, add the following line to your .pro file: LIBS += -lbbdevice

A class that provides the battery information of the device.


Overview

Properties Index

bb::device::BatteryChargingState::TypechargingState [read-only]
bb::device::BatteryCondition::Typecondition [read-only]
intcycleCount [read-only]
intfullChargeCapacity [read-only]
intlevel [read-only]
boolpresent [read-only]
QStringrxid [read-only]
floattemperature [read-only]

Public Functions Index

BatteryInfo (QObject *parent=0)
virtual ~BatteryInfo ()
BatteryChargingState::TypechargingState () const
BatteryCondition::Typecondition () const
intcycleCount () const
intfullChargeCapacity () const
boolisPresent () const
intlevel () const
QStringrxid () const
floattemperature () const

Signals Index

voidconditionChanged (bb::device::BatteryCondition::Type condition)
voidcycleCountChanged (int cycleCount)
voidfullChargeCapacityChanged (int fullChargeCapacity)
voidlevelChanged (int level, bb::device::BatteryChargingState::Type newChargingState)
voidpresentChanged (bool present)
voidrxidChanged (QString rxid)
voidtemperatureChanged (float temperature)

Properties

bb::device::BatteryChargingState::Type chargingState[read-only]

The current charging state of the battery.

See also:

bb::device::BatteryChargingState.

Since:

BlackBerry 10.0.0

bb::device::BatteryCondition::Type condition[read-only]

Indicates the current condition of the battery.

Since:

BlackBerry 10.0.0

int cycleCount[read-only]

cycleCount is the number of cycles the battery has experienced with a range of 0 to 65,535.

Since:

BlackBerry 10.0.0

int fullChargeCapacity[read-only]

fullChargeCapacity is the compensated capacity of the battery when fully charged.

fullChargeCapacity is measured in mAh.

Since:

BlackBerry 10.0.0

int level[read-only]

The level of charge left in the battery (as a percentage, 0 to 100).

Since:

BlackBerry 10.0.0

bool present[read-only]

Indicates if a battery is present or not.

Since:

BlackBerry 10.0.0

QString rxid[read-only]

The RxID of the wireless charging receiver chip.

The RxID is the string representation of an 11-byte value. If the device has not been on a charging pad since boot up, the RxID will be an empty string. The RxID is a wireless charging receiver identifier and can be used to identify the device to wireless charging systems.

Since:

BlackBerry 10.3.0

float temperature[read-only]

The average temperature of the battery.

If the battery has N thermistors, temperature is the average value of all the temperature readings in degrees Celsius.

Since:

BlackBerry 10.0.0

Public Functions

BatteryInfo (

Constructs a BatteryInfo object.

Constructs a BatteryInfo object from which may be retrieved information about the battery of the device.

Parameters
parent

If not 0, the supplied parent will be responsible for deleting this instance.

Note:

A BatteryInfo constructed in this way will return information on the active battery (if more than one battery is present in the device).

Since:

BlackBerry 10.0.0

virtual~BatteryInfo ()

Destructor.

Since:

BlackBerry 10.0.0

BatteryChargingState::Type chargingState ()

Retrieves the current charging state of the battery.

Return:

The current charging state.

Since:

BlackBerry 10.0.0

BatteryCondition::Type condition ()

The condition of the battery.

Since:

BlackBerry 10.0.0

int cycleCount ()

cycleCount is the number of cycles the battery has experienced with a range of 0 to 65,535.

Return:

The cycle count as an integer, or -1 if the value was not available.

Since:

BlackBerry 10.0.0

int fullChargeCapacity ()

fullChargeCapacity is the compensated capacity of the battery when fully charged.

fullChargeCapacity is measured in mAh.

Return:

The number of mAh available when the battery is at full charge, or -1 if the value was not available.

Since:

BlackBerry 10.0.0

bool isPresent ()

Whether a battery is present or not.

Return:

True if a battery is detected, False otherwise.

Since:

BlackBerry 10.0.0

int level ()

The percentage of battery charge.

Return:

Battery level from 0 to 100, or -1 if the value was not available.

Since:

BlackBerry 10.0.0

QString rxid ()

The RxID of the wireless charging receiver chip.

The RxID is the string representation of an 11-byte value. If the device has not been on a charging pad since boot up, the RxID will be an empty string.

Return:

The 11-byte value as a string or an empty string if the device has not been on the charging pad since boot up.

Since:

BlackBerry 10.3.0

float temperature ()

The average temperature of the battery.

If the battery has N thermistors, temperature() is the average value of all the temperature readings in degrees Celsius.

Return:

The battery temperature measured in degrees Celsius, or std::numeric_limits<float>::min() if the value was not available.

Since:

BlackBerry 10.0.0

Signals

void conditionChanged (

Emitted if the condition of the battery changes.

Parameters
condition

The new condition of the battery.

Since:

BlackBerry 10.0.0

void cycleCountChanged (
  • intcycleCount)

Emitted when the cycle count changes.

Parameters
cycleCount

The new cycle count.

Since:

BlackBerry 10.0.0

void fullChargeCapacityChanged (
  • intfullChargeCapacity)

Emitted if the full charge capacity changes.

The capacity is measured in mAh.

Parameters
fullChargeCapacity

The new full charge capacity.

Since:

BlackBerry 10.0.0

void levelChanged (

Emitted when either the charging level or the charging state changes (or both).

Parameters
level

The battery level as a value from 0 to 100

newChargingState

The current charging state.

Since:

BlackBerry 10.0.0

void presentChanged (
  • boolpresent)

Emitted if the presence of a battery changes.

Parameters
present

The new indication of whether a battery is present or not.

Since:

BlackBerry 10.0.0

void rxidChanged (

Emitted when the RxID changes.

The RxID is the string representation of an 11-byte value.

Parameters
rxid

The new RxID value.

Since:

BlackBerry 10.3.0

void temperatureChanged (
  • floattemperature)

Emitted when the battery temperature changes.

The temperature is measured in degrees Celsius.

Parameters
temperature

The new temperature in degrees Celsius.

Since:

BlackBerry 10.0.0

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus