locationmanager/locationtrail/src/cpositioninfo.cpp
changeset 21 50bf9db68373
parent 20 6dfc5f825351
child 36 aa5a574040a4
equal deleted inserted replaced
20:6dfc5f825351 21:50bf9db68373
    43 //  
    43 //  
    44 CPositionInfo::CPositionInfo( MPositionInfoObserver* aTrail ) 
    44 CPositionInfo::CPositionInfo( MPositionInfoObserver* aTrail ) 
    45     : CActive( CActive::EPriorityStandard ),
    45     : CActive( CActive::EPriorityStandard ),
    46     iFirstInterval( ETrue )
    46     iFirstInterval( ETrue )
    47     {
    47     {
       
    48     LOG( "CPositionInfo::CPositionInfo()");
    48     CActiveScheduler::Add( this );
    49     CActiveScheduler::Add( this );
    49     iTrail = aTrail;
    50     iTrail = aTrail;
    50     iTrailCaptureSetting = RLocationTrail::ECaptureAll;
    51     iTrailCaptureSetting = RLocationTrail::ECaptureAll;
    51     
    52     
    52     // Set update interval.
    53     // Set update interval.
    99     iTrailCaptureSetting = aCaptureSetting;
   100     iTrailCaptureSetting = aCaptureSetting;
   100     iUpdateInterval = aUpdateInterval;
   101     iUpdateInterval = aUpdateInterval;
   101     iFirstInterval = ETrue;
   102     iFirstInterval = ETrue;
   102     iPositionInfo = TPositionSatelliteInfo();
   103     iPositionInfo = TPositionSatelliteInfo();
   103     
   104     
   104     
       
   105     // Set update interval.
   105     // Set update interval.
   106      iUpdateOptions.SetUpdateInterval( TTimeIntervalMicroSeconds(KFirstInterval) );
   106      iUpdateOptions.SetUpdateInterval( TTimeIntervalMicroSeconds(KFirstInterval) );
   107      // Set time out level. 
   107      // Set time out level. 
   108      iUpdateOptions.SetUpdateTimeOut( TTimeIntervalMicroSeconds( KFirstTimeOut) );
   108      iUpdateOptions.SetUpdateTimeOut( TTimeIntervalMicroSeconds( KFirstTimeOut) );
   109      // Positions which have time stamp below KMaxAge can be reused
   109      // Positions which have time stamp below KMaxAge can be reused
   110      iUpdateOptions.SetMaxUpdateAge( TTimeIntervalMicroSeconds(KMaxAge) );
   110      iUpdateOptions.SetMaxUpdateAge( TTimeIntervalMicroSeconds(KMaxAge) );
   111      // Disables location framework to send partial position data
   111      // Disables location framework to send partial position data
   112      iUpdateOptions.SetAcceptPartialUpdates( EFalse );
   112      iUpdateOptions.SetAcceptPartialUpdates( EFalse );
   113     
   113     
   114    
       
   115     
       
   116     if ( aCaptureSetting == RLocationTrail::ECaptureAll ) 
   114     if ( aCaptureSetting == RLocationTrail::ECaptureAll ) 
   117     	{
   115     	{
   118 	    User::LeaveIfError( iPosServer.Connect() );
   116 	    User::LeaveIfError( iPosServer.Connect() );
   119 	    User::LeaveIfError( iPositioner.Open( iPosServer ) );
   117 	    User::LeaveIfError( iPositioner.Open( iPosServer ) );
   120 	    User::LeaveIfError( iPositioner.SetRequestor( CRequestor::ERequestorService,
   118 	    User::LeaveIfError( iPositioner.SetRequestor( CRequestor::ERequestorService,
   160 // --------------------------------------------------------------------------
   158 // --------------------------------------------------------------------------
   161 //
   159 //
   162 void CPositionInfo::Stop()
   160 void CPositionInfo::Stop()
   163     {
   161     {
   164     Cancel();    
   162     Cancel();    
   165     // Start shutdown timer...
   163 
   166     iPositioner.Close();
   164     iPositioner.Close();
   167     iPosServer.Close();
   165     iPosServer.Close();
   168     }    
   166     }    
   169         
   167         
   170 // --------------------------------------------------------------------------
   168 // --------------------------------------------------------------------------