~ubuntu-branches/ubuntu/karmic/devicekit-power/karmic-proposed

« back to all changes in this revision

Viewing changes to doc/dbus/org.freedesktop.DeviceKit.Power.Device.ref.xml

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-01-08 11:43:09 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090108114309-sz25jx234bgww096
Tags: 003-0ubuntu1
* New upstream version 003.
* debian/control: Bump libdevkit-gobject-dev build dependency.
* debian/contro: Replace Debian's Vcs-Svn: with our Vcs-Bzr: branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
    <synopsis><link linkend="Device.Refresh">Refresh</link>       ()
13
13
<link linkend="Device.GetHistory">GetHistory</link>    (in  's'      type,
14
14
               in  'u'      timespan,
 
15
               in  'u'      resolution,
15
16
               out 'a(uds)' data)
16
17
<link linkend="Device.GetStatistics">GetStatistics</link> (in  's'      type,
17
18
               out 'a(dd)'  data)
39
40
<link linkend="Device:update-time">'update-time'</link>        read      't'
40
41
<link linkend="Device:type">'type'</link>               read      's'
41
42
<link linkend="Device:power-supply">'power-supply'</link>       read      'b'
 
43
<link linkend="Device:has-history">'has-history'</link>        read      'b'
 
44
<link linkend="Device:has-statistics">'has-statistics'</link>     read      'b'
42
45
<link linkend="Device:online">'online'</link>             read      'b'
43
46
<link linkend="Device:energy">'energy'</link>             read      'd'
44
47
<link linkend="Device:energy-empty">'energy-empty'</link>       read      'd'
45
48
<link linkend="Device:energy-full">'energy-full'</link>        read      'd'
46
49
<link linkend="Device:energy-full-design">'energy-full-design'</link> read      'd'
47
50
<link linkend="Device:energy-rate">'energy-rate'</link>        read      'd'
 
51
<link linkend="Device:voltage">'voltage'</link>            read      'd'
48
52
<link linkend="Device:time-to-empty">'time-to-empty'</link>      read      'x'
49
53
<link linkend="Device:time-to-full">'time-to-full'</link>       read      'x'
50
54
<link linkend="Device:percentage">'percentage'</link>         read      'd'
60
64
    <para>
61
65
      
62
66
        <para>
63
 
          TODO: some explanatory text etc. etc. Mention that we
64
 
          collect history to provide more precise values of
65
 
          time-to-empty, time-to-full. Go into detail
66
 
          with the algorithms.
 
67
          Objects implementing this interface are usually discovered through
 
68
          the <literal>org.freedesktop.DeviceKit.Power</literal> interface on
 
69
          the <literal>/org/freedesktop/DeviceKit/Power</literal> object on
 
70
          the D-Bus system bus service with the well-known
 
71
          name <literal>org.freedesktop.DeviceKit.Power</literal> using
 
72
          the
 
73
          <link linkend="Power.EnumerateDevices"><function>EnumerateDevices</function></link>
 
74
          method.
 
75
        </para>
 
76
        <para>
 
77
          <informalexample>
 
78
            <programlisting>
 
79
$ dbus-send --print-reply \
 
80
            --system \
 
81
            --dest=org.freedesktop.DeviceKit.Power \
 
82
            /org/freedesktop/DeviceKit/Power/devices/battery_BAT0 \
 
83
            org.freedesktop.DBus.Properties.GetAll \
 
84
            string:org.freedesktop.DeviceKit.Power.Device
 
85
 
 
86
method return sender=:1.386 -&gt; dest=:1.477 reply_serial=2
 
