|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept xml:lang="en" id="GUID-0D49DE9F-AE0D-552F-8769-D056BC505FC1"><title>How to use the Quality Profile API</title><prolog><metadata><keywords/></metadata></prolog><conbody><section><title>Purpose</title> <p>This document describes how to use the <xref href="GUID-87E9656E-CBB4-5023-B6BC-148A2957AFFC.dita">Quality Profile API</xref> to get quality parameter values from the quality profiles defined in the file <filepath>lbsprofile.ini</filepath>. </p> </section> <section><title>Using the API</title> <p>The code below demonstrates how to use the API to obtain all the values from a quality profile with ProfileID = 1 defined in <filepath>lbsprofile.ini</filepath>. </p> <p><b>Creating a CLbsQualityProfileApi object </b> </p> <p>A client uses the static constructor <xref href="GUID-163A58F0-D4F4-3362-BAF4-59106D6FEE8D.dita#GUID-163A58F0-D4F4-3362-BAF4-59106D6FEE8D/GUID-0D1A5179-7D4E-3EFA-96C2-DE456627EECC"><apiname>CLbsQualityProfileApi::NewL()</apiname></xref> to create an API object and defines some variables to store the quality profile values. </p> <codeblock id="GUID-A72E7F26-F0CD-5EEB-8985-ABEB51EBCD16" xml:space="preserve">#include <lbsqualityprofileapi.h> |
|
13 |
|
14 CLbsQualityProfileApi* profileApi = CLbsQualityProfileApi::NewL(); |
|
15 CleanupStack::PushL(profileApi); |
|
16 |
|
17 TReal32 hAccuracy; |
|
18 TReal32 vAccuracy; |
|
19 |
|
20 TTimeIntervalMicroSeconds maxFixTime; |
|
21 TTimeIntervalMicroSeconds initialFixTime; |
|
22 TTimeIntervalMicroSeconds intermedFixTime; |
|
23 TTimeIntervalMicroSeconds finalLagTime; |
|
24 |
|
25 ... |
|
26 </codeblock> <p><b>Getting horizontal and vertical accuracy </b> </p> <p>A client calls <xref href="GUID-163A58F0-D4F4-3362-BAF4-59106D6FEE8D.dita#GUID-163A58F0-D4F4-3362-BAF4-59106D6FEE8D/GUID-4CC90CA9-E483-3995-8230-CFD23D097A80"><apiname>CLbsQualityProfileApi::Get()</apiname></xref> passing one of the following as the second parameter: </p> <ul><li id="GUID-A7B81292-7716-53E7-B597-78A46FEA6492"><p> <codeph>KLbsQualityProfileHorizontalAccuracy</codeph> to get the horizontal accuracy in metres </p> </li> <li id="GUID-14DA2292-589E-54D7-A074-B0BCC13D9141"><p> <codeph>KLbsQualityProfileVerticalAccuracy</codeph> to get the vertical accuracy in metres </p> </li> </ul> <codeblock id="GUID-7B4FC624-FF31-5EC4-B5BE-8E4AA0F85FF6" xml:space="preserve">... |
|
27 |
|
28 // Get horizontal accuracy |
|
29 TInt err = profileApi->Get(1, KLbsQualityProfileHorizontalAccuracy, hAccuracy); |
|
30 if (err != KErrNone) { |
|
31 // Handle error |
|
32 ... |
|
33 } |
|
34 |
|
35 // Get vertical accuracy |
|
36 err = profileApi->Get(1, KLbsQualityProfileVerticalAccuracy, vAccuracy); |
|
37 if (err != KErrNone) { |
|
38 // Handle error |
|
39 ... |
|
40 } |
|
41 |
|
42 ... |
|
43 </codeblock> <p><b>Getting the times to obtain a location fix or GPS measurements </b> </p> <p>A client class calls <xref href="GUID-163A58F0-D4F4-3362-BAF4-59106D6FEE8D.dita#GUID-163A58F0-D4F4-3362-BAF4-59106D6FEE8D/GUID-4CC90CA9-E483-3995-8230-CFD23D097A80"><apiname>CLbsQualityProfileApi::Get()</apiname></xref> passing one of the following as the second parameter: </p> <ul><li id="GUID-B3A4FE3C-521B-5A09-95D5-05A285617EE0"><p> <codeph>KLbsQualityProfileMaxFixTime</codeph> to get the time to obtain a location fix </p> </li> <li id="GUID-11015778-751B-5CCD-B3A6-DEBEC1B54500"><p> <codeph>KLbsQualityProfileMeasurementInitialFixTime</codeph> to get the time to get the first GPS measurements </p> </li> <li id="GUID-8120F558-5680-52A7-BD53-38BE83E5CE3E"><p> <codeph>KLbsQualityProfileMeasurementIntermediateFixTime</codeph> to get the time to get subsequent GPS measurements </p> </li> <li id="GUID-7E7A3FA4-3B17-54C4-A952-5E1BF64CA7AD"><p> <codeph>KLbsQualityProfileFinalNetPositionLag</codeph> to get the time required to obtain the final position from the network. </p> </li> </ul> <codeblock id="GUID-D1E1BB2E-0ADF-535A-9B94-AAD812ADF70E" xml:space="preserve">... |
|
44 |
|
45 // Get max fix time |
|
46 err = profileApi->Get(1, KLbsQualityProfileMaxFixTime, maxFixTime); |
|
47 if (err != KErrNone) { |
|
48 // Handle error |
|
49 ... |
|
50 } |
|
51 |
|
52 // Get initial measurements fix time |
|
53 err = profileApi->Get(1, KLbsQualityProfileMeasurementInitialFixTime, initialFixTime); |
|
54 if (err != KErrNone) { |
|
55 // Handle error |
|
56 ... |
|
57 } |
|
58 |
|
59 // Get intermediate measurements fix time |
|
60 err = profileApi->Get(1, KLbsQualityProfileMeasurementIntermediateFixTime, intermedFixTime); |
|
61 if (err != KErrNone) { |
|
62 // Handle error |
|
63 ... |
|
64 } |
|
65 |
|
66 // Get time required to get final network position lag time |
|
67 err = profileApi->Get(1, KLbsQualityProfileFinalNetPositionLag, finalLagTime); |
|
68 if (err != KErrNone) { |
|
69 // Handle error |
|
70 ... |
|
71 } |
|
72 |
|
73 CleanupStack::PopAndDestroy(profileApi); |
|
74 </codeblock> </section> <section><title>See also</title> <p> <xref href="GUID-87E9656E-CBB4-5023-B6BC-148A2957AFFC.dita">Quality Profiles</xref> </p> <p> <xref href="GUID-5E6CA805-6861-54B1-8687-B997A6F4E6EE.dita">Quality Profile API</xref> </p> </section> </conbody></concept> |