datacommsserver/esockserver/test/TE_EsockTestSteps/inc/MobilitySimulation.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 /**
       
     2 * Copyright (c) 2006-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 * Mobility simulation components
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file MobilitySimulation.h
       
    24 */
       
    25 
       
    26 #ifndef _MOBILITYSIMULATION_H_
       
    27 #define _MOBILITYSIMULATION_H_
       
    28 
       
    29 #include <e32base.h>
       
    30 #include <e32property.h>
       
    31 #include <in_sock.h>
       
    32 #include <es_sock.h>
       
    33 
       
    34 const TUid KBearerMobilityTestPropCat = TUid::Uid(0x10012345); // TODO replace with something meaningful or platsec ready
       
    35 
       
    36 class CBearerAvailability
       
    37 {
       
    38 	public:
       
    39 		// Constructor
       
    40 		CBearerAvailability(TUint aBearer);
       
    41 
       
    42 		enum TAvailabilityState {EAvailable, EUnavailable};
       
    43 		TInt GetAvailability(TAvailabilityState& aAvailability);
       
    44 		TInt MakeAvailable();
       
    45 		TInt MakeUnavailable();
       
    46 		TInt MakeDisconnected();
       
    47 
       
    48 
       
    49 	private:
       
    50 		TUint iBearerIndex;
       
    51 		enum TBearerIndex {EMinBearerIndex = 1, EMaxBearerIndex = 3};
       
    52 		enum TAvailabilityProp {EAvailabilityIAP1, EAvailabilityIAP2, EAvailabilityIAP3};
       
    53 
       
    54 		TUint SetAvailability(TAvailabilityState aAvailability);
       
    55 
       
    56 		TBool iPropertyDefined; // = false;
       
    57 };
       
    58 
       
    59 // Watches for changes in the simulated availability of a bearer set by a client application
       
    60 class CBearerStateWatcher : CActive
       
    61 {
       
    62 	public:
       
    63 		TInt WaitForAvailabilityChange();
       
    64 		void RunL();
       
    65 };
       
    66 
       
    67 
       
    68 #endif
       
    69