W3C home > Mailing lists > Public > public-dap-commits@w3.org > December 2009

2009/dap/system-info Overview.html,1.33,1.34

From: Max Froumentin via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 11 Dec 2009 11:18:11 +0000
To: public-dap-commits@w3.org
Message-Id: <E1NJ3Vj-0001F0-Sb@lionel-hutz.w3.org>
Update of /sources/public/2009/dap/system-info
In directory hutz:/tmp/cvs-serv4746

Modified Files:
	Overview.html 
Log Message:
* make success callback ooptional for set()
* add freeform info string for all devices
* moved orientation inside Display, makes it easier for get() and watch()
* new sensors API: ambient light, ambient noise, ambient temperature, proximity


Index: Overview.html
===================================================================
RCS file: /sources/public/2009/dap/system-info/Overview.html,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- Overview.html	10 Dec 2009 15:58:17 -0000	1.33
+++ Overview.html	11 Dec 2009 11:18:09 -0000	1.34
@@ -125,7 +125,7 @@
           <dd>An object containing the various options for fetching the properties requested</dd>
         </dl>
         </dd>
-        <dt>PendingOp set(DOMString propertyId, Object newValue, SuccessCB successCallback, optional ErrorCB? errorCallback)</dt>
+        <dt>PendingOp set(DOMString propertyId, Object newValue, optional SuccessCB? successCallback, optional ErrorCB? errorCallback)</dt>
         <dd>
           The <a>set</a> function modifies the current value of of a
           system property. When called, the function immediately
@@ -259,6 +259,9 @@
           <dt>attribute unsigned int type</dt>
           <dd>One of the constants defined in this interface, reflecting the state of this source</dd>
 
+          <dt>readonly attribute DOMString info</dt>
+          <dd>A free-form string describing this device</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>
 
@@ -322,6 +325,8 @@
           </dl>
 
           <dl title="[NoInterfaceObject] interface Cpu" class="idl">
+            <dt>readonly attribute DOMString info</dt>
+            <dd>A free-form string describing this CPU</dd>
             <dt>attribute float currentFrequency</dt>
             <dd>
               This attribute indicates the current frequency of this CPU (in MHz).
@@ -379,6 +384,8 @@
           </dl>
 
           <dl title="[NoInterfaceObject] interface Thermometer" class="idl">
+            <dt>readonly attribute DOMString info</dt>
+            <dd>A free-form string describing this Thermometer</dd>
             <dt>attribute float currentTemperature</dt>
             <dd>This thermometer's current temperature, on the Celsius scale (°C)</dd>
           </dl>
@@ -410,6 +417,8 @@
           </dl>
 
           <dl title="[NoInterfaceObject] interface CoolingDevice" class="idl">
+            <dt>readonly attribute DOMString info</dt>
+            <dd>A free-form string describing this cooling device</dd>
             <dt>const unsigned short UNKNOWN=0</dt>
             <dd>A device of undetermined type.</dd>
             <dt>const unsigned short FAN=1</dt>
@@ -491,7 +500,7 @@
             <li>URI: <code>http://www.w3.org/2009/dap/sysinfo/network#available</code></li>
             <li>Short Name: <code>network:available</code></li>
             <li>Corresponding DCO property: <a href="">@@</a></li>
-            <li>Value type: sequence of <a >Connection</a>, or derived type if applicable.</li>
+            <li>Value type: sequence of <a>Connection</a>, or derived type if applicable.</li>
           </ul>
 
           <dl title="[NoInterfaceObject] interface Ieee80211Connection : Connection" class="idl">
@@ -506,6 +515,8 @@
           </dl>
 
           <dl title="[NoInterfaceObject] interface CellularConnection : Connection" class="idl">
+            <dt>readonly attribute DOMString info</dt>
+            <dd>A free-form string describing this connection</dd>
             <dt>attribute DOMString apn</dt>
             <dd>The Access Point Name associated to a network bearer.</dd>
             <dt>attribute DOMString operatorName</dt>
@@ -678,18 +689,24 @@
           </ul>
           
           <dl title='[NoInterfaceObject] interface Display' class='idl'>
