class CLbsNetworkProtocolBase : public CBase |
The CLbsNetworkProtocolBase is the abstract interface to a network protocol module. It is used by the LBS susbstem to pass requests and responses to the module.
The CLbsNetworkProtocolBase class is used in partnership with MLbsNetworkProtocolObserver. The network protocol module responds to requests from the LBS subsystem via that observer class.
An actual implementation of a network protocol module will derive from CLbsNetworkProtocolBase or one of its derived classes (see below) to provide the specific implementation of the interface methods.
Although all the interface methods in the class are synchronous they must return immediately. When the LBS subsystem makes a request via CLbsNetworkProtocolBase the protocol module must queue the request internally and return control to the caller immediately. Afterwards, when the protocol module provides a response it uses the corresponding notification method in the MLbsNetworkProtocolObserver class.
MLbsNetworkProtocolObserver MLbsNetworkProtocolBase2
Public Member Functions | |
---|---|
~CLbsNetworkProtocolBase() | |
void | AdviceSystemStatus(TLbsSystemStatus) |
void | CancelNetworkLocation(const TLbsNetSessionId &, TInt) |
void | CancelSelfLocation(const TLbsNetSessionId &, TInt) |
void | CancelTransmitLocation(const TLbsNetSessionId &, TInt) |
IMPORT_C TAny * | ExtendedInterface(TInt, TAny *, TAny *) |
IMPORT_C CLbsNetworkProtocolBase * | NewL(TUid, TLbsNetProtocolModuleParams &) |
void | RequestAssistanceData(TLbsAsistanceDataGroup) |
void | RequestNetworkLocation(const TLbsNetSessionId &, const TLbsNetPosRequestOptionsBase &) |
void | RequestSelfLocation(const TLbsNetSessionId &, const TLbsNetPosRequestOptionsBase &) |
void | RequestTransmitLocation(const TLbsNetSessionId &, const TDesC &, TInt) |
void | RespondLocationRequest(const TLbsNetSessionId &, TInt, const TPositionInfoBase &) |
void | RespondPrivacyRequest(const TLbsNetSessionId &, const TLbsPrivacyResponse &) |
Public Member Enumerations | |
---|---|
enum | TExtInterface { EExtInterfaceCount = 0, EExtInterface2, EExtInterfaceMax } |
enum | TLbsPrivacyResponse { EPrivacyResponseUnknown = 0, EPrivacyResponseAccepted, EPrivacyResponseRejected, EPrivacyResponseIgnored } |
enum | TLbsSystemStatus { ESystemStatusNone = 0x00, ESystemStatusClientTracking = 0x01 } |
Private Attributes | |
---|---|
TUid | iDtor_ID_Key |
IMPORT_C | ~CLbsNetworkProtocolBase | ( | ) |
Standard destructor that handles the ECom destruction.
The LBS subsystem invokes the destructor on the protocol module when it wishes to unload the module. The protocol module should terminate all current requests close all connections.
void | AdviceSystemStatus | ( | TLbsSystemStatus | aStatus | ) | [pure virtual] |
The Network Gateway uses this to provide the protocol module with LBS system status advice - this can be used in making conflict control decisions and also deciding when to interact with the network.
TLbsSystemStatus aStatus | The value of the status of the Lbs positioning framework. |
void | CancelNetworkLocation | ( | const TLbsNetSessionId & | aSessionId, |
TInt | aReason | |||
) | [pure virtual] |
This method attempts to cancel a request to obtain the network based location of the terminal. The previous request will have been initiated by calling RequestNetworkLocation()
Note: If the LBS subsystem wishes to stop the network location request and immediately issue a new network location request it should issue a subsequent call to RequestNetworkLocation(). Submitting a new network location request, automatically cancels any outstanding transfer.
In some circumstances, the protocol module may still return the associated network based position calculation to the LBS subsystem. This situation can occur when the cancel request is performed after a point where it is no longer possible to stop the request being sent.
RequestNetworkLocation() MLbsNetworkProtocolObserver::ProcessLocationUpdate()
const TLbsNetSessionId & aSessionId | The Id of the network location request to be cancelled. |
TInt aReason | Indicates why the LBS subsystem wants the terminate the request. |
void | CancelSelfLocation | ( | const TLbsNetSessionId & | aSessionId, |
TInt | aReason | |||
) | [pure virtual] |
This method attempts to cancel a request to perform the network side of a self location request. The previous request will have been initiated by calling RequestSelfLocation()
Note: If the LBS subsystem wishes to stop the self location request and immediately issue a new network location request it should issue a subsequent call to RequestSelfLocation(). Submitting a new network location request, automatically cancels any outstanding transfer.
In some circumstances, the protocol module may still return information such as the reference location and assistance data. This situation can occur when the cancel request is performed after a point these are injected into the system.
RequestNetworkLocation() MLbsNetworkProtocolObserver::ProcessLocationUpdate()
const TLbsNetSessionId & aSessionId | The Id of the self location request being cancelled. |
TInt aReason | Indicates why the LBS subsystem wants the terminate the request. |
void | CancelTransmitLocation | ( | const TLbsNetSessionId & | aSessionId, |
TInt | aReason | |||
) | [pure virtual] |
CancelTransmitLocation() is called by the LBS subsystem to instruct the protocol module to stop the transfer of the device's position to a remote third-party.
Note: If the LBS subsystem wishes to stop the current transfer request and immediately submit an alternative request it should not use CancelTransmitLocation(). Instead, RequestTransmitLocation() should be used. Submitting a new transmit request, automatically cancels any outstanding transfer.
If the protocol module has sucessfully terminated a transfer request it will call MLbsNetworkProtocolObserver::ProcessSessionComplete() with a completion code of KErrNone.
If a cancel request was too late, MLbsNetworkProtocolObserver::ProcessSessionComplete() will be called as normal indicating the success or failure of the transmission.
RequestTransmitLocation() MLbsNetworkProtocolObserver::ProcessSessionComplete()
const TLbsNetSessionId & aSessionId | Identifies which transmit location request is to be stopped. |
TInt aReason | Indicates why the LBS subsystem wants the transfer terminated. |
IMPORT_C TAny * | ExtendedInterface | ( | TInt | aFunctionNumber, |
TAny * | aPtr1, | |||
TAny * | aPtr2 | |||
) | [virtual] |
This method is used to retrieve pointers to extended interfaces, if supported by derived classes.
This method is used to retrieve pointers to extended interfaces, if supported by derived classes.
IMPORT_C CLbsNetworkProtocolBase * | NewL | ( | TUid | aImplementationUid, |
TLbsNetProtocolModuleParams & | aParams | |||
) | [static] |
Creates an instance of the CLbsNetworkProtocolBase implementation with the given Uid.
Creates an instance of the CLbsNetworkProtocolBase implementation with the given Uid.
TUid aImplementationUid | Identifies the protocol module to load. |
TLbsNetProtocolModuleParams & aParams | The parameters passed to the protocol module when it is instantiated. These include the a reference to the network protocol observer. The observer is used by the protocol module to report incomming messages and responses to requests made by the LBS subsystem. |
void | RequestAssistanceData | ( | TLbsAsistanceDataGroup | aDataRequestMask | ) | [pure virtual] |
RequestAssistanceData() is used by the LBS subsystem to request that the specified subsets of assistance data are downloaded from the network.
When assistance data is received from the network the protocol module forwards the information to the LBS subsystem via the method MLbsNetworkProtocolObserver::ProcessAssistanceData().
Each call to RequestAssistanceData() supersedes any previous request. The protocol module has only to attempt to satisfy the current set of requested assistance data.
If the method is called with a data of zero, this indicates that no assistance data is currently required. If the protocol module is currently retrieving assistance data a mask of zero may allow it to cancel that request - provided the purpose of that active request is only to retrieve assistance data.
If the network does not delivered the full set of requested assistance data, the protocol module is required to re-issue a request for the missing data. However, the protocol module should forward assistance data as and when it arrives from the network. This may result in the protocol module calling MLbsNetworkProtocolObserver::ProcessAssistanceData() multiple times with the assistance data being delivered to the LBS subsystem in batches.
If it has not been possible to retrieve any part of the requested assistance data, the protocol module indicates which subsets are missing by also calling MLbsNetworkProtocolObserver::ProcessAssistanceData() with the appropriate mask and a suitable error code.
TLbsAsistanceDataGroup aDataRequestMask | Is a bitmask that specifies which subsets of GPS assistance data are required. If aDataRequestMask is set to zero, this indicates that no further assistance data is needed. |
void | RequestNetworkLocation | ( | const TLbsNetSessionId & | aSessionId, |
const TLbsNetPosRequestOptionsBase & | aOptions | |||
) | [pure virtual] |
RequestNetworkLocation() is used by the LBS subsystem to request that the network calculates the current location of the handset and returns this to the terminal.
When the location information is received from the network the protocol module forwards the information to the LBS subsystem via the method MLbsNetworkProtocolObserver::ProcessLocationUpdate().
The position information returned by is entirely network calculated and is normally expected to be an approximate location only. For example, related to the position of the current serving cell.
This method automatically cancels any outstanding network location request and replaces it with the new request. The CancelNetworkLocation() method is used when the LBS subsystem wants to a cancel request but does not immmediately wish to replace with another.
The aSessionId parameter is generated by the LBS subsystem and is used to connect all corresponding responses and further requests. The same session ID will be used the LBS subsystem if it wishes to cancel the request. Similarly, the same session ID must also be supplied by the protocol module when it responds to the LBS subsystem via the MLbsNetworkProtocolObserver::ProcessLocationUpdate() method.
The session ID is also passed by the protocol module when closes a session via the method MLbsNetworkProtocolObserver::ProcessSessionComplete().
In addition to performing the normal session complete procedures, the ProcessSessionComplete() message is used by the LBS subsystem to determine if it is allowed to provide location information to the local applications. See the discussion on protocol conflicts under RequestSelfLocation for more information.
RequestSelfLocation TLbsNetPosRequestOptions MLbsNetworkProtocolObserver::ProcessLocationUpdate() CancelNetworkLocation
const TLbsNetSessionId & aSessionId | The Id of the network location request. This is generated by the LBS and must be used by the protocol module when it returns the obtained position information. |
const TLbsNetPosRequestOptionsBase & aOptions | This must be of type TLbsNetPosRequestOptions. |
void | RequestSelfLocation | ( | const TLbsNetSessionId & | aSessionId, |
const TLbsNetPosRequestOptionsBase & | aOptions | |||
) | [pure virtual] |
RequestSelfLocation() is used by the LBS subsystem to inform the network protocol module that local applications wish to obtain the terminal's current location. This method is called every time one or more LBS client applications make location request.
The parameters indicate if GPS asistance data is required and if one of the clients is requesting location for the first time. If GPS assistance data is required the protocol module will normally initiate a MO-LR. However, the protocol may decide to perform a network request for other reasons.
When the protocol module has completed the request it signals this by calling MLbsNetworkProtocolObserver::ProcessSessionComplete(). If the protocol module had decided not to initiate a network MO-LR request it must still call MLbsNetworkProtocolObserver::ProcessSessionComplete().
In addition to performing the normal session complete procedures, this session close message is used by the LBS subsystem to determine if it is allowed to provide location information to the local applications.
If the protocol module completes the session with KErrPositionHighPriorityReceive or KErrServerBusy error this indicates there has been a protocol conflict error. Under this situation, the LBS subsystem reports this same error to all the self locate client applications that want location information at that particular time.
Note, client applications that have specified a desired time interval between their successive updates may not be affected by protocol conflicts. Their current location requests will only be returned with this error if their requests coincides with the conflict.
If the protocol module reports other type of errors, the LBS subsystem can still be attempt to provide location information to its client applications.
When the protocol module does initiate a self locate MO-LR request with the network, this will result in a number of messages and requests being exchanged. Throughout these exchanges, the protocol module must ensure it uses and tracks the session-id that was passed to RequestSelfLocation().
For example, the terminal will generally receive a reference location from the network. The protocol module forwards that information to the LBS subsystem using MLbsNetworkProtocolObserver::ProcessLocationUpdate(). The protocol module should set the session-id parameter to that original passed to RequestSelfLocation().
Similarly, if the protocol module generates ProcessLocationRequest() it must use the same session-id. It should also expect the LBS subsystem to respond to that method using the same session-id.
Submitting a new network location request, automatically cancels any outstanding transfer.
Note: if the protocol module receives a new RequestSelfLocation before the previous one has completed he may or may not initiate a new network request. In either case, the sessionid between LBS and the protocol module has already changed and the protocol module must behave accordingly. If the protocol module does not issue a new network request, he is still required to generate a ProcessLocationRequest() with the new session id to synchronise with lbs. It is also possible that LBS will call RespondLocationRequest() with the old session id before receiving the ProcessLocationRequest() with the new session id; in this case the protocol module should not ignore that 'old' update.
TLbsNetPosRequestOptionsAssistance MLbsNetworkProtocolObserver::ProcessLocationUpdate() MLbsNetworkProtocolObserver::ProcessLocationRequest() MLbsNetworkProtocolObserver::ProcessSessionComplete()
const TLbsNetSessionId & aSessionId | The Id of the self location request. This is generated by the LBS and must be used by the protocol module when it performs actions related to that request. |
const TLbsNetPosRequestOptionsBase & aOptions | This parameter should be of type TLbsNetPosRequestOptionsAssistance. It provides information about the self location request including the required assistance data. |
void | RequestTransmitLocation | ( | const TLbsNetSessionId & | aSessionId, |
const TDesC & | aDestination, | |||
TInt | aPriority | |||
) | [pure virtual] |
RequestTransmitLocation() is called by the LBS subsystem to instruct the protocol module to send the device's position to a remote third-party.
This method automatically cancels any outstanding transmit request and replaces it with the new request.
The parameter aSessionId is generated by the LBS subsystem and is used connect all corresponding responses and further requests. The same session ID will be used the LBS subsystem itself in subsequent calls to the protocol module via CLbsNetworkProtocolBase. In return, it the same session ID must also be supplied by the protocol module when it responds to the LBS subsystem or issues related requests via MLbsNetworkProtocolObserver.
For example, a request to transmit the location will normally result in the network generating a location request to determine the terminal's current position. This location request is passed to the LBS subsystem via MLbsNetworkProtocolObserver::ProcessLocationRequest() using the session-id as the initiating RequestTransmitLocation().
Note: If the LBS subsystem does wish to cancel a currently active transmit request and immediately replace it with a new request it should only use RequestTransmitLocation(). It should not attempt to explicitly cancel the outstanding request using CancelTransmitLocation(). Issuing a cancel and then submitting a subsequent transmit request can lead to inefficiencies at the network protocol level.
CancelTransmitRequest() MLbsNetworkProtocolObserver::ProcessLocationRequest() MLbsNetworkProtocolObserver::ProcessSessionComplete()
const TLbsNetSessionId & aSessionId | Contains the session identifier. The session identifier is generated by the LBS susbsystem and is used in all corresponding and subsequent responses and requests. |
const TDesC & aDestination | Specifies the remote third-party that is the target for the location information transfer. |
TInt aPriority | A protocol specific value that determines the precedence of the request. A high priority may result in the currently active request being stopped. |
void | RespondLocationRequest | ( | const TLbsNetSessionId & | aSessionId, |
TInt | aReason, | |||
const TPositionInfoBase & | aPosInfo | |||
) | [pure virtual] |
RespondLocationRequest() is called by the LBS subsystem in response to the protocol module issuing a location request (MLbsNetworkProtocolObserver::ProcessLocationRequest()) on behalf of the network.
The method is used to return the terminal's current location to network via the protocol module.
If the terminal has indicated it will accept a location request the network will normally then issue a measurement control request. When the protocol module receives this follow-on request from the network it passed to the LBS subsystem via the MLbsNetworkProtocolObserver::ProcessLocationRequest() method.
The session ID parameter indicates which request is being responded to by the LBS subsystem. This same session ID must then be supplied by the protocol module if and when it issues a location request.
MLbsNetworkProtocolObserver::ProcessLocationRequest() MLbsNetworkProtocolObserver::ProcessPrivacyRequest() MLbsNetworkProtocolObserver::ProcessSessionComplete() TPositionInfoBase TPositionInfo
const TLbsNetSessionId & aSessionId | [In] Contains the session identifier - indicating which location request is being responded too. This is the same session ID passed by the network module to the LBS subsystem when the module initiated the position calculation via a call to MLbsNetworkProtocolObserver::ProcessLocationRequest(). |
TInt aReason | [In] KErrNone if aPosition holds best location information available; KErrCancel if the session has been cancelled explicitly by a user or by an application acting on behalf of a user. KErrAccessDenied if the terminal has decided to reject the location request, or the corresponding (and previous) privacy request, or it is unwilling to accept network induced location requests (NI-LRs); KErrInUse if LBS is currently busy processing another request(s); KErrNotSupported if the positioning mode(s) requested in the corresponding location request is not supported by the LBS subsystem or the AGPS Module. |
const TPositionInfoBase & aPosInfo | [In] Provides information about the current location of terminal - provided the parameter aReason is set to KErrNone. Otherwise, aPosInfo is unassigned. Normally, aPosInfo will be of type TPositionInfo. |
void | RespondPrivacyRequest | ( | const TLbsNetSessionId & | aSessionId, |
const TLbsPrivacyResponse & | aResponse | |||
) | [pure virtual] |
Send a response to a privacy request from the network.
RespondPrivacyRequest() is called by the LBS subsystem in response to the protocol module issuing a privacy request (MLbsNetworkProtocolObserver::ProcessPrivacyRequest()) on behalf of the network.
The method indicates to the protocol module whether the terminal is willing to accept or has rejected the network's request.
If the terminal has indicated it will accept a location request, the network will normally then issue a measurement control request. When the protocol module receives this follow-on request from the network it passed to the LBS subsystem via the MLbsNetworkProtocolObserver::ProcessLocationRequest() method.
The session ID parameter indicates which request is being responded to by the LBS subsystem. This same session ID must then be supplied by the protocol module if and when it issues a location request.
MLbsNetworkProtocolObserver::ProcessPrivacyRequest() TLbsPrivacyResponse MLbsNetworkProtocolObserver::ProcessLocationRequest()
const TLbsNetSessionId & aSessionId | Is the same session identifier was passed by the protocol module when it called MLbsNetworkProtocolObserver::ProcessPrivacyRequest() to start the privacy request. |
const TLbsPrivacyResponse & aResponse | The response to the privacy request to send to the network. This indicates whether the terminal has accepted or rejected the request for its current location. |
ExtendedInterface aFunctionNumber parameter.
EExtInterfaceCount = 0 | |
EExtInterface2 | |
EExtInterfaceMax |
The response to a privacy request.
MLbsNetworkProtocolObserver::ProcessPrivacyRequest() RespondPrivacyRequest()
EPrivacyResponseUnknown = 0 |
Not Used |
EPrivacyResponseAccepted |
Inform the network the terminal will accept its location request |
EPrivacyResponseRejected |
Inform the network the terminal will reject its location request |
EPrivacyResponseIgnored |
Inform the protocol module it should not respond to the location request. This option is currently not supported |
The status of the Lbs positioning framework. It is a combined bitmask of information reported by all the Lbs framework components.
ESystemStatusNone = 0x00 |
No specific status information available |
ESystemStatusClientTracking = 0x01 |
Inform the network at least one client of the Location Server is tracking (the UpdateOptions interval is nonzero) RPositioner::SetUpdateOptions UpdateSelfLocationMode |
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.