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

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