- From: Max Froumentin via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 10 Dec 2009 11:06:14 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/system-info In directory hutz:/tmp/cvs-serv13800 Modified Files: Overview.html Log Message: added new interface describing any power source Index: Overview.html =================================================================== RCS file: /sources/public/2009/dap/system-info/Overview.html,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Overview.html 9 Dec 2009 13:58:58 -0000 1.29 +++ Overview.html 10 Dec 2009 11:06:12 -0000 1.30 @@ -155,6 +155,8 @@ </dd> </dl> + <dt title="[NoInterfaceObject] interface SystemState" class="idl"> + </dt> <dl title="[NoInterfaceObject] interface Options" class="idl"> <dt>attribute unsigned int timeout</dt> @@ -191,10 +193,10 @@ <section> <h4>ECMAScript Example</h4> <pre class="sh_javascript example"> -var success = function(power.level) { +var success = function(power) { alert("Low battery level: "+power.level); } -navigator.device.system.watch("power:batteryLevel",success,null,{lowThreshold:0.2});</pre> +navigator.device.system.watch("power:state",success,null,{lowThreshold:0.2});</pre> </section> @@ -203,24 +205,26 @@ <p>Properties that can be obtained or watched through the appropriate functions</p> <section> - <h5>Battery Level</h5> + <h5>General Power State</h5> <ul> - <li>URI: <code>http://www.w3.org/2009/dap/SysInfo/Power#batteryLevel</code></li> - <li>Short Name: <code>power:batteryLevel</code></li> + <li>URI: <code>http://www.w3.org/2009/dap/SysInfo/PowerState</code></li> + <li>Short Name: <code>power:state</code></li> <li>Value type: <a>PowerState</a></li> <li>Corresponding DCO property: <a href="">@@</a></li> </ul> - <dl title="[NoInterfaceObject] interface PowerState" class="idl"> - <dt>attribute float level</dt> + <dl title="[NoInterfaceObject] interface PowerState : SystemState" class="idl"> + <dt>attribute float? level</dt> <dd> - Specifies how much the internal power source - remains, scaled from 0 to 1. A value of 0 means that - the battery level is lowest before the system stops, - and 1 indicates that the system's charge is maximal. + Specifies how much the internal power source remains, + scaled from 0 to 1. A value of 0 means that the + battery level is lowest before the system stops, and 1 + indicates that the system's charge is maximal. Any + threshold parameter used in a <a>watch</a> function to + monitor this property applies to this attribute. </dd> - <dt>attribute unsigned int timeRemaining</dt> + <dt>attribute unsigned int? timeRemaining</dt> <dd> Represents the estimated time remaining (in milliseconds) before the system enters shutdown @@ -236,13 +240,34 @@ whether the device is plugged into an external power source. </dd> + <dt>attribute sequence<PowerSource> sources</dt> + <dd>A sequence representing all the power sources connected to the device</dd> </dl> </section> - <p class="note">A future version of this specification may - provide more specific info for each battery, by adding - members to this interface, e.g. <a>attribute - SingleBatteryInfo batteries[]</a></p> + <dl title="[NoInterfaceObject] interface PowerSource" class="idl"> + <dt>const unsigned short BATTERY=0</dt> + <dd>In <code>type</code> has this value, then this power source is a battery</dd> + + <dt>const unsigned short EXTERNAL=1</dt> + <dd>In <code>type</code> has this value, then this power source is external</dd> + + <dt>attribute unsigned int type</dt> + <dd>One of the constants defined in this interface, reflecting the state of this source</dd> + + <dt>attribute boolean? charging</dt> + <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, otherwise if this source is charging, this value MUST be <code>true</code>, otherwise <code>false</code>.</dd> + + <dt>attribute float? percentRemaining</dt> + <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, other wise it MUST indicate how much of the battery capacity is left, on a range of 0 to 1.</dd> + + <dt>attribute unsigned int? timeRemaining</dt> + <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, other +wise if this source is charging, this value MUST reflect the estimated time in milliseconds until the battery's <code>percentRemaining</code> value reaches 1. If this source is not charging then this value MUST reflect the estimated time in milliseconds until the battery's <code>percentRemaining</code> value reaches 0.</dd> + + <dt>attribute float? capacity</dt> + <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, otherwise it MUST reflect this battery's capacity, expressed in ampere-hours</dd> + </dl> </section> </section>
Received on Thursday, 10 December 2009 11:06:23 UTC