POWER_STATUS


typedef struct _POWER_STATUS {
    BYTE PS_AC_Line_Status;
    BYTE PS_Battery_Status;
    BYTE PS_Battery_Flag;
    BYTE PS_Battery_Life_Percentage;
    WORD PS_Battery_Life_Time
} POWER_STATUS;

Contains information about the APM BIOS power status. With the exception of the BatteryLifeTime parameter, this information is structured identically to that specified in the APM 1.1 specification.

PS_AC_Line_Status

AC line status. Can be 00h for off-line, 01h for on-line, or 02h for on backup power (that is, on an uninterruptible power supply). It is 0FFh if the AC status is unknown. All other values are reserved.

PS_Battery_Status

Battery charge status. Can be 00h for high charge, 01h for low charge, 02h for critical, 03h for charging, and 0FFh for unknown status. All other values are reserved.

PS_Battery_Flag

Battery status. Can be a combination of 01h for high charge, 02h for low charge, 04h for critical, 08h for charging, and 080h for no system battery. all other bit values are reserved. This member is 0FFh if status is unknown.

PS_Battery_Life_Percentage

Percentage of Full Charge remaining. Can be a value in the range 0 to 100, or 0xFF if the battery life is unknown. All other values are reserved.

PS_Battery_Life_Time

Number of seconds of battery life remaining, or 0FFFFFFFFh if the life time is unknown.

When PS_AC_Line_Status is 02h (on backup power), the power status values apply to the system's backup battery.

Since PS_Battery_Flag and PS_Battery_Life_Time are not supported by an APM 1.0 BIOS, VPOWERD returns 0FFh and 0FFFFFFFFh in these fields when connected to an APM 1.0 BIOS. The PS_Battery_Flag value should be used preferentially over the PS_Battery_Status value. The PS_Battery_Status specifies only the most recently changed status item since the last call to the BIOS power status function and therefore is supported only for backward compatibility with older systems not capable of reporting the PS_Battery_Flag value.