battery_info_get_state_of_charge()

Retrieve the state of charge from a battery information structure.

Synopsis:

#include <bps/battery.h>
 
BPS_API int battery_info_get_state_of_charge(battery_info_t *info)

Since:

BlackBerry 10.0.0

Arguments:

info

The battery_info_t structure to get the state of charge from.

Library:

libbps (For the qcc command, use the -l bps option to link against this library)

Description:

The battery_info_get_state_of_charge() function retrieves the state of charge from a battery_info_t structure. The state of charge is reported as a percentage from 0 to 100.

Returns:

The state of charging as percentage value, BPS_FAILURE otherwise. Typically, BPS_FAILURE is returned if the battery was not ready.