This describes a generic framework for discovering and using sensors and devices. It is composed primarily of two parts: a new SensorBackend
class for providing sensor values, and a SensorRegistry
class for registering backends. It also proposes several related interfaces: SensorReading
, SensorBackend
, SensorBackendConstructor
, and extensions to the Generic Sensor API to support backends.
This is a follow-up to my previous Sensor Discovery API proposal which should no longer be actively considered.
Naming things is considered one of the hardest problems in computer science, and this preliminary spec was no exception. I had to decide on a name for the API, whether or not to use Sensor to mean any device and not just a sensor, whether to create a separate Device interface and use a term that unifies Sensor and Device, and if so, what its name should be.