telephonyserverplugins/multimodetsy/test/Te_LoopBack/Te_LoopBackCCbstParse.cpp
author Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
Thu, 06 May 2010 15:10:38 +0100
branchopencode
changeset 24 6638e7f4bd8f
parent 0 3553901f7fa8
permissions -rw-r--r--
opencode
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     2
// All rights reserved.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     3
// This component and the accompanying materials are made available
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     5
// which accompanies this distribution, and is available
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     7
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     8
// Initial Contributors:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     9
// Nokia Corporation - initial contribution.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    10
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    11
// Contributors:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    12
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    13
// Description:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    14
// This file initiates the "Data Calls with diff params(speed)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    15
// The client (application) side must start the emulator and drive the ETel API.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    16
// The emulator side runs the designated script.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    17
// 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    18
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    19
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    20
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    21
 @file
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    22
 @note  There are mulitple classes implemented in this file.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    23
 @note  These classes are CTestDriveCbstParse and CTestCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    24
*/
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    25
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    26
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    27
#include <e32test.h>
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    28
#include "Te_LoopBackSLOGGER.H"
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    29
#include "Te_LoopBackCCbstParse.h"
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    30
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    31
#include "../../hayes/TSYCONFG.H" // for KInternetAccessPoint
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    32
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    33
_LIT(KMmPhoneName,"GsmPhone1");
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    34
 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    35
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    36
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    37
// Test-side class
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    38
// With the assistance of the base class, this class must start the emulator
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    39
// and drive the ETel API.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    40
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    41
CTestDriveCbstParse* CTestDriveCbstParse::NewL(const TScriptList aScriptListEntry,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    42
															 TInt aVarDelay)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    43
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    44
 * 2 Phase Constructor
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    45
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    46
 * This method creates an instance of CTestDriveCbstParse.  The ConstructL for
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    47
 * for CTestDriveCbstParse is inherited from and implemented in CTestBase. The
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    48
 * ConstructL uses the CTestDriveCbstParse object to load ond open the two iPhone
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    49
 * objects, one from each server.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    50
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    51
 * @param aScriptListEntry: enum indicating which script to use for this test.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    52
 * @param aVarDelay: integer indicating variable delay value, in seconds, to be used with an EWait script
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    53
 * @leave Leaves if a failure occurs during connect or open of the iPhone by ConstructL.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    54
 * @return pointer to the instance of CTestDriveCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    55
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    56
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    57
	CTestDriveCbstParse* aA=new(ELeave) CTestDriveCbstParse(aScriptListEntry, aVarDelay);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    58
	CleanupStack::PushL(aA);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    59
	aA->ConstructL();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    60
	CleanupStack::Pop();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    61
	return aA;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    62
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    63
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    64
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    65
CTestDriveCbstParse::CTestDriveCbstParse(const TScriptList aScriptListEntry,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    66
													   TInt aVarDelay
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    67
													  ) : iScriptListEntry(aScriptListEntry),
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    68
													      iVarDelay(aVarDelay)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    69
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    70
 * This method is the constructor for CTestDriveCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    71
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    72
 * @param aScriptListEntry: enum indicating which script to use for this test.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    73
 * @param aVarDelay: integer indicating variable delay value, in seconds, to be used with an EWait script
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    74
 * @note Initializes private data "aScriptListEntry" to received parameter.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    75
 * @note Initializes private data "aVarDelay" to received parameter.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    76
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    77
	{}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    78
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    79
TInt CTestDriveCbstParse::RunTestL()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    80
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    81
 * This method is invoked to start a "Data Call answer and remote hang-up closely followed by
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    82
 * a dial" test.  This method sets the CTestBase current script to run and the CTestBase variable
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    83
 * delay value to use for an EWait
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    84
 * script and then starts the modem emulator side of the test.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    85
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    86
 * @return KErrNone when no error exists.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    87
 * @return KErrAlreadyExists is returned if modem emulator exists and retry limit expires.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    88
 * @return Variable depending on return value from test's DriveETelApiL method and thread monitoring.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    89
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    90
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    91
	iCurrentScript=iScriptListEntry;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    92
	iVariableDelay=iVarDelay;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    93
	return StartEmulatorL();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    94
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    95
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    96
TInt CTestDriveCbstParse::DriveETelApiL()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    97
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    98
 * This method contains the real meat of the 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    99
 * @return KErrNone.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   100
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   101
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   102
	INFO_PRINTF1(_L("Wrong CBST string +CBST:  \n")) ;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   103
	DriveTestL() ; 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   104
	INFO_PRINTF1(_L("Wrong CBST string +CBST: (3,4), \n")) ;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   105
	DriveTestL() ; 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   106
	INFO_PRINTF1(_L("Wrong CBST string +CBST: (3,4),(3),  \n")) ;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   107
	DriveTestL() ; 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   108
	INFO_PRINTF1(_L("Wrong speed string +CBST: (3,4, \n")) ;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   109
	DriveTestL() ;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   110
	INFO_PRINTF1(_L("Wrong name string +CBST: (3,4), (3\n ")) ;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   111
	DriveTestL() ; 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   112
	INFO_PRINTF1(_L("Wrong CE string+CBST: (3,4), (3,2), (1 \n")) ;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   113
	DriveTestL() ; 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   114
	return KErrNone;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   115
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   116
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   117
void CTestDriveCbstParse::DriveTestL()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   118
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   119
	// Open iPhone
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   120
	iPhone3.Open(iServer,KMmPhoneName);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   121
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   122
	TRequestStatus	reqStatus;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   123
	INFO_PRINTF1(_L("Initialising the Phone...\n"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   124
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   125
	RMobilePhone::TMMTableSettings tableSettings;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   126
	tableSettings.iLocId=KInternetAccessPoint;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   127
	RMobilePhone::TMMTableSettingsPckg tableSettingsPckg(tableSettings);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   128
	iPhone3.InitialiseMM(reqStatus , tableSettingsPckg); 	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   129
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   130
	User::WaitForRequest(reqStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   131
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   132
	TESTL(reqStatus == KErrNone);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   133
	INFO_PRINTF1(_L("Attempting to force TSY into EPhoneNotInitialised state\n"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   134
	TRequestStatus status(KErrNone);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   135
	RMobilePhone::TMobilePhoneNetworkInfoV1 networkInfo;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   136
	TPckg<RMobilePhone::TMobilePhoneNetworkInfoV1> networkInfoPckg(networkInfo);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   137
	RMobilePhone::TMobilePhoneLocationAreaV1 area;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   138
	iPhone3.GetCurrentNetwork(status,networkInfoPckg,area);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   139
	User::WaitForRequest(status);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   140
	TESTL(status==KErrTimedOut);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   141
	// Close iPhone
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   142
	iPhone3.Close();		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   143
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   144
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   145
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   146
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   147
// Emulator-side class
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   148
// With the assistance of the base class, this class must run the designated script
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   149
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   150
CTestCbstParse* CTestCbstParse::NewL(const TScript* aScript)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   151
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   152
 * 2 Phase Constructor
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   153
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   154
 * This method creates an instance of CTestCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   155
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   156
 * @param aScript: pointer to the specifics of the script to run.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   157
 * @leave Leaves if out of memory when attempting to create.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   158
 * @return pointer to the instance of CTestCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   159
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   160
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   161
	CTestCbstParse* aA=new(ELeave) CTestCbstParse(aScript);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   162
	CleanupStack::PushL(aA);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   163
	aA->ConstructL();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   164
	CleanupStack::Pop();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   165
	return aA;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   166
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   167
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   168
CTestCbstParse* CTestCbstParse::NewL(const TScript* aScript, const TInt aVarDelay)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   169
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   170
 * 2 Phase Constructor
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   171
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   172
 * This method creates an instance of CTestCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   173
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   174
 * @param aScript: pointer to the specifics of the script to run.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   175
 * @param aVarDelay: time delay
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   176
 * @leave Leaves if out of memory when attempting to create.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   177
 * @return pointer to the instance of CTestCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   178
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   179
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   180
	CTestCbstParse* aA=new(ELeave) CTestCbstParse(aScript, aVarDelay);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   181
	CleanupStack::PushL(aA);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   182
	aA->ConstructL();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   183
	CleanupStack::Pop();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   184
	return aA;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   185
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   186
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   187
CTestCbstParse::CTestCbstParse(const TScript* aScript) : iScript(aScript)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   188
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   189
 * This method is the constructor for CTestCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   190
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   191
 * @param aScript: pointer to the specifics of the script to run.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   192
 * @note Initializes private data "aScript" to received parameter.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   193
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   194
	{}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   195
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   196
CTestCbstParse::CTestCbstParse(const TScript* aScript, const TInt aVarDelay) : CATScriptEng(aVarDelay), iScript(aScript)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   197
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   198
 * This method is the constructor for CTestCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   199
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   200
 * @param aScript: pointer to the specifics of the script to run.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   201
 * @param aVarDelay: user specified time delay
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   202
 * @note Initializes private data "aScript" to received parameter.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   203
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   204
	{}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   205
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   206
void CTestCbstParse::ConstructL()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   207
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   208
 * This method is used to implement the 2 Phase Constructor for CTestCbstParse.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   209
 * This method uses the CATBase ConstructL to configure the port to be used.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   210
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   211
 * @leave Leaves if CATBase leaves.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   212
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   213
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   214
	CATScriptEng::ConstructL();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   215
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   216
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   217
TInt CTestCbstParse::Start()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   218
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   219
 * This method is defined as a pure virtual function that must be implemented.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   220
 * This method is currently not used by the Etel regression test harness.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   221
 * Instead of using this method to start the scripts, the CTestTxMess::Start()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   222
 * method is used to start the scripts.  The CTestTxMess::Start() is called by
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   223
 * the responder thread of the scripting engine to start the execution of the script.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   224
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   225
 * @return KErrNone.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   226
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   227
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   228
	StartScript(iScript);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   229
	return KErrNone;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   230
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   231
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   232
void CTestCbstParse::SpecificAlgorithmL(TInt /* aParam */)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   233
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   234
 * This method is defined as a pure virtual function that must be implemented.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   235
 * This method is currently not used by the Etel regression test harness.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   236
 * Instead of using this method to perform an algorithm specific to this test,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   237
 * the CTestTxMess::SpecificAlgorithm() method is used.  The CTestTxMess::SpecificAlgorithm()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   238
 * is called by the scripting engine to perform the test specific algorithm.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   239
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   240
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   241
    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   242
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   243
void CTestCbstParse::Complete(TInt aError)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   244
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   245
 * This method is defined as a pure virtual function that must be implemented.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   246
 * This method is currently not used by the Etel regression test harness.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   247
 * Instead of using this method to end the scripts, the CTestTxMess::Complete()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   248
 * method is used to end the scripts.  The CTestTxMess::Complete() is called by
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   249
 * the scripting engine to end the execution of the script.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   250
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   251
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   252
	iReturnValue=aError;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   253
	CActiveScheduler::Stop();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   254
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   255