Resources | Resources |



IBattery interface

Describes how to use the IBattery interface to get information about the battery on a mobile device.

The IBattery interface lets an application get battery-related information. To obtain an instance of the IBattery interface, an applet calls the ISHELL_CreateInstance() method, passing to it the class ID of the new instance. The following methods retrieve specific information about the battery:

  • To get the present power level of the battery, call IBATTERY_GetBatteryLevel()
  • To get the current status of the battery, call IBATTERY_GetBatteryStatus()
  • To get the status of the battery charger, call IBATTERY_GetBatteryChargerStatus(), which places information about the status of the charger in an AEEBatteryChargerStatus structure.
  • To check whether an external power supply is available to the battery, call IBATTERY_IsExternalPowerPresent()

OEMs can use a new instance of IBattery to add customized methods.

IBattery supports the IModel interface. A client can access the IModel interface by calling IBATTERY_QueryInterface() with AEEIID_MODEL, and register listeners using IMODEL_AddListener().