87
   array [
 
88
      dict entry(
 
89
         string "native-path"
 
90
         variant             string "/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/PNP0C0A:00/power_supply/BAT0"
 
91
      )
 
92
      dict entry(
 
93
         string "vendor"
 
94
         variant             string "SONY"
 
95
      )
 
96
      dict entry(
 
97
         string "model"
 
98
         variant             string "42T4568"
 
99
      )
 
100
      dict entry(
 
101
         string "serial"
 
102
         variant             string "4179"
 
103
      )
 
104
      dict entry(
 
105
         string "update-time"
 
106
         variant             uint64 1226417875
 
107
      )
 
108
      dict entry(
 
109
         string "type"
 
110
         variant             string "battery"
 
111
      )
 
112
      dict entry(
 
113
         string "power-supply"
 
114
         variant             boolean true
 
115
      )
 
116
      dict entry(
 
117
         string "has-history"
 
118
         variant             boolean true
 
119
      )
 
120
      dict entry(
 
121
         string "has-statistics"
 
122
         variant             boolean true
 
123
      )
 
124
      dict entry(
 
125
         string "online"
 
126
         variant             boolean false
 
127
      )
 
128
      dict entry(
 
129
         string "energy"
 
130
         variant             double 72.85
 
131
      )
 
132
      dict entry(
 
133
         string "energy-empty"
 
134
         variant             double 0
 
135
      )
 
136
      dict entry(
 
137
         string "energy-full"
 
138
         variant             double 74.55
 
139
      )
 
140
      dict entry(
 
141
         string "energy-full-design"
 
142
         variant             double 74.88
 
143
      )
 
144
      dict entry(
 
145
         string "energy-rate"
 
146
         variant             double 0
 
147
      )
 
148
      dict entry(
 
149
         string "voltage"
 
150
         variant             double 16.415
 
151
      )
 
152
      dict entry(
 
153
         string "time-to-empty"
 
154
         variant             int64 0
 
155
      )
 
156
      dict entry(
 
157
         string "time-to-full"
 
158
         variant             int64 0
 
159
      )
 
160
      dict entry(
 
161
         string "percentage"
 
162
         variant             double 97.7197
 
163
      )
 
164
      dict entry(
 
165
         string "is-present"
 
166
         variant             boolean true
 
167
      )
 
168
      dict entry(
 
169
         string "state"
 
170
         variant             string "fully-charged"
 
171
      )
 
172
      dict entry(
 
173
         string "is-rechargeable"
 
174
         variant             boolean true
 
175
      )
 
176
      dict entry(
 
177
         string "capacity"
 
178
         variant             double 100
 
179
      )
 
180
      dict entry(
 
181
         string "technology"
 
182
         variant             string "lithium-ion"
 
183
      )
 
184
   ]
 
185
            </programlisting>
 
186
          </informalexample>
67
187
        </para>
68
188
        <para>
69
189
          Unless otherwise noted, an empty string or the value 0 in a
70
 
          property means not set.
 
190
          property on this interface means not set.
71
191
        </para>
72
192
      
73
193
    </para>
78
198
          </para>
79
199
        <variablelist role="params"/><refsect3><title>Errors</title><variablelist role="errors"><varlistentry><term><parameter>org.freedesktop.DeviceKit.Power.Device.GeneralError</parameter>:</term><listitem><simpara>if an error occured while refreshing</simpara></listitem></varlistentry></variablelist></refsect3><refsect3><title>Permissions</title><para role="permission">Callers need the org.freedesktop.devicekit.power.refresh-power-source authorization</para></refsect3><refsect2><title><anchor role="function" id="Device.GetHistory"/>GetHistory ()</title><indexterm><primary>GetHistory</primary><secondary>Device</secondary></indexterm><programlisting>GetHistory (in  's'      type,
80
200
            in  'u'      timespan,
 
201
            in  'u'      resolution,
81
202
            out 'a(uds)' data)</programlisting></refsect2>
82
203
          <para>
83
204
            Gets history for the power device that is persistent across reboots.
84
205
          </para>
85
206
        <variablelist role="params"><varlistentry><term><parameter>type</parameter>:</term><listitem><simpara>The type of history.
86
 
        Valid types are rate or charge.</simpara></listitem></varlistentry><varlistentry><term><parameter>timespan</parameter>:</term><listitem><simpara>The amount of data to return in seconds, or 0 for all.</simpara></listitem></varlistentry><varlistentry><term><parameter>data</parameter>:</term><listitem><simpara>
 
207
        Valid types are <literal>rate</literal> or <literal>charge</literal>.</simpara></listitem></varlistentry><varlistentry><term><parameter>timespan</parameter>:</term><listitem><simpara>The amount of data to return in seconds, or 0 for all.</simpara></listitem></varlistentry><varlistentry><term><parameter>resolution</parameter>:</term><listitem><simpara>
 
208
            The approximate number of points to return.
 
209
            A higher resolution is more accurate, at the expense of plotting speed.
 
210
          </simpara></listitem></varlistentry><varlistentry><term><parameter>data</parameter>:</term><listitem><simpara>
87
211
            The history data for the power device, if the device supports history.
88
212
            Data is ordered from the earliest in time, to the newest data point.
89
213
            Each element contains the following members:
