wlanutilities/wlanqtutilities/wrapper/src/wlanqtutilsconntestwrapper_s60.cpp
changeset 19 10810c91db26
child 31 e8f4211554fb
equal deleted inserted replaced
3:ff3b37722600 19:10810c91db26
       
     1 /*
       
     2 * Copyright (c) 2009 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 // INCLUDE FILES
       
    19 #include <e32base.h>
       
    20 #include <ictscommon.h>
       
    21 
       
    22 #include "wlanqtutilsconntestwrapper.h"
       
    23 #include "wlanqtutilsconntestwrapper_s60_p.h"
       
    24 
       
    25 #ifdef WLANQTUTILS_NO_OST_TRACES_FLAG
       
    26 #include <opensystemtrace.h>
       
    27 #else
       
    28 #include "OstTraceDefinitions.h"
       
    29 #endif
       
    30 #ifdef OST_TRACE_COMPILER_IN_USE
       
    31 #include "wlanqtutilsconntestwrapper_s60Traces.h"
       
    32 #endif
       
    33 
       
    34 
       
    35 // =========== PRIVATE CLASS MEMBER FUNCTIONS ===============
       
    36 //
       
    37 ConnTestWrapperPrivate::ConnTestWrapperPrivate(
       
    38     ConnTestWrapper *aWrapper )
       
    39 : q_ptr( aWrapper ), iIct( NULL )
       
    40     {
       
    41     OstTraceFunctionEntry1( CONNTESTWRAPPERPRIVATE_CONNTESTWRAPPERPRIVATE_ENTRY, this );
       
    42     OstTraceFunctionExit1( CONNTESTWRAPPERPRIVATE_CONNTESTWRAPPERPRIVATE_EXIT, this );
       
    43     }
       
    44 
       
    45 ConnTestWrapperPrivate::~ConnTestWrapperPrivate()
       
    46     {
       
    47     OstTraceFunctionEntry1( CONNTESTWRAPPERPRIVATE_CONNTESTWRAPPERPRIVATEDESTR_ENTRY, this );
       
    48     
       
    49     if ( !NULL ) 
       
    50         {
       
    51         delete iIct;
       
    52         }        
       
    53     
       
    54     OstTraceFunctionExit1( CONNTESTWRAPPERPRIVATE_CONNTESTWRAPPERPRIVATEDESTR_EXIT, this );
       
    55     }
       
    56 
       
    57 void ConnTestWrapperPrivate::ConnectivityObserver( 
       
    58     TIctsTestResult aResult, 
       
    59     const TDesC& /*aString*/ )
       
    60     {
       
    61     OstTraceFunctionEntry1( CONNTESTWRAPPERPRIVATE_CONNECTIVITYOBSERVER_ENTRY, this );
       
    62     OstTrace1(
       
    63         TRACE_NORMAL,
       
    64         CONNTESTWRAPPERPRIVATE_CONNECTIVITYOBSERVER,
       
    65         "ConnTestWrapperPrivate::ConnectivityObserver;aResult=%u", aResult );
       
    66     
       
    67     switch ( aResult ) 
       
    68         {
       
    69         case EConnectionOk :
       
    70             q_ptr->connectivityTestDone( ETrue );
       
    71             break;
       
    72         case EHttpAuthenticationNeeded :
       
    73         case EConnectionNotOk :
       
    74         case ETimeout :
       
    75         default:
       
    76             q_ptr->connectivityTestDone( EFalse );
       
    77             break;
       
    78         }
       
    79     
       
    80     delete iIct;
       
    81     iIct = NULL;
       
    82 
       
    83     OstTraceFunctionExit1( CONNTESTWRAPPERPRIVATE_CONNECTIVITYOBSERVER_EXIT, this );
       
    84     }
       
    85 
       
    86 void ConnTestWrapperPrivate::startConnectivityTest(
       
    87     int aIapId, int aNetId )
       
    88     {
       
    89     OstTraceFunctionEntry1( CONNTESTWRAPPERPRIVATE_STARTCONNECTIVITYTEST_ENTRY, this );
       
    90     OstTraceExt2(
       
    91         TRACE_NORMAL,
       
    92         CONNTESTWRAPPERPRIVATE_STARTCONNECTIVITYTEST,
       
    93         "ConnTestWrapperPrivate::startConnectivityTest;aIapId=%d;aNetId=%d", aIapId, aNetId );
       
    94     
       
    95     TRAPD( err, startConnectivityTestL( aIapId, aNetId ) );
       
    96     
       
    97     // Check if startConnectivityTestL() leaved.
       
    98     if ( KErrNone != err )
       
    99         {
       
   100         q_ptr->connectivityTestDone( EFalse );
       
   101         }
       
   102 
       
   103     OstTraceFunctionExit1( CONNTESTWRAPPERPRIVATE_STARTCONNECTIVITYTEST_EXIT, this );
       
   104     }
       
   105 
       
   106 void ConnTestWrapperPrivate::startConnectivityTestL(
       
   107     TInt aIapId, TInt aNetId )
       
   108     {
       
   109     OstTraceFunctionEntry1( CONNTESTWRAPPERPRIVATE_STARTCONNECTIVITYTESTL_ENTRY, this );
       
   110     
       
   111     iIct = CIctsClientInterface::NewL( aIapId, aNetId, *this );
       
   112     iIct->StartL();
       
   113  
       
   114     OstTraceFunctionExit1( CONNTESTWRAPPERPRIVATE_STARTCONNECTIVITYTESTL_EXIT, this );
       
   115     }
       
   116 
       
   117 //end of file