Opening a Session That Uses the GPS/A-GPS PSY
This shows how to open a session using the GPS/A-GPS PSY.
The GPS/A-GPS PSY is used by the Location Server eposserver.exe to connect to positioning hardware using the A-GPS Location Manager and an A-GPS Integration Module.
To use the GPS/A-GPS PSY a Location Acquisition API client opens an RPositioner subsession using one of the following methods:
These methods are described in more detail below.
To use the A-GPS PSY, open a session using its implementation UID, which is 0x10285abc. Open a session and subsession using the Location Acquisition API as shown below: #include <lbs.h>
#include <lbserrors.h>
const TInt KAGPSPSYImpl = 0x10285abc;
...
RPositionServer server;
RPositioner positioner;
/Create a session with the location server
User::LeaveIfError(server.Connect());
CleanupClosePushL(server);
// Create a subsession with the Location Server using the A-GPS PSY
User::LeaveIfError(positioner.Open(server, TUid::Uid(KAGPSPSYImpl)));
CleanupClosePushL(positioner);
// Use Location Acquisition API as normal - see API documentation for more details
...
// Close the session
CleanupStack::PopAndDestroy(&positioner);
CleanupStack::PopAndDestroy(&server);
- To use the GPS PSY, open a session using its implementation UID, which is 0x102869C7.
#include <lbs.h>
#include <lbserrors.h>
const TInt KGPSPSYImpl = 0x102869C7;
...
RPositionServer server;
RPositioner positioner;
/Create a session with the location server
User::LeaveIfError(server.Connect());
CleanupClosePushL(server);
// Create a subsession with the Location Server using the GPS PSY
User::LeaveIfError(positioner.Open(server, TUid::Uid(KGPSPSYImpl)));
CleanupClosePushL(positioner);
// Use Location Acquisition API as normal - see API documentation for more details
...
// Close the session
CleanupStack::PopAndDestroy(&positioner);
CleanupStack::PopAndDestroy(&server);
- To use the Default PSY, open a session without specifying a PSY UID.
...
//Create a session with the location server
User::LeaveIfError(server.Connect());
CleanupClosePushL(server);
// Location Server uses the default PSY, which can use the GPS/A-GPS PSY
User::LeaveIfError(positioner.Open(server);
CleanupClosePushL(positioner);
// Use Location Acquisition API as normal...
...
The Default PSY has a list of all available PSYs. If the GPS PSY and A-GPS PSY are installed, one of them can be used by the Default PSY. The choice of which PSY is used is based on the priority and availability of the PSYs. See Positioning Plug-in Information API for more information about PSY settings. See Default PSY for information about how a PSY is selected.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.