usbengines/usblocodplugin/tsrc/USBLocodPluginTest/src/LocodBearerPluginObs.cpp
changeset 35 9d8b04ca6939
parent 0 1e05558e2206
equal deleted inserted replaced
34:7858bc6ead78 35:9d8b04ca6939
       
     1 /*
       
     2 * Copyright (c) 2002 - 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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "LocodBearerPluginObs.h"
       
    20 
       
    21 CLocodBearerPluginObs::CLocodBearerPluginObs( CStifLogger* aLog )
       
    22     {
       
    23     iLog = aLog;
       
    24     }
       
    25 
       
    26 
       
    27 CLocodBearerPluginObs::~CLocodBearerPluginObs()
       
    28     {
       
    29     STIF_LOG( "[STIF_LOG] >>>CLocodBearerPluginObs::~CLocodBearerPluginObs" );
       
    30     
       
    31     if ( iWait -> IsStarted() )
       
    32         iWait -> AsyncStop();
       
    33     delete iWait;
       
    34     iWait = NULL;
       
    35     
       
    36     STIF_LOG( "[STIF_LOG] <<<CLocodBearerPluginObs::~CLocodBearerPluginObs" );
       
    37     }
       
    38 
       
    39 
       
    40 CLocodBearerPluginObs* CLocodBearerPluginObs::NewL( CStifLogger* aLog )
       
    41     {
       
    42     CLocodBearerPluginObs* self = new ( ELeave )CLocodBearerPluginObs( aLog );
       
    43     CleanupStack::PushL( self );
       
    44     self->ConstructL();
       
    45     CleanupStack::Pop( self );
       
    46     return self;
       
    47     }
       
    48 
       
    49 
       
    50 void CLocodBearerPluginObs::ConstructL()
       
    51     {
       
    52     STIF_LOG( "[STIF_LOG] >>>CLocodBearerPluginObs::ConstructL" );   
       
    53     iWait = new ( ELeave )CActiveSchedulerWait();    
       
    54     STIF_LOG( "[STIF_LOG] <<<CLocodBearerPluginObs::ConstructL" );
       
    55     }
       
    56 
       
    57 
       
    58 void CLocodBearerPluginObs::NotifyBearerStatus( TLocodBearer aBearer, TBool aStatus )
       
    59     {
       
    60     STIF_LOG( "[STIF_LOG] >>>CLocodBearerPluginObs::NotifyBearerStatus" );
       
    61     if ( iWait -> IsStarted() )
       
    62         iWait -> AsyncStop();
       
    63     iLocodBearerStatus = aStatus;
       
    64     STIF_LOG( "[STIF_LOG] <<<CLocodBearerPluginObs::NotifyBearerStatus" );
       
    65     }
       
    66 
       
    67 
       
    68 void CLocodBearerPluginObs::ActivateObserver( TBool& aLocodBearerStatus )
       
    69     {
       
    70     STIF_LOG( "[STIF_LOG] >>>CLocodBearerPluginObs::ActivateObserver" ); 
       
    71     iWait -> Start();
       
    72     aLocodBearerStatus = iLocodBearerStatus;
       
    73     STIF_LOG( "[STIF_LOG] <<<CLocodBearerPluginObs::ActivateObserver" );
       
    74     }