MLbsLocationSourceGpsObserver Class Reference

class MLbsLocationSourceGpsObserver

The MLbsLocationSourceGpsObserver class is used in partnership with CLbsLocationSourceGpsBase. These interfaces allow a GPS integration module to pass location data and status information to the observer. They are also used by the GPS integration module to retrieve GPS assistance data via the observer.

The location observer makes a request to the GPS integration module via the class CLbsLocationSourceGpsBase. As these requests will typically take a long time to complete, the module provides a response via this observer class.

When the GPS module wishes to make a request, it uses MLbsLocationSourceGpsObserver to contact the observer. In this case, the observer provides its response via CLbsLocationSourceGpsBase.

Calls from the integration module to the observer may be unsolicited and/or in response to requests made by the observer. For example, if the observer requests a location update via CLbsLocationSourceGpsBase::RequestLocationUpdate() the GPS module will respond some time later via MLbsLocationSourceGpsObserver::UpdateLocation(). However, the integration module is also allowed to provide location updates at any time and not just in response to the requests from the observer.

When the GPS integration module makes a request via the observer API that takes a long time to complete, the location observer provides a response via the corresponding notification method in the CLbsLocationSourceGpsBase class.

For example, when an integration module needs fresh GPS assistance data it will invoke MLbsLocationSourceGpsObserver::GetAssistanceData(). When this information eventually arrives from the network, the observer informs the integration module by calling CLbsLocationSourceGpsBase::NotifyAssistanceDataUpdate(). CLbsLocationSourceGpsBase

Member Functions Documentation

ExtendedInterface(TInt, TAny *, TAny *)

IMPORT_C TAny *ExtendedInterface(TIntaFunctionNumber,
TAny *aPtr1,
TAny *aPtr2
)[private, virtual]

This method is used to allow polymorphic extensions to the API without breaking BC. See documentation for explanation.

Reserved for future expansion - derived classes should see documentation on how this is to be used.

Parameters

TInt aFunctionNumbercontains the Id of the function to be invoked.
TAny * aPtr1a pointer to any data
TAny * aPtr2a pointer to any data.

GetAssistanceDataItem(TLbsAssistanceDataItem, RDataReaderRootBase &, TTime &)

TInt GetAssistanceDataItem(TLbsAssistanceDataItemaItem,
RDataReaderRootBase &aDataRoot,
TTime &aTimeStamp
)[pure virtual]

Gets cached assistance data GetAssistanceDataItem is called by the GPS integration module to obtain cached assistance data. The method always returns immediately the requested assistance data if it is available.

If the desired assistance data is not available from cache or it has become invalid, the GPS integration module uses the RequestAssistanceData method to request that fresh information is downloaded from the network. RDataReaderRootBase RequestAssistanceData

Parameters

TLbsAssistanceDataItem aItemSpecifies a single item of assistance.
RDataReaderRootBase & aDataRootReturns the requested assistance data if available.
TTime & aTimeStampContains the time the assistance data was originally downloaded from the network.

GetAssistanceDataItemTimeStamp(TLbsAssistanceDataItem, TTime &)

TInt GetAssistanceDataItemTimeStamp(TLbsAssistanceDataItemaItem,
TTime &aTimeStamp
)[pure virtual]

Gets cached assistance data time stamp GetAssistanceDataItemTimeStamp is called by the GPS integration module to obtain cached assistance data time stamp. The method always returns immediately the requested assistance data time stamp if it is available.

RDataReaderRootBase GetAssistanceDataItem

Parameters

TLbsAssistanceDataItem aItemSpecifies a single item of assistance.
TTime & aTimeStampContains the time the assistance data was originally downloaded from the network.

RequestAssistanceData(TLbsAsistanceDataGroup)

voidRequestAssistanceData(TLbsAsistanceDataGroupaDataItemMask)[pure virtual]

Requests fresh assistance data is downloaded from the network RequestAssistanceData is called by the GPS integration module to request fresh assistance data is downloaded from the network. This method returns quickly after having instigated the download.

When the assistance data arrives at the handset, the GPS integration module is informed by the observer via the method CLbsLocationSourceGpsBase::AssistanceDataEvent(). The GPS module accesses the assistance data by calling GetAssistanceDataItem().

Note: Although the GPS integration module is able to make a single call requesting various subsets of assistance data are downloaded, these may arrive in batches. That is, a single call to RequestAssistanceData() may result in multiple deliveries and CLbsLocationSourceGpsBase::AssistanceDataEvent() being called more than once.

The Module should always make this RequestAssistanceData call after a location update request has been received (from the Lbs SubSystem via RequestLocationUpdate()). This request should be made to request any assistance data it has not yet received (so aDataItemMask should change to only request the outstanding assistance data elements). Even when all of the required assistance data has been received this call should still be made, but with the aDataItemMask set to 0.

TLbsAsistanceDataGroup TLbsAsistanceDataItem CLbsLocationSourceGpsBase::AssistanceDataEvent() GetAssistanceDataItem()

Parameters

TLbsAsistanceDataGroup aDataItemMaskContains a bit mask of values from TLbsAsistanceDataItem indicating the subsets of assistance data that are required.

Shutdown()

voidShutdown()[pure virtual]

Shuts down the data source module Shutdown is called by the data source module when it wishes to close down. Note: the integration module should NOT start shutting down immediately after this call returns. When the observer is ready to shutdown it "deletes" the GPS integration module. This results in the module's destructor being called.

UpdateDataQualityStatus(TPositionModuleStatus::TDataQualityStatus)

voidUpdateDataQualityStatus(TPositionModuleStatus::TDataQualityStatusaDataQuality)[pure virtual]

