libtiepie-hw  1.2.1
Battery

Device battery related functions. More...

Collaboration diagram for Battery:

Functions

TIEPIE_HW_API tiepie_hw_bool tiepie_hw_device_has_battery (tiepie_hw_handle handle)
 Check whether the device has a battery. More...
 
TIEPIE_HW_API int8_t tiepie_hw_device_get_battery_charge (tiepie_hw_handle handle)
 Get the battery charge state of the device's battery in percent. More...
 
TIEPIE_HW_API int32_t tiepie_hw_device_get_battery_time_to_empty (tiepie_hw_handle handle)
 Get the expected time in minutes until the battery will be empty. More...
 
TIEPIE_HW_API int32_t tiepie_hw_device_get_battery_time_to_full (tiepie_hw_handle handle)
 Get the expected time in minutes until the battery will be fully charged. More...
 
TIEPIE_HW_API tiepie_hw_bool tiepie_hw_device_is_battery_charger_connected (tiepie_hw_handle handle)
 Check whether a charger is connected to the device. More...
 
TIEPIE_HW_API tiepie_hw_bool tiepie_hw_device_is_battery_charging (tiepie_hw_handle handle)
 Check whether the device's battery is being charged. More...
 
TIEPIE_HW_API tiepie_hw_bool tiepie_hw_device_is_battery_broken (tiepie_hw_handle handle)
 Check whether the device's battery is defective. More...
 

Detailed Description

Device battery related functions.

Function Documentation

◆ tiepie_hw_device_has_battery()

TIEPIE_HW_API tiepie_hw_bool tiepie_hw_device_has_battery ( tiepie_hw_handle  handle)

Check whether the device has a battery.

Parameters
[in]handleA device handle identifying the device.
Returns
TIEPIE_HW_BOOL_TRUE if the device has a battery, TIEPIE_HW_BOOL_FALSE otherwise.
Status values
TIEPIE_HW_STATUS_INVALID_HANDLE
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
Since
1.0

◆ tiepie_hw_device_get_battery_charge()

TIEPIE_HW_API int8_t tiepie_hw_device_get_battery_charge ( tiepie_hw_handle  handle)

Get the battery charge state of the device's battery in percent.

Parameters
[in]handleA device handle identifying the device.
Returns
Battery charge in percent if succesful, -1 otherwise.
TIEPIE_HW_STATUS_NOT_SUPPORTED The indicated device does not support reading the battery charge or doesn't have a battery.
TIEPIE_HW_STATUS_INVALID_HANDLE
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_device_has_battery
tiepie_hw_device_get_battery_time_to_empty
tiepie_hw_device_get_battery_time_to_full
Since
1.0

◆ tiepie_hw_device_get_battery_time_to_empty()

TIEPIE_HW_API int32_t tiepie_hw_device_get_battery_time_to_empty ( tiepie_hw_handle  handle)

Get the expected time in minutes until the battery will be empty.

Parameters
[in]handleA device handle identifying the device.
Returns
When successful, the expected time until the battery will be empty in minutes, else -1
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The indicated device does not support reading the battery time to empty or doesn't have a battery.
TIEPIE_HW_STATUS_INVALID_HANDLE
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_device_has_battery
tiepie_hw_device_get_battery_charge
tiepie_hw_device_get_battery_time_to_full
Since
1.0

◆ tiepie_hw_device_get_battery_time_to_full()

TIEPIE_HW_API int32_t tiepie_hw_device_get_battery_time_to_full ( tiepie_hw_handle  handle)

Get the expected time in minutes until the battery will be fully charged.

Parameters
[in]handleA device handle identifying the device.
Returns
When successful, the expected time until the battery will be fully charged in minutes, else -1
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The indicated device does not support reading the battery time to full or doesn't have a battery.
TIEPIE_HW_STATUS_INVALID_HANDLE
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_device_has_battery
tiepie_hw_device_get_battery_charge
tiepie_hw_device_is_battery_charging
Since
1.0

◆ tiepie_hw_device_is_battery_charger_connected()

TIEPIE_HW_API tiepie_hw_bool tiepie_hw_device_is_battery_charger_connected ( tiepie_hw_handle  handle)

Check whether a charger is connected to the device.

Parameters
[in]handleA device handle identifying the device.
Returns
TIEPIE_HW_BOOL_TRUE if the device is connected to a charger, TIEPIE_HW_BOOL_FALSE otherwise.
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The indicated device does not have a battery.
TIEPIE_HW_STATUS_INVALID_HANDLE
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_device_has_battery
tiepie_hw_device_is_battery_charging
Since
1.0

◆ tiepie_hw_device_is_battery_charging()

TIEPIE_HW_API tiepie_hw_bool tiepie_hw_device_is_battery_charging ( tiepie_hw_handle  handle)

Check whether the device's battery is being charged.

Parameters
[in]handleA device handle identifying the device.
Returns
TIEPIE_HW_BOOL_TRUE if the device's battery is being charged, TIEPIE_HW_BOOL_FALSE otherwise.
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The indicated device does not have a battery.
TIEPIE_HW_STATUS_INVALID_HANDLE
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_device_has_battery
tiepie_hw_device_get_battery_charge
tiepie_hw_device_get_battery_time_to_empty
tiepie_hw_device_get_battery_time_to_full
Since
1.0

◆ tiepie_hw_device_is_battery_broken()

TIEPIE_HW_API tiepie_hw_bool tiepie_hw_device_is_battery_broken ( tiepie_hw_handle  handle)

Check whether the device's battery is defective.

Parameters
[in]handleA device handle identifying the device.
Returns
TIEPIE_HW_BOOL_TRUE if the device's battery is defective, TIEPIE_HW_BOOL_FALSE otherwise.
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The indicated device does not have a battery.
TIEPIE_HW_STATUS_INVALID_HANDLE
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_device_has_battery
Since
1.0