LibTiePie  0.9.16
Library for interfacing TiePie engineering instruments
Battery

Description

Device battery related functions.

Functions

bool8_t DevHasBattery (LibTiePieHandle_t hDevice)
 Check whether the device has a battery. More...
 
int8_t DevGetBatteryCharge (LibTiePieHandle_t hDevice)
 Get battery charge in percent. More...
 
int32_t DevGetBatteryTimeToEmpty (LibTiePieHandle_t hDevice)
 Get battery time to empty in minutes. More...
 
int32_t DevGetBatteryTimeToFull (LibTiePieHandle_t hDevice)
 Get battery time to full in minutes. More...
 
bool8_t DevIsBatteryChargerConnected (LibTiePieHandle_t hDevice)
 Check whether the battery charger is connected. More...
 
bool8_t DevIsBatteryCharging (LibTiePieHandle_t hDevice)
 Check whether the battery is charging. More...
 
bool8_t DevIsBatteryBroken (LibTiePieHandle_t hDevice)
 Check whether the battery is broken. More...
 

Function Documentation

bool8_t DevHasBattery ( LibTiePieHandle_t  hDevice)

Check whether the device has a battery.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
BOOL8_TRUE if the device has a battery, BOOL8_FALSE otherwise.
Status values
INVALID_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
Since
0.9
int8_t DevGetBatteryCharge ( LibTiePieHandle_t  hDevice)

Get battery charge in percent.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
Battery charge in percent if succesful, -1 otherwise.
Status values
NOT_SUPPORTED The indicated device does not support reading the battery charge or doesn't have a battery.
INVALID_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
DevHasBattery
Since
0.9
int32_t DevGetBatteryTimeToEmpty ( LibTiePieHandle_t  hDevice)

Get battery time to empty in minutes.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
Battery time to empty in minutes if succesful, -1 otherwise.
Status values
NOT_SUPPORTED The indicated device does not support reading the battery time to empty or doesn't have a battery.
INVALID_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
DevHasBattery
DevGetBatteryCharge
Since
0.9
int32_t DevGetBatteryTimeToFull ( LibTiePieHandle_t  hDevice)

Get battery time to full in minutes.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
Battery time to full in minutes if succesful, -1 otherwise.
Status values
NOT_SUPPORTED The indicated device does not support reading the battery time to full or doesn't have a battery.
INVALID_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
DevHasBattery
DevIsBatteryCharging
Since
0.9
bool8_t DevIsBatteryChargerConnected ( LibTiePieHandle_t  hDevice)

Check whether the battery charger is connected.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
BOOL8_TRUE if the battery charger is connected, BOOL8_FALSE otherwise.
Status values
NOT_SUPPORTED The indicated device does not have a battery.
INVALID_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
DevHasBattery
DevIsBatteryCharging
Since
0.9
bool8_t DevIsBatteryCharging ( LibTiePieHandle_t  hDevice)

Check whether the battery is charging.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
BOOL8_TRUE if the battery is charging, BOOL8_FALSE otherwise.
Status values
NOT_SUPPORTED The indicated device does not have a battery.
INVALID_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
DevHasBattery
DevGetBatteryTimeToEmpty
DevGetBatteryTimeToFull
Since
0.9
bool8_t DevIsBatteryBroken ( LibTiePieHandle_t  hDevice)

Check whether the battery is broken.

Parameters
[in]hDeviceA device handle identifying the device.
Returns
BOOL8_TRUE if the battery is broken, BOOL8_FALSE otherwise.
Status values
NOT_SUPPORTED The indicated device does not have a battery.
INVALID_HANDLE The handle to the device is invalid.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
DevHasBattery
Since
0.9