- From: Max Froumentin via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 07 Dec 2009 16:38:03 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/system-info
In directory hutz:/tmp/cvs-serv26960
Modified Files:
Overview.html
Log Message:
changed API structure and did CPU, thermometer and fan
Index: Overview.html
===================================================================
RCS file: /sources/public/2009/dap/system-info/Overview.html,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- Overview.html 3 Dec 2009 13:55:30 -0000 1.23
+++ Overview.html 7 Dec 2009 16:38:01 -0000 1.24
@@ -23,7 +23,8 @@
</head>
<body>
<section id='abstract'>
- A proposal for the Device API and Policy Working Group System
+ A proposal for the Device <abbr title="Application Programming
+ Interface">API</abbr> and Policy Working Group System
Information and Events API.
</section>
<section class='introduction'>
@@ -77,7 +78,7 @@
</dl>
</dd>
- <dt>PendingOp watch(DOMString propertyId, SuccessCB successCallback, optional ErrorCB? errorCallback, optional in Options? options)</dt>
+ <dt>PendingOp watch(DOMString propertyId, SuccessCB successCallback, optional ErrorCB? errorCallback, optional Options? options)</dt>
<dd>The <code>watch</code> function allows tracking the change
of one or several system properties. When called, it MUST
immediately return and then asynchronously start a watch process
@@ -114,20 +115,56 @@
<dd>An object containing the various options for fetching the properties requested</dd>
</dl>
</dd>
+ <dt>PendingOp set(DOMString propertyId, SuccessCB successCallback, optional ErrorCB? errorCallback, optional Options? options)</dt>
+ <dd>
+ The <code>set</code> function modifies the current value
+ of of a system property. When called, the function MUST
+ immediately return and asynchronously attempt to set the
+ requested state of the values passed to the filter. If it
+ is successful the success callback is invoked and is
+ passed a <code>SystemState</code> object containing the
+ requested information. If an error occurs, or if the
+ system does not allow the value to be modified, then the
+ <code>errorCallback</code> function is invoked and is
+ passed a <code>PowerError</code> object indicating the
+ cause of error.
+
+ <dl class="parameters">
+ <dt>DOMString propertyId</dt>
+ <dd>The URI or curie of the property to retrieve.</dd>
+ <dt>SuccessCB successCallback</dt>
+ <dd>function called when the property have been successfully modified</dd>
+ <dt>optional ErrorCB? errorCallback</dt>
+ <dd>function called when an error occurred while modifying the property</dd>
+ </dl>
+ </dd>
</dl>
<dl title="[NoInterfaceObject] interface Options" class="idl">
+ <dt>attribute unsigned int timeout</dt>
+
+ <dd>The number of milliseconds beyond which the operation
+ must be interrupted and the <code>cancel</code> method of
+ the <code>PendingOp</code> object must be called.</dd>
+
<dt>attribute double highThreshold</dt>
- <dd>This attribute has no effect on the <code>get</code> method. On the <code>watch</code> method, it indicates that the successCallback MUST only
- be triggered if the property is a number and its value is greater than or equal this number.</dd>
+ <dd>This attribute has no effect on the <code>get</code>
+ method. On the <code>watch</code> method, it indicates that
+ the successCallback MUST only be triggered if the property
+ is a number and its value is greater than or equal this
+ number.</dd>
<dt>attribute double lowThreshold</dt>
- <dd>This attribute has no effect on the <code>get</code> method. On the <code>watch</code> method, it indicates that the successCallback MUST only
- be triggered if the property is a number and its value is lower than or equal this number.</dd>
+ <dd>This attribute has no effect on the <code>get</code>
+ method. On the <code>watch</code> method, it indicates that
+ the successCallback MUST only be triggered if the property
+ is a number and its value is lower than or equal this
+ number.</dd>
</dl>
</section>
+
<!--****************** Power ************************************************-->
<section id="power">
<h3>Power</h3>
@@ -137,10 +174,10 @@
source, as well as its charge level.</p>
<section>
- <h3>Example</h3>
+ <h4>ECMAScript Example</h4>
<pre class="example">
-var success = function(power) {
- alert("Low battery level: "+power.batteryLevel);
+var success = function(power.level) {
+ alert("Low battery level: "+power.level);
}
navigator.device.system.watch("power:batteryLevel",success,null,{lowThreshold:0.2});</pre>
</section>
@@ -148,397 +185,150 @@
<section>
<h4>Properties</h4>
- <dl>
- <dt>Battery Level</dt>
- <dd>URI: <code>http://www.w3.org/2009/dap/SysInfo/Power#batteryLevel</code><br/>
- Curie: <code>power:batteryLevel</code><br/>
- Corresponding DCO property: <a href="http://www.w3.org/TR/dcontology/hardware.html#batteryLevel">batteryLevel</a></dd>
- <dd>Specifies that the resulting <code>PowerState</code> object MUST contain a <code>batteryLevel</code> value.</dd>
+ <p>Properties that can be obtained or watched through the appropriate functions</p>
+ <section>
+ <h5>Battery Level</h5>
+ <ul>
+ <li>URI: <code>http://www.w3.org/2009/dap/SysInfo/Power#batteryLevel</code></li>
+ <li>Curie: <code>power:batteryLevel</code></li>
+ <li>Type of returned value: <code>PowerState</code></li>
+ <li>Corresponding DCO property: <a href="">@@</a></li>
+ </ul>
- <dt>Time Remaining</dt>
- <dd>URI: <code>http://www.w3.org/2009/dap/SysInfo/Power#timeRemaining</code><br/>
- Curie: <code>power:timeRemaining</code></dd>
- <dd>Specifies that the resulting <code>PowerState</code> object MUST contain a <code>timeRemaining</code> value.</dd>
+ <dd>
+ <dl title="[NoInterfaceObject] interface PowerState" 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.
+ </dd>
- <dt>External Power Source</dt>
- <dd>URI: <code>http://www.w3.org/2009/dap/SysInfo/Power#externalSource</code><br/>
- Curie: <code>power:externalSource</code></dd>
- <dd>Specifies that the resulting <code>PowerState</code> object MUST contain a <code>externalSource</code> value.</dd>
- </dl>
- </section>
+ <dt>attribute unsigned int timeRemaining</dt>
+ <dd>
+ Specifies that the success callback parameter MUST be an
+ <code>unsigned int</code> value representing the
+ estimated time remaining (in milliseconds) before the
+ system enters shutdown mode. If
+ <code>usingExternalPowerSource</code> is true and
+ <code>rate</code> is greater than or equal to 0, this
+ value MUST be 0, meaning that there is essentially
+ infinite time remaining.
+ </dd>
- <section>
- <h4>PowerState</h4>
- <dl title='interface PowerState' class='idl'>
+ <dt>attribute boolean externalSource</dt>
+ <dd>
+ Specifies that the success callback parameter indicates
+ whether the device is plugged into an external power
+ source.
+ </dd>
+ </dl>
+ </dd>
+ </section>
- <dt>readonly attribute boolean usingExternalPowerSource</dt>
- <dd>This attribute must be
- <code>true</code> if the device is plugged into an external
- power source. Otherwise, it must be <code>false</code>. If the
- correct value cannot be obtained, or if the device does not have
- an internal power source, an implementation MUST return
- <code>true</code>.</dd>
+ <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. <code>attribute
+ SingleBatteryInfo batteries[]</code></p>
+ </section>
- <dt>readonly attribute double powerLevel</dt>
- <dd>The <code>powerLevel</code> attribute MUST indicate what
- percent of the internal power source remains. The maximum value
- is 100, the minimum value is 0. If the value cannot be obtained,
- or if the device does not have an internal power source, the
- attribute value must be 0. </dd>
+ </section>
- <!--dt>readonly attribute int rate</dt>
- <dd>The <code>rate</code> attribute denotes the current rate
- (mW) of power change for the internal power sources. Discharge
- rate is a negative value. Charge rate is a positive value.
- </dd-->
+ <!--******************* Internal Sensors *******************************************-->
+ <section>
+ <h3>Internal Sensors</h3>
+ <p>This section defines a set of APIs that expose sensor
+ information pertaining to the internal state of the
+ device. For example, <abbr title="Central Processing
+ Unit">CPU</abbr> load, cooling fan speed, or temperature.</p>
+
+ <section>
+ <h4>ECMAScript Example</h4>
+ <pre class="example">
+var success = function(cpu) {
+ document.getElementById("cpuIndicator").innerHTML=("CPU: "+cpu.load);
+}
+navigator.device.system.watch("internal:CPULoad",success,null);</pre>
+ </section>
+
+ <section>
+ <h4>Properties</h4>
- <dt>readonly attribute unsigned long timeRemaining</dt>
- <dd>The <code>timeRemaining </code>attribute should indicate the
- estimated time remaining (in milliseconds) at the current rate before
- the system enters shutdown mode. If
- <code>usingExternalPowerSource</code> is true and
- <code>rate</code> is greater than or equal to 0, this value MUST
- be 0, meaning that there is essentially infinite time
- remaining. If <code>usingExternalPowerSource</code> is true and
- <code>rate </code> is less than 0 (indicating that even though
- the system is plugged into an external power source, the battery
- is still being drained), <code>timeRemainging </code>should be
- greater than 0. </dd>
+ <section>
+ <h5>CPU State</h5>
+ <ul>
+ <li>URI: <code>http://www.w3.org/2009/dap/sysinfo/internal#CPULoad</code></li>
+ <li>Curie: <code>internal:CPULoad</code></li>
+ <li>Corresponding DCO property: <a href="">@@</a></li>
+ <li>Type of returned value: <code>CpuLoad</code></li>
+ </ul>
- </dl>
- </section>
- <section>
- <h4>PowerError</h4>
- <dl title='interface PowerError : GenericError' class='idl'>
- <dt>readonly attribute unsigned short UNKNOWN_ERROR</dt>
- <dd><code>UNKNOWN_ERROR</code> (numeric value 0): The
- implementation failed to retrieve either power source or power
- level information for an unknown reason.</dd>
+ <dl title="[NoInterfaceObject] interface PowerState" class="idl">
+ <dt>attribute float load</dt>
+ <dd>
+ This attribute indicates the current CPU load, as a
+ number between 0.0 and 1.0, representing the minimum and
+ maximum values allowed by this system. On devices that
+ have multiple CPUs, this value should reflect the
+ average load of the individual CPUs.
+ </dd>
+ </dl>
+ </section>
- <dt>readonly attribute unsigned short PERMISSION_DENIED</dt>
- <dd><code>PERMISSION_DENIED</code> (numerice value 1): The
- implementation failed to retrieve either power source or power
- level information because the application context does not
- have permission to use the Platform <abbr title="Application
- Programming Interface">API</abbr>.</dd>
+ <section>
+ <h5>Internal Thermometer</h5>
+ <ul>
+ <li>URI: <code>http://www.w3.org/2009/dap/sysinfo/internal#temperature</code></li>
+ <li>Curie: <code>internal:temperature</code></li>
+ <li>Type of returned value: <code>Temperature</code></li>
+ <li>Corresponding DCO property: <a href="">@@</a></li>
+ </ul>
- <dt>readonly attribute unsigned short INFORMATION_UNAVAILABLE</dt>
- <dd><code>INFORMATION_UNAVAILABLE</code> (numeric value 2):
- The implementation failed to retrieve power information
- because the information was unavailable. For example, this
- error would be raised if the system currently does not have an
- internal power source, or if the system does provide this
- information.</dd>
+ <dl title="[NoInterfaceObject] interface Temperature" class="idl">
+ <dt>attribute float value</dt>
+ <dd>
+ This attribute indicates the current internal
+ temperature of the system, scaled to a 0.0 to 1.0
+ floating point range. A value of 0.0 means that the
+ system is running at the lowest safe temperature, and a
+ value of 1.0 means that the system is running at the
+ highest safe temparature. On devices that have multiple
+ thermometers, this value should reflect the average
+ temperature of all the thermometers.
+ </dd>
+ </dl>
+ </section>
- <dt>readonly attribute unsigned short INVALID_VALUE</dt>
- <dd><code>INVALID_VALUE</code> (numeric value 3): The
- implementation failed to retrieve power source or power level
- information because one or more of the values in the
- <code>PowerLevelOptions</code> or
- <code>PowerSourceOptions</code> parameters of the
- <code>watchPowerLevel()</code> or
- <code>watchPowerSource()</code> calls was invalid. For
- example, if the <code>PowerLevelOptions highThreshold</code>
- attribute is set to a value greater than 1.0, the
- <code>errorCallback</code> function MUST be invoked with the
- <code>PowerError</code> <code>code</code> attribute set with a
- value of <code>INVALID_VALUE</code>.</dd>
+ <section>
+ <h5>Internal Cooling Fan</h5>
+ <ul>
+ <li>URI: <code>http://www.w3.org/2009/dap/sysinfo/internal#fanThrottle</code></li>
+ <li>Curie: <code>internal:fanThrottle</code></li>
+ <li>Corresponding DCO property: <a href="">@@</a></li>
+ <li>Type of returned value: <code>FanThrottle</code></li>
+ </ul>
+
+ <dl title="[NoInterfaceObject] interface Fanthrottle" class="idl">
+ <dt>attribute float value</dt>
+ <dd>
+ This attribute indicates that the current throttling
+ speed of the cooling fans scaled to a 0.0 to 1.0
+ floating point range. A value of 0.0 means that the fan
+ is not running, and a value of 1.0 means that the system
+ is running at its maximum speed. On devices that have
+ multiple cooling fans, this value should reflect the
+ average speed of the individual fans.
+ </dd>
+ </dl>
+ </section>
+ </section>
+ </section>
+ <!--******************** /Internal **********************************-->
- <dt>readonly attribute unsigned short code</dt>
- <dd>The <code>code</code> attribute SHOULD contain one of the
- error values defined in this specification. An implementation MAY
- define additional error codes, but MUST NOT use the numeric
- values defined here.</dd>
- <dt>readonly attribute DOMString message</dt>
- <dd>The <code>message</code> attribute MAY return an error
- message describing the details of the error encountered. This
- attribute is primarily intended for debugging and developers
- SHOULD NOT use it directly in their application user
- interface.
- </dd>
- </dl>
- </section>
- </section>
- <!--******************* CPU *************************************************-->
- <section>
- <h3>CPU</h3>
- <p>This section defines a set of APIs that expose CPU information such as: utilization, frequency, brand, etc.</p>
- <dl title='[NoInterfaceObject] interface Cpu' class='idl'>
- <dt>readonly attribute unsigned int numLogicalProcessors</dt>
- <dd>The <code>numLogicalProcessors</code> attribute MUST indicate how many threads
- can run concurrently on the device. The minimum value is 1.
- </dd>
- <dt>readonly attribute unsigned int currentFrequency</dt>
- <dd>The <code>currentFrequency</code> attribute MUST indicate the current frequency
- of the CPU in Megahertz (MHz). On devices that have multiple CPUs that can run at
- different frequencies, this attribute SHOULD reflect the average frequency of the
- CPUs.
- </dd>
- <dt>readonly attribute unsigned int maximumFrequency</dt>
- <dd>The <code>maximumFrequency</code> attribute MUST indicate the maximum frequency
- for the CPU(s) in Megahertz (MHz). On devices that have mutilple CPUs that
- have different maximum frequencies, this attribute SHOULD reflect the maximum value.
- </dd>
- <dt>readonly attribute unsigned short usage</dt>
- <dd>The <code>usage</code> attribute MUST indicate at the time of retrieval what
- percentage of the total CPU resources are in use. If the device has more than one
- CPU, this attribute MUST be the average usage of all CPUs on the system. The maximum
- value is 100; the minimum value is 0.
- </dd>
- <dt>readonly attribute CpuArchitecture architecture</dt>
- <dd>The <code>architecture</code> of the CPU.
- </dd>
- <dt>readonly attribute string brand</dt>
- <dd>The brand attribute MUST include information about both the manufacturer and the
- model number. It MAY contain information identifying the supported instruction set.
- </dd>
- <dt>long watchCpuUsage(in CpuUsageCB successCallback, [Optional] in CpuUsageErrorCB errorCallback, [Optional] in CpuUsageOptions options) </dt>
- <dd>The <code>watchCpuUsage</code> function allows callers to monitor a delivery
- context's CPU utilization and takes one, two or three parameters. When called, it
- must immediately return and then asynchronously start a watch process defined by
- the following set of steps:
- <ol>
- <li>Acquire a new <code>CpuUsage</code> object that reflects the delivery
- context's current CPU utilization. If successful, invoke the associated
- <code>successCallback</code> with the <code>CpuUsage</code> object as an
- argument depending on the values specified in the
- <code>CpuUsageOptions</code> parameter. If the attempt fails, and the
- method was invoked with a non-null <code>errorCallback</code> argument, this
- method MUST invoke the <code>errorCallback</code> with a <code>CpuUsageError
- </code> object as an argument. </li>
- <li>Invoke the appropriate callback with a new <code>CpuUsage</code> object
- every time the implementation determines that the CPU utilization of the
- deliver context has changed in the manner specified by the <code>
- CpuUsageOptions</code> parameter. </li>
- </ol>
- </dd>
- </dl>
- <section>
- <h4>CpuUsageCB</h4>
- <dl title='[Callback=FunctionOnly, NoInterfaceObject] interface CpuUsageCB' class='idl'>
- <dt>void handleEvent(in CpuUsage usage)</dt>
- <dd>This function is supplied by a call to <code>watchCpuUsage()</code>. Use the
- parameter to retrieve information about system cpu utilization.</dd>
- </dl>
- </section>
- <section>
- <h4>CpuUsageErrorCB</h4>
- <dl title='[Callback=FunctionOnly, NoInterfaceObject] interface CpuUsageErrorCB' class='idl'>
- <dt>void handleEvent(in CPUUsageError error)</dt>
- <dd>This function is supplied by a call to <code>watchCpuUsage()</code>. Use the
- parameter to retrieve information about the error that occured while the implementation
- attempted to obtain Cpu Utilization information.</dd>
- </dl>
- </section>
- <section>
- <h4>CpuUsageOptions</h4>
- <dl title='interface CpuUsageOptions' class='idl'>
- <dt>attribute unsigned short highThreshold</dt>
- <dd>The <code>highThreshold</code> attribute allows the caller to specify that the
- implementation MUST only invoke the <code>CpuUsageCB</code> when the device
- CPU utilization rises above the value specified. The maximum value is 100, the
- minimum value is 0. The default value is 100, meaning that the <code>CpuUsageCB
- </code> MUST NOT be invoked with the <code>CpuUsage</code> <code>
- crossedHighThreshold</code> attribute set to <code>true</code>.
- </dd>
- <dt>attribute unsigned short lowThreshold</dt>
- <dd>The <code>lowThreshold </code> attribute allows the caller to specify that the
- implementation MUST only invoke the <code>CpuUsageCB</code> when the device
- CPU utilization falls below the value specified. The maximum value is 100, the
- minimum value is 0. The default value is 0, meaning that the <code>CpuUsageCB
- </code> MUST NOT be invoked with the <code>CpuUsage crossedLowThreshold </code>
- attribute set to <code>true</code>.
- </dd>
- <dt>attribute unsigned short highThresholdSampleCount</dt>
- <dd>The <code>highThresholdSampleCount</code> attribute allows the caller to specify
- how many consecutive samples must be taken above the value specified by <code>
- highThreshold</code> before the <code>CpuUsageCB</code> function is invoked
- with the <code>crossedHighThreshold</code> attribute set to <code>true</code>. For
- example, If
- the value is 1, the <code>CpuUsageCB</code> function MUST be invoked with the
- <code>crossedHighThreshold</code> attribute set to <code>true </code> every time the
- implementation samples the CPU utilization. If the value is 2, the
- <code>CpuUsageCB</code> function MUST be invoked with the
- <code>crossedHighThreshold</code> attribute set to <code>true</code> only if the
- implementation collects two consecutive samples that are greater than the value
- specified by the <code>highThreshold</code> attribute. The default value is 1,
- which is also the minimum value.
- </dd>
- <dt>attribute unsigned short lowThresholdSampleCount</dt>
- <dd>The <code>lowThresholdSampleCount</code> attribute allows the caller to specify
- how many consecutive samples must be taken below the value specified by <code>
- lowThreshold</code> before the <code>CpuUsageCB</code> function is invoked
- with the <code>crossedLowThreshold</code> attribute set to <code>true</code>. For
- example, If the value is 1, the <code>CpuUsageCB</code> function MUST be
- invoked with the <code>crossedLowThreshold</code> attribute set to <code>true</code>
- every time the implementation samples the CPU utilization. If the value is
- 2, the <code>CpuUsageCB</code> function must be invoked with the
- <code>crossedLowThreshold</code> attribute set to <code>true</code> only if the
- implementation collects two consecutive samples that are greater than the value
- specified by the <code>lowThreshold</code> attribute. The default value is 1, which
- is also the minimum value.
- </dd>
- <dt>attribute unsigned int sampleInterval</dt>
- <dd>The <code>sampleInterval</code> attribute is a hint to the implementation
- regarding how often (in milliseconds) it SHOULD sample Cpu utilization. An
- implementation SHOULD sample at the suggested rate, but MAY chose to ignore values
- that are too small and which are likely to hamper system performance. If no
- <code>highThreshold</code> or <code>lowThreshold</code> values are specified, the
- implementation MUST invoke the <code>CpuUsageCB</code> each time CPU
- utilization is sampled. The default sample interval is 2000, or once every two
- seconds.
- </dd>
- <dt>attribute int timeout</dt>
- <dd>
- The <code>timeout</code> attribute specifies how long (in milliseconds) an
- implementation SHOULD attempt to measure CPU utilization before invoking the
- <code>CpuUsageErrorCB</code> with the <code>TIMEOUT</code> error code. The
- default value is 5000, or five seconds.
- </dd>
- </dl>
- </section>
- <section>
- <h4>CpuUsage</h4>
- <dl title='interface CpuUsage' class='idl'>
- <dt>readonly attribute unsigned short usage</dt>
- <dd>
- The <code>usage</code> attribute MUST indicate what percentage of the total CPU
- resources are in use when the <code>CpuUsageCB</code> method is invoked. If
- the device has more than one CPU, this attribute MUST be the average usage of all
- CPUs on the system. The maximum value is 100; the minimum value is 0.
- </dd>
- <dt>readonly attribute DOMTimeStamp timestamp</dt>
- <dd>
- The <code>timestamp</code> attribute MUST indicate when the Cpu <code>usage</code>
- value was obtained.
- </dd>
- <dt>readonly attribute boolean crossedHighThreshold</dt>
- <dd>
- When a <code>CpuUsageCB</code> is invoked with a <code>CpuUsage</code>
- object whose <code>crossedHighThreshold</code> attribute set to <code>true</code>,
- the cpu usage high threshold has been crossed. This threshold value is set in
- the <code>CpuUsageOptions</code> parameter of a call to <code>watchCpuUsage()
- </code>. The <code>crossedHighThreshold</code> value MUST be false if any one
- of the following is true:
- <ul>
- <li>The <code>CpuUsageOption highThreshold</code> value was
- either not set or set to 100 in a prior call to <code>watchCpuUsage()</code>; or </li>
- <li>The current <code>usage</code> is not greater than the value specified by the
- <code>CpuUsageOption highThreshold</code> value specified in a prior call
- to <code>watchCpuUsage()</code>.</li>
- </ul>
- </dd>
- <dt>readonly attribute boolean crossedLowThreshold</dt>
- <dd>
- When a <code>CpuUsageCB</code> is invoked with a <code>CpuUsage</code>
- object whose <code>crossedLowThreshold</code> attribute set to <code>true</code>,
- the cpu utilization low threshold has been crossed. This threshold value MUST be set
- in the <code>CpuUsageOptions</code> parameter of a prior call to <code>
- watchCpuUsage()</code>. The <code>crossedLowThreshold</code> value MUST be
- <code>false</code> if any one of the following is true:
- <ul>
- <li>The <code>CpuUsageOption lowThreshold</code> value was either not set
- or set 0 in a prior call to <code>watchCpuUsage()</code>; or </li>
- <li>The current cpu utilization is not less than the value specified by the
- <code>CpuUsageOption lowThreshold</code> value in a prior call to <code>
- watchCpuUsage()</code>. </li>
- </ul>
- </dd>
- </dl>
- </section>
- <section>
- <h4>CpuUsageError</h4>
- <dl title='interface CpuUsageError' class='idl'>
- <dt>readonly attribute unsigned short UNKNOWN_ERROR</dt>
- <dd>
- <code>UNKNOWN_ERROR</code> (numeric value 0): The implementation failed to retrieve
- Cpu usage information for an unknown reason.
- </dd>
- <dt>readonly attribute unsigned short PERMISSION_DENIED</dt>
- <dd>
- <code>PERMISSION_DENIED</code> (numerice value 1): The implementation failed to
- retrieve Cpu usage information because the application
- context does not have permission to use the Platform <abbr
- title="Application Programming Interface">API</abbr>.
- </dd>
- <dt>readonly attribute unsigned short INFORMATION_UNAVAILABLE</dt>
- <dd>
- <code>INFORMATION_UNAVAILABLE</code> (numeric value 2): The implementation failed to
- retrieve Cpu usage information because the information was unavailable.
- </dd>
- <dt>readonly attribute unsigned short TIMEOUT</dt>
- <dd>
- <code>TIMEOUT</code> (numeric value 3): The specified maximum length of time has
- elapsed before the implementation could successfully acquire Cpu usage information.
- </dd>
- <dt>readonly attribute unsigned short INVALID_VALUE</dt>
- <dd>
- <code>INVALID_VALUE</code> (numeric value 4): The implementation failed to retrieve
- CPU usage information because one or more of the values in the <code>CpuUsageOptions
- </code> parameter of the <code>watchCpuUsage()</code> call was invalid. For example,
- if the <code>CpuUsageOptions highThreshold</code> attribute is set to a value
- greater than 100, the <code>CpuErrorCB</code> must be invoked with the
- <code>CpuUsageError code</code> attribute set with a value of INVALID_VALUE (4).
- </dd>
- <dt>readonly attribute unsigned short code</dt>
- <dd>
- The <code>code</code> attribute SHOULD contain one of the errors defined in this
- specification. An implementation MAY define additional error codes, but MUST NOT
- use the numeric values defined here.
- </dd>
- <dt>readonly attribute DOMString message</dt>
- <dd>
- The <code>message</code> attribute MAY return an error message describing the
- details of the error encountered. This attribute is primarily intended for
- debugging and developers SHOULD NOT use it directly in their application user interface.
- </dd>
- </dl>
- </section>
- <section>
- <h4>CpuArchitecture</h4>
- From BONDI.
- <dl title='interface CpuArchitecture' class='idl'>
- <dt>readonly attribute unsigned short ARCH_UNKNOWN</dt>
- <dd>
- <code>UNKNOWN_ARCH</code> (numeric value 0): The Cpu architecture is unknown.
- </dd>
- <dt>readonly attribute unsigned short ARCH_I386</dt>
- <dd>
- <code>ARCH_I386</code> (numerice value 1): The CPU architecture is based on the
- Intel(R) 386 instruction set.
- </dd>
- <dt>readonly attribute unsigned short ARCH_I586</dt>
- <dd>
- <code>ARCH_I586</code> (numerice value 2): The CPU architecture is based on the
- Intel(R) 586 instruction set.
- </dd>
- <dt>readonly attribute unsigned short ARCH_x86-64</dt>
- <dd>
- <code>ARCH_x86-64</code> (numerice value 3): The CPU architecture is based on the
- x86 64-bit architecture.
- </dd>
- <dt>readonly attribute unsigned short ARCH_ARM</dt>
- <dd>
- <code>ARCH_ARM</code> (numerice value 4): The CPU is an ARM processor.
- </dd>
- <dt>readonly attribute unsigned short architecture</dt>
- <dd>
- The <code>code</code> attribute SHOULD contain one of the errors defined in this
- specification. An implementation MAY define additional error codes, but MUST NOT
- use the numeric values defined here.
- </dd>
- <dt>readonly attribute DOMString message</dt>
- <dd>
- The <code>message</code> attribute MAY return an error message describing the
- details of the error encountered. This attribute is primarily intended for
- debugging and developers SHOULD NOT use it directly in their application user interface.
- </dd>
- </dl>
- </section>
- </section>
<section>
<h3>Display</h3>
<p>The <code>window.screen</code> object already exposes width, height, availWidth, availHeight,
@@ -2266,6 +2056,46 @@
</section>
+ <section>
+ <h4>GenericError</h4>
+ <dl title='interface GenericError' class='idl'>
+ <dt>const unsigned short UNKNOWN_ERROR = 0</dt>
+ <dd>The reason for an error being triggered is unknown.</dd>
+
+ <dt>const unsigned short PERMISSION_DENIED = 1</dt>
+ <dd>The application context does not have permission to
+ access this property</dd>
+
+ <dt>const unsigned short INFORMATION_UNAVAILABLE = 2</dt>
+ <dd>The property accessed is unavailable on this device (e.g. the battery level on a device that only has an external power source).</dd>
+
+ <dt>const unsigned short INVALID_VALUE = 3</dt>
+ <dd>One or more of the values in the <code>Options</code>
+ obect passed was invalid. For example, if the
+ <code>highThreshold</code> attribute is set to a value
+ greater than 1.0 for the CpuLoad property.</dd>
+
+ <dt>const unsigned short READ_ONLY = 3</dt>
+ <dd>The property that has been passed to the
+ <code>set</code> function that has triggered this callback
+ cannot be modified.</dd>
+
+ <dt>readonly attribute unsigned short code</dt>
+ <dd>The <code>code</code> attribute SHOULD contain one of the
+ error values defined in this specification. An implementation MAY
+ define additional error codes, but those MUST NOT use the numeric
+ values defined here.</dd>
+
+ <dt>readonly attribute DOMString message</dt>
+ <dd>The <code>message</code> attribute MAY return an error
+ message describing the details of the error encountered. This
+ attribute is primarily intended for debugging and developers
+ SHOULD NOT use it directly in their application user
+ interface.
+ </dd>
+ </dl>
+ </section>
+
<section>
<h2><a>PendingOp</a> interface</h2>
Received on Monday, 7 December 2009 16:38:06 UTC