Start receiving notification

Context

You must have implemented and set the appropriate observers to receive notification.

Use CHWRMPower::StartAveragePowerReporting() to start battery voltage and battery consumption measurements.

The following code snippet demonstrates how to start battery voltage measurements:

TRequestStatus newstatus;
TIntervalMultiple intmul;

iPower->StartAveragePowerReporting( newstatus, intmul );
...

Use CHWRMPower::NotifyAverageChargingCurrent() to start receiving charging current information and CHWRMPower::NotifyBatteryFullChargingTime() to receive battery charging time information.

The following code snippet demonstrates how to receive battery charging status notification:

// Start receiving charging notification 
TRequestStaus status;
iPower->NotifyAverageChargingCurrent( status, EFourTimesBaseTimeInterval );
User::WaitForRequest( status );

Notes: Charging status notification is started automatically when SetBatteryChargingObserver is called with a MHWRMBatteryChargingStatusObserver specified.

When the charging status changes to EChargingStatusChargingComplete charging status notification is automatically disabled.

The following code snippet demonstrates how to get average charging current and remaining charging time notification:

// Register only for charging current
iPower->SetBatteryChargingObserver( NULL, notifier, NULL );

// Start receiving notification now-on
TRequestStaus status;
iPower->NotifyAverageChargingCurrent( status, 4 );
User::WaitForRequest( status );
...

// Register only for remaining charging time notification
iPower->SetBatteryChargingObserver( NULL, NULL, notifier );

// Start receiving notification now-on
TRequestStaus status;
iPower->NotifyBatteryFullChargingTime( status, 4 );
User::WaitForRequest( status );
...