[Nut-upsdev] Some questions on driver implementation and variable names

Arjen de Korte nut+devel at de-korte.org
Sun Feb 25 18:37:46 CET 2007


Carlos Rodrigues wrote:

> Well, there's no need to limit the output to values directly obtained
> from the UPS.

There is. Keep in mind that every change in the state of the driver will
be pushed to all clients connected to it through the server. Even if
they don't need it (upsmon for instance will only look at ups.status and
nothing else). The more variables you add, the more verbose the driver
will be and the more traffic you'll be generating. And the bigger the
problems we'll have with growing state trees.

> The driver can calculate some stuff, like the battery
> runtime, the battery charge (percentage) and so on.

Clients can do exactly the same, with the benefit that this will work
for all drivers supporting the input variables needed, instead of just one.

> Basically, the driver should calculate values that may be useful for
> the user, as long at they're somewhat dependent on the particular
> UPS it is driving.

Name an example. None of the examples you mentioned are very device
specific.

> Basically, a driver should calculate stuff so that the hardware looks
> fancier than it actually is, but it should not implement features that
> are better off in some layer above the driver.

That it really the worst reason I can think of... :-)

Best regards, Arjen



More information about the Nut-upsdev mailing list