CLbsLocationSourceGpsBase Class Reference

class CLbsLocationSourceGpsBase : public CBase

Passes all commands and information to the GPS Integration module The CLbsLocationSourceGpsBase is the abstract interface to a GPS integration module and is used by the location observer to pass all commands and information to the module. The GPS integration module provides responses to the location observer via the MLbsLocationSourceGpsObserver class. This observer class is also used by the integration module to make requests to the observer.

An actual implementation of a GPS integration module will derive from CLbsLocationSourceGpsBase to provide the specific implementation of the interface methods.

Although all the interface methods in the class are synchronous they must complete quickly. When the location observer makes a request via CLbsLocationSourceGpsBase the integration module must queue the request and return control to the caller immediately. Afterwards, when the integration module provides a response, it uses the corresponding notification method in the MLbsLocationSourceGpsObserver class. MLbsLocationSourceGpsObserver CLbsLocationSourceBase

Inherits from

  • CLbsLocationSourceGpsBase

Constructor & Destructor Documentation

CLbsLocationSourceGpsBase(MLbsLocationSourceGpsObserver &)

IMPORT_CCLbsLocationSourceGpsBase(MLbsLocationSourceGpsObserver &aObserver)[protected]

Parameters

MLbsLocationSourceGpsObserver & aObserveris a pointer to the integration module's observer. The observer is used by the integration module to respond to requests and also by the module to obtain information.

~CLbsLocationSourceGpsBase()

IMPORT_C~CLbsLocationSourceGpsBase()

Destructor for CLbsLocationSourceGpsBase.

Member Functions Documentation

AdvisePowerMode(TPowerMode)

voidAdvisePowerMode(TPowerModeaMode)[pure virtual]

Helps the GPS integration module select the appropriate power mode. AdvisePowerMode is used by the location observer to help the GPS integration module select the appropriate power mode. However, this method only advises the integration module of what to do. The module is ultimately responsible for selecting the most appropriate power mode for its associated hardware.

The integration module should report changes to the GPS hardware's operating mode by calling the observer method MLbsLocationSourceGpsObserver::UpdateDeviceStatus().

The AdvisePowerMode method must return almost immediately. Any internal rocessing must be done asynchronously by the integration module.

TPowerMode MLbsLocationSourceGpsObserver::UpdateDeviceStatus()

Parameters

TPowerMode aModeIndicates the power mode that module may wish to use. Modes include On, Off, Standby and Close. A value of Close indicates that integration module should shutdown. Note, This value should be ignored where GPS device is used in emergency call situations.

AssistanceDataEvent(TInt, TLbsAsistanceDataGroup)

voidAssistanceDataEvent(TIntaError,
TLbsAsistanceDataGroupaDataMask
)[pure virtual]

Informs the GPS integration module that fresh assistance data is available or, in the case of 'Prefer Terminal Assisted' gps mode, that there has been an error such that assistance data is unavailable.

This method is used by the LBS subsystem to inform the GPS integration module that fresh assistance data is available. This may have been delivered unsolicited or due to a request by the integration module. The aDataMask parameter indicates which subsets of assistance data have just arrived.

To request fresh assistance data, the GPS module uses the observer method MLbsLocationSourceGpsObserver::RequestAssistanceData().

To obtain the assistance data, the GPS module uses the observer method MLbsLocationSourceGpsObserver::GetAssistanceDataItem().

This method is also used by the LBS subsystem to ask the GPS integration module to reset its assistance data and to inform it that the LBS subsystem assistance data cache has been cleared. The parameter aDataMask specifies which assistance data subset must be reset by the integration module. The error code parameter aError is set to KPositionAssistanceDataReset by the LBS subsystem to tell the integration module to reset its assistance data.

When the assistance data has been reset, calling MLbsLocationSourceGpsObserver::GetAssistanceDataItem() for any item in the reset subset will return KErrNotFound.

Note: Assistance data may be delivered by the observer in batches. For example AssistanceDataEvent() may be called multiple times as a result of a single download request.

