|
Tizen HAL API
1.0
|
The Battery provides functions for receiving Battery events or information.
#include <hal-device-battery.h>
The Battery provides the way to get the current battery capacity value, battery state and charging state. And it provides the power source information like name, type. It also supports the API for an application to receive the battery events from the system. To receive the battery event it should be described by the callback function.
The Battery functions provide battery information including:
For more information on the Battery features and the macros, see HAL Battery programming guides and tutorials.
Typedefs | |
| typedef struct _hal_backend_device_battery_funcs | hal_backend_device_battery_funcs |
| Structure for Battery functions. | |
| typedef void(* | hal_device_battery_updated_cb )(hal_device_battery_info_s *info, void *data) |
| Called when a Battery information is handled. | |
| struct _hal_backend_device_battery_funcs |
Structure for Battery functions.
Data Fields | |
| int(* | register_changed_event )(hal_device_battery_updated_cb updated_cb, void *data) |
| void(* | unregister_changed_event )(hal_device_battery_updated_cb updated_cb) |
| int(* | get_current_state )(hal_device_battery_updated_cb updated_cb, void *data) |
| int(* _hal_backend_device_battery_funcs::get_current_state)(hal_device_battery_updated_cb updated_cb, void *data) |
Get current states, it operates synchronously
| int(* _hal_backend_device_battery_funcs::register_changed_event)(hal_device_battery_updated_cb updated_cb, void *data) |
Register battery event
| void(* _hal_backend_device_battery_funcs::unregister_changed_event)(hal_device_battery_updated_cb updated_cb) |
Unregister battery event
| struct hal_device_battery_info_s |
Structure for Battery information data.
Data Fields | |
| char * | name |
| char * | status |
| char * | health |
| hal_device_battery_power_source_type_e | power_source |
| int | online |
| int | present |
| int | capacity |
| int | current_now |
| int | current_average |
| int | voltage_now |
| int | voltage_average |
| int | temperature |
The remaining capacity of the battery
The average amount of current consumed by the device over time
The amount of current being consumed by the device at the moment
The overall condition of the battery
The name of the battery
This indicates whether the device is currently receiving power from an external source.
The source of power being supplied
This indicates whether there is a battery inside the system physically, with 1 indicating it is connected and 0 otherwise.
The current state of the battery
The current temperature of the battery
The average voltage level of the battery over time
The current voltage level of the battery
Structure for Battery functions.
| typedef void(* hal_device_battery_updated_cb)(hal_device_battery_info_s *info, void *data) |
Called when a Battery information is handled.
| [out] | info | Battery information |
| [out] | user_data | User data passed |
Enumeration for Battery power source type.