+            <dt>const unsigned short ORIENTATION_UNKNOWN = 0</dt>
+            <dd>The device is not able to determine its orientation.</dd>
+            <dt>const unsigned short ORIENTATION_LANDSCAPE = 1</dt>
+            <dd>The display orientation is landscape.</dd>
+            <dt>const unsigned short ORIENTATION_PORTRAIT = 2</dt>
+            <dd>The display orientation is portrait.</dd>
+            <dt>const unsigned short ORIENTATION_INVERTED_LANDSCAPE = 3</dt>
+            <dd>The display orientation is inverted landscape.</dd>
+            <dt>const unsigned short ORIENTATION_INVERTED_PORTRAIT = 4</dt>
+            <dd>The display orientation is inverted portrait.</dd>
+            <dt>attribute unsigned short orientation</dt>
+            <dd>The display orientation from the constants listed in this object.</dd>
             <dt>attribute float brightness</dt>
             <dd>The current brightness</dd>
             <dt>attribute float contrast</dt>
             <dd>The current contrast</dd>
-            <dt>attribute boolean isBlanked</dt>
+            <dt>attribute boolean blanked</dt>
             <dd><code>true</code> if this display is currently blanked, <code>false</code> otherwise</dd>
-            <dt>readonly attribute DisplayOrientation orientation</dt>
-            <dd>
-              Returns a DisplayOrientation object that indicates the orientation of the current
-              display. 
-            </dd>
-
             <dt>attribute DisplayDevice current</dt>
             <dd>The display currently in use</dd>
             <dt>attribute sequence&lt;DisplayDevice&gt; displays</dt>
@@ -699,6 +716,9 @@
           <p>The <a>DisplayDevice</a> interface defined below inherits from the <a>Screen</a> interface as defined in [[!CSSOM-VIEW]]</p>
 
           <dl title="[NoInterfaceObject] interface DisplayDevice : Screen" class="idl">
+            <dt>readonly attribute DOMString info</dt>
+            <dd>A free-form string describing this device</dd>
+
             <dt>readonly attribute unsigned int dotsPerInchW</dt>
             <dd>Resolution of this device, along its width, in dots per inch.</dd>
             <dt>readonly attribute unsigned int dotsPerInchH</dt>
@@ -710,19 +730,6 @@
             <dd>readonly attribute sequence&lt;DisplayOrientation&gt; supportedOrientations</dd>
           </dl>
 
-          <dl title='interface DisplayOrientation' class='idl'>
-            <dt>readonly attribute unsigned short orientation</dt>
-            <dd>The display orientation from the values listed in this object.</dd>
-            <dt>readonly attribute unsigned short ORIENTATION_LANDSCAPE</dt>
-            <dd>The display orientation is landscape.</dd>
-            <dt>readonly attribute unsigned short ORIENTATION_PORTRAIT</dt>
-            <dd>The display orientation is portrait.</dd>
-            <dt>readonly attribute unsigned short ORIENTATION_INVERTED_LANDSCAPE</dt>
-            <dd>The display orientation is inverted landscape.</dd>
-            <dt>readonly attribute unsigned short ORIENTATION_INVERTED_PORTRAIT</dt>
-            <dd>The display orientation is inverted portrait.</dd>
-          </dl>
-          
           <p class="issue">Are we being short-sighted in only listing
           four? Would it make sense to have it be an angle, except
           that in most cases it would only change in 90°
@@ -732,6 +739,187 @@
       </section>
     </section>  
 
