[OpenTRV-dev] Pluggability

Damon Hart-Davis dhd at exnet.com
Thu Jun 25 18:01:24 BST 2015


Hi,

> On 25 Jun 2015, at 17:46, Kevin Wood <kevin at the-wood-family.com> wrote:
> 
> Hi Damon,
> 
> I wonder if it would be possible to make the device drivers "pluggable"
> blocks of code, so that they occupy a standard memory footprint and all
> implement a common API?

I do now have a standard ‘Sensor’ base class that might achieve some of that.  (Actuator derives from Sensor.)

> Then, use a bootloader with a bit of intelligence to scan the hardware
> and, using informatio reported by it, download only the required drivers
> into the device when it is flashed?

If large numbers of these things are to be deployed in the field for a particular application then forcing a custom code release for each device is probably not ideal, and it is also specifically useful to add and remove sensors after deployment, eg to winnow out uses of a more expensive sensor where it proves not to add much value, eg for rare issues.

> In other words, move much of the device scanning intelligence, and all of
> the redundant drivers, out of the memory map of the device and into the
> build / downloading process.

Nice.  Will need to think more on that.

> 
> You'd then either selectively build each of the "drivers" for the segment
> of memory in which it's going to reside, make them all position
> independent, or declare a small number of segments that each of them could
> occupy and build a version for each, then select the correct one.
> 
> This does assume a device keeps the configuration it was created with, and
> doesn't need to be "plug and play" except by flashing it again.
> 
> Just an idle thought that hasn't been fully fleshed out, so I'm sure there
> will be snags...;-)

Some very good ideas there, some of which I may get to play with!

That has helped already with expanding the Pluggability section, thank you!

Rgds

Damon


More information about the OpenTRV-dev mailing list