Note: If the module has been put into 'Prefer Terminal Assisted' gps mode, and a subsequent network error causes the self-locate session to be closed, then LBS will send a 'dummy' assistance data event to the module with that network error. In this case the assistance data mask will be set to KLbsDummyAssistanceDataMaskWithError to indicate a 'dummy' event. At this point, the integration module should either switch to 'Autonomous' mode or, if unable to calculate positions autonomously, fail with appropriate error. If the module switches to Autonomous mode, it should supply a position update immediately (with NANs, say) indicating that it has done so, otherwise it should supply a measurement update with error and stop.

TLbsAsistanceDataGroup TLbsAsistanceDataItem MLbsLocationSourceGpsObserver::GetAssistanceDataItem() MLbsLocationSourceGpsObserver::RequestAssistanceData()

Parameters

TInt aErrorerror code associated with this assistance data event, or KPositionAssistanceDataReset if the LBS subsystem is asking the GPS integration module to reset its assistance data.
TLbsAsistanceDataGroup aDataMaskContains a bit mask of values from TLbsAsistanceDataItem indicating the subsets of assistance data that have newly arrived from the network.

CancelLocationRequest()

voidCancelLocationRequest()[pure virtual]

Cancels an outstanding location request Used by the location observer to cancel an outstanding location request. It is normally called when it is not known if and when the next location update is required. When the observer wishes to replace the current location request with another, it makes a single call to RequestLocationUpdate(). In this case CancelLocationRequest() is not used.

The integration module does not need to respond or acknowledge to the cancellation. It may even continue to provide the location update at specified times.

This method must return almost immediately. Any internal processing must be done asynchronously by the integration module. RequestUpdateLocation()

ConstructL()

IMPORT_C voidConstructL()[protected]

Leaving constructor for CLbsLocationSourceGpsBase. In case required.

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.

NewL(MLbsLocationSourceGpsObserver &, TUid)

IMPORT_C CLbsLocationSourceGpsBase *NewL(MLbsLocationSourceGpsObserver &aObserver,
TUidaEcomModuleId
)[static]

Returns a pointer to an instance of the interface class for a GPS integration module. MLbsLocationSourceGpsObserver

Parameters

MLbsLocationSourceGpsObserver & aObserveris a pointer to the integration module's observer. The observer is used by the integration module to respond to requests made via methods in CLbsLocationSourceGpsBase. The MLbsLocationSourceGpsObserver observer class is also used by the module to provide unsolicited information and obtain and request information from the observer.
TUid aEcomModuleIdis the UID of the ECOM module to load.

RequestLocationUpdate(const TTime &, const TLbsLocRequestQuality &)

voidRequestLocationUpdate(const TTime &aTargetTime,
const TLbsLocRequestQuality &aQuality
)[pure virtual]

Used by the location observer to request a position update from the data source. The parameters indicate when the position update is needed and the desired accuracy.

This method must return almost immediately. When the integration module is ready to provide the requested location information it responds by calling MLbsLocationSourceGpsObserver::UpdateLocation() on its observer.

The aTargetTime parameter specifies when the location update is required. The integration module should provide a response to the location request at this time or shortly afterwards. When the data source provides a response to the request, it includes the target time to indicate which request it is dealing with.

The data source module should only hold and process a single location request at any time. If another RequestLocationUpdate is received before the location module has responded to an outstanding request, the outstanding request is cancelled.

Generally, a second location request will specify a different target time - indicating that a location update is needed either before or after the current request. However, a subsequent request may also indicate that a different accuracy is required. This could have the same target time of the outstanding request.

The current location request may also be cancelled via the CancelLocationRequest() method.

More normally, the integration module will receive its the next location request after it has responded to the current request.

Integration modules are responsible for performing power management on any associated hardware. One factor they should take into account is when the next update is required. It may be possible for them to put the hardware into power saving mode in the intervening period. Integration modules are also advised which power mode to select via the method AdvisePowerMode().