90
214
            <para><itemizedlist><listitem><emphasis role="bold">time: </emphasis>
91
 
                  The time value in seconds from the gettimeofday() method.
 
215
                  The time value in seconds from the <literal>gettimeofday()</literal> method.
92
216
                </listitem><listitem><emphasis role="bold">value: </emphasis>
93
217
                  The data value, for instance the rate in W or the charge in %.
94
218
                </listitem><listitem><emphasis role="bold">state: </emphasis>
95
 
                  The state of the device, for instance charging or
96
 
                  discharging.
 
219
                  The state of the device, for instance <literal>charging</literal> or
 
220
                  <literal>discharging</literal>.
97
221
                </listitem></itemizedlist></para>
98
222
        </simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Device.GetStatistics"/>GetStatistics ()</title><indexterm><primary>GetStatistics</primary><secondary>Device</secondary></indexterm><programlisting>GetStatistics (in  's'     type,
99
223
               out 'a(dd)' data)</programlisting></refsect2>
102
226
            to show on a graph in the session.
103
227
          </para>
104
228
        <variablelist role="params"><varlistentry><term><parameter>type</parameter>:</term><listitem><simpara>The mode for the statistics.
105
 
        Valid types are charging or discharging.</simpara></listitem></varlistentry><varlistentry><term><parameter>data</parameter>:</term><listitem><simpara>
 
229
        Valid types are <literal>charging</literal> or <literal>discharging</literal>.</simpara></listitem></varlistentry><varlistentry><term><parameter>data</parameter>:</term><listitem><simpara>
106
230
            The statistics data for the power device.
107
231
            Each element contains the following members:
108
232
            <para><itemizedlist><listitem><emphasis role="bold">value: </emphasis>
217
341
          </para>
218
342
    <variablelist role="params"/>
219
343
    <refsect2>
 
344
      <title><anchor role="function" id="Device:has-history"/>The "has-history" property</title>
 
345
      <indexterm>
 
346
        <primary>has-history</primary>
 
347
        <secondary>Device</secondary>
 
348
      </indexterm>
 
349
      <programlisting>'has-history'  read      'b'
 
350
</programlisting>
 
351
    </refsect2>
 
352
    <para>
 
353
            If the power device has history.
 
354
          </para>
 
355
    <variablelist role="params"/>
 
356
    <refsect2>
 
357
      <title><anchor role="function" id="Device:has-statistics"/>The "has-statistics" property</title>
 
358
      <indexterm>
 
359
        <primary>has-statistics</primary>
 
360
        <secondary>Device</secondary>
 
361
      </indexterm>
 
362
      <programlisting>'has-statistics'  read      'b'
 
363
</programlisting>
 
364
    </refsect2>
 
365
    <para>
 
366
            If the power device has statistics.
 
367
          </para>
 
368
    <variablelist role="params"/>
 
369
    <refsect2>
220
370
      <title><anchor role="function" id="Device:online"/>The "online" property</title>
221
371
      <indexterm>
222
372
        <primary>online</primary>
329
479
      </para>
330
480
    <variablelist role="params"/>
331
481
    <refsect2>
 
482
      <title><anchor role="function" id="Device:voltage"/>The "voltage" property</title>
 
483
      <indexterm>
 
484
        <primary>voltage</primary>
 
485
        <secondary>Device</secondary>
 
486
      </indexterm>
 
487
      <programlisting>'voltage'  read      'd'
 
488
</programlisting>
 
489
    </refsect2>
 
490
    <para>
 
491
            Voltage in the Cell or being recorded by the meter.
 
492
          </para>
 
493
    <variablelist role="params"/>
 
494
    <refsect2>
332
495
      <title><anchor role="function" id="Device:time-to-empty"/>The "time-to-empty" property</title>
333
496
      <indexterm>
334
497
        <primary>time-to-empty</primary>
339
502
    </refsect2>
340
503
    <para>
341
504
            Number of seconds until the power source is considered empty.
342
 
            Is set to -1 if unknown.
 
505
            Is set to 0 if unknown.
343
506
          </para>
344
507
    <para>
345
508
            This property is only valid if the property
358
521
    </refsect2>
359
522
    <para>
360
523
            Number of seconds until the power source is considered full.
361
 
            Is set to -1 if unknown.
 
524
            Is set to 0 if unknown.
362
525
          </para>
363
526
    <para>
364
527
            This property is only valid if the property