Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,672
6,212
Over the past few months I've been collecting data from customers via Battery Status (with their permission - I'd have about 100x more data if I collected it without asking) with the intent of solving this issue:

The IORegistry entry for Apple's Wireless Keyboard sometimes contains a different value in Battery Percent than what System Preferences reports. How much it differs isn't consistent. Anyways, I've been getting dumps of the IORegistry entry for the keyboards.

One of the fields in the registry entry is called "Battery". Here's the contents for a keyboard that said its BatteryPercent was 75, but System Preferences said was actually 100.

(Note that the "<= (number)" weren't in the original text, nor was the spacing. I added the line returns and indents, along with the decimal equivalents of hexadecimal numbers.)

Code:
<dict ID="0">
    <key>MV</key>
    <dict ID="1">
        <key>LT</key>
        <integer size="16" ID="2">0xafc</integer> <= 2812
    </dict>
    <key>UT</key>
    <dict ID="3">
        <key>F</key>
        <integer size="16" ID="4">0xb84</integer> <= 2948
        <key>L</key>
        <integer size="16" ID="5">0x9c6</integer> <= 2502
        <key>C</key>
        <integer size="16" ID="6">0x960</integer> <= 2400
        <key>E</key>
        <integer size="16" ID="7">0x803</integer> <= 2051
    </dict>
    <key>BT</key>
    <dict ID="8">
        <key>S</key>
        <integer size="64" ID="9">0xd7</integer> <= 215
        <key>R</key>
        <integer size="64" ID="10">0x1c41</integer> <= 7233
    </dict>
</dict>

Here's another one, for when the keyboard said it was 58 and it really was 58 (or at least the customer reported that way... maybe they were wrong, that would suck...)

Code:
<dict ID="0">
    <key>MV</key>
    <dict ID="1">
        <key>LT</key>
        <integer size="16" ID="2">0xa95</integer> <= 2709
    </dict>
    <key>UT</key>
    <dict ID="3">
        <key>F</key>
        <integer size="16" ID="4">0xb7d</integer> <= 2941
        <key>L</key>
        <integer size="16" ID="5">0x9be</integer> <= 2494
        <key>C</key>
        <integer size="16" ID="6">0x954</integer> <= 2388
        <key>E</key>
        <integer size="16" ID="7">0x7f9</integer> <= 2041
    </dict>
    <key>BT</key>
    <dict ID="8">
        <key>S</key>
        <integer size="64" ID="9">0x92</integer> <= 146
        <key>R</key>
        <integer size="64" ID="10">0x113</integer> <= 275
    </dict>
</dict>

What do you make of those variable names?
Code:
MV
    LT
UT
    F
    L
    C
    E
BT
    S
    R

I almost feel like these must be voltage measurements for a transistor or something. Maybe I2C or something. If I decipher them properly, I'll be able to determine the battery percentage properly.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.