W3C home > Mailing lists > Public > public-device-apis@w3.org > February 2010

Re: Sensors simplified (or not)

From: Max Froumentin <maxfro@opera.com>
Date: Fri, 12 Feb 2010 10:26:53 +0100
Message-ID: <4B751EDD.3000106@opera.com>
To: "Nilsson, Claes1" <Claes1.Nilsson@sonyericsson.com>
CC: "public-device-apis@w3.org" <public-device-apis@w3.org>
On 11/02/2010 17:23, Nilsson, Claes1 wrote:

> However, don't we still need some method to discover which sensors
> this actual device supports? I am considering something similar to
> Android getSensorList,
> http://developer.android.com/reference/android/hardware/SensorManager.html#getSensorList(int)

I think you're right. Right now I'd considered that you would be able to 


function error(e) {
     // there's no pressure sensor, so do something else

function success(p) {
   // we have a pressure value, proceed
   watch("AmbientAtmosphericPressure", error2, success2);

but perhaps it's indeed better if we could write:

if (navigator.device.sysinfo.supports("AmbientAtmosphericPressure"))
   // we have a pressure value, proceed
   watch("AmbientAtmosphericPressure", error, success);
   // no pressure sensor, do something else

Something like that?

Received on Friday, 12 February 2010 09:27:27 UTC

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