This tutorial explains how to use the Power API of the HWRM.
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 |
---|---|---|
Average battery voltage and current consumption |
||
Charging status |
||
Average charging current |
||
Remaining charging time |
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() .
Create a power client using CHWRMPower::NewL() or NewLC() .
You can retrieve the battery voltage or consumption information.
Call CHRMPower::SetBatteryChargingObserver(), if necessary.
Start receiving notification using the appropriate start function(s).
Stop receiving notification using the appropriate stop function(s).
Note: If the notification period exceeds the maximum reporting period, set when the HWRM server starts, notification is cancelled.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.