summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2008-11-11 11:36:25 -0500
committerDavid Zeuthen <davidz@redhat.com>2008-11-11 11:36:25 -0500
commitd34ad4346454b9bf03cd60a5d65fed558e691f43 (patch)
treee0a09d1ac3e2d27f5d9630805b5831c51b3fcea1 /src
parentfca50189968bd0abc2973b34867cee22268d8919 (diff)
document how to access the D-Bus service with examples
Diffstat (limited to 'src')
-rw-r--r--src/org.freedesktop.DeviceKit.Power.Device.xml126
-rw-r--r--src/org.freedesktop.DeviceKit.Power.xml29
2 files changed, 150 insertions, 5 deletions
diff --git a/src/org.freedesktop.DeviceKit.Power.Device.xml b/src/org.freedesktop.DeviceKit.Power.Device.xml
index 8148665..92beb57 100644
--- a/src/org.freedesktop.DeviceKit.Power.Device.xml
+++ b/src/org.freedesktop.DeviceKit.Power.Device.xml
@@ -8,14 +8,130 @@
<doc:doc>
<doc:description>
<doc:para>
- TODO: some explanatory text etc. etc. Mention that we
- collect history to provide more precise values of
- time-to-empty, time-to-full. Go into detail
- with the algorithms.
+ Objects implementing this interface are usually discovered through
+ the <doc:tt>org.freedesktop.DeviceKit.Power</doc:tt> interface on
+ the <doc:tt>/org/freedesktop/DeviceKit/Power</doc:tt> object on
+ the D-Bus system bus service with the well-known
+ name <doc:tt>org.freedesktop.DeviceKit.Power</doc:tt> using
+ the
+ <doc:ref type="method" to="Power.EnumerateDevices">EnumerateDevices</doc:ref>
+ method.
+ </doc:para>
+ <doc:para>
+ <doc:example language="shell" title="simple example">
+ <doc:code>
+$ dbus-send --print-reply \
+ --system \
+ --dest=org.freedesktop.DeviceKit.Power \
+ /org/freedesktop/DeviceKit/Power/devices/battery_BAT0 \
+ org.freedesktop.DBus.Properties.GetAll \
+ string:org.freedesktop.DeviceKit.Power.Device
+
+method return sender=:1.386 -> dest=:1.477 reply_serial=2
+ array [
+ dict entry(
+ string "native-path"
+ variant string "/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/PNP0C0A:00/power_supply/BAT0"
+ )
+ dict entry(
+ string "vendor"
+ variant string "SONY"
+ )
+ dict entry(
+ string "model"
+ variant string "42T4568"
+ )
+ dict entry(
+ string "serial"
+ variant string "4179"
+ )
+ dict entry(
+ string "update-time"
+ variant uint64 1226417875
+ )
+ dict entry(
+ string "type"
+ variant string "battery"
+ )
+ dict entry(
+ string "power-supply"
+ variant boolean true
+ )
+ dict entry(
+ string "has-history"
+ variant boolean true
+ )
+ dict entry(
+ string "has-statistics"
+ variant boolean true
+ )
+ dict entry(
+ string "online"
+ variant boolean false
+ )
+ dict entry(
+ string "energy"
+ variant double 72.85
+ )
+ dict entry(
+ string "energy-empty"
+ variant double 0
+ )
+ dict entry(
+ string "energy-full"
+ variant double 74.55
+ )
+ dict entry(
+ string "energy-full-design"
+ variant double 74.88
+ )
+ dict entry(
+ string "energy-rate"
+ variant double 0
+ )
+ dict entry(
+ string "voltage"
+ variant double 16.415
+ )
+ dict entry(
+ string "time-to-empty"
+ variant int64 0
+ )
+ dict entry(
+ string "time-to-full"
+ variant int64 0
+ )
+ dict entry(
+ string "percentage"
+ variant double 97.7197
+ )
+ dict entry(
+ string "is-present"
+ variant boolean true
+ )
+ dict entry(
+ string "state"
+ variant string "fully-charged"
+ )
+ dict entry(
+ string "is-rechargeable"
+ variant boolean true
+ )
+ dict entry(
+ string "capacity"
+ variant double 100
+ )
+ dict entry(
+ string "technology"
+ variant string "lithium-ion"
+ )
+ ]
+ </doc:code>
+ </doc:example>
</doc:para>
<doc:para>
Unless otherwise noted, an empty string or the value 0 in a
- property means not set.
+ property on this interface means not set.
</doc:para>
</doc:description>
</doc:doc>
diff --git a/src/org.freedesktop.DeviceKit.Power.xml b/src/org.freedesktop.DeviceKit.Power.xml
index ee29b45..3070c30 100644
--- a/src/org.freedesktop.DeviceKit.Power.xml
+++ b/src/org.freedesktop.DeviceKit.Power.xml
@@ -4,6 +4,35 @@
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<interface name="org.freedesktop.DeviceKit.Power">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The DeviceKit-power service is available via the system message
+ bus. To access the service, use
+ the <doc:tt>org.freedesktop.DeviceKit.Power</doc:tt> interface on
+ the <doc:tt>/org/freedesktop/DeviceKit/Power</doc:tt> object on
+ the D-Bus system bus service with the well-known
+ name <doc:tt>org.freedesktop.DeviceKit.Power</doc:tt>.
+ </doc:para>
+ <doc:para>
+ <doc:example language="shell" title="simple example">
+ <doc:code>
+$ dbus-send --print-reply \
+ --system \
+ --dest=org.freedesktop.DeviceKit.Power \
+ /org/freedesktop/DeviceKit/Power \
+ org.freedesktop.DeviceKit.Power.EnumerateDevices
+
+method return sender=:1.386 -> dest=:1.451 reply_serial=2
+ array [
+ object path "/org/freedesktop/DeviceKit/Power/devices/line_power_AC"
+ object path "/org/freedesktop/DeviceKit/Power/devices/battery_BAT0"
+ ]
+ </doc:code>
+ </doc:example>
+ </doc:para>
+ </doc:description>
+ </doc:doc>
<!-- ************************************************************ -->