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 |
// CPhoneLine.H
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalComponent
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef __CPHONELINE_H__
|
|
24 |
#define __CPHONELINE_H__
|
|
25 |
|
|
26 |
#include "Te_LoopbackTestStepBase.h"
|
|
27 |
#include "Te_LoopBackScriptEng.h"
|
|
28 |
|
|
29 |
//
|
|
30 |
// First a Script where everything is in order
|
|
31 |
//
|
|
32 |
const struct TScript KPhoneLineScript[]= {
|
|
33 |
{ ERxString, (TText8*)"AT\r", 0, ERxEvent },
|
|
34 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
35 |
|
|
36 |
{ EIfRxStringJmp, (TText8*)"AT\r", 1, 0 },
|
|
37 |
|
|
38 |
{ ERxString, (TText8*)"AT+FCLASS=?", 0, ERxEvent },
|
|
39 |
{ ETxString, (TText8*)"0,1,2\r", 0, ETxEvent|EFailIfTimeOut },
|
|
40 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
41 |
|
|
42 |
//
|
|
43 |
// The initialisation string - we don't care what it is
|
|
44 |
//
|
|
45 |
{ ERxString, (TText8*)"AT", 0, ERxEvent },
|
|
46 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
47 |
|
|
48 |
{ ERxString, (TText8*)"AT+CNMI=,0", 0, ERxEvent },
|
|
49 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
50 |
|
|
51 |
{ ERxString, (TText8*)"ATS7?", 0, ERxEvent },
|
|
52 |
{ ETxString, (TText8*)"050\r", 0, ETxEvent|EFailIfTimeOut },
|
|
53 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
54 |
|
|
55 |
{ ERxString, (TText8*)"ATS0=0", 0, ERxEvent },
|
|
56 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
57 |
|
|
58 |
{ ERxString, (TText8*)"AT+CGMI", 0, ERxEvent },
|
|
59 |
{ ETxString, (TText8*)"ERICSSON\r", 0, ETxEvent|EFailIfTimeOut },
|
|
60 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
61 |
|
|
62 |
{ ERxString, (TText8*)"AT+CGMM", 0, ERxEvent },
|
|
63 |
{ ETxString, (TText8*)"1100801\r", 0, ETxEvent|EFailIfTimeOut },
|
|
64 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
65 |
|
|
66 |
{ ERxString, (TText8*)"AT+CGMR", 0, ERxEvent },
|
|
67 |
{ ETxString, (TText8*)"9808261341\r", 0, ETxEvent|EFailIfTimeOut },
|
|
68 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
69 |
|
|
70 |
{ ERxString, (TText8*)"AT+CGSN", 0, ERxEvent },
|
|
71 |
{ ETxString, (TText8*)"520002512954000\r", 0, ETxEvent|EFailIfTimeOut },
|
|
72 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
73 |
|
|
74 |
{ ERxString, (TText8*)"AT+CIMI", 0, ERxEvent },
|
|
75 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
76 |
|
|
77 |
{ ERxString, (TText8*)"AT+CMGF=?", 0, ERxEvent },
|
|
78 |
{ ETxString, (TText8*)"+CMGF: (0)\r", 0, ETxEvent|EFailIfTimeOut },
|
|
79 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
80 |
|
|
81 |
{ ERxString, (TText8*)"AT+CMGF=0", 0, ERxEvent },
|
|
82 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
83 |
|
|
84 |
{ ERxString, (TText8*)"AT+CPMS=?", 0, ERxEvent },
|
|
85 |
{ ETxString, (TText8*)"+CPMS: (\"ME\",\"SM\"),(\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut },
|
|
86 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
87 |
|
|
88 |
{ ERxString, (TText8*)"AT+CPMS?", 0, ERxEvent },
|
|
89 |
{ ETxString, (TText8*)"+CPMS: \"SM\",0,15,\"SM\",0,15\r", 0, ETxEvent|EFailIfTimeOut },
|
|
90 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
91 |
|
|
92 |
{ ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent },
|
|
93 |
{ ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut },
|
|
94 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
95 |
|
|
96 |
{ ERxString, (TText8*)"AT+CREG=0", 0, ERxEvent },
|
|
97 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
98 |
|
|
99 |
{ ERxString, (TText8*)"AT+CREG=2", 0, ERxEvent },
|
|
100 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
101 |
|
|
102 |
{ ERxString, (TText8*)"AT+CREG=1", 0, ERxEvent },
|
|
103 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
104 |
|
|
105 |
{ ERxString, (TText8*)"AT+CREG?", 0, ERxEvent },
|
|
106 |
{ ETxString, (TText8*)"+CREG: 1,1\r", 0, ETxEvent|EFailIfTimeOut },
|
|
107 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
108 |
|
|
109 |
{ ERxString, (TText8*)"AT+CRC=1", 0, ERxEvent },
|
|
110 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
111 |
|
|
112 |
{ ERxString, (TText8*)"AT+COPS?", 0, ERxEvent },
|
|
113 |
{ ETxString, (TText8*)"+COPS: 0,0,\"UK VODAFONE\"\r", 0, ETxEvent|EFailIfTimeOut },
|
|
114 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
115 |
|
|
116 |
{ ERxString, (TText8*)"AT+CBC", 0, ERxEvent },
|
|
117 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
118 |
|
|
119 |
{ ERxString, (TText8*)"AT+CSQ", 0, ERxEvent },
|
|
120 |
{ ETxString, (TText8*)"+CSQ: 15,99\r",0, ETxEvent|EFailIfTimeOut },
|
|
121 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
122 |
|
|
123 |
{ ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent },
|
|
124 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
125 |
|
|
126 |
{ ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent },
|
|
127 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
128 |
|
|
129 |
{ ERxString, (TText8*)"AT+CGQREQ", 0, ERxEvent },
|
|
130 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
131 |
|
|
132 |
{ ERxString, (TText8*)"AT+CGATT", 0, ERxEvent },
|
|
133 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
134 |
|
|
135 |
{ ERxString, (TText8*)"AT+CNMI=?", 0, ERxEvent },
|
|
136 |
{ ETxString, (TText8*)"+CNMI: (0-2),(0,1,3),(0),(0),(0,1)\r", 0, ETxEvent|EFailIfTimeOut },
|
|
137 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
138 |
|
|
139 |
{ ERxString, (TText8*)"AT+CBST=?", 0, ERxEvent },
|
|
140 |
{ ETxString, (TText8*)"+CBST: (0-7,12,14-16,34,36,38,39,43,47-51,65,66,68,70,71,75,79-81),(0,2),(1)\r", 0, ETxEvent|EFailIfTimeOut },
|
|
141 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
142 |
|
|
143 |
{ ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent },
|
|
144 |
{ ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut },
|
|
145 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
146 |
|
|
147 |
{ ERxString, (TText8*)"AT+CGREG=1", 0, ERxEvent },
|
|
148 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
149 |
|
|
150 |
{ ERxString, (TText8*)"AT*ECAM=1", 0, ERxEvent },
|
|
151 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
152 |
|
|
153 |
// End of initialization sequence, no AT commands are sent to the iPhone for this test
|
|
154 |
{ EWait, NULL, 2, ETimeOutEvent },
|
|
155 |
{ EComplete, NULL, 0, 0 }
|
|
156 |
};
|
|
157 |
|
|
158 |
class CTestDrivePhoneLine : public CTestBase
|
|
159 |
{
|
|
160 |
public:
|
|
161 |
static CTestDrivePhoneLine* NewL(const TScriptList aScriptListEntry);
|
|
162 |
CTestDrivePhoneLine(const TScriptList aScriptListEntry);
|
|
163 |
~CTestDrivePhoneLine();
|
|
164 |
virtual TInt RunTestL();
|
|
165 |
protected:
|
|
166 |
virtual TInt DriveETelApiL();
|
|
167 |
private:
|
|
168 |
RMobilePhone iVlPhone;
|
|
169 |
TScriptList iScriptListEntry;
|
|
170 |
void testPhoneL();
|
|
171 |
void testLineL();
|
|
172 |
};
|
|
173 |
|
|
174 |
class CTestPhoneLine : public CATScriptEng
|
|
175 |
{
|
|
176 |
public:
|
|
177 |
static CTestPhoneLine* NewL(const TScript* aScript);
|
|
178 |
CTestPhoneLine(const TScript* aScript);
|
|
179 |
~CTestPhoneLine();
|
|
180 |
void ConstructL();
|
|
181 |
|
|
182 |
virtual void SpecificAlgorithmL(TInt aParam);
|
|
183 |
virtual void Complete(TInt aError);
|
|
184 |
virtual TInt Start();
|
|
185 |
|
|
186 |
private:
|
|
187 |
const TScript* iScript;
|
|
188 |
};
|
|
189 |
|
|
190 |
#endif
|