Apple PowerBook 520 Technical Information Page 120

  • Download
  • Add to my manuals
  • Print
  • Page
    / 144
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 119
CHAPTER 6
Power Manager Interface
106 About the Power Manager Interface
DESCRIPTION
The GetScaledBatteryInfo routine provides a generic means of returning
information about the battery or batteries in the system. Instead of returning a voltage
value, the routine returns the battery level as a fraction of the total possible voltage.
Note
New battery technologies such as NiCad (nickel cadmium) and nickel
metal hydride (NiMH) have replaced the sealed lead acid batteries of
the original Macintosh Portable. The algorithm for determining the
battery voltage that is documented in the Power Manager chapter of
Inside Macintosh, Volume VI, is no longer correct for all PowerBook
models.
The value of whichBattery determines whether GetScaledBatteryInfo returns
information about a particular battery or about the total battery level. The value of
GetScaledBatteryInfo should be in the range of 0 to BatteryCount(). If the value
of whichBattery is 0, GetScaledBatteryInfo returns a summation of all the
batteries, that is, the effective battery level of the whole system. If the value of
whichBattery is out of range, or the selected battery is not installed,
GetScaledBatteryInfo will return a result of 0 in all fields. Here is a summary of the
effects of the whichBattery parameter:
The GetScaledBatteryInfo routine returns information about the battery in the
following data structure:
typedef struct BatteryInfo {
unsigned char flags; /* misc flags (see below) */
unsigned char warningLevel; /* scaled warning level (0-255) */
char reserved; /* reserved for internal use */
unsigned char batteryLevel; /* scaled battery level (0-255) */
} BatteryInfo;
The flags character contains several bits that describe the battery and charger state. If a
bit value is 1, that feature is available or is operating; if the bit value is 0, that feature is
not operating. Unused bits are reserved by Apple for future expansion.
Field descriptions
Bit
Bit name number Description
batteryInstalled 7 A battery is installed.
batteryCharging 6 The battery is charging.
chargerConnected 5 The charger is connected.
Value of whichBattery Information returned
0 Total battery level for all batteries
From 1 to BatteryCount() Battery level for the selected battery
Less than 0 or greater than
BatteryCount
0 in all fields of theInfo
Page view 119
1 2 ... 115 116 117 118 119 120 121 122 123 124 125 ... 143 144

Comments to this Manuals

No comments