// -----------------------------------------------------------------------------
// CVibraTimer::Set(TInt aIntervalInMilliSecs)
// Start the timer to complete after the specified number of microseconds.
// If the duration is zero, then timer is set to predefined maximum value.
// -----------------------------------------------------------------------------
//
TInt CVibraTimer::Set(TInt aIntervalInMilliSecs)
    {
    __ASSERT_ALWAYS(CActiveScheduler::Current()!= NULL, User::Invariant());
    
    if (!IsAdded())
        {
        CActiveScheduler::Add(this);
        }
    
    // If the timer is already running, cancel it... 
    if (IsActive())
        {
        Cancel();
        }
    // And set the new timer... 
    // Convert to uS first -- which is, after all, why this method really exists...
    if ((0 == aIntervalInMilliSecs) || (aIntervalInMilliSecs > iMaximumVibraTimeMs))
        {
        After(iMaximumVibraTimeMs * 1000);
        }
    else
        {    
        After(aIntervalInMilliSecs * 1000);
        }
    return KErrNone;
    }
Exemple #2
0
void CIkev1SA::StartTimer()
{
	if (iRemainingTime > KMaxTInt/SECOND)   //To avoid overflowing the Timer
	{
		iRemainingTime -= KMaxTInt/SECOND;
		After(KMaxTInt);
	}
	else    //No overflow
	{
		After(iRemainingTime*SECOND);
		iRemainingTime = 0;
	}
}
void CSenCoreShutdownTimer::ActivateShutdown()
    {
    CActiveScheduler::Add(this);
    if( iShutdownTimeInSecs > 0 )
        {
        TTimeIntervalMicroSeconds32 interval = iShutdownTimeInSecs * 1000 * 1000;
        After( interval );
        }
    else // use 30 secs (default)
        {
        TTimeIntervalMicroSeconds32 interval = KSenDefaultShutdownTime * 1000 * 1000;
        After( interval );
        }
    }
/**
 * @brief Completes the second phase of Symbian object construction.
 * Put initialization code that could leave here.
 */
void Csymbian_ua_guiAppUi::ConstructL()
{
    // [[[ begin generated region: do not modify [Generated Contents]
    BaseConstructL (EAknEnableSkin);
    InitializeContainersL();
    // ]]] end generated region [Generated Contents]

    // Create private folder
    RProcess process;
    TFileName path;

    path.Copy (process.FileName().Left (2));

    if (path.Compare (_L ("c")) || path.Compare (_L ("C")))
        CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC);
    else if (path.Compare (_L ("e")) || path.Compare (_L ("E")))
        CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE);

    // Init PJSUA
    if (symbian_ua_init() != 0) {
        symbian_ua_destroy();
        Exit();
    }

    ExecuteDlg_wait_initLD();

    CTimer::ConstructL();
    CActiveScheduler::Add (this);
    After (4000000);
}
void CTestTimer::QueueAndInfoPrint()
	{
	After(iSecondsRemaining*1000000);
	TBuf<100> message;
	message.Format(_L("%d seconds remaining"), iSecondsRemaining);
	User::InfoPrint(message);
	}
Exemple #6
0
/**
Starts the shutdown timer.
*/
void CLlcpTimer::Start(TInt aMSecs)
    {
    BEGIN
    const TUint KDelay = (1000 * aMSecs);
    After(KDelay);
    END
    }
void CIkeV1KeepAlive::StartTimer()
    {	
    if ( iRemainingTime > KMaxTInt/1000000 )   //To avoid overflowing the Timer
        {
        iRemainingTime -= KMaxTInt/1000000;
		After(KMaxTInt);
        }
    else    //No overflow
        {
		if ( iRemainingTime )
		    {
		    After(iRemainingTime*1000000);
		    }
		iRemainingTime = 0;
        }
    }
Exemple #8
0
/** context sensitive completion
 *  take current line, give list of completions (both atoms and files)
 *  thanks to Jan for crafting a proper interface wrapping SWI-Prolog available facilities
 */
