Symbian3/SDK/Source/GUID-FC7F8CFE-F9AD-4442-9289-CCEFEC62DF68.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-FC7F8CFE-F9AD-4442-9289-CCEFEC62DF68" xml:lang="en"><title>Start
receiving notification</title><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context>       <p>You must have implemented and set the appropriate observers
to receive notification. </p> <p>Use <xref href="GUID-4A98138C-4C68-3399-80E8-25CB41E43D5C.dita"><apiname>CHWRMPower::StartAveragePowerReporting()</apiname></xref> to
start battery voltage and battery consumption measurements. </p> <p>The following
code snippet demonstrates how to start battery voltage measurements: </p> <codeblock id="GUID-36804159-E282-5E5C-9EE2-73959BC41F43" xml:space="preserve">
TRequestStatus newstatus;
TIntervalMultiple intmul;

iPower-&gt;StartAveragePowerReporting( newstatus, intmul );
...
</codeblock> <p>Use <xref href="GUID-4A98138C-4C68-3399-80E8-25CB41E43D5C.dita"><apiname>CHWRMPower::NotifyAverageChargingCurrent()</apiname></xref> to
start receiving charging current information and <xref href="GUID-4A98138C-4C68-3399-80E8-25CB41E43D5C.dita"><apiname>CHWRMPower::NotifyBatteryFullChargingTime()</apiname></xref> to
receive battery charging time information. </p> <p>The following code snippet
demonstrates how to receive battery charging status notification: </p> <codeblock id="GUID-6DCA3FFC-04FE-53A1-BDA2-EF57B04D8A17" xml:space="preserve">// Start receiving charging notification 
TRequestStaus status;
iPower-&gt;NotifyAverageChargingCurrent( status, EFourTimesBaseTimeInterval );
User::WaitForRequest( status );
</codeblock> <p> <b>Notes:</b> Charging status notification is started automatically
when <xref href="GUID-4A98138C-4C68-3399-80E8-25CB41E43D5C.dita"><apiname>SetBatteryChargingObserver</apiname></xref> is
called with a <xref href="GUID-4A98138C-4C68-3399-80E8-25CB41E43D5C.dita"><apiname>MHWRMBatteryChargingStatusObserver</apiname></xref> specified. </p> <p>When
the charging status changes to <xref href="GUID-4A98138C-4C68-3399-80E8-25CB41E43D5C.dita"><apiname>EChargingStatusChargingComplete</apiname></xref> charging
status notification is automatically disabled. </p> <p>The following code
snippet demonstrates how to get average charging current and remaining charging
time notification: </p> <codeblock id="GUID-27456CE4-5C58-5608-BE47-C3050D7E32E5" xml:space="preserve">// Register only for charging current
iPower-&gt;SetBatteryChargingObserver( NULL, notifier, NULL );

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

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

// Start receiving notification now-on
TRequestStaus status;
iPower-&gt;NotifyBatteryFullChargingTime( status, 4 );
User::WaitForRequest( status );
...</codeblock>     </context>
</taskbody></task>