How to use the Quality Profile API

Purpose

This document describes how to use the Quality Profile API to get quality parameter values from the quality profiles defined in the file lbsprofile.ini.

Using the API

The code below demonstrates how to use the API to obtain all the values from a quality profile with ProfileID = 1 defined in lbsprofile.ini.

Creating a CLbsQualityProfileApi object

A client uses the static constructor CLbsQualityProfileApi::NewL() to create an API object and defines some variables to store the quality profile values.

#include <lbsqualityprofileapi.h>

CLbsQualityProfileApi* profileApi = CLbsQualityProfileApi::NewL();
CleanupStack::PushL(profileApi);

TReal32 hAccuracy;
TReal32 vAccuracy;

TTimeIntervalMicroSeconds maxFixTime;
TTimeIntervalMicroSeconds initialFixTime;
TTimeIntervalMicroSeconds intermedFixTime;
TTimeIntervalMicroSeconds finalLagTime;

...

Getting horizontal and vertical accuracy

A client calls CLbsQualityProfileApi::Get() passing one of the following as the second parameter:

  • KLbsQualityProfileHorizontalAccuracy to get the horizontal accuracy in metres

  • KLbsQualityProfileVerticalAccuracy to get the vertical accuracy in metres

...

// Get horizontal accuracy
TInt err = profileApi->Get(1, KLbsQualityProfileHorizontalAccuracy, hAccuracy);
if (err != KErrNone) {
 // Handle error
 ...
}

// Get vertical accuracy
err = profileApi->Get(1, KLbsQualityProfileVerticalAccuracy, vAccuracy);
if (err != KErrNone) {
 // Handle error
 ...
}

...

Getting the times to obtain a location fix or GPS measurements

A client class calls CLbsQualityProfileApi::Get() passing one of the following as the second parameter:

  • KLbsQualityProfileMaxFixTime to get the time to obtain a location fix

  • KLbsQualityProfileMeasurementInitialFixTime to get the time to get the first GPS measurements

  • KLbsQualityProfileMeasurementIntermediateFixTime to get the time to get subsequent GPS measurements

  • KLbsQualityProfileFinalNetPositionLag to get the time required to obtain the final position from the network.

...

// Get max fix time
err = profileApi->Get(1, KLbsQualityProfileMaxFixTime, maxFixTime);
if (err != KErrNone) {
 // Handle error
 ...
}

// Get initial measurements fix time
err = profileApi->Get(1, KLbsQualityProfileMeasurementInitialFixTime, initialFixTime);
if (err != KErrNone) {
 // Handle error
 ...
}

// Get intermediate measurements fix time
err = profileApi->Get(1, KLbsQualityProfileMeasurementIntermediateFixTime, intermedFixTime);
if (err != KErrNone) {
 // Handle error
 ...
}

// Get time required to get final network position lag time
err = profileApi->Get(1, KLbsQualityProfileFinalNetPositionLag, finalLagTime);
if (err != KErrNone) {
 // Handle error
 ...
}
        
CleanupStack::PopAndDestroy(profileApi);