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, |