Everytime this call is made to the module, the module should make a call to the RequestAssistanceData() function. This will contain the request of any assistanca data it requires and has still not received. Even after all assistance data has been received by the module this call will still be made after this location request, but the assistance data mask will always be 0.

MLbsLocationSourceGpsObserver::UpdateLocation() TLbsLocRequestQuality CancelLocationRequest() AdvisePowerMode()

Parameters

const TTime & aTargetTimeSpecifies the time when the location update should be provided by the integration module. A value of 0 indicates that the update is required immediately.
const TLbsLocRequestQuality & aQualityContains the desired accuracy of the location information and also the maximum time before the module produces an update. The module should provide an update either when the desired accuracy has been reach OR the maximum time has expired.

SetGpsOptions(const TLbsGpsOptions &)

voidSetGpsOptions(const TLbsGpsOptions &aGpsOptions)[pure virtual]

Sets global parameters for the GPS data This includes the mode of operation for the GPS device. For example, it is used to specify if the GPS device should operate in autonomous or terminal-based modes.

The standard parameter passed to the method is an instance of the TLbsGpsOptions class. This indicates to the GPS module what mode it is required to operate in and that it should only produce updates of type TPositionSatelliteInfo.

However, if LBS subsystem requires the module to provide updates containing more than one type of data or indeed a different class type it will pass a parameter of the type TLbsGpsOptionsArray. The GPS module can determine the full type of the supplied parameter by calling the method ClassType() on aGpsOptions. See the Note below for more information.

TLbsGpsOptionsArray contains an array of TLbsGpsOptionsItem with the elements specifying the information the module is required to provide when it produces a location update.

When the GPS module calls MLbsLocationSourceGpsObserver::UpdateLocation() it supplies an array of position information via the parameter aPosInfoArray. Each element of aPosInfoArray array should correspond to the requested class types from the elements of TLbsGpsOptionsArray.

For example, the data provided by the GPS module in element aPosInfoArray[0] should be that requested data type as specified in the first element TLbsGpsOptionsArray.

The GPS module can determine the required data types by calling the function TLbsGpsOptionsItem::PosUpdateType() on each element of the TLbsGpsOptionsArray.

A value of "EPosUpdateCalculation" specifies that the GPS module should provide an item of type TPositionSatelliteInfo in the corresponding array entry of the parameter aPosInfoArray[] when it calls MLbsLocationSourceGpsObserver::UpdateLocation().

A value of "EPosUpdateMeasurement" specifies that the GPS module should provide an item of type TPositionGpsMeasurementInfo in the corresponding array entry of aPosInfoArray[].

Note: As mentioned above, the GPS module can determine the full type of the aGpsOptions parameter by calling aGpsOptions.ClassType(). To check if the LBS subsystem has passed an instance TLbsGpsOptionsArray the returned value should be bitwise compared with ELbsGpsOptionsArrayClass. It is best to perform a bitwise "AND" rather than testing if the ClassType() is equal to ELbsGpsOptionsArrayClass. This allows future expandability while maintaining binary compatibility.

TLbsGpsOptions

Parameters

const TLbsGpsOptions & aGpsOptionsThis specifies global operational parameters for the GPS module and its associated hardware.

Member Enumerations Documentation

Enum TPowerMode

Power mode advice for GPS AdvisePowerMode()

Enumerators

EPowerModeUnknown

Power Mode Unknown

EPowerModeOn

Advise the module to turn on GPS hardware power

EPowerModeStandby

Advise the module to set the GPS hardware power to standby

EPowerModeOff

Advise the module to turn off GPS hardware power

EPowerModeClose

Advise the module that the LBS subsystem is shutting down

Member Data Documentation

TUid iDtor_ID_Key

TUid iDtor_ID_Key[private]

MLbsLocationSourceGpsObserver & iLocSourceGpsObserver

MLbsLocationSourceGpsObserver &iLocSourceGpsObserver[protected]

observer

TAny * iReserved

TAny *iReserved[private]

reserved