W3C home > Mailing lists > Public > public-device-apis@w3.org > October 2009

First stab at System Info & Events API

From: Tran, Dzung D <dzung.d.tran@intel.com>
Date: Tue, 20 Oct 2009 20:24:37 -0700
To: "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-ID: <753F67ADE6F5094C9F1DBA00D1BAA8D312C4102E09@orsmsx501.amr.corp.intel.com>

Hello all,

Following Robin's advice to put some concrete APIs on paper, so I gave it a stab: 


Also some thinking around about extensibility and how implement for known capabilities versus unknown future capabilities.

A) use concrete APIs for well known existing capabilities
B) have a 'sequence' of objects defined that have extension capabilities. This allows future apps to find them and make use of them *between&* major revisions of the specification. These extensions can be brought into the specification at major revisions and they will then become concrete APIs.

Example interfaces:
interface CapabilityExtensions : Object {
    readonly attribute sequence DAPExtension Cap;

interface EventExtenstions : Object {
    readonly attribute sequence DAPExtension events;

interface DAPExtension: Object {
    readonly attribute DOMString name;
    readonly attribute DOMString vendor;
    readonly attribute DOMString version;
    attribute Object extOb;

Javascript to find / use an extension capability:
var futureExt;
for(var x = 0; x < device.capabilityExtensions.length; x++){
  currExt = device.capabilityExtensions[x];
  if(currExt.name == "cool new capability"){
    futureExt = device.capabilityExtensions[x];
if(futureExt === undefined){
  /* extention not available */
  /* use it based on vendor specification*/
Received on Wednesday, 21 October 2009 03:25:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:32:12 UTC