Sensor and sensor instances
QSH divides the sensor implementation in two logical units: sensor and sensor instance.-
Sensors are producers, consumers, or a combination of producers and consumers of asynchronous data.
- Each sensor can have one or more sensor instances.
- Any request to a sensor for data results in the creation of a sensor instance or sharing of an existing sensor instance.
-
The sensor creates sensor instances on demand.
- Sensors manage the lifecycle and configuration of their corresponding instances, and send configuration updates and initial state events to their clients.
- Each sensor instance operates with a specific client configuration.
- The sensor instance of a physical sensor programs the sensor hardware to operate at required configuration.
- Vendors must serve all client requests with a minimal number of sensor instances.
- The sensor instance generates and sends a stream of data to all the active clients.
-
Many sensors can share and configure a single sensor instance. This mode of operation is typical to a combo driver for hardware
sensors, such as the following:
- Accelerometer and gyroscope
- Proximity and ambient light

