Opening a session that uses the Network PSY

This shows how to open a session using the Network PSY.

The Network PSY is used by the Location Server eposserver.exe to connect to positioning hardware using the Network Location Manager and a Network Protocol Module.

To use the Network 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 Network PSY explicitly, open a session using the Network PSY implementation UID. The Network PSY has an implementation UID = 0x10285abc. Open a session and subsession using the Location Acquisition API as shown below:
    #include <lbs.h>
    #include <lbserrors.h>
    
    #define KNetPSYImplUid 0x10285abe
    
    ...
    
    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 Network PSY
    User::LeaveIfError(positioner.Open(server, TUid::Uid(KNetPSYImplUid)));
    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 Network PSY implicitly through 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 Network 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 Network PSY is installed it 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.