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: 

http://dev.w3.org/2009/dap/system-info/Overview.html


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 */
}
else{
  /* use it based on vendor specification*/
  futureExt.XYZApi()
}
Received on Wednesday, 21 October 2009 03:25:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:01 GMT