Re: [sensors] Sensor discovery (#7)

@anssiko @larsgk I've done some preliminary experiments, and I put together an unfinished basic spec here: https://gist.github.com/Symbitic/7e7f0722da6357aaa2d5a2a2df999c4d

Long story short, it defines a generic `SensorSource` interface that acts as a driver, adds an optional `source` member to the `Sensor` constructor, and defines a `SensorRegistry` interface that handles creating instances of `SensorSensor` that can be passed to the `Sensor` constructor.

I'm still working on `SensorRegistry`, but the idea is that it will contain a list of categorized sensors while also allowing the user to register a way of detecting sensors (i.e. `registerSensorScanner("Accelerometer", DiscoverBluetoothDevicesWithAccelerometers)`). This should allow hosts (the browser) to securely expose multiple sensors while still being extensible enough to allow the user to add other sensors. Static (hardware) sensors can be pre-defined based on permissions, while dynamic (software) sensors can be added later.

No part of this is finished yet, but I'd like to hear your thoughts on the work so far.

-- 
GitHub Notification of comment by Symbitic
Please view or discuss this issue at https://github.com/w3c/sensors/issues/7#issuecomment-1871746017 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 29 December 2023 05:46:33 UTC