xdmprotocols/src/XdmShutdownTimer.cpp
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 2005 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:  CXdmShutdownTimer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <e32base.h>
       
    21 #include "XcapProtocol.h"
       
    22 #include "XdmShutdownTimer.h"
       
    23 #include "XdmShutdownSwitch.h"
       
    24 
       
    25 // ----------------------------------------------------
       
    26 // CXdmShutdownTimer::CXdmShutdownTimer
       
    27 // 
       
    28 // ----------------------------------------------------
       
    29 //
       
    30 CXdmShutdownTimer::CXdmShutdownTimer( CXcapProtocol& aXcapProtocol,
       
    31                                       MXdmShutdownSwitch* aShutdownSwitch ) :
       
    32                                       CTimer( -1 ),
       
    33                                       iXcapProtocol( aXcapProtocol ),
       
    34                                       iShutdownSwitch( aShutdownSwitch )
       
    35 	{
       
    36 	}
       
    37 
       
    38 // ----------------------------------------------------
       
    39 // CXdmShutdownTimer::ConstructL
       
    40 // 
       
    41 // ----------------------------------------------------
       
    42 //	
       
    43 void CXdmShutdownTimer::ConstructL()
       
    44 	{
       
    45 	#ifdef _DEBUG
       
    46         iXcapProtocol.WriteToLog( _L8( "CXdmShutdownTimer::ConstructL()" ) );
       
    47     #endif
       
    48 	CTimer::ConstructL();
       
    49 	CActiveScheduler::Add( this );
       
    50 	}
       
    51 
       
    52 // ----------------------------------------------------
       
    53 // CXdmShutdownTimer::Start
       
    54 // 
       
    55 // ----------------------------------------------------
       
    56 //
       
    57 void CXdmShutdownTimer::Start( const TTimeIntervalMicroSeconds32 aShutdownDelay )
       
    58 	{
       
    59 	#ifdef _DEBUG
       
    60         iXcapProtocol.WriteToLog( _L8( "CXdmShutdownTimer::Start()" ) );
       
    61     #endif
       
    62 	After( aShutdownDelay );
       
    63 	}
       
    64 
       
    65 // ----------------------------------------------------
       
    66 // CXdmShutdownTimer::RunL
       
    67 // 
       
    68 // ----------------------------------------------------
       
    69 //	
       
    70 void CXdmShutdownTimer::RunL()
       
    71 	{
       
    72 	#ifdef _DEBUG
       
    73         iXcapProtocol.WriteToLog( _L8( "CXdmShutdownTimer::RunL() - Close transfer media" ) );
       
    74     #endif
       
    75 	iShutdownSwitch->SwitchOff();
       
    76 	}
       
    77 
       
    78