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

Carlos Rodrigues carlos.efr at mail.telepac.pt
Sun Feb 25 19:48:14 CET 2007


On 2/25/07, Arjen de Korte <nut+devel at de-korte.org> wrote:
> For instance, calculating remaining battery capacity requires much more
> than just measuring battery voltage, yet this is what we're doing in
> some drivers now (and probably some UPS'es will use the same method). Of
> course you'll see a nice decreasing value passing in time, but it has no
> relation to the actual remaining capacity.
>
> I would like to see a difference between values that are reported by the
> UPS and values we (NUT) have calculated from these.

Factoring this kind of code out of the drivers would be good in theory
but bad in practice. Of course, we could devise an excellent function
to calculate the remaining capacity, but that would require the
drivers to export a lot of parameters... Parameters that aren't
available in most UPSes, which the driver would have to lie about, so
that the client code could still report someting...

In the end, you would end up with a very nice, complex, reusable code
that would uttely suck.

-- 
Carlos Rodrigues



More information about the Nut-upsdev mailing list