|
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 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #ifndef __CTWOFAXRX_H__ |
|
22 #define __CTWOFAXRX_H__ |
|
23 |
|
24 #include "Te_LoopbackTestStepBase.h" |
|
25 #include "Te_LoopBackScriptEng.h" |
|
26 |
|
27 // |
|
28 // Two Faxes to be received, one after the other |
|
29 // |
|
30 const struct TScript KTwoFaxRxScriptA[]= { |
|
31 { ERxString, (TText8*)"AT\r", 0, ERxEvent }, |
|
32 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
33 |
|
34 { EIfRxStringJmp, (TText8*)"AT\r", 1, 0 }, |
|
35 |
|
36 { ERxString, (TText8*)"AT+FCLASS=?", 0, ERxEvent }, |
|
37 { ETxString, (TText8*)"0,1,2\r", 0, ETxEvent|EFailIfTimeOut }, |
|
38 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
39 |
|
40 // |
|
41 // The initialisation string - we don't care what it is |
|
42 // |
|
43 { ERxString, (TText8*)"AT", 0, ERxEvent }, |
|
44 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
45 |
|
46 { ERxString, (TText8*)"AT+CNMI=,0", 0, ERxEvent }, |
|
47 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
48 |
|
49 { ERxString, (TText8*)"ATS7?", 0, ERxEvent }, |
|
50 { ETxString, (TText8*)"050\r", 0, ETxEvent|EFailIfTimeOut }, |
|
51 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
52 |
|
53 { ERxString, (TText8*)"ATS0=0", 0, ERxEvent }, |
|
54 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
55 |
|
56 { ERxString, (TText8*)"AT+CGMI", 0, ERxEvent }, |
|
57 { ETxString, (TText8*)"ERICSSON\r", 0, ETxEvent|EFailIfTimeOut }, |
|
58 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
59 |
|
60 { ERxString, (TText8*)"AT+CGMM", 0, ERxEvent }, |
|
61 { ETxString, (TText8*)"1100801\r", 0, ETxEvent|EFailIfTimeOut }, |
|
62 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
63 |
|
64 { ERxString, (TText8*)"AT+CGMR", 0, ERxEvent }, |
|
65 { ETxString, (TText8*)"9808261341\r", 0, ETxEvent|EFailIfTimeOut }, |
|
66 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
67 |
|
68 { ERxString, (TText8*)"AT+CGSN", 0, ERxEvent }, |
|
69 { ETxString, (TText8*)"520002512954000\r", 0, ETxEvent|EFailIfTimeOut }, |
|
70 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
71 |
|
72 { ERxString, (TText8*)"AT+CIMI", 0, ERxEvent }, |
|
73 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
74 |
|
75 { ERxString, (TText8*)"AT+CMGF=?", 0, ERxEvent }, |
|
76 { ETxString, (TText8*)"+CMGF: (0)\r", 0, ETxEvent|EFailIfTimeOut }, |
|
77 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
78 |
|
79 { ERxString, (TText8*)"AT+CMGF=0", 0, ERxEvent }, |
|
80 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
81 |
|
82 { ERxString, (TText8*)"AT+CPMS=?", 0, ERxEvent }, |
|
83 { ETxString, (TText8*)"+CPMS: (\"ME\",\"SM\"),(\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
84 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
85 |
|
86 { ERxString, (TText8*)"AT+CPMS?", 0, ERxEvent }, |
|
87 { ETxString, (TText8*)"+CPMS: \"SM\",0,15,\"SM\",0,15\r", 0, ETxEvent|EFailIfTimeOut }, |
|
88 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
89 |
|
90 { ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent }, |
|
91 { ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
92 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
93 |
|
94 { ERxString, (TText8*)"AT+CREG=0", 0, ERxEvent }, |
|
95 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
96 |
|
97 { ERxString, (TText8*)"AT+CREG=2", 0, ERxEvent }, |
|
98 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
99 |
|
100 { ERxString, (TText8*)"AT+CREG=1", 0, ERxEvent }, |
|
101 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
102 |
|
103 { ERxString, (TText8*)"AT+CREG?", 0, ERxEvent }, |
|
104 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
105 |
|
106 { ERxString, (TText8*)"AT+CRC=1", 0, ERxEvent }, |
|
107 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
108 |
|
109 { ERxString, (TText8*)"AT+COPS?", 0, ERxEvent }, |
|
110 { ETxString, (TText8*)"+COPS: 0,0,\"UK VODAFONE\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
111 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
112 |
|
113 { ERxString, (TText8*)"AT+CBC", 0, ERxEvent }, |
|
114 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
115 |
|
116 { ERxString, (TText8*)"AT+CSQ", 0, ERxEvent }, |
|
117 { ETxString, (TText8*)"+CSQ: 31,99\r", 0, ETxEvent|EFailIfTimeOut }, |
|
118 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
119 |
|
120 { ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent }, |
|
121 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
122 |
|
123 { ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent }, |
|
124 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
125 |
|
126 { ERxString, (TText8*)"AT+CGQREQ", 0, ERxEvent }, |
|
127 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
128 |
|
129 { ERxString, (TText8*)"AT+CGATT", 0, ERxEvent }, |
|
130 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
131 |
|
132 { ERxString, (TText8*)"AT+CNMI=?", 0, ERxEvent }, |
|
133 { ETxString, (TText8*)"+CNMI: (0-2),(0,1,3),(0),(0),(0,1)\r", 0, ETxEvent|EFailIfTimeOut }, |
|
134 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
135 |
|
136 { ERxString, (TText8*)"AT+CBST=?", 0, ERxEvent }, |
|
137 { 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 }, |
|
138 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
139 |
|
140 { ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent }, |
|
141 { ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut }, |
|
142 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
143 |
|
144 { ERxString, (TText8*)"AT+CGREG=1", 0, ERxEvent }, |
|
145 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
146 |
|
147 { ERxString, (TText8*)"AT*ECAM=1", 0, ERxEvent }, |
|
148 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
149 |
|
150 // |
|
151 // Now, finally, we handle an Incoming Call Fax request |
|
152 // |
|
153 { EWait, NULL, 1, ETimeOutEvent }, |
|
154 { ETxString, (TText8*)"\r\n+CRING: FAX\r\n", 0, ETxEvent|EFailIfTimeOut }, |
|
155 |
|
156 // { ERxString, (TText8*)"AT", 0, ERxEvent }, |
|
157 // { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
158 |
|
159 { ERxString, (TText8*)"AT+FCLASS=2", 0, ERxEvent }, |
|
160 { ETxString, (TText8*)"\r\nOK\r\n", 0, ETxEvent|EFailIfTimeOut }, |
|
161 |
|
162 { ERxString, (TText8*)"AT", 0, ERxEvent }, |
|
163 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
164 |
|
165 { ERxString, (TText8*)"AT+FDCC=?", 0, ERxEvent }, |
|
166 { ETxString, (TText8*)"(0-1),(0-3),(0-4),(0-2),(0-3),(0-1),(0-1),(0-7)", |
|
167 0, ETxEvent|EFailIfTimeOut }, |
|
168 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
169 |
|
170 { ERxString, (TText8*)"AT+FDCC=0,3,0,2,0,0,0,0", 0, ERxEvent }, |
|
171 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
172 |
|
173 { ERxString, (TText8*)"AT+FAA=0", 0, ERxEvent }, |
|
174 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
175 |
|
176 { ERxString, (TText8*)"AT+FCR=1", 0, ERxEvent }, |
|
177 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
178 |
|
179 { ERxString, (TText8*)"AT+FLID=\"", 0, ERxEvent }, |
|
180 { ERxString, (TText8*)"\"", 0, ERxEvent }, |
|
181 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
182 |
|
183 { ERxString, (TText8*)"ATA", 0, ERxEvent }, |
|
184 { ETxString, (TText8*)"+FCO", 0, ETxEvent|EFailIfTimeOut }, |
|
185 { ETxString, (TText8*)"+FCS:0,3,0,2,0,0,0,0", 0, ETxEvent|EFailIfTimeOut }, |
|
186 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
187 |
|
188 { ERxString, (TText8*)"AT+FDR", 0, ERxEvent }, |
|
189 { ETxString, (TText8*)"CONNECT", 0, ETxEvent|EFailIfTimeOut }, |
|
190 |
|
191 { ERxString, (TText8*)"ATH", 0, ERxEvent }, |
|
192 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
193 |
|
194 { ERxString, (TText8*)"ATE0+FCLASS=0",0, ERxEvent }, |
|
195 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
196 |
|
197 // |
|
198 // Now, finally, we handle an Incoming Call Fax request |
|
199 // |
|
200 { EWait, NULL, 4, ETimeOutEvent }, |
|
201 { ETxString, (TText8*)"\r\n+CRING: FAX\r\n", 0, ETxEvent|EFailIfTimeOut }, |
|
202 |
|
203 // { ERxString, (TText8*)"AT", 0, ERxEvent }, |
|
204 // { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
205 |
|
206 { ERxString, (TText8*)"AT+FCLASS=2", 0, ERxEvent }, |
|
207 { ETxString, (TText8*)"\r\nOK\r\n", 0, ETxEvent|EFailIfTimeOut }, |
|
208 |
|
209 { ERxString, (TText8*)"AT", 0, ERxEvent }, |
|
210 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
211 |
|
212 { ERxString, (TText8*)"AT+FDCC=?", 0, ERxEvent }, |
|
213 { ETxString, (TText8*)"(0-1),(0-3),(0-4),(0-2),(0-3),(0-1),(0-1),(0-7)", |
|
214 0, ETxEvent|EFailIfTimeOut }, |
|
215 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
216 |
|
217 { ERxString, (TText8*)"AT+FDCC=0,3,0,2,0,0,0,0", 0, ERxEvent }, |
|
218 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
219 |
|
220 { ERxString, (TText8*)"AT+FAA=0", 0, ERxEvent }, |
|
221 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
222 |
|
223 { ERxString, (TText8*)"AT+FCR=1", 0, ERxEvent }, |
|
224 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
225 |
|
226 { ERxString, (TText8*)"AT+FLID=\"", 0, ERxEvent }, |
|
227 { ERxString, (TText8*)"\"", 0, ERxEvent }, |
|
228 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
229 |
|
230 { ERxString, (TText8*)"ATA", 0, ERxEvent }, |
|
231 { ETxString, (TText8*)"+FCO", 0, ETxEvent|EFailIfTimeOut }, |
|
232 { ETxString, (TText8*)"+FCS:0,3,0,2,0,0,0,0", 0, ETxEvent|EFailIfTimeOut }, |
|
233 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
234 |
|
235 { ERxString, (TText8*)"AT+FDR", 0, ERxEvent }, |
|
236 { ETxString, (TText8*)"CONNECT", 0, ETxEvent|EFailIfTimeOut }, |
|
237 |
|
238 { ERxString, (TText8*)"ATH", 0, ERxEvent }, |
|
239 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
240 |
|
241 { ERxString, (TText8*)"ATE0+FCLASS=0",0, ERxEvent }, |
|
242 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
243 |
|
244 { EWait, NULL, 2, ETimeOutEvent}, |
|
245 { EComplete, NULL, 0, 0 } |
|
246 }; |
|
247 |
|
248 class CTestDriveTwoFaxRx : public CTestBase |
|
249 { |
|
250 public: |
|
251 static CTestDriveTwoFaxRx* NewL(const TScriptList aScriptListEntry); |
|
252 virtual TInt RunTestL(); |
|
253 |
|
254 protected: |
|
255 virtual TInt DriveETelApiL(); |
|
256 |
|
257 private: |
|
258 CTestDriveTwoFaxRx(const TScriptList aScriptListEntry); |
|
259 |
|
260 TScriptList iScriptListEntry; |
|
261 }; |
|
262 |
|
263 class CTestTwoFaxRx : public CATScriptEng |
|
264 { |
|
265 public: |
|
266 static CTestTwoFaxRx* NewL(const TScript* aScript); |
|
267 |
|
268 virtual void SpecificAlgorithmL(TInt aParam); |
|
269 virtual void Complete(TInt aError); |
|
270 virtual TInt Start(); |
|
271 |
|
272 private: |
|
273 CTestTwoFaxRx(const TScript* aScript); |
|
274 void ConstructL(); |
|
275 |
|
276 const TScript* iScript; |
|
277 }; |
|
278 |
|
279 #endif |