networkingtestandutils/networkingintegrationtest/Te_Msg/src/TeMsgStep.cpp
changeset 51 78fceed50f62
parent 0 af10295192d8
child 58 8d540f55e491
child 71 a800ea6cb454
equal deleted inserted replaced
42:88121cf79045 51:78fceed50f62
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    27 #include <in_sock.h>
    27 #include <in_sock.h>
    28 #include <c32root.h>
    28 #include <c32root.h>
    29 #include <commdbconnpref.h>
    29 #include <commdbconnpref.h>
    30 #include <e32std.h>
    30 #include <e32std.h>
    31 #include <securesocket.h>
    31 #include <securesocket.h>
       
    32 #include <e32property.h>
    32 
    33 
    33 
    34 
    34 _LIT(KIap,					"Iap");
    35 _LIT(KIap,					"Iap");
    35 _LIT(KIapNumber,			"IapNumber");
    36 _LIT(KIapNumber,			"IapNumber");
    36 _LIT(KTCPConfig,			"TCP Config");
    37 _LIT(KTCPConfig,			"TCP Config");
    44 #define LDD_NAME _L("ECOMM")
    45 #define LDD_NAME _L("ECOMM")
    45 #else
    46 #else
    46 #define PDD_NAME _L("EUART1")
    47 #define PDD_NAME _L("EUART1")
    47 #define LDD_NAME _L("ECOMM")
    48 #define LDD_NAME _L("ECOMM")
    48 #endif
    49 #endif
    49 
    50 #ifndef SIROCCO_CODE_MIGRATION
    50 const TInt iapCount = 2;
    51 const TInt iapCount = 2;
    51 
    52 #endif
    52 CTestConnectStep::CTestConnectStep():iIapNumber(0), iPort(0), iScheduler(NULL)
    53 CTestConnectStep::CTestConnectStep():iIapNumber(0), iPort(0), iScheduler(NULL)
    53 /**
    54 /**
    54  * Constructor
    55  * Constructor
    55  */
    56  */
    56 	{
    57 	{
    78 		}
    79 		}
    79 	else
    80 	else
    80 		{
    81 		{
    81 		iScheduler = new CActiveScheduler();
    82 		iScheduler = new CActiveScheduler();
    82 		CActiveScheduler::Install(iScheduler);
    83 		CActiveScheduler::Install(iScheduler);
       
    84 #ifdef SIROCCO_CODE_MIGRATION 
       
    85 		TInt err;
       
    86 #else
    83 		INFO_PRINTF1(_L("Load PDD"));	
    87 		INFO_PRINTF1(_L("Load PDD"));	
    84 		TInt err = User::LoadPhysicalDevice(PDD_NAME);
    88 		TInt err = User::LoadPhysicalDevice(PDD_NAME);
    85 		if (err != KErrNone && err != KErrAlreadyExists)
    89 		if (err != KErrNone && err != KErrAlreadyExists)
    86 			{
    90 			{
    87 			INFO_PRINTF2(_L("Could not load PDD! Leaving with error %d"), err);
    91 			INFO_PRINTF2(_L("Could not load PDD! Leaving with error %d"), err);
    88 			SetTestStepResult(EFail);
    92 			SetTestStepResult(EFail);
    89 			User::Leave(err);
    93 			User::Leave(err);
    90 			}
    94 			}
    91 
    95 #endif
    92 		INFO_PRINTF1(_L("Load LDD"));	
    96 		INFO_PRINTF1(_L("Load LDD"));	
    93 		err = User::LoadLogicalDevice(LDD_NAME);
    97 		err = User::LoadLogicalDevice(LDD_NAME);
    94 		if (err != KErrNone && err != KErrAlreadyExists)
    98 		if (err != KErrNone && err != KErrAlreadyExists)
    95 			{
    99 			{
    96 			INFO_PRINTF2(_L("Could not load LDD! Leaving with error %d"), err);
   100 			INFO_PRINTF2(_L("Could not load LDD! Leaving with error %d"), err);
   153 				}
   157 				}
   154 			}
   158 			}
   155 		INFO_PRINTF2((_L("IapNumber = %d")), iIapNumber);
   159 		INFO_PRINTF2((_L("IapNumber = %d")), iIapNumber);
   156 
   160 
   157 		TRequestStatus status;
   161 		TRequestStatus status;
       
   162 #ifdef SIROCCO_CODE_MIGRATION
       
   163 	TCommDbConnPref prefs;
       
   164 	prefs.SetIapId(iIapNumber);
       
   165 	prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
       
   166 		const TUid KMyPropertyCat = {0x101FD9C5};
       
   167         const TUint32 KMyPropertyDestPortv4 = 67;
       
   168         TInt err = RProperty::Define(KMyPropertyCat, KMyPropertyDestPortv4, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
       
   169 		     TSecurityPolicy(ECapabilityWriteDeviceData));
       
   170         User::LeaveIfError(RProperty::Set(KMyPropertyCat, KMyPropertyDestPortv4, 93));
       
   171 #else
   158 
   172 
   159 		TInt rank = 1;
   173 		TInt rank = 1;
   160 
   174 
   161 		// Create a multiple connection preference object
   175 		// Create a multiple connection preference object
   162 		TCommDbMultiConnPref prefs;
   176 		TCommDbMultiConnPref prefs;
   177 
   191 
   178 			rank++;
   192 			rank++;
   179 			}
   193 			}
   180 
   194 
   181 		prefs.SetConnectionAttempts(rank-1);
   195 		prefs.SetConnectionAttempts(rank-1);
       
   196 #endif 
   182 
   197 
   183 		// Start the connection
   198 		// Start the connection
   184 		iConnection.Start(prefs, status);
   199 		iConnection.Start(prefs, status);
   185 
   200 
   186 		
   201