btobexprofiles/obexsendservices/obexservicesendutils/src/BTConnectionTimer.cpp
branchRCL_3
changeset 23 9386f31cc85b
parent 22 613943a21004
child 24 269724087bed
equal deleted inserted replaced
22:613943a21004 23:9386f31cc85b
     1 /*
       
     2 * Copyright (c) 2002 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:  Waiter class implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "BTConnectionTimer.h"
       
    22 #include "BTServiceUtils.h"
       
    23 #include "BTSUDebug.h"
       
    24 
       
    25 // CONSTANTS
       
    26 
       
    27                                     
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CBTSBPPServerWait::CBTSBPPServerWait
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CBTConnectionTimer::CBTConnectionTimer( MBTConTimeObserver* aObserver ) : 
       
    38     CTimer( EPriorityStandard ), iObserver( aObserver )
       
    39                                   
       
    40     {
       
    41     
       
    42     CActiveScheduler::Add( this );
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CBTConnectionTimer::ConstructL
       
    47 // Symbian 2nd phase constructor can leave.
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 void CBTConnectionTimer::ConstructL()
       
    51     {
       
    52     FLOG(_L("[BTSU]\t CBTConnectionTimer::ConstructL()"));
       
    53 
       
    54     CTimer::ConstructL();
       
    55     
       
    56 
       
    57     FLOG(_L("[BTSU]\t CBTConnectionTimer::ConstructL() completed"));
       
    58     }
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // CBTConnectionTimer::NewL
       
    62 // Two-phased constructor.
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 CBTConnectionTimer* CBTConnectionTimer::NewL( MBTConTimeObserver* aObserver )
       
    66     {
       
    67     CBTConnectionTimer* self = new( ELeave ) CBTConnectionTimer( aObserver );
       
    68     CleanupStack::PushL( self );
       
    69     self->ConstructL();
       
    70     CleanupStack::Pop(self);
       
    71     return self;
       
    72     }
       
    73 
       
    74     
       
    75 // Destructor
       
    76 CBTConnectionTimer::~CBTConnectionTimer()
       
    77     {
       
    78     Cancel();
       
    79     }
       
    80     
       
    81 // -----------------------------------------------------------------------------
       
    82 // CBTConnectionTimer::SetTimeOut
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 void CBTConnectionTimer::SetTimeOut(TTimeIntervalMicroSeconds32 aTimeOutValue)
       
    86     {
       
    87     iTimeOutValue = aTimeOutValue;
       
    88     }
       
    89 // -----------------------------------------------------------------------------
       
    90 // CBTConnectionTimer::Start
       
    91 // -----------------------------------------------------------------------------
       
    92 //
       
    93 void CBTConnectionTimer::Start()
       
    94     {    
       
    95     After( iTimeOutValue );
       
    96     }
       
    97         
       
    98 // -----------------------------------------------------------------------------
       
    99 // CBTConnectionTimer::RunL
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 void CBTConnectionTimer::RunL()
       
   103     {
       
   104     FTRACE(FPrint(_L("[BTSU]\t CBTConnectionTimer::RunL() status %d"), iStatus.Int() ) );
       
   105     
       
   106     if ( iObserver )
       
   107         {
       
   108         iObserver->ConnectionTimedOut();
       
   109         }
       
   110 
       
   111     FLOG(_L("[BTSU]\t CBTConnectionTimer::RunL() completed"));
       
   112     }
       
   113 
       
   114 //  End of File