diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-C3B6E5F6-74DC-5C0E-94C8-B4822F4A2EB6.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-C3B6E5F6-74DC-5C0E-94C8-B4822F4A2EB6.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,76 @@ + + + + + +Power +API Tutorial This tutorial explains how to use the Power API of the HWRM. +
Introduction

Power API methods can be used by constructing +an instance of CHWRMPower and calling +its functions. However, to use its full functionality write a class which +implements one or more of the observer interfaces described in the following +table. Then, construct an instance of CHWRMPower and +provide it with pointers to observers.

+ + + +Interface +Notification +Method to override + + + + +

MHWRMBatteryPowerObserver

+

Average battery voltage and current consumption

+

PowerMeasurement

+
+ +

MHWRMBatteryChargingStatusObserver

+

Charging status

+

ChargingStatusChange

+
+ +

MHWRMBatteryChargingCurrentObserver

+

Average charging current

+

AverageChargingCurrentChange

+
+ +

MHWRMBatteryFullChargingTimeObserver

+

Remaining charging time

+

BatteryFullChargingTimeChange

+
+ + +

For example, if the application requires periodic measurements +of average battery voltage and current consumption, it must implement MHWRMBatteryPowerObserver and instantiate a CHWRMPower object using the CHWRMPower::NewL(NULL, +MHWRMBatteryPowerObserver *) method.

Note: The battery +charging observers cannot be passed to CHWRMPower using +a NewL() function. Call the dedicated +function, CHRMPower::SetBatteryChargingObserver().

+
Procedure
    +
  1. Derive +a class from one or more of the above interfaces.

  2. +
  3. Implement +the appropriate observer functions.

  4. +
  5. Create +a power client using CHWRMPower::NewL() or NewLC().

    You +can retrieve the battery voltage or consumption information.

  6. +
  7. Call CHRMPower::SetBatteryChargingObserver(), if +necessary.

  8. +
  9. Start +receiving notification using the appropriate start function(s).

  10. +
  11. Stop +receiving notification using the appropriate stop function(s).

  12. +

Note: If the notification period exceeds the maximum reporting +period, set when the HWRM server starts, notification is cancelled.

+
+Power API + +
\ No newline at end of file