diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-8D237BD6-9759-4180-B190-F1624594017F.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-8D237BD6-9759-4180-B190-F1624594017F.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,76 @@ + + + + + +Time Client Interface Tutorial — Using the InterfaceProvides examples of how the Time client interface is used. +

The Time client interface methods can be executed independently. +The following examples show the Time client interface functions being +used along with an explanation.

+
Using +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

An example of the use of this function is:

MRtcAdaptation* rtcAdaptation = NewRtcAdaptationL(); +TPckgBuf<TBool> boolPckg; +TRequestStatus status; + +rtcAdaptation->ValidateRtc(boolPckg, status); +

The first three lines define the instance of the MRtcAdaptation class and the variables that are to be used.

The fifth line invokes the MRtcAdaptation::ValidateRtc() method. The first parameter will return the validity of the Real +Time Clock (RTC) as a boolean value. The second parameter returns +the completion status of the request. If the RTC clock is valid, then +this would be KErrNone.

+
Using +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

An example of the use of this function is:

Asic Asic_class; +TInt r; +r = Asic_class::SetSystemTimeCalibration(30);

In the +above example, the RTC is being set with a time calibration value +of 30ppm (parts per million). This means that the RTC can lose up +to one second every 30 million seconds.

The value returned by +this function is either KErrNone or a system wide +error code if something went wrong.

+
Using +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

An example of the use of this function is:

TPckgC <TTime> timePckg(testTime); + rtcAdaptation->SetWakeupAlarm(timePckg, status);

In +the above example, the first line declares the variable to be used +and initializes it. The second line is used to set the wake-up alarm +time.

+
Using +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

An example of the use of this function is:

TRequestStatus status; +rtcAdaptation->UnsetWakeupAlarm(status); +

The first line declares the variable that is to be +used. The second line deletes the current device wake-up alarm time.

+
Using +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

An example of the use of this function is:

rtcAdaptation->Cancel(); +

In the above example, the last request made to the +instance of the MRtcAdaptation class, defined as rtcAdaptation in the above example, will be deleted.

+
Using +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

An example of the use of this function is:

rtcAdaptation->Release(); +

In the above example, a call to the destructor in the +instance of the MRtcAdaptation class, defined as rtcAdaptation in the above example, is made.

+
Using +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

An example of the use of this function is:

Asic Asic_class; +TInt hwrtc = 0; +Asic_class::SystemTimeInSecondsFrom2000(hwrtc); +

The first and second lines declare and initialize the +variables and classes that are to be used. The third line calls the ASIC::SystemTimeInSecondsFrom2000() function. The number +of seconds since the start of the year 2000 is placed in the variable +that has been passed as a parameter.

The value returned by this +function is either KErrNone or a system wide error +code (if something went wrong).

+
Using +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

An example of the use of this function is:

Asic Asic_class; +TInt r=0; +r = Asic_class::SetSystemTimeInSecondsFrom2000(0);

The +first and second lines declare and initialize the variables and classes +that are to be used. The third line sets the RTC to be zero seconds +from the start of the year 2000.

The value returned by this +function is either KErrNone or a system wide error +code (if something went wrong).

+
+Time +Implementation Guide +
\ No newline at end of file