|
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 |
|
22 #ifndef __CSCA_H__ |
|
23 #define __CSCA_H__ |
|
24 |
|
25 #include <e32test.h> |
|
26 #include <etelmm.h> |
|
27 #include <mmlist.h> |
|
28 #include <mmretrieve.h> |
|
29 |
|
30 #include "Te_LoopbackTestStepBase.h" |
|
31 #include "Te_LoopBackScriptEng.h" |
|
32 #include "Te_LoopbackCWrapGetSmspList.h" |
|
33 |
|
34 |
|
35 // Constants |
|
36 |
|
37 _LIT(KSCAddressA,"447785016005"); |
|
38 |
|
39 // Scripts |
|
40 |
|
41 const struct TScript KScaSimpleScript[]= { |
|
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: 15,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 // Change the default SC Address |
|
162 { ERxString, (TText8*)"AT+CSCA=\"441632960000\"", 0, ERxEvent }, |
|
163 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
164 |
|
165 // Attempt to read current default SC Address |
|
166 { ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent }, |
|
167 { ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut }, |
|
168 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
169 |
|
170 // Done |
|
171 { EWait, NULL, 5, ETimeOutEvent}, |
|
172 { EComplete, NULL, 0, 0 } |
|
173 }; |
|
174 |
|
175 const struct TScript KSca8210StyleScript[]= { |
|
176 { ERxString, (TText8*)"AT\r", 0, ERxEvent }, |
|
177 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
178 |
|
179 { EIfRxStringJmp, (TText8*)"AT\r", 1, 0 }, |
|
180 |
|
181 { ERxString, (TText8*)"AT+FCLASS=?", 0, ERxEvent }, |
|
182 { ETxString, (TText8*)"0,1,2\r", 0, ETxEvent|EFailIfTimeOut }, |
|
183 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
184 |
|
185 // |
|
186 // The initialisation string - we don't care what it is |
|
187 // |
|
188 { ERxString, (TText8*)"AT", 0, ERxEvent }, |
|
189 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
190 |
|
191 { ERxString, (TText8*)"AT+CNMI=,0", 0, ERxEvent }, |
|
192 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
193 |
|
194 { ERxString, (TText8*)"ATS7?", 0, ERxEvent }, |
|
195 { ETxString, (TText8*)"060\r", 0, ETxEvent|EFailIfTimeOut }, |
|
196 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
197 |
|
198 { ERxString, (TText8*)"ATS0=0", 0, ERxEvent }, |
|
199 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
200 |
|
201 { ERxString, (TText8*)"AT+CGMI", 0, ERxEvent }, |
|
202 { ETxString, (TText8*)"Nokia Mobile Phones\r", 0, ETxEvent|EFailIfTimeOut }, |
|
203 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
204 |
|
205 { ERxString, (TText8*)"AT+CGMM", 0, ERxEvent }, |
|
206 { ETxString, (TText8*)"Nokia 8210\r", 0, ETxEvent|EFailIfTimeOut }, |
|
207 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
208 |
|
209 { ERxString, (TText8*)"AT+CGMR", 0, ERxEvent }, |
|
210 { ETxString, (TText8*)"SW5.11\r", 0, ETxEvent|EFailIfTimeOut }, |
|
211 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
212 |
|
213 { ERxString, (TText8*)"AT+CGSN", 0, ERxEvent }, |
|
214 { ETxString, (TText8*)"448902103708860\r", 0, ETxEvent|EFailIfTimeOut }, |
|
215 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
216 |
|
217 { ERxString, (TText8*)"AT+CIMI", 0, ERxEvent }, |
|
218 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
219 |
|
220 { ERxString, (TText8*)"AT+CMGF=?", 0, ERxEvent }, |
|
221 { ETxString, (TText8*)"+CMGF: (0,1)\r", 0, ETxEvent|EFailIfTimeOut }, |
|
222 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
223 |
|
224 { ERxString, (TText8*)"AT+CMGF=0", 0, ERxEvent }, |
|
225 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
226 |
|
227 { ERxString, (TText8*)"AT+CPMS=?", 0, ERxEvent }, |
|
228 { ETxString, (TText8*)"+CPMS: (\"ME\",\"SM\"),(\"ME\",\"SM\"),(\"SM\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
229 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
230 |
|
231 { ERxString, (TText8*)"AT+CPMS?", 0, ERxEvent }, |
|
232 { ETxString, (TText8*)"+CPMS: \"SM\",14,15,\"SM\",14,15,\"SM\",14,15\r", 0, ETxEvent|EFailIfTimeOut }, |
|
233 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
234 |
|
235 { ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent }, |
|
236 { ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\",\"FD\",\"ON\",\"EN\",\"MC\",\"DC\",\"RC\")\r", 0, ETxEvent|EFailIfTimeOut }, |
|
237 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
238 |
|
239 { ERxString, (TText8*)"AT+CREG=0", 0, ERxEvent }, |
|
240 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
241 |
|
242 { ERxString, (TText8*)"AT+CREG=2", 0, ERxEvent }, |
|
243 { ETxString, (TText8*)"OK\r", 0, ETxEvent|EFailIfTimeOut }, |
|
244 |
|
245 { ERxString, (TText8*)"AT+CREG?", 0, ERxEvent }, |
|
246 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
247 |
|
248 { ERxString, (TText8*)"AT+CRC=1", 0, ERxEvent }, |
|
249 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
250 |
|
251 { ERxString, (TText8*)"AT+COPS?", 0, ERxEvent }, |
|
252 { ETxString, (TText8*)"+COPS: 0,0,\"UK VODAFONE\"\r", 0, ETxEvent|EFailIfTimeOut }, |
|
253 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
254 |
|
255 { ERxString, (TText8*)"AT+CBC", 0, ERxEvent }, |
|
256 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
257 |
|
258 { ERxString, (TText8*)"AT+CSQ", 0, ERxEvent }, |
|
259 { ETxString, (TText8*)"+CSQ: 15,99\r",0, ETxEvent|EFailIfTimeOut }, |
|
260 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
261 |
|
262 { ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent }, |
|
263 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
264 |
|
265 { ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent }, |
|
266 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
267 |
|
268 { ERxString, (TText8*)"AT+CGQREQ", 0, ERxEvent }, |
|
269 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
270 |
|
271 { ERxString, (TText8*)"AT+CGATT", 0, ERxEvent }, |
|
272 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
273 |
|
274 { ERxString, (TText8*)"AT+CNMI=?", 0, ERxEvent }, |
|
275 { ETxString, (TText8*)"+CNMI: (0-2),(0,1,3),(0),(0),(0,1)\r", 0, ETxEvent|EFailIfTimeOut }, |
|
276 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
277 |
|
278 { ERxString, (TText8*)"AT+CBST=?", 0, ERxEvent }, |
|
279 { 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 }, |
|
280 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
281 |
|
282 { ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent }, |
|
283 { ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut }, |
|
284 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
285 |
|
286 { ERxString, (TText8*)"AT+CGREG=1", 0, ERxEvent }, |
|
287 { ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut }, |
|
288 |
|
289 { ERxString, (TText8*)"AT+CSCA=\"441632960000\"", 0, ERxEvent }, |
|
290 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
291 |
|
292 // Attempt to read current default SC Address |
|
293 { ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent }, |
|
294 { ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut }, |
|
295 { ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut }, |
|
296 |
|
297 // Done |
|
298 { EWait, NULL, 5, ETimeOutEvent}, |
|
299 { EComplete, NULL, 0, 0 } |
|
300 }; |
|
301 |
|
302 |
|
303 // Driver class |
|
304 |
|
305 class CTestDriveSca : public CTestBase |
|
306 { |
|
307 public: |
|
308 static CTestDriveSca* NewL(const TScriptList aScriptListEntry); |
|
309 ~CTestDriveSca(); |
|
310 virtual TInt RunTestL(); |
|
311 |
|
312 protected: |
|
313 virtual TInt DriveETelApiL(); |
|
314 |
|
315 private: |
|
316 CTestDriveSca(const TScriptList aScriptListEntry); |
|
317 |
|
318 void DisplayMobileAddr(RMobilePhone::TMobileAddress aMobileAddr); |
|
319 void DisplaySmspEntry(RMobileSmsMessaging::TMobileSmspEntryV1& aSmspEntry); |
|
320 |
|
321 void GetSmspListL(RMobileSmsMessaging::TMobileSmspEntryV1& aSmspEntry,RMobileSmsMessaging& aSms); |
|
322 void SetSmspListL(RMobileSmsMessaging::TMobileSmspEntryV1& aSmspEntry,RMobileSmsMessaging& aSms); |
|
323 |
|
324 TScriptList iScriptListEntry; |
|
325 }; |
|
326 |
|
327 #endif |