+<!-- ********* /display ************************************************************* -->
+
+
+
+<!-- ********* Sensors ************************************************************** -->
+    <section>
+      <h2>Sensors</h2>
+      <p>This API exposes the values of external sensors, reflecting the device's environment, such as temperature, ambient brightness or ambient sound.</p>
+      <section>
+        <h4>ECMAScript Example</h4>
+        <pre class="sh_javascript example">
+// Adjust the screen's brightness if the ambient brightness is above a certain level
+navigator.device.system.watch("sensor:ambientLight",success,{maxThreshold: 0.9});
+
+function success(brightnessLevel) {
+  navigator.device.system.set("display",{screen:brightness: 0.4});
+}
+</pre>
+      </section>
+      <section>
+        <h4>Ambient Light</h4>
+        <ul>
+          <li>Property URI: <code>http://www.w3.org/2009/dap/SysInfo/ambientLight</code></li>
+          <li>Short name: <code>sensors:ambientLight</code></li>
+          <li>Value type: <code>AmbientLight</code></li>
+          <li>Corresponding DCO property: <a href="@@">@@</a></li>
+        </ul>
+        <dl title="[NoInterfaceObject] interface AmbientLight" class="idl">
+          <dt>attribute float value</dt>
+          <dd>A normalised value representing the overall ambient light around the device</dd>
+          <dt>attribute sequence&lt;AmbientLightSensor&gt; sensors</dt>
+          <dd>The list of all ambient light sensors connected to this device</dd>
+        </dl>
+        <dl title="[NoInterfaceObject] interface AmbientLightSensor" class="idl">
+          <dt>attribute DOMString info</dt>
+          <dd>A free-form string describing this device.</dd>
+          <dt>attribute float luminance</dt>
+          <dd>The luminance measured by this device, in candela per square metre (cd/m<sup>2</sup>)</dd>.
+          <dt>attribute float maxLuminance</dt>
+          <dd>The maximum luminance that this device can report, in candela per square metre (cd/m<sup>2</sup>)</dd>.
+        </dl>
+      </section>
+      <section>
+        <h4>Ambient Noise</h4>
+        <ul>
+          <li>Property URI: <code>http://www.w3.org/2009/dap/SysInfo/ambientNoise</code></li>
+          <li>Short name: <code>sensors:ambientNoise</code></li>
+          <li>Value type: <code>AmbientNoise</code></li>
+          <li>Corresponding DCO property: <a href="@@">@@</a></li>
+        </ul>
+        <dl title="[NoInterfaceObject] interface AmbientNoise" class="idl">
+          <dt>attribute float value</dt>
+          <dd>A normalised value representing the overall ambient noise around the device</dd>
+          <dt>attribute sequence&lt;AmbientNoiseSensor&gt; sensors</dt>
+          <dd>The list of all ambient noise sensors connected to this device</dd>
+        </dl>
+        <dl title="[NoInterfaceObject] interface AmbientNoiseSensor" class="idl">
+          <dt>attribute DOMString info</dt>
+          <dd>A free-form string describing this device.</dd>
+          <dt>attribute float level</dt>
+          <dd>The noise level measured by this device, in decibels (dB)</dd>.
+          <dt>attribute float maxLevel</dt>
+          <dd>The maximum noise level that this device can report, in decibels (dB)</dd>.
+        </dl>
+      </section>
+      <section>
+        <h4>Ambient Temperature</h4>
+        <ul>
+          <li>Property URI: <code>http://www.w3.org/2009/dap/SysInfo/ambientTemperature</code></li>
+          <li>Short name: <code>sensors:ambientTemperature</code></li>
+          <li>Value type: <code>AmbientTemperature</code></li>
+          <li>Corresponding DCO property: <a href="@@">@@</a></li>
+        </ul>
+        <dl title="[NoInterfaceObject] interface AmbientTemperature" class="idl">
+          <dt>attribute float value</dt>
+          <dd>The overall ambient temperature level around the
+          device. The value is normalised from the minimum and maximum
+          temperature level that this device can report to 0 and
+          1.</dd>
+          <dt>attribute sequence&lt;AmbientTemperatureSensor&gt; sensors</dt>
+          <dd>The list of all ambient temperature sensors connected to this device</dd>
+        </dl>
+        <dl title="[NoInterfaceObject] interface AmbientTemperatureSensor" class="idl">
+          <dt>attribute DOMString info</dt>
+          <dd>A free-form string describing this device.</dd>
+          <dt>attribute float temperature</dt>
+          <dd>The temperature measured by this device, in degrees Celcius (°C)</dd>.
+          <dt>attribute float maxLevel</dt>
+          <dd>The maximum temperature that this device can report, in degrees Celcius (°C)</dd>.
+          <dt>attribute float minLevel</dt>
+          <dd>The minimum temperature that this device can report, in degrees Celcius (°C)</dd>.
+        </dl>
+      </section>
+      <section>
+        <h4>Ambient Atmospheric Pressure</h4>
+        <ul>
+          <li>Property URI: <code>http://www.w3.org/2009/dap/SysInfo/ambientAtmosphericPressure</code></li>
+          <li>Short name: <code>sensors:ambientAtmosphericPressure</code></li>
+          <li>Value type: <code>AmbientAtmosphericPressure</code></li>
+          <li>Corresponding DCO property: <a href="@@">@@</a></li>
+        </ul>
+        <dl title="[NoInterfaceObject] interface AmbientAtmosphericPressure" class="idl">
+          <dt>attribute float pressure</dt>
+          <dd>The estimated atmospheric pressure around this device, in kiloPascal (kPa)</dd>
+          <dt>attribute sequence&lt;AmbientAtmosphericPressureSensor&gt; sensors</dt>
+          <dd>The list of all ambient atmospheric pressure sensors connected to this device</dd>
+        </dl>
+
+        <dl title="[NoInterfaceObject] interface AmbientAtmosphericPressureSensor" class="idl">
+          <dt>attribute DOMString info</dt>
+          <dd>A free-form string describing this device.</dd>
+          <dt>attribute float pressure</dt>
+          <dd>The atmospheric pressure measured by this device, in kiloPascal (kPa)</dd>.
+          <dt>attribute float maxLevel</dt>
+          <dd>The maximum atmospheric pressure that this device can report, in kiloPascal (kPa)</dd>
+          <dt>attribute float minLevel</dt>
+          <dd>The minimum atmospheric pressure that this device can report, in kiloPascal (kPa)</dd>
+        </dl>
+      </section>
+      <section>
+        <h4>Proximity</h4>
+        <ul>
+          <li>Property URI: <code>http://www.w3.org/2009/dap/SysInfo/Proximity</code></li>
+          <li>Short name: <code>sensors:proximity</code></li>
+          <li>Value type: <code>Proximity</code></li>
+          <li>Corresponding DCO property: <a href="@@">@@</a></li>
+        </ul>
+        <dl title="[NoInterfaceObject] interface Proximity" class="idl">
+          <dt>attribute float value</dt>
+          <dd>The distance from the device to the nearest object, as determined by the array of proximity sensors, in meters (m)</dd>
+          <dt>attribute sequence&lt;ProximitySensor&gt; sensors</dt>
+          <dd>The list of all proximity sensors connected to this device</dd>
+        </dl>
+
+        <dl title="[NoInterfaceObject] interface ProximitySensor" class="idl">
+          <dt>attribute DOMString info</dt>
+          <dd>A free-form string describing this device.</dd>
+          <dt>attribute float proximity</dt>
+          <dd>The distance between this sensor and the nearmost object, in meters</dd>.
+          <dt>attribute float minProximity</dt>
+          <dd>The maximum proximity that this device can report, in meters</dd>
+          <dt>attribute float maxProximity</dt>
+          <dd>The minimum proximity that this device can report, in meters</dd>
+        </dl>
+      </section>
+    </section>
+<!-- ********* /@@ ************************************************************** -->
+
+<!-- ********* @@ ************************************************************** -->
+    <section>
+      <h2>@@</h2>
+      <p>@@</p>
+      <section>
+        <h4>ECMAScript Example</h4>
+        <pre class="sh_javascript example">
+// @@
+@@</pre>
+      </section>
+      <section>
+        <h3>Properties</h3>
+        <section>
+          <h4>@@</h4>
+          <ul>
+            <li>URI: <code>http://www.w3.org/2009/dap/SysInfo/@@</code></li>
+            <li>Short name: <code>@@</code></li>
+            <li>Value type: <code>@@</code></li>
+            <li>Corresponding DCO property: <a href="@@">@@</a></li>
+          </ul>
+          <dl title="[NoInterfaceObject] interface Template" class="idl">
+            <dt>const unsigned int @@ = 0</dt>
+            <dd>@@</dd>
+            <dt>attribute float @@</dt>
+            <dd>@</dd>
+            <dt>attribute sequence&lt;@@&gt; @@</dt>
+            <dd>@@</dd>
+          </dl>
+        </section>
+      </section>
+    </section>
+<!-- ********* /@@ ************************************************************** -->
+
 <!--
   <section>
     <h3>Audio</h3>
Received on Friday, 11 December 2009 11:18:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 11 December 2009 11:18:22 GMT