datasourceadaptation/gpsdatasourceadaptation/src/EPos_CPositioner.cpp
changeset 19 bdd4df282e3e
parent 0 9cfd9a3ee49c
child 49 5f20f71a57a3
equal deleted inserted replaced
0:9cfd9a3ee49c 19:bdd4df282e3e
    21 #include <lbs/epos_cpositioner.h>
    21 #include <lbs/epos_cpositioner.h>
    22 #include "EPos_MPosParameterObserver.h"
    22 #include "EPos_MPosParameterObserver.h"
    23 #include "EPos_PositionerConstructParams.h"
    23 #include "EPos_PositionerConstructParams.h"
    24 #include "EPos_CPositionerExtension.h"
    24 #include "EPos_CPositionerExtension.h"
    25 #include "EPos_CPosPsyExtension.h"
    25 #include "EPos_CPosPsyExtension.h"
       
    26 #include "OstTraceDefinitions.h"
       
    27 #ifdef OST_TRACE_COMPILER_IN_USE
       
    28 #include "EPos_CPositionerTraces.h"
       
    29 #endif
       
    30 
    26 
    31 
    27 // ================= MEMBER FUNCTIONS =======================
    32 // ================= MEMBER FUNCTIONS =======================
    28 
    33 
    29 /**
    34 /**
    30 * Creates a new instance of a CPositioner implementation.
    35 * Creates a new instance of a CPositioner implementation.
    34 * @return The positioner implementation.
    39 * @return The positioner implementation.
    35 */
    40 */
    36 EXPORT_C CPositioner* CPositioner::NewL(
    41 EXPORT_C CPositioner* CPositioner::NewL(
    37     TAny* aConstructionParameters)
    42     TAny* aConstructionParameters)
    38     {
    43     {
       
    44     OstTraceFunctionEntry0( CPOSITIONER_NEWL_ENTRY );
    39     TUid implUid = reinterpret_cast<TPositionerConstructParams*>
    45     TUid implUid = reinterpret_cast<TPositionerConstructParams*>
    40             (aConstructionParameters)->iImplementationUid;
    46             (aConstructionParameters)->iImplementationUid;
    41 
    47 
    42     TInt32 offset = static_cast<TInt32> _FOFF(CPositioner, iDtorIdKey);
    48     TInt32 offset = static_cast<TInt32> _FOFF(CPositioner, iDtorIdKey);
    43 
    49 
    66 */
    72 */
    67 EXPORT_C CPositioner* CPositioner::NewL(
    73 EXPORT_C CPositioner* CPositioner::NewL(
    68     TUid aImplementationUid,
    74     TUid aImplementationUid,
    69     const CPositioner& aPositioner)
    75     const CPositioner& aPositioner)
    70     {
    76     {
       
    77     OstTraceFunctionEntry0( DUP1_CPOSITIONER_NEWL_ENTRY );
    71     TPositionerConstructParams params;
    78     TPositionerConstructParams params;
    72 
    79 
    73     params.iImplementationUid = aImplementationUid;
    80     params.iImplementationUid = aImplementationUid;
    74     params.iParamObserver = aPositioner.iExtension->iParamObserver;
    81     params.iParamObserver = aPositioner.iExtension->iParamObserver;
    75     params.iStatusObserver = 
    82     params.iStatusObserver = 
    81 /**
    88 /**
    82 * Destructor.
    89 * Destructor.
    83 */
    90 */
    84 EXPORT_C CPositioner::~CPositioner()
    91 EXPORT_C CPositioner::~CPositioner()
    85     {
    92     {
       
    93     OstTraceFunctionEntry1( CPOSITIONER_CPOSITIONER_ENTRY, this );
    86     delete iExtension;
    94     delete iExtension;
    87     REComSession::DestroyedImplementation(iDtorIdKey);
    95     REComSession::DestroyedImplementation(iDtorIdKey);
       
    96     OstTraceFunctionExit1( CPOSITIONER_CPOSITIONER_EXIT, this );
    88     }
    97     }
    89 
    98 
    90 /**
    99 /**
    91 * C++ default constructor.
   100 * C++ default constructor.
    92 */
   101 */
    93 EXPORT_C CPositioner::CPositioner()
   102 EXPORT_C CPositioner::CPositioner()
    94     {
   103     {
       
   104     OstTraceFunctionEntry1( DUP1_CPOSITIONER_CPOSITIONER_ENTRY, this );
       
   105     OstTraceFunctionExit1( DUP1_CPOSITIONER_CPOSITIONER_EXIT, this );
    95     }
   106     }
    96 
   107 
    97 /**
   108 /**
    98 * Creates the internals of the positioner.
   109 * Creates the internals of the positioner.
    99 *
   110 *
   103 * @param aConstructionParameters The construction parameters supplied
   114 * @param aConstructionParameters The construction parameters supplied
   104 *                                in the factory call.
   115 *                                in the factory call.
   105 */
   116 */
   106 EXPORT_C void CPositioner::BaseConstructL(TAny* aConstructionParameters)
   117 EXPORT_C void CPositioner::BaseConstructL(TAny* aConstructionParameters)
   107     {
   118     {
       
   119     OstTraceFunctionEntry1( CPOSITIONER_BASECONSTRUCTL_ENTRY, this );
   108     TPositionerConstructParams* params = 
   120     TPositionerConstructParams* params = 
   109         reinterpret_cast<TPositionerConstructParams*>(aConstructionParameters);
   121         reinterpret_cast<TPositionerConstructParams*>(aConstructionParameters);
   110 
   122 
   111     iExtension = CPositionerExtension::NewL(
   123     iExtension = CPositionerExtension::NewL(
   112         params->iImplementationUid, 
   124         params->iImplementationUid, 
   113         params->iStatusObserver,
   125         params->iStatusObserver,
   114         params->iParamObserver);
   126         params->iParamObserver);
       
   127     OstTraceFunctionExit1( CPOSITIONER_BASECONSTRUCTL_EXIT, this );
   115     }
   128     }
   116 
   129 
   117 /**
   130 /**
   118 * Indicate if the PSY has overridden tracking. The default
   131 * Indicate if the PSY has overridden tracking. The default
   119 * implementation returns EFalse. Override and return ETrue to use PSY:s
   132 * implementation returns EFalse. Override and return ETrue to use PSY:s
   120 * own timer.
   133 * own timer.
   121 * @return ETrue if PSY has own timer, otherwise EFalse.
   134 * @return ETrue if PSY has own timer, otherwise EFalse.
   122 */
   135 */
   123 EXPORT_C TBool CPositioner::TrackingOverridden() const
   136 EXPORT_C TBool CPositioner::TrackingOverridden() const
   124     {
   137     {
       
   138     OstTraceFunctionEntry1( CPOSITIONER_TRACKINGOVERRIDDEN_ENTRY, this );
   125     return EFalse;
   139     return EFalse;
   126     }
   140     }
   127 
   141 
   128 /**
   142 /**
   129 * Initiate a tracking session.
   143 * Initiate a tracking session.
   131 * @param aInterval [in] Interval for position requests.
   145 * @param aInterval [in] Interval for position requests.
   132 */
   146 */
   133 EXPORT_C void CPositioner::StartTrackingL(
   147 EXPORT_C void CPositioner::StartTrackingL(
   134     const TTimeIntervalMicroSeconds& /*aInterval*/)
   148     const TTimeIntervalMicroSeconds& /*aInterval*/)
   135     {
   149     {
       
   150     OstTraceFunctionEntry1( CPOSITIONER_STARTTRACKINGL_ENTRY, this );
   136     User::Leave(KErrNotSupported);
   151     User::Leave(KErrNotSupported);
       
   152     OstTraceFunctionExit1( CPOSITIONER_STARTTRACKINGL_EXIT, this );
   137     }
   153     }
   138 
   154 
   139 /**
   155 /**
   140 * Stop a periodic update session.
   156 * Stop a periodic update session.
   141 * Any outstanding requests will be cancelled.
   157 * Any outstanding requests will be cancelled.
   142 */
   158 */
   143 EXPORT_C void CPositioner::StopTracking()
   159 EXPORT_C void CPositioner::StopTracking()
   144     {
   160     {
       
   161     OstTraceFunctionEntry1( CPOSITIONER_STOPTRACKING_ENTRY, this );
       
   162     OstTraceFunctionExit1( CPOSITIONER_STOPTRACKING_EXIT, this );
   145     }
   163     }
   146 
   164 
   147 /**
   165 /**
   148 * Service a PSY specific request.
   166 * Service a PSY specific request.
   149 *
   167 *
   155 *
   173 *
   156 * @param aMessage The client server request message object.
   174 * @param aMessage The client server request message object.
   157 */
   175 */
   158 EXPORT_C void CPositioner::ServiceL(RMessage2& /*aMessage*/)
   176 EXPORT_C void CPositioner::ServiceL(RMessage2& /*aMessage*/)
   159     {
   177     {
       
   178     OstTraceFunctionEntry1( CPOSITIONER_SERVICEL_ENTRY, this );
   160     User::Leave(KErrNotSupported);
   179     User::Leave(KErrNotSupported);
       
   180     OstTraceFunctionExit1( CPOSITIONER_SERVICEL_EXIT, this );
   161     }
   181     }
   162 
   182 
   163 /**
   183 /**
   164 * Called to return the implementation UID set when calling NewL.
   184 * Called to return the implementation UID set when calling NewL.
   165 *
   185 *
   166 * @return The UID of the handler implementation.
   186 * @return The UID of the handler implementation.
   167 */
   187 */
   168 EXPORT_C TUid CPositioner::ImplementationUid() const
   188 EXPORT_C TUid CPositioner::ImplementationUid() const
   169     {
   189     {
       
   190     OstTraceFunctionEntry1( CPOSITIONER_IMPLEMENTATIONUID_ENTRY, this );
   170     return iExtension->iPsyExtension->iImplementationUid;
   191     return iExtension->iPsyExtension->iImplementationUid;
   171     }
   192     }
   172 
   193 
   173 /**
   194 /**
   174 * Get the quality of service requested by the client.
   195 * Get the quality of service requested by the client.
   181 *   KErrNone if there is.
   202 *   KErrNone if there is.
   182 */
   203 */
   183 EXPORT_C TInt CPositioner::GetRequiredPositionQuality(
   204 EXPORT_C TInt CPositioner::GetRequiredPositionQuality(
   184     TPositionQuality& aPositionQuality) const
   205     TPositionQuality& aPositionQuality) const
   185     {
   206     {
       
   207     OstTraceFunctionEntry1( CPOSITIONER_GETREQUIREDPOSITIONQUALITY_ENTRY, this );
   186     return iExtension->iParamObserver->GetRequiredPositionQuality(
   208     return iExtension->iParamObserver->GetRequiredPositionQuality(
   187         aPositionQuality);
   209         aPositionQuality);
   188     }
   210     }
   189 
   211 
   190 /**
   212 /**
   201 *   an old position fix. If no max age is defined aMaxAge will contain 
   223 *   an old position fix. If no max age is defined aMaxAge will contain 
   202 *   a time set to zero.
   224 *   a time set to zero.
   203 */
   225 */
   204 EXPORT_C void CPositioner::GetMaxAge(TTime& aMaxAge) const
   226 EXPORT_C void CPositioner::GetMaxAge(TTime& aMaxAge) const
   205     {
   227     {
       
   228     OstTraceFunctionEntry1( CPOSITIONER_GETMAXAGE_ENTRY, this );
   206     iExtension->iParamObserver->GetMaxAge(aMaxAge);
   229     iExtension->iParamObserver->GetMaxAge(aMaxAge);
       
   230     OstTraceFunctionExit1( CPOSITIONER_GETMAXAGE_EXIT, this );
   207     }
   231     }
   208 
   232 
   209 /**
   233 /**
   210 * Checks if the client allows a partial position update.
   234 * Checks if the client allows a partial position update.
   211 *
   235 *
   220 * @return ETrue if partial position updates are allowed, otherwise
   244 * @return ETrue if partial position updates are allowed, otherwise
   221 *   EFalse.
   245 *   EFalse.
   222 */
   246 */
   223 EXPORT_C TBool CPositioner::IsPartialUpdateAllowed() const
   247 EXPORT_C TBool CPositioner::IsPartialUpdateAllowed() const
   224     {
   248     {
       
   249     OstTraceFunctionEntry1( CPOSITIONER_ISPARTIALUPDATEALLOWED_ENTRY, this );
   225     return iExtension->iParamObserver->IsPartialUpdateAllowed();
   250     return iExtension->iParamObserver->IsPartialUpdateAllowed();
   226     }
   251     }
   227 
   252 
   228 /**
   253 /**
   229 * Retrieve the interface for reporting positioner status.
   254 * Retrieve the interface for reporting positioner status.
   230 *
   255 *
   231 * @return The interface for reporting positioner status.
   256 * @return The interface for reporting positioner status.
   232 */
   257 */
   233 EXPORT_C MPositionerStatus* CPositioner::PositionerStatus()
   258 EXPORT_C MPositionerStatus* CPositioner::PositionerStatus()
   234     {
   259     {
       
   260     OstTraceFunctionEntry1( CPOSITIONER_POSITIONERSTATUS_ENTRY, this );
   235     return iExtension->iPsyExtension;
   261     return iExtension->iPsyExtension;
   236     }
   262     }
   237 
   263 
   238 
   264 
   239 
   265 
   245  * @prototype
   271  * @prototype
   246  */
   272  */
   247 
   273 
   248 EXPORT_C void CPositioner::CancelNotifyPositionUpdate(TInt /*aError*/)
   274 EXPORT_C void CPositioner::CancelNotifyPositionUpdate(TInt /*aError*/)
   249     {
   275     {
       
   276     OstTraceFunctionEntry1( CPOSITIONER_CANCELNOTIFYPOSITIONUPDATE_ENTRY, this );
   250     CancelNotifyPositionUpdate();
   277     CancelNotifyPositionUpdate();
       
   278     OstTraceFunctionExit1( CPOSITIONER_CANCELNOTIFYPOSITIONUPDATE_EXIT, this );
   251     }
   279     }
   252 
   280 
   253 //EXPORT_C void CPositioner::CPositioner_Reserved1()
   281 //EXPORT_C void CPositioner::CPositioner_Reserved1()
   254 //    {
   282 //    {
   255 //    }
   283 //    }
   257 /**
   285 /**
   258  * Reserved function
   286  * Reserved function
   259  */
   287  */
   260 EXPORT_C void CPositioner::CPositioner_Reserved2()
   288 EXPORT_C void CPositioner::CPositioner_Reserved2()
   261     {
   289     {
       
   290     OstTraceFunctionEntry1( CPOSITIONER_CPOSITIONER_RESERVED2_ENTRY, this );
       
   291     OstTraceFunctionExit1( CPOSITIONER_CPOSITIONER_RESERVED2_EXIT, this );
   262     }
   292     }
   263 
   293 
   264 /**
   294 /**
   265  * Returns the location update timeout associated with the subsession. The method returns a real timeout,
   295  * Returns the location update timeout associated with the subsession. The method returns a real timeout,
   266  * which is defined and used by the Location Server. It may be different from the timeout set by the client
   296  * which is defined and used by the Location Server. It may be different from the timeout set by the client
   270  * 
   300  * 
   271  * @prototype
   301  * @prototype
   272  */
   302  */
   273 EXPORT_C void CPositioner::GetUpdateTimeOut(TTimeIntervalMicroSeconds& aUpdateTimeOut) const
   303 EXPORT_C void CPositioner::GetUpdateTimeOut(TTimeIntervalMicroSeconds& aUpdateTimeOut) const
   274 	{
   304 	{
       
   305 	OstTraceFunctionEntry1( CPOSITIONER_GETUPDATETIMEOUT_ENTRY, this );
   275 	iExtension->iParamObserver->GetUpdateTimeOut(aUpdateTimeOut);
   306 	iExtension->iParamObserver->GetUpdateTimeOut(aUpdateTimeOut);
       
   307 	OstTraceFunctionExit1( CPOSITIONER_GETUPDATETIMEOUT_EXIT, this );
   276 	}
   308 	}
   277 
   309 
   278 /**
   310 /**
   279  * Called to inform the Location Server about the PSY default update timeout. The Location
   311  * Called to inform the Location Server about the PSY default update timeout. The Location
   280  * Server may use this value to calculate the update timeout it uses. 
   312  * Server may use this value to calculate the update timeout it uses. 
   285  * 
   317  * 
   286  * @prototype
   318  * @prototype
   287  */
   319  */
   288 EXPORT_C void CPositioner::SetPsyDefaultUpdateTimeOut(const TTimeIntervalMicroSeconds& aUpdateTimeOut)
   320 EXPORT_C void CPositioner::SetPsyDefaultUpdateTimeOut(const TTimeIntervalMicroSeconds& aUpdateTimeOut)
   289 	{
   321 	{
       
   322 	OstTraceFunctionEntry1( CPOSITIONER_SETPSYDEFAULTUPDATETIMEOUT_ENTRY, this );
   290 	iExtension->iParamObserver->SetPsyDefaultUpdateTimeOut(aUpdateTimeOut);
   323 	iExtension->iParamObserver->SetPsyDefaultUpdateTimeOut(aUpdateTimeOut);
       
   324 	OstTraceFunctionExit1( CPOSITIONER_SETPSYDEFAULTUPDATETIMEOUT_EXIT, this );
   291 	}
   325 	}
   292 
   326 
   293 /**
   327 /**
   294  * Extends the active request timeout by the value specified. Only the current active request is 
   328  * Extends the active request timeout by the value specified. Only the current active request is 
   295  * affected and the changes are not stored. That is the value returned by GetUpdateTimeOut and
   329  * affected and the changes are not stored. That is the value returned by GetUpdateTimeOut and
   300  * 
   334  * 
   301  * @prototype
   335  * @prototype
   302  */
   336  */
   303 EXPORT_C void CPositioner::ExtendUpdateTimeOut(const TTimeIntervalMicroSeconds& aAdditionalTime)
   337 EXPORT_C void CPositioner::ExtendUpdateTimeOut(const TTimeIntervalMicroSeconds& aAdditionalTime)
   304 	{
   338 	{
       
   339 	OstTraceFunctionEntry1( CPOSITIONER_EXTENDUPDATETIMEOUT_ENTRY, this );
   305 	iExtension->iParamObserver->ExtendUpdateTimeOut(aAdditionalTime);
   340 	iExtension->iParamObserver->ExtendUpdateTimeOut(aAdditionalTime);
       
   341 	OstTraceFunctionExit1( CPOSITIONER_EXTENDUPDATETIMEOUT_EXIT, this );
   306 	}
   342 	}
   307 
   343 
   308 
   344 
   309 
   345 
   310 //  End of File  
   346 //  End of File