equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the Qt Mobility Components. |
7 ** This file is part of the Qt Mobility Components. |
8 ** |
8 ** |
403 // the time interval set is in milli seconds // |
403 // the time interval set is in milli seconds // |
404 ////////////////////////////////////////////////////////////// |
404 ////////////////////////////////////////////////////////////// |
405 int CQMLBackendAO::setUpdateInterval(int aMilliSec) |
405 int CQMLBackendAO::setUpdateInterval(int aMilliSec) |
406 { |
406 { |
407 int minimumUpdateInterval = 0; |
407 int minimumUpdateInterval = 0; |
408 TInt64 mUpdateInterval = 0; |
408 TInt64 mUpdateInterval = 0 ; |
409 |
409 |
410 if (mRequester) |
410 if (mRequester) |
411 minimumUpdateInterval = mRequester->minimumUpdateInterval(); |
411 minimumUpdateInterval = mRequester->minimumUpdateInterval(); |
412 else |
412 else |
413 minimumUpdateInterval = mRequesterSatellite->minimumUpdateInterval(); |
413 minimumUpdateInterval = mRequesterSatellite->minimumUpdateInterval(); |
442 // will set Either zero, minimum or +ve value |
442 // will set Either zero, minimum or +ve value |
443 // seconds converted to TTimeIntervalMicroSeconds |
443 // seconds converted to TTimeIntervalMicroSeconds |
444 aPosOption.SetUpdateInterval(TTimeIntervalMicroSeconds(mUpdateInterval * 1000)); |
444 aPosOption.SetUpdateInterval(TTimeIntervalMicroSeconds(mUpdateInterval * 1000)); |
445 |
445 |
446 // set the timeout to the smaller of 150% of interval or update interval + 10 seconds |
446 // set the timeout to the smaller of 150% of interval or update interval + 10 seconds |
447 TInt mUpdateTimeout = (mUpdateInterval * 3) / 2; |
447 TInt64 mUpdateTimeout = (mUpdateInterval * 3) / 2; |
448 if (mUpdateTimeout > mUpdateInterval + 10000) |
448 if (mUpdateTimeout > mUpdateInterval + 10000) |
449 mUpdateTimeout = mUpdateInterval + 10000; |
449 mUpdateTimeout = mUpdateInterval + 10000; |
450 |
450 |
451 if (aMilliSec > 0) |
451 if (aMilliSec > 0) |
452 aPosOption.SetUpdateTimeOut(TTimeIntervalMicroSeconds(mUpdateTimeout * 1000)); |
452 aPosOption.SetUpdateTimeOut(TTimeIntervalMicroSeconds(mUpdateTimeout * 1000)); |