|
1 // Copyright (c) 2008-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 |
|
18 /** |
|
19 @file The TEFUnit test suite for OpenChannel in the SAT. |
|
20 */ |
|
21 |
|
22 #include <cstktsy/bertlv_defs.h> |
|
23 #include <etel.h> |
|
24 #include <etelmm.h> |
|
25 #include <etelsat.h> |
|
26 #include <ctsy/serviceapi/gsmerror.h> |
|
27 #include <ctsy/mmtsy_names.h> |
|
28 #include <satcs.h> |
|
29 #include <ctsy/ltsy/sat_defs.h> |
|
30 #include <cstktsy/ttlv.h> |
|
31 |
|
32 #include <ctsy/ltsy/mltsydispatchsatinterface.h> |
|
33 #include <ctsy/ltsy/mltsydispatchphoneinterface.h> |
|
34 #include <test/mockltsyindicatorids.h> |
|
35 #include <test/tmockltsydata.h> |
|
36 |
|
37 #include "ccsatopenchannelfu.h" |
|
38 |
|
39 _LIT8(KUser8, "UserLog"); |
|
40 _LIT16(KUser16, "UserLog"); |
|
41 |
|
42 _LIT8(KPwd8, "UserPwd"); |
|
43 _LIT16(KPwd16, "UserPwd"); |
|
44 |
|
45 //Precedence Class: 02 |
|
46 //Delay Class: 04 |
|
47 //Reliability Class: 05 |
|
48 //Peak throughput class: 05 |
|
49 //Mean throughput class: 16 |
|
50 //Packet data protocol: 02 (IP) |
|
51 _LIT8(KBearerParams, "\x02\x04\x05\x05\x10\x02"); |
|
52 |
|
53 //01.01.01.01 |
|
54 _LIT8(KAddress, "\x01\x01\x01\x01"); |
|
55 |
|
56 // 1 bit always on, ton - international number, npi - isdn |
|
57 static const TUint8 KInternationalNumIsdn = (0x80 | 0x10 | 0x01); |
|
58 |
|
59 //immediate link establishment |
|
60 static const TUint8 KCmdQualifier = 0x01; |
|
61 static const TUint16 KBufferSize = 1400; |
|
62 |
|
63 static const TUint8 KCmdId = 0x01; |
|
64 |
|
65 //channel 1, Link established or Packet data service activated |
|
66 static const TUint8 KChannelStatusByte1 = 0x81; |
|
67 // no more info |
|
68 static const TUint8 KChannelStatusByte2 = 0x00; |
|
69 |
|
70 // 9600 |
|
71 static const TUint8 KBearerByte1 = 0x07; |
|
72 // async UDI |
|
73 static const TUint8 KBearerByte2 = 0x00; |
|
74 // non-transparent |
|
75 static const TUint8 KBearerByte3 = 0x01; |
|
76 |
|
77 static const TUint8 KUseTCP = 0x02; |
|
78 static const TUint8 KUseUDP = 0x01; |
|
79 |
|
80 static const TUint16 KTcpPort = 44444; |
|
81 |
|
82 |
|
83 CTestSuite* CCSatOpenChannelFU::CreateSuiteL(const TDesC& aName) |
|
84 { |
|
85 SUB_SUITE; |
|
86 |
|
87 ADD_TEST_STEP_ISO_CPP(CCSatOpenChannelFU, TestNotifyOpenChannelPCmd0001L); |
|
88 ADD_TEST_STEP_ISO_CPP(CCSatOpenChannelFU, TestNotifyOpenChannelPCmd0002L); |
|
89 ADD_TEST_STEP_ISO_CPP(CCSatOpenChannelFU, TestNotifyOpenChannelPCmd0004L); |
|
90 ADD_TEST_STEP_ISO_CPP(CCSatOpenChannelFU, TestNotifyOpenChannelPCmd0001bL); |
|
91 ADD_TEST_STEP_ISO_CPP(CCSatOpenChannelFU, TestNotifyOpenChannelPCmd0001cL); |
|
92 ADD_TEST_STEP_ISO_CPP(CCSatOpenChannelFU, TestNotifyOpenChannelPCmd0001dL); |
|
93 |
|
94 END_SUITE; |
|
95 } |
|
96 |
|
97 |
|
98 // |
|
99 // Actual test cases |
|
100 // |
|
101 |
|
102 |
|
103 /** |
|
104 @SYMTestCaseID BA-CSAT-CHAN-SCHANPC-0001 |
|
105 @SYMPREQ 1780 |
|
106 @SYMComponent telephony_ctsy |
|
107 @SYMTestCaseDesc Test support in CTSY for RSat::NotifyOpenChannelPCmd |
|
108 @SYMTestPriority High |
|
109 @SYMTestActions Invokes RSat::NotifyOpenChannelPCmd |
|
110 @SYMTestExpectedResults Pass |
|
111 @SYMTestType CT |
|
112 */ |
|
113 void CCSatOpenChannelFU::TestNotifyOpenChannelPCmd0001L() |
|
114 { |
|
115 OpenEtelServerL(EUseExtendedError); |
|
116 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
117 OpenPhoneL(); |
|
118 OpenSatL(); |
|
119 |
|
120 RBuf8 data; |
|
121 CleanupClosePushL(data); |
|
122 |
|
123 _LIT8(KNum, "112233445566778"); |
|
124 TTlv tlv; |
|
125 |
|
126 PrepareTlv( tlv, KCmdQualifier, KInternationalNumIsdn, KNum, KBipDefaultBearer); |
|
127 TDesC8* tlvDscPtr = &const_cast<TDesC8&>(tlv.End()); |
|
128 TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr); |
|
129 |
|
130 TRequestStatus notifyStatus; |
|
131 ReinitChannel(iOpenCsChannel); |
|
132 RSat::TOpenCsChannelV2Pckg csChanPck(iOpenCsChannel); |
|
133 |
|
134 //------------------------------------------------------------------------- |
|
135 // TEST C: Successful completion request of RSat::NotifyOpenChannelPCmd |
|
136 //------------------------------------------------------------------------- |
|
137 |
|
138 PrepareAndCompleteDispatchL( *tlvDscPtr ); |
|
139 |
|
140 iSat.NotifyOpenChannelPCmd(notifyStatus, csChanPck); |
|
141 |
|
142 User::WaitForRequest(notifyStatus); |
|
143 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
144 |
|
145 ASSERT_EQUALS( 0, iOpenCsChannel.iUserPassword.Compare(KNullDesC16)); |
|
146 ASSERT_EQUALS( 0, iOpenCsChannel.iUserLogin.Compare(KNullDesC16)); |
|
147 ASSERT_EQUALS( 0, iOpenCsChannel.iSubAddress.Compare(KNullDesC16)); |
|
148 ASSERT_EQUALS( RSat::EProtocolNotPresent, iOpenCsChannel.iSimMeInterface.iTransportProto); |
|
149 ASSERT_EQUALS( RSat::ENoAutomaticReconnection, iOpenCsChannel.iReconnectionMode); |
|
150 ASSERT_EQUALS( RSat::EAnyBearer, iOpenCsChannel.iPCmdType); |
|
151 ASSERT_EQUALS( RSat::EAddressNotSet, iOpenCsChannel.iLocalAddress.iType); |
|
152 ASSERT_EQUALS( RSat::EImmediate, iOpenCsChannel.iLinkEst); |
|
153 ASSERT_EQUALS( RSat::ENoIconId, iOpenCsChannel.iIconId.iQualifier); |
|
154 ASSERT_EQUALS( RSat::ETimeUnitNotSet, iOpenCsChannel.iDuration1.iTimeUnit); |
|
155 ASSERT_EQUALS( RSat::ETimeUnitNotSet, iOpenCsChannel.iDuration2.iTimeUnit); |
|
156 ASSERT_EQUALS( RSat::EAddressNotPresent, iOpenCsChannel.iDestinationAddress.iType); |
|
157 ASSERT_EQUALS( KBufferSize, iOpenCsChannel.iBufferSize); |
|
158 ASSERT_EQUALS( RSat::EAlphaIdNotPresent, iOpenCsChannel.iAlphaId.iStatus); |
|
159 ASSERT_EQUALS( RSat::ETypeOfNumberNotSet, iOpenCsChannel.iAddress.iTypeOfNumber); |
|
160 ASSERT_EQUALS( RSat::ENumberingPlanNotSet, iOpenCsChannel.iAddress.iNumberPlan); |
|
161 ASSERT_EQUALS( RSat::EDefaultBearer, iOpenCsChannel.iBearer.iType); |
|
162 ASSERT_EQUALS( 0, iOpenCsChannel.iBearer.iParams.Compare(KNullDesC8)); |
|
163 |
|
164 //terminal response |
|
165 RSat::TOpenChannelRspV2 terminalRsp; |
|
166 RSat::TOpenChannelRspV2Pckg terminalRspPckg(terminalRsp); |
|
167 terminalRsp.SetPCmdNumber(KCmdId); |
|
168 terminalRsp.iGeneralResult = RSat::KSuccess; |
|
169 terminalRsp.iInfoType = RSat::KNoAdditionalInfo; |
|
170 terminalRsp.iAdditionalInfo = KNullDesC; |
|
171 terminalRsp.iBufferSize = KBufferSize; |
|
172 |
|
173 TTlv termRespAddInfo; |
|
174 termRespAddInfo.AddTag( KTlvBufferSizeTag ); |
|
175 termRespAddInfo.AddByte( TUint8( ( KBufferSize & 0xFF00 ) >> 8 ) ); |
|
176 termRespAddInfo.AddByte( TUint8( KBufferSize & 0x00FF ) ); |
|
177 |
|
178 GenerateTerminalResponseL(KCmdId, KOpenChannel, KCmdQualifier, |
|
179 RSat::EOpenChannelCs, terminalRspPckg, terminalRsp.iAdditionalInfo, |
|
180 terminalRsp.iGeneralResult, termRespAddInfo.GetDataWithoutTopLevelTag()); |
|
181 |
|
182 AssertMockLtsyStatusL(); |
|
183 |
|
184 // passing unsupported bearer type - KBipLocalLinkBearer |
|
185 PrepareTlv( tlv, KCmdQualifier, KInternationalNumIsdn, KNum, KBipLocalLinkBearer); |
|
186 tlv.End(); |
|
187 |
|
188 PrepareAndCompleteDispatchL( *tlvDscPtr ); |
|
189 |
|
190 iSat.NotifyOpenChannelPCmd(notifyStatus, csChanPck); |
|
191 |
|
192 TTlv termRespAddInfo2; |
|
193 termRespAddInfo2.AddTag( KTlvBearerDescriptionTag ); |
|
194 termRespAddInfo2.AddByte( (TUint8)RSat::EBearerTypeNotSet ); |
|
195 termRespAddInfo2.AddByte( 0x00 ); |
|
196 termRespAddInfo2.AddTag( KTlvBufferSizeTag ); |
|
197 termRespAddInfo2.AddByte( 0x00 ); |
|
198 termRespAddInfo2.AddByte( 0x00 ); |
|
199 |
|
200 PrepareTerminalResponseMockDataL( KCmdId, KOpenChannel, KCmdQualifier, |
|
201 KNullDesC, RSat::KCmdDataNotUnderstood, termRespAddInfo2.GetDataWithoutTopLevelTag()); |
|
202 |
|
203 User::WaitForRequest(notifyStatus); |
|
204 ASSERT_EQUALS(KErrCorrupt, notifyStatus.Int()); |
|
205 |
|
206 AssertMockLtsyStatusL(); |
|
207 |
|
208 // passing tlv buffer without buffer size and bearer description |
|
209 |
|
210 tlv.Begin(KBerTlvProactiveSimCommandTag); |
|
211 tlv.AddTag(KTlvCommandDetailsTag); |
|
212 tlv.AddByte(KCmdId);//ETLV_CommandNumber |
|
213 tlv.AddByte(KOpenChannel); //ETLV_TypeOfCommand |
|
214 tlv.AddByte(KCmdQualifier); //ETLV_CommandQualifier |
|
215 tlv.AddTag(KTlvDeviceIdentityTag); |
|
216 tlv.AddByte(KSim); //ETLV_SourceDeviceIdentity |
|
217 tlv.AddByte(KMe); //ETLV_DestinationDeviceIdentity |
|
218 tlv.End(); |
|
219 |
|
220 PrepareAndCompleteDispatchL( *tlvDscPtr ); |
|
221 |
|
222 iSat.NotifyOpenChannelPCmd(notifyStatus, csChanPck); |
|
223 |
|
224 PrepareTerminalResponseMockDataL( KCmdId, KOpenChannel, KCmdQualifier, |
|
225 KNullDesC, RSat::KErrorRequiredValuesMissing, termRespAddInfo2.GetDataWithoutTopLevelTag()); |
|
226 |
|
227 User::WaitForRequest(notifyStatus); |
|
228 ASSERT_EQUALS(KErrCorrupt, notifyStatus.Int()); |
|
229 |
|
230 AssertMockLtsyStatusL(); |
|
231 |
|
232 //------------------------------------------------------------------------- |
|
233 // TEST E: Unsolicited completion of RSat::NotifyOpenChannelPCmd from LTSY. |
|
234 //------------------------------------------------------------------------- |
|
235 TRequestStatus requestStatus; |
|
236 iMockLTSY.NotifyTerminated(requestStatus); |
|
237 tlvDscPack.SerialiseL(data); |
|
238 iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, KErrNone, data, 10); |
|
239 |
|
240 TBuf<1> additionalInfo(0); |
|
241 additionalInfo.Append( RSat::KNoSpecificMeProblem ); |
|
242 PrepareTerminalResponseMockDataL( KCmdId, KOpenChannel, KCmdQualifier, |
|
243 additionalInfo, RSat::KMeUnableToProcessCmd, termRespAddInfo2.GetDataWithoutTopLevelTag()); |
|
244 |
|
245 User::WaitForRequest(requestStatus); |
|
246 AssertMockLtsyStatusL(); |
|
247 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
248 |
|
249 //------------------------------------------------------------------------- |
|
250 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
251 //------------------------------------------------------------------------- |
|
252 PrepareAndCompleteDispatchL( *tlvDscPtr, KErrUnknown ); |
|
253 |
|
254 iSat.NotifyOpenChannelPCmd(notifyStatus, csChanPck); |
|
255 |
|
256 User::WaitForRequest(notifyStatus); |
|
257 ASSERT_EQUALS(KErrUnknown, notifyStatus.Int()); |
|
258 |
|
259 AssertMockLtsyStatusL(); |
|
260 |
|
261 // testing all TerminalResponse variants |
|
262 DoTestTerminalResponseL(); |
|
263 |
|
264 CleanupStack::PopAndDestroy(2, this); |
|
265 } |
|
266 |
|
267 void CCSatOpenChannelFU::ReinitChannel(RSat::TOpenCsChannelV2 &aChannel) |
|
268 { |
|
269 aChannel.iAddress.iTypeOfNumber = RSat::ETypeOfNumberNotSet; |
|
270 aChannel.iAddress.iNumberPlan = RSat::ENumberingPlanNotSet; |
|
271 aChannel.iAddress.iTelNumber.Zero(); |
|
272 aChannel.iSubAddress.Zero(); |
|
273 aChannel.iDuration1.iTimeUnit = RSat::ETimeUnitNotSet; |
|
274 aChannel.iDuration1.iNumOfUnits = 0; |
|
275 aChannel.iDuration2.iTimeUnit = RSat::ETimeUnitNotSet; |
|
276 aChannel.iDuration2.iNumOfUnits = 0; |
|
277 aChannel.iLocalAddress.iType = RSat::EAddressNotSet; |
|
278 aChannel.iLocalAddress.iAddress.Zero(); |
|
279 aChannel.iUserLogin.Zero(); |
|
280 aChannel.iUserPassword.Zero(); |
|
281 aChannel.iPCmdType = RSat::EPCmdTypeNotSet; |
|
282 aChannel.iLinkEst = RSat::ELinkEstablishmentNotSet; |
|
283 aChannel.iReconnectionMode = RSat::EReconnectionModeNotSet; |
|
284 aChannel.iAlphaId.iStatus = RSat::EAlphaIdNotSet; |
|
285 aChannel.iAlphaId.iAlphaId.Zero(); |
|
286 aChannel.iIconId.iQualifier = RSat::EIconQualifierNotSet; |
|
287 aChannel.iIconId.iIdentifier = 0; |
|
288 aChannel.iBearer.iType = RSat::EBearerTypeNotSet; |
|
289 aChannel.iBearer.iParams.Zero(); |
|
290 aChannel.iBufferSize = 0; |
|
291 aChannel.iSimMeInterface.iTransportProto = RSat::EProtocolNotSet; |
|
292 aChannel.iSimMeInterface.iPrtNumber = 0; |
|
293 aChannel.iDestinationAddress.iType = RSat::EAddressNotSet; |
|
294 aChannel.iDestinationAddress.iAddress.Zero(); |
|
295 //aChannel.iPCmdNumber = 0; |
|
296 //aChannel.iExtensionId = 0; |
|
297 } |
|
298 /** |
|
299 @SYMTestCaseID BA-CSAT-CHAN-SCHANPC-0002 |
|
300 @SYMPREQ 1780 |
|
301 @SYMComponent telephony_ctsy |
|
302 @SYMTestCaseDesc Test support in CTSY for cancelling of RSat::NotifyOpenChannelPCmd |
|
303 @SYMTestPriority High |
|
304 @SYMTestActions Invokes cancelling of RSat::NotifyOpenChannelPCmd |
|
305 @SYMTestExpectedResults Pass |
|
306 @SYMTestType CT |
|
307 */ |
|
308 void CCSatOpenChannelFU::TestNotifyOpenChannelPCmd0002L() |
|
309 { |
|
310 OpenEtelServerL(EUseExtendedError); |
|
311 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
312 OpenPhoneL(); |
|
313 OpenSatL(); |
|
314 |
|
315 TRequestStatus notifyStatus; |
|
316 RSat::TOpenCsChannelV2 csChan; |
|
317 RSat::TOpenCsChannelV2Pckg csChanPck(csChan); |
|
318 |
|
319 PrepareDispatchL( ); |
|
320 |
|
321 iSat.NotifyOpenChannelPCmd(notifyStatus, csChanPck); |
|
322 |
|
323 iSat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd); |
|
324 |
|
325 User::WaitForRequest(notifyStatus); |
|
326 ASSERT_EQUALS(KErrCancel, notifyStatus.Int()); |
|
327 |
|
328 AssertMockLtsyStatusL(); |
|
329 |
|
330 CleanupStack::PopAndDestroy(1, this); |
|
331 } |
|
332 |
|
333 |
|
334 |
|
335 /** |
|
336 @SYMTestCaseID BA-CSAT-CHAN-SCHANPC-0004 |
|
337 @SYMPREQ 1780 |
|
338 @SYMComponent telephony_ctsy |
|
339 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RSat::NotifyOpenChannelPCmd |
|
340 @SYMTestPriority High |
|
341 @SYMTestActions Invokes multiple client requests to RSat::NotifyOpenChannelPCmd |
|
342 @SYMTestExpectedResults Pass |
|
343 @SYMTestType CT |
|
344 */ |
|
345 void CCSatOpenChannelFU::TestNotifyOpenChannelPCmd0004L() |
|
346 { |
|
347 OpenEtelServerL(EUseExtendedError); |
|
348 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
349 OpenPhoneL(); |
|
350 OpenSatL(); |
|
351 |
|
352 // Open second client |
|
353 RTelServer telServer2; |
|
354 TInt ret = telServer2.Connect(); |
|
355 ASSERT_EQUALS(KErrNone, ret); |
|
356 CleanupClosePushL(telServer2); |
|
357 |
|
358 RMobilePhone phone2; |
|
359 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
|
360 ASSERT_EQUALS(KErrNone, ret); |
|
361 CleanupClosePushL(phone2); |
|
362 |
|
363 RSat sat2; |
|
364 User::LeaveIfError(sat2.Open(phone2)); |
|
365 CleanupClosePushL(sat2); |
|
366 |
|
367 _LIT8(KNum, "112233445566778"); |
|
368 TUint8 bearerType(KBipDefaultBearer); |
|
369 TTlv tlv; |
|
370 |
|
371 PrepareTlv( tlv, KCmdQualifier, KInternationalNumIsdn, KNum, bearerType); |
|
372 |
|
373 TRequestStatus notifyStatus; |
|
374 RSat::TOpenCsChannelV2 csChan; |
|
375 RSat::TOpenCsChannelV2Pckg csChanPck(csChan); |
|
376 |
|
377 PrepareAndCompleteDispatchL( tlv.End() ); |
|
378 |
|
379 iSat.NotifyOpenChannelPCmd(notifyStatus, csChanPck); |
|
380 |
|
381 TRequestStatus notifyStatus2; |
|
382 RSat::TOpenCsChannelV2 csChan2; |
|
383 RSat::TOpenCsChannelV2Pckg csChanPck2(csChan2); |
|
384 |
|
385 sat2.NotifyOpenChannelPCmd(notifyStatus2, csChanPck2); |
|
386 |
|
387 User::WaitForRequest(notifyStatus); |
|
388 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
389 |
|
390 ASSERT_EQUALS( 0, csChan.iUserPassword.Compare(KNullDesC16)); |
|
391 ASSERT_EQUALS( 0, csChan.iUserLogin.Compare(KNullDesC16)); |
|
392 ASSERT_EQUALS( 0, csChan.iSubAddress.Compare(KNullDesC16)); |
|
393 ASSERT_EQUALS( RSat::EProtocolNotPresent, csChan.iSimMeInterface.iTransportProto); |
|
394 ASSERT_EQUALS( RSat::ENoAutomaticReconnection, csChan.iReconnectionMode); |
|
395 ASSERT_EQUALS( RSat::EAnyBearer, csChan.iPCmdType); |
|
396 ASSERT_EQUALS( RSat::EAddressNotSet, csChan.iLocalAddress.iType); |
|
397 ASSERT_EQUALS( RSat::EImmediate, csChan.iLinkEst); |
|
398 ASSERT_EQUALS( RSat::ENoIconId, csChan.iIconId.iQualifier); |
|
399 ASSERT_EQUALS( RSat::ETimeUnitNotSet, csChan.iDuration1.iTimeUnit); |
|
400 ASSERT_EQUALS( RSat::ETimeUnitNotSet, csChan.iDuration2.iTimeUnit); |
|
401 ASSERT_EQUALS( RSat::EAddressNotPresent, csChan.iDestinationAddress.iType); |
|
402 ASSERT_EQUALS( KBufferSize, csChan.iBufferSize); |
|
403 ASSERT_EQUALS( RSat::EAlphaIdNotPresent, csChan.iAlphaId.iStatus); |
|
404 ASSERT_EQUALS( RSat::ETypeOfNumberNotSet, csChan.iAddress.iTypeOfNumber); |
|
405 ASSERT_EQUALS( RSat::ENumberingPlanNotSet, csChan.iAddress.iNumberPlan); |
|
406 ASSERT_EQUALS( RSat::EDefaultBearer, csChan.iBearer.iType); |
|
407 ASSERT_EQUALS( 0, csChan.iBearer.iParams.Compare(KNullDesC8)); |
|
408 |
|
409 User::WaitForRequest(notifyStatus2); |
|
410 ASSERT_EQUALS(KErrNone, notifyStatus2.Int()); |
|
411 |
|
412 ASSERT_EQUALS( 0, csChan2.iUserPassword.Compare(KNullDesC16)); |
|
413 ASSERT_EQUALS( 0, csChan2.iUserLogin.Compare(KNullDesC16)); |
|
414 ASSERT_EQUALS( 0, csChan2.iSubAddress.Compare(KNullDesC16)); |
|
415 ASSERT_EQUALS( RSat::EProtocolNotPresent, csChan2.iSimMeInterface.iTransportProto); |
|
416 ASSERT_EQUALS( RSat::ENoAutomaticReconnection, csChan2.iReconnectionMode); |
|
417 ASSERT_EQUALS( RSat::EAnyBearer, csChan2.iPCmdType); |
|
418 ASSERT_EQUALS( RSat::EAddressNotSet, csChan2.iLocalAddress.iType); |
|
419 ASSERT_EQUALS( RSat::EImmediate, csChan2.iLinkEst); |
|
420 ASSERT_EQUALS( RSat::ENoIconId, csChan2.iIconId.iQualifier); |
|
421 ASSERT_EQUALS( RSat::ETimeUnitNotSet, csChan2.iDuration1.iTimeUnit); |
|
422 ASSERT_EQUALS( RSat::ETimeUnitNotSet, csChan2.iDuration2.iTimeUnit); |
|
423 ASSERT_EQUALS( RSat::EAddressNotPresent, csChan2.iDestinationAddress.iType); |
|
424 ASSERT_EQUALS( KBufferSize, csChan2.iBufferSize); |
|
425 ASSERT_EQUALS( RSat::EAlphaIdNotPresent, csChan2.iAlphaId.iStatus); |
|
426 ASSERT_EQUALS( RSat::ETypeOfNumberNotSet, csChan2.iAddress.iTypeOfNumber); |
|
427 ASSERT_EQUALS( RSat::ENumberingPlanNotSet, csChan2.iAddress.iNumberPlan); |
|
428 ASSERT_EQUALS( RSat::EDefaultBearer, csChan2.iBearer.iType); |
|
429 ASSERT_EQUALS( 0, csChan2.iBearer.iParams.Compare(KNullDesC8)); |
|
430 |
|
431 AssertMockLtsyStatusL(); |
|
432 |
|
433 CleanupStack::PopAndDestroy(4, this); |
|
434 } |
|
435 |
|
436 |
|
437 |
|
438 /** |
|
439 @SYMTestCaseID BA-CSAT-CHAN-SCHANPC-0001b |
|
440 @SYMPREQ 1780 |
|
441 @SYMComponent telephony_ctsy |
|
442 @SYMTestCaseDesc Test support in CTSY for RSat::NotifyOpenChannelPCmd, GPRS, no alpha, no network access name |
|
443 @SYMTestPriority High |
|
444 @SYMTestActions Invokes RSat::NotifyOpenChannelPCmd |
|
445 @SYMTestExpectedResults Pass |
|
446 @SYMTestType CT |
|
447 */ |
|
448 void CCSatOpenChannelFU::TestNotifyOpenChannelPCmd0001bL() |
|
449 { |
|
450 OpenEtelServerL(EUseExtendedError); |
|
451 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
452 OpenPhoneL(); |
|
453 OpenSatL(); |
|
454 |
|
455 _LIT8(KNum, "112233445566778"); |
|
456 TUint8 bearerType(KBipGprsBearer); |
|
457 TTlv tlv; |
|
458 |
|
459 PrepareTlv( tlv, KCmdQualifier, KInternationalNumIsdn, KNum, bearerType); |
|
460 |
|
461 TRequestStatus notifyStatus; |
|
462 RSat::TOpenGprsChannelV4 gprsChan; |
|
463 RSat::TOpenGprsChannelV4Pckg gprsChanPck(gprsChan); |
|
464 |
|
465 //see ETSI TS 100 607 Expected Sequence 2.1 |
|
466 //(OPEN CHANNEL, immediate link establishment, GPRS, no local address, no alpha identifier, no network access name) |
|
467 |
|
468 PrepareAndCompleteDispatchL( tlv.End() ); |
|
469 |
|
470 iSat.NotifyOpenChannelPCmd(notifyStatus, gprsChanPck); |
|
471 |
|
472 User::WaitForRequest(notifyStatus); |
|
473 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
474 |
|
475 ASSERT_EQUALS( 0, gprsChan.iUserPassword.Compare(KPwd16)); |
|
476 ASSERT_EQUALS( 0, gprsChan.iUserLogin.Compare(KUser16)); |
|
477 ASSERT_EQUALS( RSat::EUdp, gprsChan.iSimMeInterface.iTransportProto); |
|
478 ASSERT_EQUALS( RSat::ENoAutomaticReconnection, gprsChan.iReconnectionMode); |
|
479 ASSERT_EQUALS( RSat::EGprsBearer, gprsChan.iPCmdType); |
|
480 ASSERT_EQUALS( RSat::EAddressNotSet, gprsChan.iLocalAddress.iType); |
|
481 ASSERT_EQUALS( RSat::EImmediate, gprsChan.iLinkEst); |
|
482 ASSERT_EQUALS( RSat::ENoIconId, gprsChan.iIconId.iQualifier); |
|
483 ASSERT_EQUALS( RSat::EIPv4Address, gprsChan.iDestinationAddress.iType); |
|
484 ASSERT_EQUALS( 0, gprsChan.iDestinationAddress.iAddress.Compare(KAddress)); |
|
485 ASSERT_EQUALS( KBufferSize, gprsChan.iBufferSize); |
|
486 ASSERT_EQUALS( RSat::EAlphaIdNotPresent, gprsChan.iAlphaId.iStatus); |
|
487 ASSERT_EQUALS( 0, gprsChan.iAccessName.Compare(KNullDesC8)); |
|
488 ASSERT_EQUALS( RSat::EGPRSBearer, gprsChan.iBearer.iType); |
|
489 ASSERT_EQUALS( 0, gprsChan.iBearer.iParams.Compare(KBearerParams)); |
|
490 |
|
491 //terminal response |
|
492 RSat::TOpenChannelRspV2 terminalRsp; |
|
493 RSat::TOpenChannelRspV2Pckg terminalRspPckg(terminalRsp); |
|
494 terminalRsp.SetPCmdNumber(KCmdId); |
|
495 terminalRsp.iGeneralResult = RSat::KSuccess; |
|
496 terminalRsp.iInfoType = RSat::KChannelStatusInfo; |
|
497 terminalRsp.iAdditionalInfo.Append(KChannelStatusByte1);; |
|
498 terminalRsp.iAdditionalInfo.Append(KChannelStatusByte2);; |
|
499 terminalRsp.iBufferSize = KBufferSize; |
|
500 terminalRsp.iBearer.iType = RSat::EGPRSBearer; |
|
501 terminalRsp.iBearer.iParams.Append(KBearerParams); |
|
502 |
|
503 TTlv termRespAddInfo; |
|
504 termRespAddInfo.AddTag( KTlvChannelStatusTag ); |
|
505 termRespAddInfo.AddByte(KChannelStatusByte1); |
|
506 termRespAddInfo.AddByte(KChannelStatusByte2); |
|
507 termRespAddInfo.AddTag( KTlvBearerDescriptionTag ); |
|
508 termRespAddInfo.AddByte( bearerType ); |
|
509 termRespAddInfo.AddData(KBearerParams); |
|
510 termRespAddInfo.AddTag( KTlvBufferSizeTag ); |
|
511 termRespAddInfo.AddByte( TUint8( ( KBufferSize & 0xFF00 ) >> 8 ) ); |
|
512 termRespAddInfo.AddByte( TUint8( KBufferSize & 0x00FF ) ); |
|
513 |
|
514 GenerateTerminalResponseL(KCmdId, KOpenChannel, KCmdQualifier, |
|
515 RSat::EOpenChannelGprs, terminalRspPckg, KNullDesC, |
|
516 terminalRsp.iGeneralResult, termRespAddInfo.GetDataWithoutTopLevelTag()); |
|
517 |
|
518 AssertMockLtsyStatusL(); |
|
519 |
|
520 CleanupStack::PopAndDestroy(1, this); |
|
521 } |
|
522 |
|
523 |
|
524 /** |
|
525 @SYMTestCaseID BA-CSAT-CHAN-SCHANPC-0001c |
|
526 @SYMPREQ 1780 |
|
527 @SYMComponent telephony_ctsy |
|
528 @SYMTestCaseDesc Test support in CTSY for RSat::NotifyOpenChannelPCmd, GPRS, alpha, network access name |
|
529 @SYMTestPriority High |
|
530 @SYMTestActions Invokes RSat::NotifyOpenChannelPCmd |
|
531 @SYMTestExpectedResults Pass |
|
532 @SYMTestType CT |
|
533 */ |
|
534 void CCSatOpenChannelFU::TestNotifyOpenChannelPCmd0001cL() |
|
535 { |
|
536 OpenEtelServerL(EUseExtendedError); |
|
537 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
538 OpenPhoneL(); |
|
539 OpenSatL(); |
|
540 |
|
541 TUint8 bearerType(KBipGprsBearer); |
|
542 _LIT8(KNetworkAcessName, ".TestGp.rs"); |
|
543 _LIT8(KAlpha, "Open ID"); |
|
544 _LIT16(KAlpha16, "Open ID"); |
|
545 TTlv tlv; |
|
546 |
|
547 PrepareTlv( tlv, KCmdQualifier, 0, KNullDesC8, bearerType, |
|
548 KNetworkAcessName, KAlpha, KUseTCP, EFalse); // false - IPv6 |
|
549 |
|
550 TRequestStatus notifyStatus; |
|
551 RSat::TOpenGprsChannelV4 gprsChan; |
|
552 RSat::TOpenGprsChannelV4Pckg gprsChanPck(gprsChan); |
|
553 |
|
554 //(OPEN CHANNEL, immediate link establishment GPRS, alpha identifier, with network access name) |
|
555 |
|
556 PrepareAndCompleteDispatchL( tlv.End() ); |
|
557 |
|
558 iSat.NotifyOpenChannelPCmd(notifyStatus, gprsChanPck); |
|
559 |
|
560 User::WaitForRequest(notifyStatus); |
|
561 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
562 |
|
563 ASSERT_EQUALS( 0, gprsChan.iUserPassword.Compare(KPwd16)); |
|
564 ASSERT_EQUALS( 0, gprsChan.iUserLogin.Compare(KUser16)); |
|
565 ASSERT_EQUALS( RSat::ETcp, gprsChan.iSimMeInterface.iTransportProto); |
|
566 ASSERT_EQUALS( RSat::ENoAutomaticReconnection, gprsChan.iReconnectionMode); |
|
567 ASSERT_EQUALS( RSat::EGprsBearer, gprsChan.iPCmdType); |
|
568 ASSERT_EQUALS( RSat::EAddressNotSet, gprsChan.iLocalAddress.iType); |
|
569 ASSERT_EQUALS( RSat::EImmediate, gprsChan.iLinkEst); |
|
570 ASSERT_EQUALS( RSat::ENoIconId, gprsChan.iIconId.iQualifier); |
|
571 ASSERT_EQUALS( RSat::EIPv6Address, gprsChan.iDestinationAddress.iType); |
|
572 ASSERT_EQUALS( 0, gprsChan.iDestinationAddress.iAddress.Compare(KAddress)); |
|
573 ASSERT_EQUALS( KBufferSize, gprsChan.iBufferSize); |
|
574 ASSERT_EQUALS( RSat::EAlphaIdProvided, gprsChan.iAlphaId.iStatus); |
|
575 ASSERT_EQUALS( 0, gprsChan.iAlphaId.iAlphaId.Compare(KAlpha16)); |
|
576 ASSERT_EQUALS( 0, gprsChan.iAccessName.Compare(KNetworkAcessName)); |
|
577 ASSERT_EQUALS( RSat::EGPRSBearer, gprsChan.iBearer.iType); |
|
578 ASSERT_EQUALS( 0, gprsChan.iBearer.iParams.Compare(KBearerParams)); |
|
579 |
|
580 //terminal response |
|
581 RSat::TOpenChannelRspV2 terminalRsp; |
|
582 RSat::TOpenChannelRspV2Pckg terminalRspPckg(terminalRsp); |
|
583 terminalRsp.SetPCmdNumber(KCmdId); |
|
584 terminalRsp.iGeneralResult = RSat::KMeUnableToProcessCmd; |
|
585 terminalRsp.iInfoType = RSat::KMeProblem; |
|
586 terminalRsp.iAdditionalInfo.Append(RSat::KMeBusyOnCall); |
|
587 terminalRsp.iBufferSize = KBufferSize; |
|
588 terminalRsp.iBearer.iType = RSat::EGPRSBearer; |
|
589 terminalRsp.iBearer.iParams.Append(KBearerParams); |
|
590 |
|
591 TTlv termRespAddInfo; |
|
592 termRespAddInfo.AddTag( KTlvBearerDescriptionTag ); |
|
593 termRespAddInfo.AddByte( bearerType ); |
|
594 termRespAddInfo.AddData(KBearerParams); |
|
595 termRespAddInfo.AddTag( KTlvBufferSizeTag ); |
|
596 termRespAddInfo.AddByte( TUint8( ( KBufferSize & 0xFF00 ) >> 8 ) ); |
|
597 termRespAddInfo.AddByte( TUint8( KBufferSize & 0x00FF ) ); |
|
598 |
|
599 GenerateTerminalResponseL(KCmdId, KOpenChannel, KCmdQualifier, |
|
600 RSat::EOpenChannelGprs, terminalRspPckg, terminalRsp.iAdditionalInfo, |
|
601 terminalRsp.iGeneralResult, termRespAddInfo.GetDataWithoutTopLevelTag()); |
|
602 |
|
603 AssertMockLtsyStatusL(); |
|
604 |
|
605 CleanupStack::PopAndDestroy(1, this); |
|
606 } |
|
607 |
|
608 |
|
609 /** |
|
610 @SYMTestCaseID BA-CSAT-CHAN-SCHANPC-0001d |
|
611 @SYMPREQ 1780 |
|
612 @SYMComponent telephony_ctsy |
|
613 @SYMTestCaseDesc Test support in CTSY for RSat::NotifyOpenChannelPCmd, NULL alpha identifier |
|
614 @SYMTestPriority High |
|
615 @SYMTestActions Invokes RSat::NotifyOpenChannelPCmd |
|
616 @SYMTestExpectedResults Pass |
|
617 @SYMTestType CT |
|
618 */ |
|
619 void CCSatOpenChannelFU::TestNotifyOpenChannelPCmd0001dL() |
|
620 { |
|
621 OpenEtelServerL(EUseExtendedError); |
|
622 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
623 OpenPhoneL(); |
|
624 OpenSatL(); |
|
625 |
|
626 TUint8 cmdQualifier(0x02); //on demand, automatic reconnection |
|
627 TUint8 bearerType(KBipGprsBearer); |
|
628 _LIT8(KNetworkAcessName, ".TestGp.rs"); |
|
629 TTlv tlv; |
|
630 |
|
631 PrepareTlv( tlv, cmdQualifier, 0, KNullDesC8, bearerType, |
|
632 KNetworkAcessName, KNullDesC8, 66); // no protocol |
|
633 |
|
634 TRequestStatus notifyStatus; |
|
635 RSat::TOpenGprsChannelV4 gprsChan; |
|
636 RSat::TOpenGprsChannelV4Pckg gprsChanPck(gprsChan); |
|
637 |
|
638 //(OPEN CHANNEL, immediate link establishment GPRS, NULL alpha identifier, with network access name) |
|
639 |
|
640 PrepareAndCompleteDispatchL( tlv.End() ); |
|
641 |
|
642 iSat.NotifyOpenChannelPCmd(notifyStatus, gprsChanPck); |
|
643 |
|
644 User::WaitForRequest(notifyStatus); |
|
645 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
646 |
|
647 ASSERT_EQUALS( 0, gprsChan.iUserPassword.Compare(KPwd16)); |
|
648 ASSERT_EQUALS( 0, gprsChan.iUserLogin.Compare(KUser16)); |
|
649 ASSERT_EQUALS( RSat::EProtocolNotPresent, gprsChan.iSimMeInterface.iTransportProto); |
|
650 ASSERT_EQUALS( RSat::EAutomaticReconnection, gprsChan.iReconnectionMode); |
|
651 ASSERT_EQUALS( RSat::EGprsBearer, gprsChan.iPCmdType); |
|
652 ASSERT_EQUALS( RSat::EIPv4Address, gprsChan.iLocalAddress.iType); |
|
653 ASSERT_EQUALS( 0, gprsChan.iLocalAddress.iAddress.Compare(KAddress)); |
|
654 ASSERT_EQUALS( RSat::EOnDemand, gprsChan.iLinkEst); |
|
655 ASSERT_EQUALS( RSat::ENoIconId, gprsChan.iIconId.iQualifier); |
|
656 ASSERT_EQUALS( RSat::EAddressNotPresent, gprsChan.iDestinationAddress.iType); |
|
657 ASSERT_EQUALS( KBufferSize, gprsChan.iBufferSize); |
|
658 ASSERT_EQUALS( RSat::EAlphaIdNull, gprsChan.iAlphaId.iStatus); |
|
659 ASSERT_EQUALS( 0, gprsChan.iAccessName.Compare(KNetworkAcessName)); |
|
660 ASSERT_EQUALS( RSat::EGPRSBearer, gprsChan.iBearer.iType); |
|
661 ASSERT_EQUALS( 0, gprsChan.iBearer.iParams.Compare(KBearerParams)); |
|
662 |
|
663 //terminal response |
|
664 RSat::TOpenChannelRspV2 terminalRsp; |
|
665 RSat::TOpenChannelRspV2Pckg terminalRspPckg(terminalRsp); |
|
666 terminalRsp.SetPCmdNumber(KCmdId); |
|
667 terminalRsp.iGeneralResult = RSat::KBearerIndepProtocolError; |
|
668 terminalRsp.iInfoType = RSat::KMeProblem; |
|
669 terminalRsp.iAdditionalInfo.Append(RSat::KMeBusyOnCall); |
|
670 terminalRsp.iBufferSize = KBufferSize; |
|
671 terminalRsp.iBearer.iType = RSat::EGPRSBearer; |
|
672 terminalRsp.iBearer.iParams.Append(KBearerParams); |
|
673 |
|
674 TTlv termRespAddInfo; |
|
675 termRespAddInfo.AddTag( KTlvBearerDescriptionTag ); |
|
676 termRespAddInfo.AddByte( bearerType ); |
|
677 termRespAddInfo.AddData(KBearerParams); |
|
678 termRespAddInfo.AddTag( KTlvBufferSizeTag ); |
|
679 termRespAddInfo.AddByte( TUint8( ( KBufferSize & 0xFF00 ) >> 8 ) ); |
|
680 termRespAddInfo.AddByte( TUint8( KBufferSize & 0x00FF ) ); |
|
681 |
|
682 GenerateTerminalResponseL(KCmdId, KOpenChannel, cmdQualifier, |
|
683 RSat::EOpenChannelGprs, terminalRspPckg, terminalRsp.iAdditionalInfo, |
|
684 terminalRsp.iGeneralResult, termRespAddInfo.GetDataWithoutTopLevelTag()); |
|
685 |
|
686 AssertMockLtsyStatusL(); |
|
687 |
|
688 CleanupStack::PopAndDestroy(1, this); |
|
689 } |
|
690 |
|
691 |
|
692 |
|
693 |
|
694 void CCSatOpenChannelFU::PrepareTlv(TTlv& aTlv, TUint8 aCmdQualifier, TUint8 aTon, |
|
695 const TDesC8& aNum, TUint8 aBearer, const TDesC8& aNetworkAccessName, |
|
696 const TDesC8& aAlpha, TUint8 aUdpTcp, TBool aIPv4 ) |
|
697 { |
|
698 aTlv.Begin(KBerTlvProactiveSimCommandTag); |
|
699 aTlv.AddTag(KTlvCommandDetailsTag); |
|
700 aTlv.AddByte(KCmdId);//ETLV_CommandNumber |
|
701 aTlv.AddByte(KOpenChannel); //ETLV_TypeOfCommand |
|
702 aTlv.AddByte(aCmdQualifier); //ETLV_CommandQualifier |
|
703 |
|
704 aTlv.AddTag(KTlvDeviceIdentityTag); |
|
705 aTlv.AddByte(KSim); //ETLV_SourceDeviceIdentity |
|
706 aTlv.AddByte(KMe); //ETLV_DestinationDeviceIdentity |
|
707 |
|
708 if(0 != aAlpha.Compare(KNoAlpha)) |
|
709 { |
|
710 aTlv.AddTag(KTlvAlphaIdentifierTag); |
|
711 aTlv.AddData(aAlpha); |
|
712 } |
|
713 |
|
714 if(0 < aNum.Length()) |
|
715 { |
|
716 aTlv.AddTag(KTlvAddressTag); |
|
717 aTlv.AddByte(aTon); |
|
718 TBuf8<KMaxAddressLength> bcdSetUpCallNo; |
|
719 TSatUtility::AsciiToBCD(aNum,bcdSetUpCallNo); |
|
720 aTlv.AddData(bcdSetUpCallNo); |
|
721 } |
|
722 |
|
723 aTlv.AddTag(KTlvBearerDescriptionTag); |
|
724 aTlv.AddByte(aBearer); |
|
725 switch(aBearer) |
|
726 { |
|
727 case KBipCsdBearer: |
|
728 aTlv.AddByte(KBearerByte1); |
|
729 aTlv.AddByte(KBearerByte2); |
|
730 aTlv.AddByte(KBearerByte3); |
|
731 break; |
|
732 case KBipGprsBearer: |
|
733 aTlv.AddData(KBearerParams); |
|
734 break; |
|
735 default: |
|
736 break; |
|
737 } |
|
738 |
|
739 aTlv.AddTag(KTlvBufferSizeTag); |
|
740 aTlv.AddByte( TUint8( ( KBufferSize & 0xFF00 ) >> 8 ) ); |
|
741 aTlv.AddByte( TUint8( KBufferSize & 0x00FF ) ); |
|
742 |
|
743 if(0 < aNetworkAccessName.Length()) |
|
744 { |
|
745 aTlv.AddTag(KTlvNetworkAccessNameTag); |
|
746 aTlv.AddData(aNetworkAccessName); |
|
747 } |
|
748 |
|
749 if(KBipGprsBearer == aBearer) |
|
750 { |
|
751 aTlv.AddTag(KTlvTextStringTag); // user login |
|
752 aTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
753 aTlv.AddData(KUser8); |
|
754 aTlv.AddTag(KTlvTextStringTag); // user password |
|
755 aTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
756 aTlv.AddData(KPwd8); |
|
757 |
|
758 if((KUseUDP == aUdpTcp) || (KUseTCP == aUdpTcp)) |
|
759 { |
|
760 aTlv.AddTag(KTlvSimMeTransportLevelTag); |
|
761 aTlv.AddByte(aUdpTcp); //UDP/TCP |
|
762 aTlv.AddByte( TUint8( ( KTcpPort & 0xFF00 ) >> 8 ) ); |
|
763 aTlv.AddByte( TUint8( KTcpPort & 0x00FF ) ); |
|
764 } |
|
765 |
|
766 aTlv.AddTag(KTlvOtherAddressTag); |
|
767 if(aIPv4) |
|
768 { |
|
769 aTlv.AddByte(KIPV4); |
|
770 } |
|
771 else |
|
772 { |
|
773 aTlv.AddByte(KIPV6); |
|
774 } |
|
775 aTlv.AddData(KAddress); // 01.01.01.01 |
|
776 } |
|
777 } |
|
778 |
|
779 |
|
780 void CCSatOpenChannelFU::PrepareAndCompleteDispatchL(TPtrC8 aTlvDsc, TInt aRes) |
|
781 { |
|
782 RBuf8 data; |
|
783 CleanupClosePushL(data); |
|
784 |
|
785 PrepareDispatchL(); |
|
786 |
|
787 TDesC8* tlvDscPtr = &aTlvDsc; |
|
788 TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr); |
|
789 |
|
790 tlvDscPack.SerialiseL(data); |
|
791 iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, aRes, data, 10); |
|
792 |
|
793 CleanupStack::PopAndDestroy(1); |
|
794 } |
|
795 |
|
796 void CCSatOpenChannelFU::PrepareDispatchL(void) |
|
797 { |
|
798 RBuf8 data; |
|
799 CleanupClosePushL(data); |
|
800 |
|
801 TUint8 pcmdCode = KOpenChannel; |
|
802 TMockLtsyData1<TUint8> expLtsyData(pcmdCode); |
|
803 expLtsyData.SerialiseL(data); |
|
804 |
|
805 iMockLTSY.ExpectL(MLtsyDispatchSatPCmdNotification::KLtsyDispatchSatPCmdNotificationApiId,data); |
|
806 |
|
807 CleanupStack::PopAndDestroy(1); |
|
808 } |
|
809 |
|
810 void CCSatOpenChannelFU::DoTestTerminalResponseL() |
|
811 { |
|
812 static const struct |
|
813 { |
|
814 RSat::TPCmdResult iGeneralResult; |
|
815 RSat::TAdditionalInfoType iInfoType; |
|
816 TBool iIntentionallyOmmitAdditionalInfo; |
|
817 TUint8 iAdditionalInfo; |
|
818 TInt iExpectedResult; |
|
819 } |
|
820 KResponsesToTest[] = |
|
821 { |
|
822 { |
|
823 // 0x01 - Command performed with partial comprehension; |
|
824 RSat::KPartialComprehension, |
|
825 RSat::KNoAdditionalInfo, |
|
826 ETrue, |
|
827 0, |
|
828 KErrNone |
|
829 }, |
|
830 { |
|
831 // 0x02 - Command performed, with missing information; |
|
832 RSat::KMissingInformation, |
|
833 RSat::KNoAdditionalInfo, |
|
834 ETrue, |
|
835 0, |
|
836 KErrNone |
|
837 }, |
|
838 { |
|
839 // 0x03 - REFRESH performed with additional EFs read; |
|
840 RSat::KRefreshAdditionEFRead, |
|
841 RSat::KNoAdditionalInfo, |
|
842 ETrue, |
|
843 0, |
|
844 KErrCorrupt |
|
845 }, |
|
846 { |
|
847 // 0x04 - Command performed successfully, but requested icon could not be displayed; |
|
848 RSat::KSuccessRequestedIconNotDisplayed, |
|
849 RSat::KNoAdditionalInfo, |
|
850 ETrue, |
|
851 0, |
|
852 KErrNone |
|
853 }, |
|
854 { |
|
855 // 0x05 - Command performed, but modified by call control by NAA; |
|
856 RSat::KModifiedByCallControl, |
|
857 RSat::KNoAdditionalInfo, |
|
858 ETrue, |
|
859 0, |
|
860 KErrCorrupt |
|
861 }, |
|
862 { |
|
863 // 0x06 - Command performed successfully, limited service; |
|
864 RSat::KSuccessLimitedService, |
|
865 RSat::KNoAdditionalInfo, |
|
866 ETrue, |
|
867 0, |
|
868 KErrCorrupt |
|
869 }, |
|
870 { |
|
871 // 0x07 - Command performed with modification; |
|
872 RSat::KPerformedWithModifications, |
|
873 RSat::KNoAdditionalInfo, |
|
874 ETrue, |
|
875 0, |
|
876 KErrNone |
|
877 }, |
|
878 { |
|
879 // 0x08 - REFRESH performed but indicated NAA was not active; |
|
880 RSat::KRefreshUSIMNotActive, |
|
881 RSat::KNoAdditionalInfo, |
|
882 ETrue, |
|
883 0, |
|
884 KErrNone |
|
885 }, |
|
886 { |
|
887 // 0x09 - Command performed successfully, tone not played; |
|
888 RSat::KPlayTonePerformedSuccessfully, |
|
889 RSat::KNoAdditionalInfo, |
|
890 ETrue, |
|
891 0, |
|
892 KErrCorrupt |
|
893 }, |
|
894 { |
|
895 // 0x10 - Proactive UICC session terminated by the user; |
|
896 RSat::KPSessionTerminatedByUser, |
|
897 RSat::KNoAdditionalInfo, |
|
898 ETrue, |
|
899 0, |
|
900 KErrNone |
|
901 }, |
|
902 { |
|
903 // 0x11 - Backward move in the proactive UICC session requested by the user; |
|
904 RSat::KBackwardModeRequestedByUser, |
|
905 RSat::KNoAdditionalInfo, |
|
906 ETrue, |
|
907 0, |
|
908 KErrCorrupt |
|
909 }, |
|
910 { |
|
911 // 0x12 - No response from user; |
|
912 RSat::KNoResponseFromUser, |
|
913 RSat::KNoAdditionalInfo, |
|
914 ETrue, |
|
915 0, |
|
916 KErrCorrupt |
|
917 }, |
|
918 { |
|
919 // 0x13 - Help information required by the user; |
|
920 RSat::KHelpRequestedByUser, |
|
921 RSat::KNoAdditionalInfo, |
|
922 ETrue, |
|
923 0, |
|
924 KErrCorrupt |
|
925 }, |
|
926 { |
|
927 // 0x14 - reserved for GSM/3G. |
|
928 RSat::KUssdTransactionTerminatedByUser, |
|
929 RSat::KNoAdditionalInfo, |
|
930 ETrue, |
|
931 0, |
|
932 KErrCorrupt |
|
933 }, |
|
934 { |
|
935 // 0x20 - terminal currently unable to process command; |
|
936 RSat::KMeUnableToProcessCmd, |
|
937 RSat::KMeProblem, |
|
938 EFalse, |
|
939 0, |
|
940 KErrNone |
|
941 }, |
|
942 { |
|
943 // 0x20 without additional information (erroneous) |
|
944 RSat::KMeUnableToProcessCmd, |
|
945 RSat::KMeProblem, |
|
946 ETrue, // Intentional error ! |
|
947 0, |
|
948 KErrCorrupt |
|
949 }, |
|
950 { |
|
951 // 0x21 - Network currently unable to process command; |
|
952 RSat::KNetworkUnableToProcessCmd, |
|
953 RSat::KSatNetworkErrorInfo, |
|
954 EFalse, |
|
955 0, |
|
956 KErrNone |
|
957 }, |
|
958 { |
|
959 // 0x22 - User did not accept the proactive command; |
|
960 RSat::KPCmdNotAcceptedByUser, |
|
961 RSat::KNoAdditionalInfo, |
|
962 ETrue, |
|
963 0, |
|
964 KErrNone |
|
965 }, |
|
966 { |
|
967 // 0x23 - User cleared down call before connection or network release; |
|
968 RSat::KCallClearedBeforeConnectionOrReleased, |
|
969 RSat::KNoAdditionalInfo, |
|
970 EFalse, |
|
971 0, |
|
972 KErrCorrupt |
|
973 }, |
|
974 { |
|
975 // 0x24 - Action in contradiction with the current timer state; |
|
976 RSat::KContradictionWithTimerState, |
|
977 RSat::KNoAdditionalInfo, |
|
978 EFalse, |
|
979 0, |
|
980 KErrCorrupt |
|
981 }, |
|
982 { |
|
983 // 0x25 - Interaction with call control by NAA, temporary problem; |
|
984 RSat::KInteractionWithCCTemporaryError, |
|
985 RSat::KNoAdditionalInfo, |
|
986 EFalse, |
|
987 0, |
|
988 KErrNone |
|
989 }, |
|
990 { |
|
991 // 0x26 - Launch browser generic error code; |
|
992 RSat::KLaunchBrowserError, |
|
993 RSat::KMeProblem, |
|
994 EFalse, |
|
995 RSat::KNoSpecificBrowserError, |
|
996 KErrCorrupt |
|
997 }, |
|
998 { |
|
999 // 0x27 - MMS temporary problem. |
|
1000 RSat::KMMSTemporaryProblem, |
|
1001 RSat::KNoAdditionalInfo, |
|
1002 EFalse, |
|
1003 0, |
|
1004 KErrCorrupt |
|
1005 }, |
|
1006 { |
|
1007 // 0x30 - Command beyond terminal's capabilities; |
|
1008 RSat::KCmdBeyondMeCapabilities, |
|
1009 RSat::KNoAdditionalInfo, |
|
1010 EFalse, |
|
1011 0, |
|
1012 KErrNone |
|
1013 }, |
|
1014 { |
|
1015 // 0x31 - Command type not understood by terminal; |
|
1016 RSat::KCmdTypeNotUnderstood, |
|
1017 RSat::KNoAdditionalInfo, |
|
1018 EFalse, |
|
1019 0, |
|
1020 KErrNone |
|
1021 }, |
|
1022 { |
|
1023 // 0x32 - Command data not understood by terminal; |
|
1024 RSat::KCmdDataNotUnderstood, |
|
1025 RSat::KNoAdditionalInfo, |
|
1026 EFalse, |
|
1027 0, |
|
1028 KErrNone |
|
1029 }, |
|
1030 { |
|
1031 // 0x33 - Command number not known by terminal; |
|
1032 RSat::KCmdNumberNotKnown, |
|
1033 RSat::KNoAdditionalInfo, |
|
1034 EFalse, |
|
1035 0, |
|
1036 KErrNone |
|
1037 }, |
|
1038 { |
|
1039 // 0x34 - reserved for GSM/3G; |
|
1040 RSat::KSsReturnError, |
|
1041 RSat::KNoAdditionalInfo, |
|
1042 ETrue, |
|
1043 0, |
|
1044 KErrCorrupt |
|
1045 }, |
|
1046 { |
|
1047 // 0x35 - reserved for GSM/3G; |
|
1048 RSat::KSmsRpError, |
|
1049 RSat::KNoAdditionalInfo, |
|
1050 ETrue, |
|
1051 0, |
|
1052 KErrCorrupt |
|
1053 }, |
|
1054 { |
|
1055 // 0x36 - Error, required values are missing; |
|
1056 RSat::KErrorRequiredValuesMissing, |
|
1057 RSat::KNoAdditionalInfo, |
|
1058 ETrue, |
|
1059 0, |
|
1060 KErrNone |
|
1061 }, |
|
1062 { |
|
1063 // 0x37 - reserved for GSM/3G; |
|
1064 RSat::KUssdReturnError, |
|
1065 RSat::KNoAdditionalInfo, |
|
1066 ETrue, |
|
1067 0, |
|
1068 KErrCorrupt |
|
1069 }, |
|
1070 { |
|
1071 // 0x38 - MultipleCard commands error; |
|
1072 RSat::KMultipleCardCmdsError, |
|
1073 RSat::KMeProblem, |
|
1074 EFalse, |
|
1075 RSat::KNoSpecificMultiCardError, |
|
1076 KErrCorrupt |
|
1077 }, |
|
1078 { |
|
1079 // 0x39 - Interaction with call control by NAA, permanent problem; |
|
1080 RSat::KInteractionWithCCPermanentError, |
|
1081 RSat::KMeProblem, |
|
1082 EFalse, |
|
1083 RSat::KNoSpecificInteractionError, |
|
1084 KErrCorrupt |
|
1085 }, |
|
1086 { |
|
1087 // 0x3A - Bearer Independent Protocol error; |
|
1088 RSat::KBearerIndepProtocolError, |
|
1089 RSat::KMeProblem, |
|
1090 EFalse, |
|
1091 RSat::KNoSpecificBIPError, |
|
1092 KErrNone |
|
1093 }, |
|
1094 { |
|
1095 // 0x3A without additional information (erroneous) |
|
1096 RSat::KBearerIndepProtocolError, |
|
1097 RSat::KMeProblem, |
|
1098 ETrue, // Intentional error |
|
1099 0, |
|
1100 KErrCorrupt |
|
1101 }, |
|
1102 { |
|
1103 // 0x3B - Access Technology unable to process command; |
|
1104 RSat::KAccessTechUnableProcessCmd, |
|
1105 RSat::KNoAdditionalInfo, |
|
1106 EFalse, |
|
1107 0, |
|
1108 KErrNone |
|
1109 }, |
|
1110 { |
|
1111 // 0x3C - Frames error; |
|
1112 RSat::KFramesError, |
|
1113 RSat::KMeProblem, |
|
1114 EFalse, |
|
1115 RSat::KNoSpecificCauseCanBeGiven, |
|
1116 KErrNone |
|
1117 }, |
|
1118 { |
|
1119 // 0x3D - MMS Error. |
|
1120 RSat::KMMSError, |
|
1121 RSat::KNoAdditionalInfo, |
|
1122 EFalse, |
|
1123 0, |
|
1124 KErrCorrupt |
|
1125 } |
|
1126 }; |
|
1127 |
|
1128 const TInt KNumberOfResponsesToTest = sizeof(KResponsesToTest)/ sizeof(KResponsesToTest[0]); |
|
1129 |
|
1130 TTlv tlv; |
|
1131 PrepareTlv( tlv, KCmdQualifier, KInternationalNumIsdn, _L8("112233445566778"), KBipDefaultBearer); |
|
1132 |
|
1133 TDesC8* tlvDscPtr = &const_cast<TDesC8&>(tlv.End()); |
|
1134 TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr); |
|
1135 |
|
1136 TRequestStatus notifyStatus; |
|
1137 ReinitChannel(iOpenCsChannel); |
|
1138 RSat::TOpenCsChannelV2Pckg csChanPck(iOpenCsChannel); |
|
1139 |
|
1140 TTlv termRespAddInfo; |
|
1141 termRespAddInfo.AddTag( KTlvBufferSizeTag ); |
|
1142 termRespAddInfo.AddByte( TUint8( ( KBufferSize & 0xFF00 ) >> 8 ) ); |
|
1143 termRespAddInfo.AddByte( TUint8( KBufferSize & 0x00FF ) ); |
|
1144 const TDesC8* tlvAddPtr = &termRespAddInfo.GetDataWithoutTopLevelTag(); |
|
1145 |
|
1146 for(TInt i = 0; i <= KNumberOfResponsesToTest; i++) |
|
1147 { |
|
1148 // notify request |
|
1149 PrepareAndCompleteDispatchL( *tlvDscPtr ); |
|
1150 iSat.NotifyOpenChannelPCmd(notifyStatus, csChanPck); |
|
1151 User::WaitForRequest(notifyStatus); |
|
1152 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
1153 |
|
1154 AssertMockLtsyStatusL(); |
|
1155 |
|
1156 // now test a "TERMINAL RESPONSE" specific to this loop |
|
1157 RSat::TOpenChannelRspV2 rsp; |
|
1158 RSat::TOpenChannelRspV2Pckg rspPckg(rsp); |
|
1159 rsp.SetPCmdNumber(KCmdId); |
|
1160 rsp.iBufferSize = KBufferSize; |
|
1161 |
|
1162 if(i < KNumberOfResponsesToTest) |
|
1163 { |
|
1164 // looping through KResponsesToTest table |
|
1165 rsp.iGeneralResult = KResponsesToTest[i].iGeneralResult; |
|
1166 rsp.iInfoType = KResponsesToTest[i].iInfoType; |
|
1167 if(rsp.iInfoType != RSat::KNoAdditionalInfo && |
|
1168 !KResponsesToTest[i].iIntentionallyOmmitAdditionalInfo) |
|
1169 { |
|
1170 rsp.iAdditionalInfo.Append(KResponsesToTest[i].iAdditionalInfo); |
|
1171 } |
|
1172 GenerateTerminalResponseL(KCmdId, KOpenChannel, KCmdQualifier, |
|
1173 RSat::EOpenChannelCs, rspPckg, rsp.iAdditionalInfo, |
|
1174 rsp.iGeneralResult, *tlvAddPtr, KResponsesToTest[i].iExpectedResult); |
|
1175 } |
|
1176 else |
|
1177 { |
|
1178 // now tell Mock to return KErrUnknown when dispatching forthcoming RSat::TerminalRsp() |
|
1179 rsp.iGeneralResult = RSat::KSuccess; |
|
1180 rsp.iInfoType = RSat::KNoAdditionalInfo; |
|
1181 |
|
1182 PrepareTerminalResponseMockDataL( KCmdId, KOpenChannel, KCmdQualifier, |
|
1183 rsp.iAdditionalInfo, rsp.iGeneralResult, *tlvAddPtr, KErrUnknown); |
|
1184 |
|
1185 TerminalResponseL( RSat::EOpenChannelCs, rspPckg, KErrUnknown); |
|
1186 } |
|
1187 |
|
1188 AssertMockLtsyStatusL(); |
|
1189 } |
|
1190 } |
|
1191 |