Informs the observer about the accuracy of data it expects to produce UpdateDataQualityStatus is used by the GPS integration module to inform the observer about the accuracy of data it expects to produce. It is the responsibility of the integration module to call this method whenever it is required. The module does not receive any form of request from the location observer asking it for a status update.

A module may inform its observer that the quality of its location data will be "Normal", "Partial" or "Loss".

A status of "Normal" indicates that the data source is able to produce updates that are to its normal accuracy. When a module is still able to produce location information but to a less accurate degree than it would normally expect it signals this with a data quality of "Partial." A status of "Loss" is used when it is not possible to provide any location estimate.

Note: Data quality updates reflect the current ability for the data source module to produce accurate location information. The module is still required to produce updates of its expected data quality whenever it is powered on and not just when it is processing a location request.

Note: The values of "Normal" and "Partial" correspond to the integration module's normal accuracy. They do not reflect its ability to satisfy the accuracy desired by any current location request. PositionModuleStatus::TDataQualityStatus

Parameters

TPositionModuleStatus::TDataQualityStatus aDataQualityIndicates the expected data quality of location information that could be produced by the GPS integration module.

UpdateDeviceStatus(TPositionModuleStatus::TDeviceStatus)

voidUpdateDeviceStatus(TPositionModuleStatus::TDeviceStatusaDeviceStatus)[pure virtual]

Shows the current state of associated hardware UpdateDeviceStatus is used by GPS integration module to provide an indication of the current state of its associated hardware. It is the responsibility of the integration module to call this method whenever it is required. The module does not receive any form of request from the location observer asking it for a status update.

Device status updates reflect the current power mode of the hardware. In the case of GPS it will also indicate how long the GPS device takes to produce a location update. For example, a status of "Ready" indicates that the hardware is powered on and is in a "warm" state. It is capable of producing an accurate location update quickly.

An "Inactive" state indicates the hardware is powered off and will need a "cold" start. The GPS module may need to download assistance data resulting in a delay in producing an accurate fix.

The "StandBy" state could indicate that although the hardware is not powered on it is still capable of quickly producing a location update. This may be as a result of having valid assistance data cached.

Note: The GPS integration module may need to report a status change even though the hardware itself has not changed state. For example, when the GPS assistance data becomes invalid, the module may not be able to produce a location update quickly. The GPS integration module should actively monitor for these types of situation and update its state accordingly - for example, from "StandBy" to "Inactive". TPositionModuleStatus::TDeviceStatus

Parameters

TPositionModuleStatus::TDeviceStatus aDeviceStatusContains the current device status of the data source.

UpdateLocation(TInt, const TPositionInfoBase *, TInt, const TTime &)

voidUpdateLocation(TIntaStatus,
const TPositionInfoBase *aPosInfoArray,
TIntaNumItems,
const TTime &aTargetTime
)[pure virtual]

Provides a location update UpdateLocation is used by the GPS integration module to provide a location update. This is normally in response to having received a location request via CLbsLocationSourceGpsBase::RequestLocationUpdate().

Location requests received by the integration module contain a target time (start time) of when the location update is wanted and its desired quality. The integration module should provide the response at the start time or shortly afterwards. If the quality information specifies a maximum time period this indicates the stop time. In this case the module must produce its best effort before that time expires.

To associate a response with a location request, the module must include the target time as received in the request.

The default positioning provided by the GPS module is of type TPositionSatelliteInfo. A pointer to an instance of this class is normally passed in the first element of aPosInfoArray. However, the LBS subsystem may require the GPS module to provide either different or additional positioning information via this array. The data types required by the LBS subsystem are specified via the method CLbsLocationSourceGpsBase::SetGpsOptions(). The GPS module should provide positioning information according to the current GPS options.

Note that a GPS module must not return a position with a horizontal accuracy or vertical accuracy = 0 because the position update will not be returned to the client by the LBS subsystem.

Although integration modules normally provide a location update as a direct response to a request, they are allowed to provide unsolicited location updates at any time. This is done by indicating they are "additional" updates to a previous request. The module continues to include the target time of the previous request in the response until (a) it decides to stop producing unsolicited updates or (b) it is time to provide a location update in response to the next request.

Only when the integration module starts to produce a location update for a subsequent request should it call UpdateLocation() with the new target time.

When the integration module wishes to produce location updates without having received a request, the target time in the location update "response" should be zero.

Note: It is not recommended that integration modules provide unsolicited location updates. Careful consideration must be given to both the power drain and the overall performance impact.

In certain circumstances, the GPS module may determine that it will not be able to satisfy the required accuracy of the request. In this situation, it should provide an update but set the aStatus parameter to KPositionCalculationFutile. All required elements of the the position information array (aPosInfoArray) must be supplied as normal. The GPS module should assign any information available to the data members. CLbsLocationSourceGpsBase::RequestLocationUpdate() TLbsLocRequestQuality RPositioner::NotifyPositionUpdate()

Parameters

TInt aStatusis the return/error code for the location update. see RPositioner::NotifyPositionUpdate for more information.
const TPositionInfoBase * aPosInfoArrayThis is an array of pointers of position information. For most GPS positioning modules this will typically contain a single pointer to an instance of type TPositionSatelliteInfo. This should contain the current location of the handset and details about the satellites that are in view.
TInt aNumItemsContains a count of the number of items in aPosInfoArray
const TTime & aTargetTimeContains the time when the location update was requested by the observer.

Version()

IMPORT_C TVersionVersion()[virtual]

Returns the version of the MLbsLocationSourceGpsObserver interface implemented by the observer