GetPowerState

(Engine-Level Function)

Description: Returns a structure that holds details of the computer's power supply status.
Returns: Structure containing four elements
Usage: Steady State only.
Function Groups: Network & Workstation
Related to:  
Format: GetPowerState()
Parameters: none

Comments:

This function is intended for use when the workstation is running on battery power, whether UPS or laptop battery. The return structure contains the following elements:

PowerStatus

Short. AC line status.

0 == Offline

1 == Online

255 == Unknown status.

BatteryState

Short. Indicates the battery charge status as follows:

1 == High

2 == Low

4 == Critical

8 == Charging

128 == No system battery

255 == Unknown status.

BatteryLevel

Short. The remaining charge in the battery, expressed as a percentage.

BatteryLifetime

Double. Estimated number of seconds of charge remaining in battery.

Examples:

  { Display selected page name on the title bar }
  PowerState = GetPowerState();