QString Completion::initialize(int promptPosition, QTextCursor c, QStringList &strings) {
    QString rets;
    SwiPrologEngine::in_thread _int;
    try {
        int p = c.position();
        Q_ASSERT(p >= promptPosition);

        c.setPosition(promptPosition, c.KeepAnchor);
        QString left = c.selectedText();
        if (left.length()) {
            PlString Before(left.toStdWString().data());

            c.setPosition(p);
            c.movePosition(c.EndOfLine, c.KeepAnchor);
            QString after = c.selectedText();
            PlString After(after.toStdWString().data());

            PlTerm Completions, Delete, word;
            if (PlCall("prolog", "complete_input", PlTermv(Before, After, Delete, Completions)))
                for (PlTail l(Completions); l.next(word); )
                    strings.append(t2w(word));

            c.setPosition(p);
            rets = t2w(Delete);
        }
    }
    catch(PlException e) {
        qDebug() << t2w(e);
    }
    catch(...) {
        qDebug() << "...";
    }

    return rets;
}
void CTReadWrite::ReadL()
    {
    ReadFuncL();

    if(iFrameNumber != KNumberOfFrames)
         {
         iFrameNumber++;

         for(TInt i=0; i<iBufferSize; i++)
             {
             if(iData[i] != iInitialColour)
                 {
                 RDebug::Print(_L("Unexpected pixel colour %x"), iData[i]);
                 CActiveScheduler::Stop();
                 iTestPass = EFalse;
                 return;
                 }
             }
         //Re-issue the request
         After(TTimeIntervalMicroSeconds32(0));
         }
     else
         {
         //Stop the active scheduler and process with test termination
         CActiveScheduler::Stop();
         }
    }
void CTReadWrite::ReadWriteImageL()
    {
    ReadImageFuncL();

    TBool ret = EFalse; 
    for(TInt i=0; i<iBufferSize; i++)
        {
        if(iData[i] == iInitialColour)
            {
            iData[i] = iFinalColour;
            WriteImageFuncL();

            //Re-issue the request
            After(TTimeIntervalMicroSeconds32(0));
            
            ret = ETrue;
            break;
            }
        else if(iData[i] != iFinalColour)
            {
            CActiveScheduler::Stop();
            iTestPass = EFalse;
            
            ret = ETrue;
            break;
            }
        }

    //If no pixels have been modified, check to see if the test should finish
    if( (IsFinished() != EFalse) && (ret == EFalse) )
        {
        //Stop the active scheduler and process with test termination
        CActiveScheduler::Stop();
        }
    }
Exemple #11
0
void CIkev1SA::SetExpired()
{
    DEBUG_LOG(_L("CIkev1SA::SetExpired"));

	if ( !iExpired )  //If already expired do nothing to avoid renewing the expiration timer.
	{
	    DEBUG_LOG(_L("SA is still active. Expiring it..."));
	
		iExpired = ETrue;
		//if ( iHdr.iIkeData->iIpsecExpires )
		//{	
	    //DEB(iEngine->PrintText(_L("iIpsecExpires is ETrue\n"));)
		for (TInt i = 0; i < iSPIList->Count(); i++)
		{
		    DEBUG_LOG(_L("Deleting IPsec SA"));
			TIpsecSPI* spi_node = iSPIList->At(i);
			iPluginSession.DeleteIpsecSA( spi_node->iSPI,
			                              spi_node->iSrcAddr,
			                              spi_node->iDstAddr,
			                              spi_node->iProtocol );
		}
		//}	
		Cancel();   //Cancel the current timer
		After(ISAKMP_DELETE_TIME);
	}
}
void CGlxMediaListsTestCollectionPlugin::CTestTimer::RunL()
	{
	CMPXMedia* media = CMPXMedia::NewL();
	CleanupStack::PushL(media);

	media->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXImage);

	switch (iNextEvent)
		{
		case EAddItem:
			iPlugin->AddL(*media);
			iNextEvent = ERemoveItem;
			break;
		case ERemoveItem:
			iPlugin->RemoveL(*media);
			iNextEvent = EAddItem;
			break;
		default:
			break;
		}

	CleanupStack::PopAndDestroy(media);

	After(2000000);
	}
void CSoftwareConnectTimer::SoftwareDisconnect(TInt aInterval)
	{
	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_ENTRY, this );
	iConnectType = EDisconnect;
	After(aInterval*KOneSecond);
	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_EXIT, this );
	}
