Adaptation/GUID-8D237BD6-9759-4180-B190-F1624594017F.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     6
<!-- Initial Contributors:
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     7
    Nokia Corporation - initial contribution.
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     8
Contributors: 
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
     9
-->
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    10
<!DOCTYPE concept
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    12
<concept id="GUID-8D237BD6-9759-4180-B190-F1624594017F" xml:lang="en"><title>Time Client Interface Tutorial — Using the Interface</title><shortdesc>Provides examples of how the Time client interface is used.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    13
<p>The Time client interface methods can be executed independently.
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    14
The following examples show the Time client interface functions being
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    15
used along with an explanation.</p>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    16
<section id="GUID-98F7B0DE-CBA6-430C-972D-02F9AB444E1B"><title>Using
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    17
the <xref href="GUID-CC79A63E-15DF-3437-983B-9A90966B3004.dita#GUID-CC79A63E-15DF-3437-983B-9A90966B3004/GUID-AC7C2EFB-BE71-301A-9C03-A15BDC0EF310"><apiname>MRtcAdaptation::ValidateRtc()</apiname></xref> function</title><p>An example of the use of this function is:</p><codeblock xml:space="preserve">MRtcAdaptation* rtcAdaptation = NewRtcAdaptationL();
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    18
TPckgBuf&lt;TBool&gt; boolPckg;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    19
TRequestStatus status;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    20
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    21
rtcAdaptation-&gt;ValidateRtc(boolPckg, status);
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    22
</codeblock><p>The first three lines define the instance of the <xref href="GUID-CC79A63E-15DF-3437-983B-9A90966B3004.dita"><apiname>MRtcAdaptation</apiname></xref> class and the variables that are to be used.</p><p>The fifth line invokes the <xref href="GUID-CC79A63E-15DF-3437-983B-9A90966B3004.dita#GUID-CC79A63E-15DF-3437-983B-9A90966B3004/GUID-AC7C2EFB-BE71-301A-9C03-A15BDC0EF310"><apiname>MRtcAdaptation::ValidateRtc()</apiname></xref> method. The first parameter will return the validity of the Real
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    23
Time Clock (RTC) as a boolean value. The second parameter returns
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    24
the completion status of the request. If the RTC clock is valid, then
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    25
this would be <codeph>KErrNone</codeph>.</p></section>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    26
<section id="GUID-3D0DD0AB-4F3F-4411-B5E8-9199AB71F1A6"><title>Using
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    27
the <xref href="GUID-69C70CA3-1121-3C5B-AEA4-B2E0245539B9.dita#GUID-69C70CA3-1121-3C5B-AEA4-B2E0245539B9/GUID-2D7976BE-F6D5-3FC4-8253-C34A592A63D3"><apiname>ASIC::SetSystemTimeCalibration()</apiname></xref> function</title><p>An example of the use of this function is:</p><codeblock xml:space="preserve">Asic Asic_class;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    28
TInt r;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    29
r = Asic_class::SetSystemTimeCalibration(30);</codeblock><p>In the
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    30
above example, the RTC is being set with a time calibration value
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    31
of 30ppm (parts per million). This means that the RTC can lose up
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    32
to one second every 30 million seconds.</p><p>The value returned by
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    33
this function is either <codeph>KErrNone</codeph> or a system wide
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    34
error code if something went wrong.</p></section>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    35
<section id="GUID-813CB223-3385-4293-9D1C-8C712B031E8F"><title>Using
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    36
the <xref href="GUID-C82E90BC-451B-3BB4-83E0-243061BCFA14.dita#GUID-C82E90BC-451B-3BB4-83E0-243061BCFA14/GUID-611E6535-9CCA-39E3-8236-654FF280B7CD"><apiname>MRtcAdaption::SetWakeUpAlarm()</apiname></xref> function</title><p>An example of the use of this function is:</p><codeblock xml:space="preserve"> TPckgC &lt;TTime&gt; timePckg(testTime);
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    37
 rtcAdaptation-&gt;SetWakeupAlarm(timePckg, status); </codeblock><p>In
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    38
the above example, the first line declares the variable to be used
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    39
and initializes it. The second line is used to set the wake-up alarm
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    40
time.</p></section>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    41
<section id="GUID-DE156EC7-759F-4BFC-BCAA-FE0E84CC83D9"><title>Using
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    42
the <xref href="GUID-CC79A63E-15DF-3437-983B-9A90966B3004.dita#GUID-CC79A63E-15DF-3437-983B-9A90966B3004/GUID-C2A7DE1F-6354-31D6-A397-5CE690C4C67E"><apiname>MRtcAdaptation::UnsetWakeUpAlarm()</apiname></xref> function</title><p>An example of the use of this function is:</p><codeblock xml:space="preserve">TRequestStatus status;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    43
rtcAdaptation-&gt;UnsetWakeupAlarm(status);
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    44
</codeblock><p>The first line declares the variable that is to be
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    45
used. The second line deletes the current device wake-up alarm time.</p></section>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    46
<section id="GUID-1111CFEA-D85C-4107-BB14-618C6A5A0B3F"><title>Using
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    47
the <xref href="GUID-CC79A63E-15DF-3437-983B-9A90966B3004.dita#GUID-CC79A63E-15DF-3437-983B-9A90966B3004/GUID-ADC7041A-23F0-319F-A163-29E8BB261D0B"><apiname>MRtcAdaptation::Cancel()</apiname></xref> function</title><p>An example of the use of this function is:</p><codeblock xml:space="preserve">rtcAdaptation-&gt;Cancel();
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    48
</codeblock><p>In the above example, the last request made to the
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    49
instance of the <xref href="GUID-CC79A63E-15DF-3437-983B-9A90966B3004.dita"><apiname>MRtcAdaptation</apiname></xref> class, defined as <codeph>rtcAdaptation</codeph> in the above example, will be deleted.</p></section>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    50
<section id="GUID-2EE46E01-006D-431E-B6C0-CAEBDDE5D53A"><title>Using
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    51
the <xref href="GUID-CC79A63E-15DF-3437-983B-9A90966B3004.dita#GUID-CC79A63E-15DF-3437-983B-9A90966B3004/GUID-C44E98E9-6568-3628-9A7E-85379C4298FD"><apiname>MRtcAdaptation::Release()</apiname></xref> function</title><p>An example of the use of this function is:</p><codeblock xml:space="preserve">rtcAdaptation-&gt;Release();
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    52
</codeblock><p>In the above example, a call to the destructor in the
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    53
instance of the <xref href="GUID-CC79A63E-15DF-3437-983B-9A90966B3004.dita"><apiname>MRtcAdaptation</apiname></xref> class, defined as <codeph>rtcAdaptation</codeph> in the above example, is made.</p></section>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    54
<section id="GUID-C69C0225-1779-4FFC-B071-D18B71C18A74"><title>Using
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    55
the <xref href="GUID-69C70CA3-1121-3C5B-AEA4-B2E0245539B9.dita#GUID-69C70CA3-1121-3C5B-AEA4-B2E0245539B9/GUID-EE99A729-F30E-3B3A-BCA2-0F10B383AB6C"><apiname>ASIC::SystemTimeInSecondsFrom2000()</apiname></xref> function</title><p>An example of the use of this function is:</p><codeblock xml:space="preserve">Asic Asic_class;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    56
TInt hwrtc = 0;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    57
Asic_class::SystemTimeInSecondsFrom2000(hwrtc);
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    58
</codeblock><p>The first and second lines declare and initialize the
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    59
variables and classes that are to be used. The third line calls the <xref href="GUID-69C70CA3-1121-3C5B-AEA4-B2E0245539B9.dita#GUID-69C70CA3-1121-3C5B-AEA4-B2E0245539B9/GUID-EE99A729-F30E-3B3A-BCA2-0F10B383AB6C"><apiname>ASIC::SystemTimeInSecondsFrom2000()</apiname></xref> function. The number
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    60
of seconds since the start of the year 2000 is placed in the variable
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    61
that has been passed as a parameter.</p><p>The value returned by this
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    62
function is either <codeph>KErrNone</codeph> or a system wide error
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    63
code (if something went wrong).</p></section>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    64
<section id="GUID-1BFBAEE5-AE48-4624-BD34-3D6B936C8C3B"><title>Using
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    65
the <xref href="GUID-69C70CA3-1121-3C5B-AEA4-B2E0245539B9.dita#GUID-69C70CA3-1121-3C5B-AEA4-B2E0245539B9/GUID-C6983BB7-6496-3863-8109-6845F5DA62CF"><apiname>ASIC::SetSystemTimeInSecondsFrom2000()</apiname></xref> function</title><p>An example of the use of this function is:</p><codeblock xml:space="preserve">Asic Asic_class;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    66
TInt r=0;
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    67
r = Asic_class::SetSystemTimeInSecondsFrom2000(0);</codeblock><p>The
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    68
first and second lines declare and initialize the variables and classes
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    69
that are to be used. The third line sets the RTC to be zero seconds
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    70
from the start of the year 2000.</p><p>The value returned by this
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    71
function is either <codeph>KErrNone</codeph> or a system wide error
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    72
code (if something went wrong).</p></section>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    73
</conbody><related-links>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    74
<link href="GUID-10D79C75-6AB9-4717-87EF-057F19CB8283.dita"><linktext>Time
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    75
Implementation Guide</linktext></link>
307f4279f433 Initial contribution of the Adaptation Documentation.
Graeme Price <GRAEME.PRICE@NOKIA.COM>
parents:
diff changeset
    76
</related-links></concept>