From the ACPI spec (3.0): 2. Battery Capacity
Each battery must report its designed capacity, latest full-charged capacity, and present remaining capacity. Remaining capacity decreases during usage, and it also changes depending on the environment. Therefore, the OS must use latest full-charged capacity to calculate the battery percentage. ... At the most basic level, the OS calculates Remaining Battery Percentage [%] using the following formula: Remaining Capacity Percentage = Battery Remaining Capacity ----------------------------- * 100 Last Full Charged Capacity So the way the code in wmbattery / procmeter is written now doesn't comply to this spec. Likely this means that the percentage will be different than that given by other acpi programs or other operating systems. Conversely, the APM systes that I've had experience with seem to use the design capacity (or equivilant) the same as my the acpi code does, so my code probably yeilds numbers for acpi that are closer to those you'd see if using APM. Personally I find the spec's rationalle for choosing to use the last full capacity here somewhere between bogus and nonexistant. I suspect this choice was made to avoid frightening/confusing users who don't realize that batteries degrade over time. I personally pay attention to the maximum percentage my batteries are charging to, and use this as one of the ways to guage if they're healthy or beginning to degrade. I've had bad batteries in the past that would only charge to 5% of their design capacity, and with such a battery having the meter read 5% when it's done charging is a nice indication that your battery is broken and you proably don't want to unplug. Having the guage read 100% for such a battery and then drop to 0% after 5 minutes off-line would, IMHO, suck. Due to the compataility issues though, I'm tempted to go the option route, make it configurable, and make the formula in the spec be the default. Another interesting approach (in wmbattery) might be to base the displayed percentage on the acpi spec percentage, but provide a visual indication of the dead part of the battery at the top of the dial. -- see shy jo
signature.asc
Description: Digital signature