diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-F0BDE1EC-5042-5328-9290-22BB2189F6B4.dita --- a/Symbian3/PDK/Source/GUID-F0BDE1EC-5042-5328-9290-22BB2189F6B4.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-F0BDE1EC-5042-5328-9290-22BB2189F6B4.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,83 +1,83 @@ - - - - - -How -to Implement a LBS Set Clock Plug-in DLLThis topic describes how to implement a LBS set clock plug-in class. -
Required background

LBS -system clock adjustment overview describes the set clock plug-in interface.

-
Introduction

LBS contains a default implementation -of a set clock module that sets the system clock time by calling User::SetUTCTime().

To -set the system clock by some other method, a licensee must create a set clock -plug-in DLL and configure LBS to use it.

-
Implementing the plug-in class

Licensee set clock -plug-in classes must derive from the abstract base class CGPSSetClockBase shown -in figure 1.

CGPSSetClockBase is packaged in GPSSetClock.dll. -An implementation includes GPSSetClockBase.h and links -with GPSSetClock.lib.

- Figure 1. CGPSSetClockBase is the base class for LBS -set clock plug-in classes. - -

To implement a set clock plug-in a developer must follow the steps -in the next section.

-
Procedure
    -
  1. Create a class derived -from CGPSSetClockBase:

    #include <GPSSetClockBase.h> - -class CGPSSetClockImpl : public CGPSSetClockBase -{ - - public: - static CGPSSetClockImpl* NewL(); - - virtual TInt SetUTCTime(const TTime& aTime); - virtual ~CGPSSetClockImpl(); - - private: - CGPSSetClockImpl(); - void ConstructL(); - -}; -

    Note that the implementation class must only allocate -memory on construction, not when CGPSSetClockBase::SetUTCTime() is -called. This is because LBS must always be able to respond to emergency services -location requests and so must never run out of memory at runtime. Memory for -the set clock plug-in DLL must therefore be allocated on startup of the LBS -subsystem when the ECom framework loads the plug-in DLL and calls the NewL() function -on the implementation class.

    CGPSSetClockImpl* CGPSSetClockImpl::NewL() -{ - // Allocate all required memory here or in ConstructL() - ... -} -
  2. -
  3. Implement the virtual -method CGPSSetClockBase::SetUTCTime(). The implementation -of this method is licensee specific and depends on the method that the licensee -uses to set the system clock.

    -TInt CGPSSetClockImpl::SetUTCTime(const TTime& aTime) -{ - // Licensee method of setting the system clock - // Do not allocate any additional memory! - ... -} -
  4. -
  5. Package the class as -an ECom plug-in DLL.

    See How -to create implementation collections for information on how to package -an implementation class as an ECom plug-in DLL.

    Note: LBS -must be configured to use the licensee set clock plug-in DLL to set the system -clock. LBS administration describes -how to configure LBS system clock synchronisation settings using either the -LBS Administration API or a repository initialisation file.

  6. -
-
-LBS System -Clock Synchronisation Overview + + + + + +How +to Implement a LBS Set Clock Plug-in DLLThis topic describes how to implement a LBS set clock plug-in class. +
Required background

LBS +system clock adjustment overview describes the set clock plug-in interface.

+
Introduction

LBS contains a default implementation +of a set clock module that sets the system clock time by calling User::SetUTCTime().

To +set the system clock by some other method, a licensee must create a set clock +plug-in DLL and configure LBS to use it.

+
Implementing the plug-in class

Licensee set clock +plug-in classes must derive from the abstract base class CGPSSetClockBase shown +in figure 1.

CGPSSetClockBase is packaged in GPSSetClock.dll. +An implementation includes GPSSetClockBase.h and links +with GPSSetClock.lib.

+ Figure 1. CGPSSetClockBase is the base class for LBS +set clock plug-in classes. + +

To implement a set clock plug-in a developer must follow the steps +in the next section.

+
Procedure
    +
  1. Create a class derived +from CGPSSetClockBase:

    #include <GPSSetClockBase.h> + +class CGPSSetClockImpl : public CGPSSetClockBase +{ + + public: + static CGPSSetClockImpl* NewL(); + + virtual TInt SetUTCTime(const TTime& aTime); + virtual ~CGPSSetClockImpl(); + + private: + CGPSSetClockImpl(); + void ConstructL(); + +}; +

    Note that the implementation class must only allocate +memory on construction, not when CGPSSetClockBase::SetUTCTime() is +called. This is because LBS must always be able to respond to emergency services +location requests and so must never run out of memory at runtime. Memory for +the set clock plug-in DLL must therefore be allocated on startup of the LBS +subsystem when the ECom framework loads the plug-in DLL and calls the NewL() function +on the implementation class.

    CGPSSetClockImpl* CGPSSetClockImpl::NewL() +{ + // Allocate all required memory here or in ConstructL() + ... +} +
  2. +
  3. Implement the virtual +method CGPSSetClockBase::SetUTCTime(). The implementation +of this method is licensee specific and depends on the method that the licensee +uses to set the system clock.

    +TInt CGPSSetClockImpl::SetUTCTime(const TTime& aTime) +{ + // Licensee method of setting the system clock + // Do not allocate any additional memory! + ... +} +
  4. +
  5. Package the class as +an ECom plug-in DLL.

    See How +to create implementation collections for information on how to package +an implementation class as an ECom plug-in DLL.

    Note: LBS +must be configured to use the licensee set clock plug-in DLL to set the system +clock. LBS administration describes +how to configure LBS system clock synchronisation settings using either the +LBS Administration API or a repository initialisation file.

  6. +
+
+LBS System +Clock Synchronisation Overview
\ No newline at end of file