Microsoft Windows CE 3.0  

BATTERY_STATUS

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This structure specifies information about the power status of the system.

typedef struct {  
BYTE
ACLineStatus; 
BYTE
BatteryFlag; 
BYTE
BatteryLifePercent; 
BYTE
Reserved1; 
DWORD
BatteryLifeTime; 
DWORD
BatteryFullLifeTime; 
BYTE
Reserved2; 
BYTE
BackupBatteryFlag; 
BYTE
BackupBatteryLifePercent; 
BYTE
fBatteriesChangedSinceLastCall; 
DWORD
BackupBatteryLifeTime; 
DWORD
BackupBatteryFullLifeTime; 
} BATTERY_STATUS;

Members

ACLineStatus
Indicates whether the device is running on AC power; one of the following values:
Value Description
AC_LINE_OFFLINE Offline.
AC_LINE_ONLINE Online.
AC_LINE_BACKUP_POWER Backup power.
AC_LINE_UNKNOWN Unknown status.

All other values are reserved.

BatteryFlag
Battery charge status; one of the following values:
Value Description
BATTERY_FLAG_HIGH High.
BATTERY_FLAG_LOW Low.
BATTERY_FLAG_CRITICAL Critical.
BATTERY_FLAG_CHARGING Charging.
BATTERY_FLAG_NO_BATTERY No system battery.
BATTERY_FLAG_UNKNOWN Unknown status.

All other values are reserved.

BatteryLifePercent
Percentage of battery charge remaining. Must be in the range from 0 through 100 or BATTERY_PERCENTAGE_UNKNOWN.
Reserved1
Must be 0.
BatteryLifeTime
Number of seconds of battery life remaining or BATTERY_LIFE_UNKNOWN if remaining lifetime is unknown.
BatteryFullLifeTime
Number of seconds of battery life when at full charge or BATTERY_LIFE_UNKNOWN if full lifetime is unknown.
Reserved2
Must be 0.
BackupBatteryFlag
Backup battery charge status; one of the following values:
Value Description
BATTERY_FLAG_HIGH High.
BATTERY_FLAG_LOW Low.
BATTERY_FLAG_CRITICAL Critical.
BATTERY_FLAG_CHARGING Charging.
BATTERY_FLAG_NO_BATTERY No system battery.
BATTERY_FLAG_UNKNOWN Unknown status.

All other values are reserved.

BackupBatteryLifePercent
Percentage of full backup battery charge remaining. Must be in the range from 0 through 100 or BATTERY_PERCENTAGE_UNKNOWN.
fBatteriesChangedSinceLastCall
One of the following values:
Value Description
TRUE (1) Indicates that the batteries have been changed since the last time the BatteryDrvrGetStatusfunction was called.
FALSE (0) Indicates that the batteries have not been changed.

Usually, the driver determines this bit during an interrupt process. When a Battery Cover Opened interrupt occurs, the interrupt service routine (ISR) sets a global variable to indicate that the cover has been opened. The next time BatteryDrvrGetStatusis called, the driver sets fBatteriesChangedSinceLastCallto TRUE and resets variable. If the global variable was not set, fBatteriesChangedSinceLastCallis set to FALSE.

BackupBatteryLifeTime
Number of seconds of backup battery life remaining or BATTERY_LIFE_UNKNOWN if remaining lifetime is unknown.
BackupBatteryFullLifeTime
Number of seconds of backup battery life when at full charge or BATTERY_LIFE_UNKNOWN if full lifetime is unknown.

Remarks

This GWES data structure is implemented as part of porting native device drivers.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Battery.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.


 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.