class MHWRMBatteryPowerObserver |
A callback interface for power measurements reporting.
If the client requires periodical measurements of the Average Power, it needs to derive a class from the MHWRMBatteryPowerObserver interface and implement the PowerMeasurement() method.
A callback object header example:
// INCLUDES #include <hwrmpower.h> // Link against HWRMPowerClient.lib. class CTest : public CBase, public MHWRMBatteryPowerObserver { public: CTest(); ~CTest(); void ConstructL(); static CTest* NewL(); // from MHWRMBatteryPowerObserver virtual void PowerMeasurement(TInt aErr, CHWRMPower::TBatteryPowerMeasurementData& aMeasurement); private: CHWRMPower* iPower; };
A callback method implementation example:
void CTest::PowerMeasurement(TInt aErr, CHWRMPower::TBatteryPowerMeasurementData& aMeasurement); { if (aErrorCode == KErrNone) { INFO_PRINTF2(_L("INFO: Power Measurement Received, averageVolatge=%d, averageCurrent=%d"),aMeasurement.iAverageVoltage, aMeasurement.iAverageCurrent); } else { INFO_PRINTF2(_L("INFO: Power Measurement Measurement Error, error=%d"),aErr); } }
Public Member Functions | |
---|---|
void | PowerMeasurement ( TInt , CHWRMPower::TBatteryPowerMeasurementData &) |
void | PowerMeasurement | ( | TInt | aErr, |
CHWRMPower::TBatteryPowerMeasurementData & | aMeasurement | |||
) | [pure virtual] |
Called when a Power(Voltage and Current) consumption measurement value is received.
TInt aErr | Error code. |
CHWRMPower::TBatteryPowerMeasurementData & aMeasurement | The Average Power value calculated by the plugin. Valid only when aErr == KErrNone. |
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.