Exemple #14
0
void CRepositoryCacheManager::RescheduleTimer(const TTime& aTimeInUTC)
	{
	
	TTime now;
	now.UniversalTime();
	
	//Get the 64bit time interval between now and the cache timeout
	TTimeIntervalMicroSeconds interval64 = aTimeInUTC.MicroSecondsFrom(now);
	TTimeIntervalMicroSeconds32 interval32(iDefaultTimeout);
	
	//If the interval is positive, i.e. the timeout is in the future, convert 
	//this interval to a 32 bit value, otherwise use the default timeout
	if(interval64 > 0)
		{
		//If the interval value is less than the maximum 32 bit value cast
		//interval to 32 bit value, otherwise the interval is too large for 
		//a 32 bit value so just set the interval to the max 32 bit value
		const TInt64 KMax32BitValue(KMaxTInt32);
		interval32 = (interval64 <= KMax32BitValue) ? 
				static_cast<TTimeIntervalMicroSeconds32>(interval64.Int64()): KMaxTInt32;
		}

	//Reschedule the timer
	After(interval32);

	}
// --------------------------------------------------------------------------
// CUPnPBrowseTimer::Start
// Starts the periodizer.
// --------------------------------------------------------------------------
//
void CUPnPBrowseTimer::Start()
    {
    if ( !IsActive() )
        {
        After( TTimeIntervalMicroSeconds32( iTimerWavelength ) );
        }
    }
// -----------------------------------------------------------------------------
// CRadioServerShutdown::Start
// -----------------------------------------------------------------------------
//
void CRadioServerShutdown::Start()
    {
	if ( !IsActive() )
		{
		After(KServerShutdownDelay);
		}
    }
void CIniFileManager::ScheduleSaveIniFileSettings(TInt aSaveFlags, TBool aReplace)
	{
	// make sure all requested writes are saved
	iSaveType |= aSaveFlags;
	iReplace = aReplace;

	// make sure change isn't due to Internalize
	if (iBackupFlag != EIsRestoring)
		{
		iBackupFlag = ERequestSave;
		//iNumberOfAttemptedRetries = 0;

		// set the time to RunL if not already set to run
		// check that no Backup or Restore is in progress, 
		// For Backup And Restore
		if (!(iDbMgrCtrlr.BackupRestoreAgent().BackupInProgress()) &&
			!(iDbMgrCtrlr.BackupRestoreAgent().RestoreInProgress()))
			{
			if (!IsActive())
				{
#ifdef INIFILE_DEBUG_LOG
				RDebug::Print(_L("\n[CNTMODEL] CIniFileManager::ScheduleSaveIniFileSettings(aSaveFlags = %i, aReplace %i)\r\n"),aSaveFlags, aReplace);
#endif
				After(KIniFileSaveDelay);	
				}
			}
		}
	}
/**
Set rendering mode to synchronous or asynchronous
@param aMode Rendering mode to set.
*/
void CEglContent::SetMode(TMode aMode)
	{
	if(aMode == iMode)
		return;

	iMode = aMode;

	// reset mode
	if(aMode == ESync)
		{
		// cancel request for next frame
		Cancel();
		iFrame = 0;
		}
	else if(aMode == EAsync)
		{
		// render init frame
		iFrame = 0;
		RenderNextFrame();
		// issue request for next frame
		After(KEglContentDelay);
		}
	else // EAsyncDebug
		{
		// render init frame
		iFrame = 0;
		RenderNextFrame();
		}
	}
// ---------------------------------------------------------------------------
// Notifies the Plug-in's client of stream's current sending status.
// ---------------------------------------------------------------------------
//
void CNATFWStunConnectionHandler::RunL()
    {
    ExecuteCallBack();
    if ( iCallBackCmds.Count() )
        {
        After( KWaitTime );
        }
    }
/**
 * Retry a previously requested backup operation
 */
void CASSrvAlarmStore::RetryStoreOperation()
	{
	if (iFlags.IsSet(ERequestExternalize) && !IsActive())
		{
		// can RunL now
		After(0);
		}
	}
void CMMF_TSU_SWCDWRAP_MakeAsyncHwDeviceCall::CallStopAndDeleteCodecAfter(CMMFHwDevice& aHwDevice, TTimeIntervalMicroSeconds32 aTimeInterval)
	{
	iCallActionCancelled = EFalse;
	iHwDevice = &aHwDevice;
	iCallStopAndDeleteCodec = ETrue;
	iStopError = KErrNone;
	After(aTimeInterval);	
	}
