Top |
UpDevice * | up_device_new () |
gchar * | up_device_to_text () |
gboolean | up_device_refresh_sync () |
gboolean | up_device_set_object_path_sync () |
GPtrArray * | up_device_get_history_sync () |
GPtrArray * | up_device_get_statistics_sync () |
const gchar * | up_device_get_object_path () |
guint | battery-level | Read / Write |
double | capacity | Read / Write |
int | charge-cycles | Read / Write |
guint | charge-end-threshold | Read / Write |
guint | charge-start-threshold | Read / Write |
gboolean | charge-threshold-enabled | Read / Write |
gboolean | charge-threshold-supported | Read / Write |
double | energy | Read / Write |
double | energy-empty | Read / Write |
double | energy-full | Read / Write |
double | energy-full-design | Read / Write |
double | energy-rate | Read / Write |
gboolean | has-history | Read / Write |
gboolean | has-statistics | Read / Write |
char * | icon-name | Read / Write |
gboolean | is-present | Read / Write |
gboolean | is-rechargeable | Read / Write |
guint | kind | Read / Write |
double | luminosity | Read / Write |
char * | model | Read / Write |
char * | native-path | Read / Write |
gboolean | online | Read / Write |
double | percentage | Read / Write |
gboolean | power-supply | Read / Write |
char * | serial | Read / Write |
guint | state | Read / Write |
guint | technology | Read / Write |
double | temperature | Read / Write |
gint64 | time-to-empty | Read / Write |
gint64 | time-to-full | Read / Write |
guint64 | update-time | Read / Write |
char * | vendor | Read / Write |
double | voltage | Read / Write |
guint | warning-level | Read / Write |
A helper GObject to use for accessing UPower devices, and to be notified when it is changed.
gchar *
up_device_to_text (UpDevice *device
);
Converts the device to a string description.
Since: 0.9.0
gboolean up_device_refresh_sync (UpDevice *device
,GCancellable *cancellable
,GError **error
);
up_device_refresh_sync
is deprecated and should not be used in newly-written code.
Refreshes properties on the device. This function is normally not required and will only return without an error if the daemon was started in debug mode.
Since: 0.9.0
gboolean up_device_set_object_path_sync (UpDevice *device
,const gchar *object_path
,GCancellable *cancellable
,GError **error
);
Sets the object path of the object and fills up initial properties.
device |
a UpDevice instance. |
|
object_path |
The UPower object path. |
|
cancellable |
a GCancellable or |
|
error |
a GError, or |
Since: 0.9.0
GPtrArray * up_device_get_history_sync (UpDevice *device
,const gchar *type
,guint timespec
,guint resolution
,GCancellable *cancellable
,GError **error
);
Gets the device history.
device |
a UpDevice instance. |
|
type |
The type of history, known values are "rate" and "charge". |
|
timespec |
the amount of time to look back into time. |
|
resolution |
the resolution of data. |
|
cancellable |
a GCancellable or |
|
error |
a GError, or |
an array of UpHistoryItem's, with the most
recent one being first; NULL
if error
is set or device
is
invalid.
[element-type UpHistoryItem][transfer full]
Since: 0.9.0
GPtrArray * up_device_get_statistics_sync (UpDevice *device
,const gchar *type
,GCancellable *cancellable
,GError **error
);
Gets the device current statistics.
device |
a UpDevice instance. |
|
type |
the type of statistics. |
|
cancellable |
a GCancellable or |
|
error |
a GError, or |
an array of UpStatsItem's, else NULL and error
is used.
[element-type UpStatsItem][transfer full]
Since: 0.9.0
“battery-level”
property “battery-level” guint
The battery level, e.g. UP_DEVICE_LEVEL_CRITICAL
. If this is something
other than UP_DEVICE_LEVEL_NONE
, then User Interfaces should use this
approximate level instead of percentages.
Owner: UpDevice
Flags: Read / Write
Allowed values: <= 9
Default value: 1
Since: 1.0
“capacity”
property “capacity” double
The percentage capacity of the device where 100% means the device has the same charge potential as when it was manufactured.
Owner: UpDevice
Flags: Read / Write
Allowed values: [0,100]
Default value: 100
Since: 0.9.0
“charge-cycles”
property “charge-cycles” int
The number of charge cycles for the battery, or -1 if unknown or non-applicable.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= -1
Default value: -1
Since: 1.0
“charge-end-threshold”
property “charge-end-threshold” guint
The charge end threshold of a battery.
Owner: UpDevice
Flags: Read / Write
Allowed values: <= 100
Default value: 100
Since: 1.90.5
“charge-start-threshold”
property “charge-start-threshold” guint
The charge start threshold of a battery.
Owner: UpDevice
Flags: Read / Write
Allowed values: <= 100
Default value: 0
Since: 1.90.5
“charge-threshold-enabled”
property “charge-threshold-enabled” gboolean
The charge threshold of a battery is enabled, or false if unknown or non-applicable.
Owner: UpDevice
Flags: Read / Write
Default value: FALSE
Since: 1.90.5
“charge-threshold-supported”
property “charge-threshold-supported” gboolean
The charge threshold of a battery is supported, or false if unknown or non-applicable.
Owner: UpDevice
Flags: Read / Write
Default value: FALSE
Since: 1.90.5
“energy”
property “energy” double
The energy left in the device. Measured in mWh.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.0
“energy-empty”
property “energy-empty” double
The energy the device will have when it is empty. This is usually zero. Measured in mWh.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.0
“energy-full”
property “energy-full” double
The amount of energy when the device is fully charged. Measured in mWh.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.0
“energy-full-design”
property “energy-full-design” double
The amount of energy when the device was brand new. Measured in mWh.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.0
“energy-rate”
property “energy-rate” double
The rate of discharge or charge. Measured in mW.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.0
“has-history”
property “has-history” gboolean
If the device has history data that might be useful.
Owner: UpDevice
Flags: Read / Write
Default value: FALSE
Since: 0.9.0
“has-statistics”
property “has-statistics” gboolean
If the device has statistics data that might be useful.
Owner: UpDevice
Flags: Read / Write
Default value: FALSE
Since: 0.9.0
“icon-name”
property “icon-name” char *
The icon name, following the Icon Naming Speficiation
Owner: UpDevice
Flags: Read / Write
Default value: NULL
Since: 1.0
“is-present”
property “is-present” gboolean
If the device is present, as some devices like laptop batteries can be removed, leaving an empty bay that is still technically a device.
Owner: UpDevice
Flags: Read / Write
Default value: FALSE
Since: 0.9.0
“is-rechargeable”
property “is-rechargeable” gboolean
If the device has a rechargable battery.
Owner: UpDevice
Flags: Read / Write
Default value: FALSE
Since: 0.9.0
“kind”
property “kind” guint
The device kind, e.g. UP_DEVICE_KIND_KEYBOARD
.
Owner: UpDevice
Flags: Read / Write
Allowed values: <= 29
Default value: 0
Since: 0.9.0
“luminosity”
property “luminosity” double
The current luminosity of the device.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.19
“model”
property “model” char *
The model of the device.
Owner: UpDevice
Flags: Read / Write
Default value: NULL
Since: 0.9.0
“native-path”
property “native-path” char *
The native path of the device, useful for direct device access.
Owner: UpDevice
Flags: Read / Write
Default value: NULL
Since: 0.9.0
“online”
property “online” gboolean
If the device is online, i.e. connected.
Owner: UpDevice
Flags: Read / Write
Default value: FALSE
Since: 0.9.0
“percentage”
property “percentage” double
The percentage charge of the device. Note that if the battery level property
is something other than UP_DEVICE_LEVEL_NONE
, then this percentage is an
approximation, and should not be used a number to display to the user.
Owner: UpDevice
Flags: Read / Write
Allowed values: [0,100]
Default value: 100
Since: 0.9.0
“power-supply”
property “power-supply” gboolean
If the device is powering the system.
Owner: UpDevice
Flags: Read / Write
Default value: FALSE
Since: 0.9.0
“serial”
property “serial” char *
The serial number of the device.
Owner: UpDevice
Flags: Read / Write
Default value: NULL
Since: 0.9.0
“state”
property “state” guint
The state the device is in at this time, e.g. UP_DEVICE_STATE_EMPTY
.
Owner: UpDevice
Flags: Read / Write
Allowed values: <= 7
Default value: 0
Since: 0.9.0
“technology”
property “technology” guint
The battery technology e.g. UP_DEVICE_TECHNOLOGY_LITHIUM_ION
.
Owner: UpDevice
Flags: Read / Write
Allowed values: <= 7
Default value: 0
Since: 0.9.0
“temperature”
property “temperature” double
The temperature of the device in degrees Celsius.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.22
“time-to-empty”
property “time-to-empty” gint64
The amount of time until the device is empty.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.0
“time-to-full”
property “time-to-full” gint64
The amount of time until the device is fully charged.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.0
“update-time”
property “update-time” guint64
The last time the device was updated.
Owner: UpDevice
Flags: Read / Write
Default value: 0
Since: 0.9.0
“vendor”
property “vendor” char *
The vendor of the device.
Owner: UpDevice
Flags: Read / Write
Default value: NULL
Since: 0.9.0
“voltage”
property “voltage” double
The current voltage of the device.
Owner: UpDevice
Flags: Read / Write
Allowed values: >= 0
Default value: 0
Since: 0.9.0
“warning-level”
property “warning-level” guint
The warning level e.g. UP_DEVICE_LEVEL_CRITICAL
.
Owner: UpDevice
Flags: Read / Write
Allowed values: <= 9
Default value: 0
Since: 1.0