24
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#include <e32test.h>
|
|
17 |
#include <etelmm.h>
|
|
18 |
#include "Te_LoopBackcnocmgf.h"
|
|
19 |
#include "../../hayes/TSYCONFG.H" // for KInternetAccessPoint
|
|
20 |
|
|
21 |
//
|
|
22 |
// Test-side class
|
|
23 |
// With the assistance of the base class, this class must start the emulator
|
|
24 |
// and drive the ETel API.
|
|
25 |
//
|
|
26 |
CTestDriveNoCmgf* CTestDriveNoCmgf::NewL(const TScriptList aScriptListEntry)
|
|
27 |
{
|
|
28 |
CTestDriveNoCmgf* cmgf=new(ELeave) CTestDriveNoCmgf(aScriptListEntry);
|
|
29 |
CleanupStack::PushL(cmgf);
|
|
30 |
cmgf->ConstructL();
|
|
31 |
CleanupStack::Pop();
|
|
32 |
return cmgf;
|
|
33 |
}
|
|
34 |
|
|
35 |
CTestDriveNoCmgf::CTestDriveNoCmgf(const TScriptList aScriptListEntry) : iScriptListEntry(aScriptListEntry)
|
|
36 |
{}
|
|
37 |
|
|
38 |
TInt CTestDriveNoCmgf::RunTestL()
|
|
39 |
{
|
|
40 |
iCurrentScript=iScriptListEntry;
|
|
41 |
return StartEmulatorL();
|
|
42 |
}
|
|
43 |
|
|
44 |
TInt CTestDriveNoCmgf::DriveETelApiL()
|
|
45 |
/**
|
|
46 |
* This file contains a slightly different initialisation sequence. This iPhone does not
|
|
47 |
* return a response to the AT+CMGF=? Query.
|
|
48 |
* @return KErrNone
|
|
49 |
*/
|
|
50 |
{
|
|
51 |
// Open and initialise the iPhone object
|
|
52 |
_LIT(KMmPhoneName,"GsmPhone1");
|
|
53 |
TESTL(iCmgfPhone.Open(iServer,KMmPhoneName)==KErrNone);
|
|
54 |
|
|
55 |
TRequestStatus reqStatus;
|
|
56 |
RMobilePhone::TMMTableSettings tableSettings;
|
|
57 |
tableSettings.iLocId=KInternetAccessPoint;
|
|
58 |
RMobilePhone::TMMTableSettingsPckg tableSettingsPckg(tableSettings);
|
|
59 |
iCmgfPhone.InitialiseMM(reqStatus , tableSettingsPckg);
|
|
60 |
User::WaitForRequest(reqStatus);
|
|
61 |
TESTL(reqStatus == KErrNone);
|
|
62 |
|
|
63 |
// Close the iPhone
|
|
64 |
iCmgfPhone.Close();
|
|
65 |
return KErrNone;
|
|
66 |
}
|
|
67 |
|
|
68 |
|
|
69 |
//
|
|
70 |
// Emulator-side class
|
|
71 |
// With the assistance of the base class, this class must run the designated script
|
|
72 |
//
|
|
73 |
CTestNoCmgf* CTestNoCmgf::NewL(const TScript* aScript)
|
|
74 |
{
|
|
75 |
CTestNoCmgf* cmgf=new(ELeave) CTestNoCmgf(aScript);
|
|
76 |
CleanupStack::PushL(cmgf);
|
|
77 |
cmgf->ConstructL();
|
|
78 |
CleanupStack::Pop();
|
|
79 |
return cmgf;
|
|
80 |
}
|
|
81 |
|
|
82 |
CTestNoCmgf::CTestNoCmgf(const TScript* aScript) : iScript(aScript)
|
|
83 |
{}
|
|
84 |
|
|
85 |
void CTestNoCmgf::ConstructL()
|
|
86 |
{
|
|
87 |
CATScriptEng::ConstructL();
|
|
88 |
}
|
|
89 |
|
|
90 |
TInt CTestNoCmgf::Start()
|
|
91 |
{
|
|
92 |
StartScript(iScript);
|
|
93 |
return KErrNone;
|
|
94 |
}
|
|
95 |
|
|
96 |
void CTestNoCmgf::SpecificAlgorithmL(TInt /* aParam */)
|
|
97 |
{
|
|
98 |
}
|
|
99 |
|
|
100 |
void CTestNoCmgf::Complete(TInt aError)
|
|
101 |
{
|
|
102 |
iReturnValue=aError;
|
|
103 |
CActiveScheduler::Stop();
|
|
104 |
}
|