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 |
// This file has the class definitions and scripts for the "Data Call set-up, data transfer
|
|
15 |
// and remote termination" Test in the ETel Regression test harness. The call scripts are
|
|
16 |
// processed and handled by the emulator side of the test via the scripting engine. Each
|
|
17 |
// line in the script represents an action that the emulator must take, either a receive
|
|
18 |
// action (which defines an expected string) or a transmit action with the ASCII data to
|
|
19 |
// be sent. See the description of the scripting language for more information.
|
|
20 |
//
|
|
21 |
//
|
|
22 |
|
|
23 |
/**
|
|
24 |
@file
|
|
25 |
@internalComponent
|
|
26 |
*/
|
|
27 |
|
|
28 |
#ifndef __CDATACALLREMOTETERM_H__
|
|
29 |
#define __CDATACALLREMOTETERM_H__
|
|
30 |
|
|
31 |
#include "Te_LoopbackTestStepBase.h"
|
|
32 |
#include "Te_LoopBackScriptEng.h"
|
|
33 |
|
|
34 |
_LIT8(KWriteTestRemoteData,"ABCD\r\n");
|
|
35 |
_LIT8(KWriteTestRemoteData2,"EFGH\r\n");
|
|
36 |
|
|
37 |
//
|
|
38 |
// First a Script where everything is in order
|
|
39 |
//
|
|
40 |
|
|
41 |
const struct TScript KDataCallRemoteTermScript[]= {
|
|
42 |
{ ERxString, (TText8*)"AT\r", 0, ERxEvent },
|
|
43 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
44 |
|
|
45 |
{ EIfRxStringJmp, (TText8*)"AT\r", 1, 0 },
|
|
46 |
|
|
47 |
{ ERxString, (TText8*)"AT+FCLASS=?", 0, ERxEvent },
|
|
48 |
{ ETxString, (TText8*)"0,1,2\r", 0, ETxEvent|EFailIfTimeOut },
|
|
49 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
50 |
|
|
51 |
//
|
|
52 |
// The initialisation string - we don't care what it is
|
|
53 |
//
|
|
54 |
{ ERxString, (TText8*)"AT", 0, ERxEvent },
|
|
55 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
56 |
|
|
57 |
{ ERxString, (TText8*)"AT+CNMI=,0", 0, ERxEvent },
|
|
58 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
59 |
|
|
60 |
{ ERxString, (TText8*)"ATS7?", 0, ERxEvent },
|
|
61 |
{ ETxString, (TText8*)"050\r", 0, ETxEvent|EFailIfTimeOut },
|
|
62 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
63 |
|
|
64 |
{ ERxString, (TText8*)"ATS0=0", 0, ERxEvent },
|
|
65 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
66 |
|
|
67 |
{ ERxString, (TText8*)"AT+CGMI", 0, ERxEvent },
|
|
68 |
{ ETxString, (TText8*)"ERICSSON\r", 0, ETxEvent|EFailIfTimeOut },
|
|
69 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
70 |
|
|
71 |
{ ERxString, (TText8*)"AT+CGMM", 0, ERxEvent },
|
|
72 |
{ ETxString, (TText8*)"1100801\r", 0, ETxEvent|EFailIfTimeOut },
|
|
73 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
74 |
|
|
75 |
{ ERxString, (TText8*)"AT+CGMR", 0, ERxEvent },
|
|
76 |
{ ETxString, (TText8*)"9808261341\r", 0, ETxEvent|EFailIfTimeOut },
|
|
77 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
78 |
|
|
79 |
{ ERxString, (TText8*)"AT+CGSN", 0, ERxEvent },
|
|
80 |
{ ETxString, (TText8*)"520002512954000\r", 0, ETxEvent|EFailIfTimeOut },
|
|
81 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
82 |
|
|
83 |
{ ERxString, (TText8*)"AT+CIMI", 0, ERxEvent },
|
|
84 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
85 |
|
|
86 |
{ ERxString, (TText8*)"AT+CMGF=?", 0, ERxEvent },
|
|
87 |
{ ETxString, (TText8*)"+CMGF: (0)\r", 0, ETxEvent|EFailIfTimeOut },
|
|
88 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
89 |
|
|
90 |
{ ERxString, (TText8*)"AT+CMGF=0", 0, ERxEvent },
|
|
91 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
92 |
|
|
93 |
{ ERxString, (TText8*)"AT+CPMS=?", 0, ERxEvent },
|
|
94 |
{ ETxString, (TText8*)"+CPMS: (\"ME\",\"SM\"),(\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut },
|
|
95 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
96 |
|
|
97 |
{ ERxString, (TText8*)"AT+CPMS?", 0, ERxEvent },
|
|
98 |
{ ETxString, (TText8*)"+CPMS: \"SM\",0,15,\"SM\",0,15\r", 0, ETxEvent|EFailIfTimeOut },
|
|
99 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
100 |
|
|
101 |
{ ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent },
|
|
102 |
{ ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut },
|
|
103 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
104 |
|
|
105 |
{ ERxString, (TText8*)"AT+CREG=0", 0, ERxEvent },
|
|
106 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
107 |
|
|
108 |
{ ERxString, (TText8*)"AT+CREG=2", 0, ERxEvent },
|
|
109 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
110 |
|
|
111 |
{ ERxString, (TText8*)"AT+CREG=1", 0, ERxEvent },
|
|
112 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
113 |
|
|
114 |
{ ERxString, (TText8*)"AT+CREG?", 0, ERxEvent },
|
|
115 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
116 |
|
|
117 |
{ ERxString, (TText8*)"AT+CRC=1", 0, ERxEvent },
|
|
118 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
119 |
|
|
120 |
{ ERxString, (TText8*)"AT+COPS?", 0, ERxEvent },
|
|
121 |
{ ETxString, (TText8*)"+COPS: 0,0,\"UK VODAFONE\"\r", 0, ETxEvent|EFailIfTimeOut },
|
|
122 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
123 |
|
|
124 |
{ ERxString, (TText8*)"AT+CBC", 0, ERxEvent },
|
|
125 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
126 |
|
|
127 |
{ ERxString, (TText8*)"AT+CSQ", 0, ERxEvent },
|
|
128 |
{ ETxString, (TText8*)"+CSQ: 31,99\r", 0, ETxEvent|EFailIfTimeOut },
|
|
129 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
130 |
|
|
131 |
{ ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent },
|
|
132 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
133 |
|
|
134 |
{ ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent },
|
|
135 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
136 |
|
|
137 |
{ ERxString, (TText8*)"AT+CGQREQ", 0, ERxEvent },
|
|
138 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
139 |
|
|
140 |
{ ERxString, (TText8*)"AT+CGATT", 0, ERxEvent },
|
|
141 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
142 |
|
|
143 |
{ ERxString, (TText8*)"AT+CNMI=?", 0, ERxEvent },
|
|
144 |
{ ETxString, (TText8*)"+CNMI: (0-2),(0,1,3),(0),(0),(0,1)\r", 0, ETxEvent|EFailIfTimeOut },
|
|
145 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
146 |
|
|
147 |
{ ERxString, (TText8*)"AT+CBST=?", 0, ERxEvent },
|
|
148 |
{ 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 },
|
|
149 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
150 |
|
|
151 |
{ ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent },
|
|
152 |
{ ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut },
|
|
153 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
154 |
|
|
155 |
{ ERxString, (TText8*)"AT+CGREG=1", 0, ERxEvent },
|
|
156 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
157 |
|
|
158 |
{ ERxString, (TText8*)"AT*ECAM=1", 0, ERxEvent },
|
|
159 |
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
|
|
160 |
|
|
161 |
//
|
|
162 |
// Initialisation complete.
|
|
163 |
// Perform the Dial request
|
|
164 |
//
|
|
165 |
{ ERxString, (TText8*)"AT+FCLASS=0", 0, ERxEvent },
|
|
166 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
167 |
|
|
168 |
{ ERxString, (TText8*)"ATM0L0X3S8=0", 0, ERxEvent },
|
|
169 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
170 |
|
|
171 |
// This is the Data Init String
|
|
172 |
{ ERxString, (TText8*)"AT345678901234567890123456789012345678901234567890", 0, ERxEvent },
|
|
173 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
174 |
|
|
175 |
// This is just another quick "AT", "OK" sequence to check we're still alright
|
|
176 |
{ ERxString, (TText8*)"AT", 0, ERxEvent },
|
|
177 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
178 |
|
|
179 |
// Issue the dial command and wait for connection
|
|
180 |
{ ERxString, (TText8*)"ATD+1234", 0, ERxEvent },
|
|
181 |
// Set signal for connection
|
|
182 |
{ ESignalMark, NULL, KSignalDCD, 0 },
|
|
183 |
{ ETxString, (TText8*)"\r\nCONNECT 28800/ARQ/V34/LAPM/V42BIS\r\n", 0, ETxEvent|EFailIfTimeOut },
|
|
184 |
|
|
185 |
// This is the Data Xfer String
|
|
186 |
{ ERxString, (TText8*)"ABCD\r\n", 0, ERxEvent },
|
|
187 |
{ ERxString, (TText8*)"ABCD\r\n", 0, ERxEvent },
|
|
188 |
|
|
189 |
{ ERxString, (TText8*)"AT", 0, ERxEvent },
|
|
190 |
{ ERxString, (TText8*)"+++", 0, ERxEvent },
|
|
191 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
192 |
|
|
193 |
// Simulate Remote hangup
|
|
194 |
// Deassert signal for no-connection
|
|
195 |
{ ESignalSpace, NULL, KSignalDCD, 0 },
|
|
196 |
{ ETxString, (TText8*)"NO CARRIER", 0, ETxEvent },
|
|
197 |
|
|
198 |
// Request for Phone Signal Strength
|
|
199 |
{ ERxString, (TText8*)"AT+CSQ", 0, ERxEvent },
|
|
200 |
{ ETxString, (TText8*)"+CSQ:31,99", 0, ETxEvent|EFailIfTimeOut },
|
|
201 |
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
|
|
202 |
|
|
203 |
{ EWait, NULL, 2, ETimeOutEvent },
|
|
204 |
{ EComplete, NULL, 0, 0 }
|
|
205 |
};
|
|
206 |
|
|
207 |
/**
|
|
208 |
* This class is used by the client side of the test. It contains the method DriveETelApi
|
|
209 |
* which is the primary client side method. This class inherits from the CTestBase class.
|
|
210 |
* All client side test classes must contain these entries.
|
|
211 |
*/
|
|
212 |
class CTestDriveDataCallRemoteTerm : public CTestBase
|
|
213 |
{
|
|
214 |
public:
|
|
215 |
static CTestDriveDataCallRemoteTerm* NewL(const TScriptList aScriptListEntry);
|
|
216 |
// Called by the user interface from the C function PerformTestL.
|
|
217 |
virtual TInt RunTestL();
|
|
218 |
|
|
219 |
protected:
|
|
220 |
// Called by the CTestBase::StartEmulator method to drive the ETel API.
|
|
221 |
virtual TInt DriveETelApiL();
|
|
222 |
|
|
223 |
private:
|
|
224 |
CTestDriveDataCallRemoteTerm(const TScriptList aScriptListEntry);
|
|
225 |
|
|
226 |
TScriptList iScriptListEntry; //< Initialized by the constructor, it records the enumerated
|
|
227 |
//< script entry number.
|
|
228 |
};
|
|
229 |
|
|
230 |
/**
|
|
231 |
* This class is used by the emulator side of the test. It implements several virtual functions
|
|
232 |
* which are test specific and referenced by other classes. This class inherits from the
|
|
233 |
* CATScriptEng class. All Emulator side test classes should have this structure.
|
|
234 |
*/
|
|
235 |
class CTestDataCallRemoteTerm : public CATScriptEng
|
|
236 |
{
|
|
237 |
public:
|
|
238 |
static CTestDataCallRemoteTerm* NewL(const TScript* aScript);
|
|
239 |
|
|
240 |
// Called by the scripting engine to implement the EExecuteSpecial Command.
|
|
241 |
virtual void SpecificAlgorithmL(TInt aParam);
|
|
242 |
|
|
243 |
// Called by the scripting engine to end the execution of the script.
|
|
244 |
virtual void Complete(TInt aError);
|
|
245 |
|
|
246 |
// Called by the scripting engine to start the execution of the script.
|
|
247 |
virtual TInt Start();
|
|
248 |
|
|
249 |
private:
|
|
250 |
CTestDataCallRemoteTerm(const TScript* aScript);
|
|
251 |
void ConstructL();
|
|
252 |
|
|
253 |
const TScript* iScript; //< Pointer to the first line in the associated script.
|
|
254 |
};
|
|
255 |
|
|
256 |
#endif
|