Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Discharge cycles' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Discharge cycles
Authored by: SOX on Mar 13, '03 02:10:07PM

Does the powerobook or OS keep track of the number of discharge cycles a battery or computer has gone through? This is a better indicator of effective battery age than simple time.

also what do those flags and stuff mean?



[ Reply to This | # ]
Discharge cycles
Authored by: mattmoss on Mar 13, '03 04:40:50PM

I haven't gone looking for any docs, but this is what I quickly figured out:

bit 0: power adapter present
bit 1: charging
bit 2: ??? (always 1?)
bit 3-6: ??? (always 0?)
bit 7: battery missing

Don't know bits? Here's the few flag values I saw:

flags=4: battery in, power adapter out
flags=5: battery in, power adapter in
flags=7: battery in, power adapter in, charging battery
flags=131: battery out, power adapter in



[ Reply to This | # ]
Discharge cycles "Flags"=133
Authored by: robx on Mar 14, '03 06:01:42AM

have two batteries on a lombard with strange flags, whats wrong?
1:
% /usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | sed -n '/battery/','/}$/'p
| | +-o battery@3
| | | {
| | | "reg" =
| | | "AAPL,phandle" =
| | | "device_type" =
| | | "name" =
| | | "IOBatteryInfo" = (
{"Voltage"=12657,"Flags"=133,
"Amperage"=1055,"Capacity"=4425,"Current"=0},
{"Voltage"=0,"Flags"=1,
"Amperage"=0,"Capacity"=0,"Current"=0})
| | | }

2:
% /usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | sed -n '/battery/','/}$/'p
| | +-o battery@3
| | | {
| | | "reg" =
| | | "AAPL,phandle" =
| | | "device_type" =
| | | "name" =
| | | "IOBatteryInfo" = (
{"Voltage"=11154,"Flags"=133,
"Amperage"=1055,"Capacity"=2642,"Current"=0},
{"Voltage"=0,"Flags"=1,
"Amperage"=0,"Capacity"=0,"Current"=0})
| | | }
BOTH:
% /usr/sbin/ioreg -p IODeviceTree -n battery -w 0 | sed -n '/battery/','/}$/'p
| | +-o battery@3
| | | {
| | | "reg" =
| | | "AAPL,phandle" =
| | | "device_type" =
| | | "name" =
| | | "IOBatteryInfo" = (
{"Voltage"=11154,"Flags"=133,
"Amperage"=1200,"Capacity"=2642,"Current"=0},
{"Voltage"=12520,"Flags"=133,
"Amperage"=1200,"Capacity"=4425,"Current"=0})
| | | }



[ Reply to This | # ]
Flags and alternative script
Authored by: hayne on Jun 26, '03 03:03:42AM

I discovered a similar, but more elaborate, script that uses the same (ioreg) method but has various display modes.
The author of this script has figured out what all the flags mean.
Script and documentation available from:
http://www.mitt-eget.com/software/macosx/



[ Reply to This | # ]