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