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:

  • Explicitly using a PSY implementation UID

  • Implicitly (the Location Server uses the Default PSY)

These methods are described in more detail below.


  1. 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);
    
  2. 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);
    
  3. 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.