|
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 __CPHONEBOOK_H__ |
|
22 #define __CPHONEBOOK_H__ |
|
23 |
|
24 #include "Te_LoopbackTestStepBase.h" |
|
25 #include "Te_LoopBackScriptEng.h" |
|
26 |
|
27 // |
|
28 // First a Script where everything is in order |
|
29 // |
|
30 const struct TScript KPhoneBookScript[]= { |
|
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: 15,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 // Init Complete |
|
151 |
|
152 { ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent }, |
|
153 { ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
154 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
155 |
|
156 // Get info. about the ME iPhone book |
|
157 { ERxString, (TText8*)"AT+CPBS=\"ME\"", 0, ERxEvent }, |
|
158 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
159 |
|
160 { ERxString, (TText8*)"AT+CPBS?", 0, ERxEvent }, |
|
161 { ETxString, (TText8*)"+CPBS: \"ME\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
162 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
163 |
|
164 { ERxString, (TText8*)"AT+CPBR=?", 0, ERxEvent }, |
|
165 { ETxString, (TText8*)"+CPBR: (1-99),20,18\r", 0, ETxEvent|EFailIfTimeOut }, |
|
166 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
167 |
|
168 { ERxString, (TText8*)"AT+CPBS=\"SM\"", 0, ERxEvent }, |
|
169 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
170 |
|
171 { ERxString, (TText8*)"AT+CPBS?", 0, ERxEvent }, |
|
172 { ETxString, (TText8*)"+CPBS: \"SM\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
173 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
174 |
|
175 { ERxString, (TText8*)"AT+CPBR=?", 0, ERxEvent }, |
|
176 { ETxString, (TText8*)"+CPBR: (1-100),20,14\r", 0, ETxEvent|EFailIfTimeOut }, |
|
177 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
178 |
|
179 // Phone book Requests. |
|
180 // Open the SM iPhone book, get its caps and read all its entries. |
|
181 |
|
182 { ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent }, |
|
183 { ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
184 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
185 |
|
186 { ERxString, (TText8*)"AT+CPBS?", 0, ERxEvent }, |
|
187 { ETxString, (TText8*)"+CPBS: \"ME\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
188 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
189 |
|
190 |
|
191 { ERxString, (TText8*)"AT+CPBR=?", 0, ERxEvent }, |
|
192 { ETxString, (TText8*)"+CPBR: (1-100),20,14\r", 0, ETxEvent|EFailIfTimeOut }, |
|
193 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
194 |
|
195 { ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent }, |
|
196 { ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
197 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
198 |
|
199 |
|
200 |
|
201 // Open the ME iPhone book, get its caps and read all its entries. |
|
202 { ERxString, (TText8*)"AT+CPBS=\"ME\"", 0, ERxEvent }, |
|
203 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
204 |
|
205 { ERxString, (TText8*)"AT+CPBS?", 0, ERxEvent }, |
|
206 { ETxString, (TText8*)"+CPBS: \"ME\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
207 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
208 |
|
209 { ERxString, (TText8*)"AT+CPBR=?", 0, ERxEvent }, |
|
210 { ETxString, (TText8*)"+CPBR: (1-99),20,18\r", 0, ETxEvent|EFailIfTimeOut }, |
|
211 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
212 |
|
213 { ERxString, (TText8*)"AT+CPBS?", 0, ERxEvent }, |
|
214 { ETxString, (TText8*)"+CPBS: \"ME\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
215 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
216 |
|
217 { ERxString, (TText8*)"AT+CPBS=\"SM\"", 0, ERxEvent }, |
|
218 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
219 |
|
220 // Delete the first five entries in the SM phonebook |
|
221 |
|
222 { ERxString, (TText8*)"AT+CPBW=1", 0, ERxEvent }, |
|
223 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
224 |
|
225 { ERxString, (TText8*)"AT+CPBW=2", 0, ERxEvent }, |
|
226 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
227 |
|
228 { ERxString, (TText8*)"AT+CPBW=3", 0, ERxEvent }, |
|
229 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
230 |
|
231 { ERxString, (TText8*)"AT+CPBW=4", 0, ERxEvent }, |
|
232 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
233 |
|
234 { ERxString, (TText8*)"AT+CPBW=5", 0, ERxEvent }, |
|
235 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
236 |
|
237 { ERxString, (TText8*)"AT+CPBR=1,99", 0, ERxEvent }, |
|
238 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
239 |
|
240 { ERxString, (TText8*)"AT+CPBS=\"ME\"", 0, ERxEvent }, |
|
241 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
242 |
|
243 { ERxString, (TText8*)"AT+CPBW=1", 0, ERxEvent }, |
|
244 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
245 |
|
246 { ERxString, (TText8*)"AT+CPBW=2", 0, ERxEvent }, |
|
247 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
248 |
|
249 { ERxString, (TText8*)"AT+CPBW=3", 0, ERxEvent }, |
|
250 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
251 |
|
252 { ERxString, (TText8*)"AT+CPBW=4", 0, ERxEvent }, |
|
253 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
254 |
|
255 { ERxString, (TText8*)"AT+CPBW=5", 0, ERxEvent }, |
|
256 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
257 |
|
258 { ERxString, (TText8*)"AT+CPBR=1,99", 0, ERxEvent }, |
|
259 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
260 |
|
261 //TestPhoneBookReadWrite - Start |
|
262 |
|
263 // Write a few entries to the SM iPhone book |
|
264 |
|
265 { ERxString, (TText8*)"AT+CPBS=\"SM\"", 0, ERxEvent }, |
|
266 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
267 |
|
268 { ERxString, (TText8*)"AT+CPBW=1,\"02220111\",129,\"MuddyW\"", 0, ERxEvent }, |
|
269 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
270 { ERxString, (TText8*)"AT+CPBW=2,\"03334567\",129,\"ArethaF\"", 0, ERxEvent }, |
|
271 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
272 |
|
273 { ERxString, (TText8*)"AT+CPBR=1", 0, ERxEvent }, |
|
274 { ETxString, (TText8*)"+CPBR: 1,\"02220111\",0,\"MuddyW\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
275 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
276 |
|
277 |
|
278 { ERxString, (TText8*)"AT+CPBR=2", 0, ERxEvent }, |
|
279 { ETxString, (TText8*)"+CPBR: 2,\"03334567\",0,\"ArethaF\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
280 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
281 |
|
282 |
|
283 |
|
284 //TestPhoneBookReadWrite - End |
|
285 |
|
286 // TestAdvancedPhoneBook - Start |
|
287 |
|
288 { ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent }, |
|
289 { ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
290 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
291 |
|
292 { ERxString, (TText8*)"AT+CPBS?", 0, ERxEvent }, |
|
293 { ETxString, (TText8*)"+CPBS: \"SM\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
294 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
295 |
|
296 { ERxString, (TText8*)"AT+CPBR=?", 0, ERxEvent }, |
|
297 { ETxString, (TText8*)"+CPBR: (1-100),20,14\r", 0, ETxEvent|EFailIfTimeOut }, |
|
298 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
299 |
|
300 { ERxString, (TText8*)"AT+CPBW=1,\"012345678901\",129,\"Tel 01\"", 0, ERxEvent }, |
|
301 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
302 |
|
303 { ERxString, (TText8*)"AT+CPBW=2,\"012345678902\",129,\"Tel 02\"", 0, ERxEvent }, |
|
304 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
305 |
|
306 { ERxString, (TText8*)"AT+CPBW=3,\"012345678903\",129,\"Tel 03\"", 0, ERxEvent }, |
|
307 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
308 |
|
309 |
|
310 { ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent }, |
|
311 { ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
312 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
313 |
|
314 { ERxString, (TText8*)"AT+CPBS?", 0, ERxEvent }, |
|
315 { ETxString, (TText8*)"+CPBS: \"SM\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
316 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
317 |
|
318 { ERxString, (TText8*)"AT+CPBR=?", 0, ERxEvent }, |
|
319 { ETxString, (TText8*)"+CPBR: (1-100),20,14\r", 0, ETxEvent|EFailIfTimeOut }, |
|
320 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
321 |
|
322 { ERxString, (TText8*)"AT+CPBW=1", 0, ERxEvent }, |
|
323 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
324 |
|
325 { ERxString, (TText8*)"AT+CPBW=2", 0, ERxEvent }, |
|
326 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
327 |
|
328 // TestAdvancedPhoneBook - End |
|
329 |
|
330 // TestPhoneBookNotifications - Start |
|
331 |
|
332 { ERxString, (TText8*)"AT+CPBW=1,\"02220111\",129,\"MuddyW\"", 0, ERxEvent }, |
|
333 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
334 |
|
335 { ERxString, (TText8*)"AT+CPBW=1", 0, ERxEvent }, |
|
336 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
337 |
|
338 { ERxString, (TText8*)"AT+CPBW=1,\"02220111\",129,\"MuddyW\"", 0, ERxEvent }, |
|
339 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
340 |
|
341 { ERxString, (TText8*)"AT+CPBW=1", 0, ERxEvent }, |
|
342 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
343 |
|
344 |
|
345 // TestPhoneBookNotifications - End |
|
346 |
|
347 // TestPhoneBookReadCancel - Start |
|
348 |
|
349 { ERxString, (TText8*)"AT+CPBW=1,\"02220111\",129,\"MuddyW\"", 0, ERxEvent }, |
|
350 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
351 { ERxString, (TText8*)"AT+CPBW=2,\"03334567\",129,\"ArethaF\"", 0, ERxEvent }, |
|
352 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
353 |
|
354 // Read First time |
|
355 { ERxString, (TText8*)"AT+CPBR=1", 0, ERxEvent }, |
|
356 { EWait, NULL, 1, ETimeOutEvent }, |
|
357 { ETxString, (TText8*)"+CPBR: 1,\"02220111\",0,\"MuddyW\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
358 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
359 |
|
360 // International Number Read and Write Tests |
|
361 { ERxString, (TText8*)"AT+CPBW=1,\"+441234\",145,\"ABCD\"", 0, ERxEvent }, |
|
362 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
363 { ERxString, (TText8*)"AT+CPBW=2,\"+445678\",145,\"EFGH\"", 0, ERxEvent }, |
|
364 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
365 |
|
366 { ERxString, (TText8*)"AT+CPBR=1,2", 0, ERxEvent }, |
|
367 { ETxString, (TText8*)"+CPBR: 1,\"+441234\",145,\"ABCD\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
368 { ETxString, (TText8*)"+CPBR: 2,\"+445678\",145,\"EFGH\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
369 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
370 |
|
371 // Testing Multiple Threads writing at the same time... |
|
372 { ERxString, (TText8*)"AT+CPBW=1,\"12345678\",129,\"ABCDEFGH\"", 0, ERxEvent }, |
|
373 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
374 { ERxString, (TText8*)"AT+CPBW=1,\"12345678\",129,\"ABCDEFGH\"", 0, ERxEvent }, |
|
375 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
376 |
|
377 { EWait, NULL, 1, ETimeOutEvent }, |
|
378 |
|
379 { EComplete, NULL, 0, 0 } |
|
380 }; |
|
381 |
|
382 |
|
383 class CTestDrivePhoneBook : public CTestBase |
|
384 { |
|
385 public: |
|
386 static CTestDrivePhoneBook* NewL(const TScriptList aScriptListEntry); |
|
387 virtual TInt RunTestL(); |
|
388 |
|
389 protected: |
|
390 virtual TInt DriveETelApiL(); |
|
391 |
|
392 private: |
|
393 CTestDrivePhoneBook(const TScriptList aScriptListEntry); |
|
394 void GetPhoneInfoL(); |
|
395 TRequestStatus IsPhoneBookAvailable (const TDesC& aPhoneBook, TInt &aCount); |
|
396 void ReadAndWriteL(); |
|
397 void testGetPhBkCapsAndInfoL(); |
|
398 TInt testClearPhBkL(const TDesC& phoneBookName); |
|
399 void testPhBkReadAndWrite(); |
|
400 void testAdvancedPhBkL(); |
|
401 void testPhBkNotificationsL(); |
|
402 void testPhBkReadCancelL(); |
|
403 void testPhoneBookReadAndWriteInternationalL(); |
|
404 void testPhoneBookMultiWriteL(); |
|
405 static TInt ThreadFnWritePhoneBookEntry(TAny*); |
|
406 |
|
407 // New methods using CPhoneBookBuffer |
|
408 void testPhoneBookReadAndWrite(); |
|
409 void DotestPhoneBookReadAndWriteL(); |
|
410 void testAdvancedPhoneBook(); |
|
411 void DotestAdvancedPhoneBookL(); |
|
412 void testPhoneBookNotifications(); |
|
413 void DotestPhoneBookNotificationsL(); |
|
414 void testPhoneBookReadCancel(); |
|
415 void DotestPhoneBookReadCancelL(); |
|
416 RMobilePhone iMmPhone; |
|
417 |
|
418 TBool iMESupported; |
|
419 |
|
420 TScriptList iScriptListEntry; |
|
421 }; |
|
422 |
|
423 class CTestPhoneBook : public CATScriptEng |
|
424 { |
|
425 public: |
|
426 static CTestPhoneBook* NewL(const TScript* aScript); |
|
427 virtual void SpecificAlgorithmL(TInt aParam); |
|
428 virtual void Complete(TInt aError); |
|
429 virtual TInt Start(); |
|
430 |
|
431 private: |
|
432 CTestPhoneBook(const TScript* aScript); |
|
433 void ConstructL(); |
|
434 |
|
435 const TScript* iScript; |
|
436 }; |
|
437 |
|
438 #endif |