Generic driver architecture

Developer
Jan 21, 2010 at 6:47 AM

The current implementation of the driver exposes only a fixed number of sensors. We should try to make the architecture generic so that it is easy to configure any number of attached sensor without a need for recompiling the driver.

Initially I though this could be all done inside of the microcontroller. The idea was that on startup driver would query the microcontroller what sensor types it has attached and then build their coresponding internal representation. This is under assumption that it would be much easier to modify an Arduino sketch for particular sensor configuration than to modify the driver itself.

However I now believe that Windows Sensor platform wouldn't allow us to reconfigure the sensors on the fly like this. In particularCSensorDdi::OnGetSupportedSensorObjects method is called during initialization and has to return the list of supported sensors. Therefore I think we should move this configuration to the driver. For example during initialization driver would look up the configuration in registry and build the internal representation of attached sensors. We could provide a configuration tool to edit the sensor manifest and save it to registry in proper format. The manifest would consist of list properties and data fields exposed for each sensor. We can also provide templates for supported sensor types. This is the same data that is now hard coded inside WpdOjectProperties class.