W3C home > Mailing lists > Public > public-device-apis@w3.org > June 2015

Re: [sensors] When there are multiple sensors of a given type, how do we identify which one to instantiate?

From: davidmarkclements via GitHub <sysbot+gh@w3.org>
Date: Fri, 05 Jun 2015 14:14:08 +0000
To: public-device-apis@w3.org
Message-ID: <issue_comment.created-109305722-1433513647-sysbot+gh@w3.org>
Or:

```
var pSensors = Sensor.Proximity.list(); // => [ 
<ProximitySensorObject>, <ProximitySensorObject> ];
var topLeft = pSensors[0];
topLeft.meta(); // => {position: 'top-left'}
topLeft.meta({more:'info'});
topLeft.meta(); // => {position: 'top-left', more: 'info'}
var mySensor = topLeft.create(); // or pSensors[0].spawn(); ?

/**
<ProximitySensorObject>
   id: 'as per id discovered from device?' //read-only
**/

```





-- 
GitHub Notif of comment by davidmarkclements
See https://github.com/w3c/sensors/issues/26#issuecomment-109305722
Received on Friday, 5 June 2015 14:14:10 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:54:05 UTC