// ---------------------------------------------------------------------------
//CheckStatus of CacheDb and do cleanup if necessary
// ---------------------------------------------------------------------------
//
void CIRCacheCleanup::CheckStatusL()
    {
    IRLOG_DEBUG( "CIRCacheCleanup::CheckStatusL - Entering" );
    TTimeIntervalMicroSeconds32  interval(GetCleanupInterval());
    After(interval);
    CleanupCacheDbL();
    IRLOG_DEBUG( "CIRCacheCleanup::CheckStatusL - Exiting" );
    }
inline void CShutdown::Start()
	{
	
	RDEBUG( "creenSaverServer: starting shutdown timeout" );
	
	After(KSCPClientTestServerShutdownDelay);
	//SetActive();
	}
// -----------------------------------------------------------------------------
// CNaviScrollTimer::StartScroll()
// Starts to scroll the navigation pane text.
// -----------------------------------------------------------------------------
//
void CNaviScrollTimer::StartScroll()
    {   
    // Start scrolling only if text do not fit to navi pane 
    if( iNaviText->Des().Length() > KMaxVisibleStringLenth ) 
        After( 1 );
    else
        UpdateNaviPaneL();
    }
void CMTPDeviceInfoTimer::Start()
    {
    OstTraceFunctionEntry0( CMTPDEVICEINFOTIMER_START_ENTRY );

    After(KMTPDeviceInfoDelay);
    iState = EStartTimer;
    OstTraceFunctionExit0( CMTPDEVICEINFOTIMER_START_EXIT );
    }
void CMMF_TSU_SWCDWRAP_MakeAsyncHwDeviceCall::CallPauseAfter(CMMFHwDevice& aHwDevice, TTimeIntervalMicroSeconds32 aTimeInterval)
	{
	iCallActionCancelled = EFalse;
	iHwDevice = &aHwDevice;
	iCallPause = ETrue;
	iPauseError = KErrNone;
	After(aTimeInterval);	
	}
// -----------------------------------------------------------------------------
// CObexUtilsDialogTimer::Tickle
// -----------------------------------------------------------------------------
//
void CObexUtilsDialogTimer::Tickle()
    {
    FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::Tickle()"));

    Cancel();
    After( iTimeout );

    FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::Tickle() completed"));
    }
Exemple #28
0
EXPORT_C void CRegisteredParserDll::ReleaseLibrary()
/** Releases the parser DLL, and decrements the reference count. */
	{
	iDllRefCount--;
	if(iDllRefCount==0)
		{
        After(KReleaseLibraryTimeout);
		}
	}
// -----------------------------------------------------------------------------
// CRadioServerShutdown::Start
// -----------------------------------------------------------------------------
//
void CSensrvShutdown::Start()
    {
    COMPONENT_TRACE( _L( "Sensor Server - CSensrvShutdown::Start" ) );
	if ( !IsActive() )
		{
		After(iProxyManager.TerminationPeriod());
		}
	COMPONENT_TRACE( _L( "Sensor Server - CSensrvShutdown::Start - return" ) );
    }
/**
 * @see CActive
 */
void CASSrvAlarmStore::RunL()
	{
	TInt error = iStatus.Int();

	// operation isn't cancelled
	if	(error == KErrNone)
		{
		// task : Externalize
		if (iFlags.IsSet(ERequestExternalize))
			{
			// Try to Externalize
			error = Externalize();

			if (error < KErrNone)
				{
				++iNumberOfAttemptedRetries;

				// check retries, and reschedule
				if (iNumberOfAttemptedRetries == KNumberOfAttemptsAtExternalizingFile)
					{
					// Try one last time. Wait for 10 mins and then attempt operation again.
					// After that, give up.
					//
					// Possible reasons for entering this state:
					//
					// Low disk space, low memory, corrupt file system, etc etc. Don't think
					// its acceptable to panic - operation should be failed gracefully. 
					After(KDelayInMicrosecondsBetweenFileOperationsLongDelay);
					}
				else if (iNumberOfAttemptedRetries < KNumberOfAttemptsAtExternalizingFile)
					{
					// Try again after the delay
					After(KDelayInMicrosecondsBetweenFileOperations);
					}
				else
					{
					// Tried max number of times already. Give up.
					iFlags.Clear(ERequestExternalize);
					}
				}

			}
		}
	}