ImagePrint/ImagePrintEngine/DeviceProtocols/btprotocol/src/cbttimer.cpp
branchGCC_SURGE
changeset 25 59ea2209bb67
parent 23 08cc4cc059d4
parent 15 a92d00fca574
equal deleted inserted replaced
23:08cc4cc059d4 25:59ea2209bb67
     1 /*
       
     2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "cbttimer.h"
       
    20 #include "clog.h"
       
    21 
       
    22 //  CONSTANTS
       
    23  
       
    24 CBtTimer* CBtTimer::NewL( MBtTimerObserver& aObserver )
       
    25     {
       
    26 	CBtTimer* obj = new (ELeave) CBtTimer( aObserver );
       
    27     CleanupStack::PushL( obj ) ;
       
    28     obj->ConstructL();
       
    29 	CleanupStack::Pop(); // obj
       
    30     return obj;
       
    31     }
       
    32 
       
    33 CBtTimer::~CBtTimer()
       
    34 	{
       
    35 	}
       
    36 
       
    37 CBtTimer::CBtTimer( MBtTimerObserver& aObserver ) : 
       
    38 									CTimer( -1 ),
       
    39 									iObserver( aObserver )
       
    40     {
       
    41 	CActiveScheduler::Add( this );
       
    42     }
       
    43 
       
    44 void CBtTimer::ConstructL()
       
    45     {
       
    46 	CTimer::ConstructL();
       
    47     }
       
    48 
       
    49 void CBtTimer::Start(TUint aDelay)
       
    50     {
       
    51     LOG1("[CBtTimer::Start] timeout %d", aDelay);
       
    52 	After( KDiscoveryDelay );
       
    53     }
       
    54 
       
    55 void CBtTimer::RunL()
       
    56 	{
       
    57 	LOG2("[CBtTimer::RunL] iStatus.Int(): %d/0x%X", iStatus.Int(),iStatus.Int());
       
    58 	if( iStatus.Int() == KErrNone )
       
    59 		{
       
    60 		iObserver.HandleTimeoutL();	
       
    61 		}
       
    62 	LOG("CBtTimer::RunL end");	
       
    63 	}
       
    64 
       
    65 //  End of File