networkingtestandutils/networkingintegrationtest/Te_Msg/src/TeMsgStep.cpp
branchRCL_3
changeset 22 8d540f55e491
parent 21 abbed5a4b42a
equal deleted inserted replaced
21:abbed5a4b42a 22:8d540f55e491
     1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2003-2009 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>
       
    33 
    32 
    34 
    33 
    35 _LIT(KIap,					"Iap");
    34 _LIT(KIap,					"Iap");
    36 _LIT(KIapNumber,			"IapNumber");
    35 _LIT(KIapNumber,			"IapNumber");
    37 _LIT(KTCPConfig,			"TCP Config");
    36 _LIT(KTCPConfig,			"TCP Config");
    45 #define LDD_NAME _L("ECOMM")
    44 #define LDD_NAME _L("ECOMM")
    46 #else
    45 #else
    47 #define PDD_NAME _L("EUART1")
    46 #define PDD_NAME _L("EUART1")
    48 #define LDD_NAME _L("ECOMM")
    47 #define LDD_NAME _L("ECOMM")
    49 #endif
    48 #endif
    50 #ifndef SIROCCO_CODE_MIGRATION
    49 
    51 const TInt iapCount = 2;
    50 const TInt iapCount = 2;
    52 #endif
    51 
    53 CTestConnectStep::CTestConnectStep():iIapNumber(0), iPort(0), iScheduler(NULL)
    52 CTestConnectStep::CTestConnectStep():iIapNumber(0), iPort(0), iScheduler(NULL)
    54 /**
    53 /**
    55  * Constructor
    54  * Constructor
    56  */
    55  */
    57 	{
    56 	{
    79 		}
    78 		}
    80 	else
    79 	else
    81 		{
    80 		{
    82 		iScheduler = new CActiveScheduler();
    81 		iScheduler = new CActiveScheduler();
    83 		CActiveScheduler::Install(iScheduler);
    82 		CActiveScheduler::Install(iScheduler);
    84 #ifdef SIROCCO_CODE_MIGRATION 
       
    85 		TInt err;
       
    86 #else
       
    87 		INFO_PRINTF1(_L("Load PDD"));	
    83 		INFO_PRINTF1(_L("Load PDD"));	
    88 		TInt err = User::LoadPhysicalDevice(PDD_NAME);
    84 		TInt err = User::LoadPhysicalDevice(PDD_NAME);
    89 		if (err != KErrNone && err != KErrAlreadyExists)
    85 		if (err != KErrNone && err != KErrAlreadyExists)
    90 			{
    86 			{
    91 			INFO_PRINTF2(_L("Could not load PDD! Leaving with error %d"), err);
    87 			INFO_PRINTF2(_L("Could not load PDD! Leaving with error %d"), err);
    92 			SetTestStepResult(EFail);
    88 			SetTestStepResult(EFail);
    93 			User::Leave(err);
    89 			User::Leave(err);
    94 			}
    90 			}
    95 #endif
    91 
    96 		INFO_PRINTF1(_L("Load LDD"));	
    92 		INFO_PRINTF1(_L("Load LDD"));	
    97 		err = User::LoadLogicalDevice(LDD_NAME);
    93 		err = User::LoadLogicalDevice(LDD_NAME);
    98 		if (err != KErrNone && err != KErrAlreadyExists)
    94 		if (err != KErrNone && err != KErrAlreadyExists)
    99 			{
    95 			{
   100 			INFO_PRINTF2(_L("Could not load LDD! Leaving with error %d"), err);
    96 			INFO_PRINTF2(_L("Could not load LDD! Leaving with error %d"), err);
   157 				}
   153 				}
   158 			}
   154 			}
   159 		INFO_PRINTF2((_L("IapNumber = %d")), iIapNumber);
   155 		INFO_PRINTF2((_L("IapNumber = %d")), iIapNumber);
   160 
   156 
   161 		TRequestStatus status;
   157 		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
       
   172 
   158 
   173 		TInt rank = 1;
   159 		TInt rank = 1;
   174 
   160 
   175 		// Create a multiple connection preference object
   161 		// Create a multiple connection preference object
   176 		TCommDbMultiConnPref prefs;
   162 		TCommDbMultiConnPref prefs;
   191 
   177 
   192 			rank++;
   178 			rank++;
   193 			}
   179 			}
   194 
   180 
   195 		prefs.SetConnectionAttempts(rank-1);
   181 		prefs.SetConnectionAttempts(rank-1);
   196 #endif 
       
   197 
   182 
   198 		// Start the connection
   183 		// Start the connection
   199 		iConnection.Start(prefs, status);
   184 		iConnection.Start(prefs, status);
   200 
   185 
   201 		
   186