GetBatteryTimesYou can use the
GetBatteryTimesfunction to find out about how much battery time remains.
void GetBatteryTimes (short whichBattery, BatteryTimeRec *theTimes);
- The battery for which you want to know the time remaining. Specify 0 to get combined information about all the batteries.
- A pointer to a battery time structure, which contains information about the time remaining for the batteries. The
BatteryTimeRecdata type is described on page 6-28.
GetBatteryTimesfunction returns information about the time remaining on the computer's battery or batteries. The time values are in seconds. The value of
theTimes.expectedBatteryTimeis the estimated time remaining based on current use patterns. The values of
theTimes.maximumBatteryTime are worst-case and best-case estimates, respectively. The value of
theTimes.timeUntilCharged is the time that remains until the battery or batteries are fully charged.
The value of
GetBatteryTimesreturns the time information about a particular battery or the total time for all batteries. The value of
GetScaledBatteryInfoshould be in the range of 0 to
BatteryCount(). If the value of
GetBatteryTimesreturns a total time for all the batteries, that is, the effective battery time for the whole system. If the value of
whichBatteryis out of range, or the selected battery is not installed,
GetBatteryTimeswill return a result of 0 in all fields. Here is a summary of the effects of the
Information returned 0 Total battery time for all batteries From 1 to
Battery time for the selected battery Less than 0 or greater than
0 in all fields of
ASSEMBLY-LANGUAGE INFORMATIONThe trap is
_PowerMgrDispatch($A09E). The selector value for
GetBatteryTimesis 28 ($1C) in the low word of register D0. The pointer to
BatteryTimeRecis passed in register A0.