On Sun, Dec 23, 2012 at 10:41:17PM +0100, Stefan Sperling wrote: > On Sun, Dec 23, 2012 at 10:23:55PM +0100, David Coppa wrote: > > On Sun, Dec 23, 2012 at 3:18 PM, Stefan Sperling <[email protected]> wrote: > > > This diff updates the e17 ports to the final 0.17.0 release. > > > > > > There are known issues (e.g. battery module) that I'm not addressing > > > here. I want to get this upgrade out of the way first. > > > > What's the problem with the battery module? > > Maxime Villard reported it to me privately instead of the list. > I'm quoting him below (I hope he doesn't mind), instead of paraphrasing > him, so that those who are interested in the problem are in the loop. > > On the surface it looks like the code should be using named constants > instead of hard-coded numbers.
Ugh, gross. If you want to implement it properly you can take example on what i did in upower here : http://cgit.freedesktop.org/upower/tree/src/openbsd/up-backend.c#n353 mib[3] is a sensor_type, 7 is WATTHOUR, 8 is AMPHOUR. The thing here is you got to detect first the unit used by the battery/hw to check if you got to multiply the value by bst_volt. I think i took the loop from src/sbin/sysctl.. Landry
