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

[sensors] Do we need a lightweight interface representing available sensors?

From: Tobie Langel via GitHub <sysbot+gh@w3.org>
Date: Mon, 08 Jun 2015 10:00:46 +0000
To: public-device-apis@w3.org
Message-ID: <issues.opened-86111779-1433757646-sysbot+gh@w3.org>
tobie has just created a new issue for https://github.com/w3c/sensors:

== Do we need a lightweight interface representing available sensors? 
==
This would be something like:

```
interface SensorMetaData {
    readonly attribute SensorIdentifier identifier;
    readonly attribute boolean isDefault;
    readonly attribute SensorPosition position;
    readonly attribute SensorDirection position;
    readonly attribute isInternal boolean;
    Sensor createObserver(SensorInit sensorInitDict);
    // Would create a Sensor object for this particular physical 
sensor.
}

enum SensorPosition {
    "top-left",
    "top",
    "top-right",
    "middle-left",
    "middle",
    "middle-right",
    "bottom-left",
    "bottom",
    "bottom-right"
}

enum SensorDirection {
    "front",
    "rear",
    "left",
    "right",
    "top",
    "bottom"
}
```

`Enums` inferred from 
https://github.com/w3c/sensors/issues/26#issuecomment-109392164 (which
 is definitive).

The name is terrible, but please bear with me. It might be worth 
considering renaming `Sensor` to something like `SensorObserver` 
instead and using `Sensor` for this object, which would give us:

```
interface Sensor {
    readonly attribute SensorIdentifier identifier;
    readonly attribute boolean isDefault;
    readonly attribute SensorPosition position;
    readonly attribute SensorDirection position;
    readonly attribute isInternal boolean;
    SensorObserver createObserver(SensorObserverInit 
sensorObserverInitDict);
}
```





See https://github.com/w3c/sensors/issues/28
Received on Monday, 8 June 2015 10:00:48 UTC

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