|
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 GetChannelStatus 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 |
|
38 #include "ccsatgetchannelstatusfu.h" |
|
39 |
|
40 const TUint KDelay = 10; |
|
41 const TUint8 KCmdId = 1; |
|
42 const TUint8 KCmdQualifier = 0x00; |
|
43 const TUint8 KNoChannelStatusByte1 = 0x00; |
|
44 const TUint8 KChannelStatusByte2 = 0x00; |
|
45 const TUint8 KChannel1StatusOk = 0x81; |
|
46 |
|
47 CTestSuite* CCSatGetChannelStatusFU::CreateSuiteL(const TDesC& aName) |
|
48 { |
|
49 SUB_SUITE; |
|
50 |
|
51 ADD_TEST_STEP_ISO_CPP(CCSatGetChannelStatusFU, TestNotifyGetChannelStatusPCmd0001L); |
|
52 ADD_TEST_STEP_ISO_CPP(CCSatGetChannelStatusFU, TestNotifyGetChannelStatusPCmd0002L); |
|
53 ADD_TEST_STEP_ISO_CPP(CCSatGetChannelStatusFU, TestNotifyGetChannelStatusPCmd0004L); |
|
54 |
|
55 END_SUITE; |
|
56 } |
|
57 |
|
58 |
|
59 // |
|
60 // Actual test cases |
|
61 // |
|
62 |
|
63 |
|
64 /** |
|
65 @SYMTestCaseID BA-CSAT-CHAN-SGCHANSPC-0001 |
|
66 @SYMPREQ 1780 |
|
67 @SYMComponent telephony_ctsy |
|
68 @SYMTestCaseDesc Test support in CTSY for RSat::NotifyGetChannelStatusPCmd |
|
69 @SYMTestPriority High |
|
70 @SYMTestActions Invokes RSat::NotifyGetChannelStatusPCmd |
|
71 @SYMTestExpectedResults Pass |
|
72 @SYMTestType CT |
|
73 */ |
|
74 void CCSatGetChannelStatusFU::TestNotifyGetChannelStatusPCmd0001L() |
|
75 { |
|
76 OpenEtelServerL(EUseExtendedError); |
|
77 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
78 OpenPhoneL(); |
|
79 OpenSatL(); |
|
80 |
|
81 RBuf8 data; |
|
82 CleanupClosePushL(data); |
|
83 |
|
84 TTlv tlv; |
|
85 |
|
86 PrepareTlv( tlv ); |
|
87 TDesC8* tlvDscPtr = &const_cast<TDesC8&>(tlv.End()); |
|
88 TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr); |
|
89 |
|
90 TRequestStatus notifyStatus; |
|
91 RSat::TGetChannelStatusV2 chan; |
|
92 RSat::TGetChannelStatusV2Pckg chanPck(chan); |
|
93 |
|
94 //------------------------------------------------------------------------- |
|
95 // TEST C: Successful completion request of RSat::NotifyGetChannelStatusPCmd, |
|
96 // no channel connected, passing no data about channels |
|
97 //------------------------------------------------------------------------- |
|
98 PrepareDispatchL(); |
|
99 |
|
100 iSat.NotifyGetChannelStatusPCmd(notifyStatus, chanPck); |
|
101 |
|
102 CompleteDispatchL( *tlvDscPtr ); |
|
103 |
|
104 User::WaitForRequest(notifyStatus); |
|
105 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
106 ASSERT_EQUALS( KCmdId, chan.PCmdNumber()); |
|
107 |
|
108 //terminal response |
|
109 RSat::TGetChannelStatusRspV2 terminalRsp; |
|
110 RSat::TGetChannelStatusRspV2Pckg terminalRspPckg(terminalRsp); |
|
111 terminalRsp.SetPCmdNumber(KCmdId); |
|
112 terminalRsp.iGeneralResult = RSat::KSuccess; |
|
113 terminalRsp.iInfoType = RSat::KNoAdditionalInfo; |
|
114 terminalRsp.iAdditionalInfo = KNullDesC; |
|
115 |
|
116 GenerateTerminalResponseL(KCmdId, KGetChannelStatus, KCmdQualifier, |
|
117 RSat::EGetChannelStatus, terminalRspPckg, terminalRsp.iAdditionalInfo, |
|
118 terminalRsp.iGeneralResult); |
|
119 |
|
120 AssertMockLtsyStatusL(); |
|
121 |
|
122 //------------------------------------------------------------------------- |
|
123 // TEST C2: Successful completion request of RSat::NotifyGetChannelStatusPCmd, |
|
124 // no channel connected, passing "No Channel available" |
|
125 //------------------------------------------------------------------------- |
|
126 PrepareDispatchL(); |
|
127 |
|
128 iSat.NotifyGetChannelStatusPCmd(notifyStatus, chanPck); |
|
129 |
|
130 CompleteDispatchL( *tlvDscPtr ); |
|
131 |
|
132 User::WaitForRequest(notifyStatus); |
|
133 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
134 ASSERT_EQUALS( KCmdId, chan.PCmdNumber()); |
|
135 |
|
136 //terminal response |
|
137 terminalRsp.iInfoType = RSat::KChannelStatusInfo; |
|
138 terminalRsp.iAdditionalInfo.Append(KNoChannelStatusByte1); |
|
139 terminalRsp.iAdditionalInfo.Append(KChannelStatusByte2); |
|
140 |
|
141 TTlv termRespAddInfo; |
|
142 termRespAddInfo.AddTag( KTlvChannelStatusTag ); |
|
143 termRespAddInfo.AddByte(KNoChannelStatusByte1); |
|
144 termRespAddInfo.AddByte(KNoChannelStatusByte1); |
|
145 |
|
146 GenerateTerminalResponseL(KCmdId, KGetChannelStatus, KCmdQualifier, |
|
147 RSat::EGetChannelStatus, terminalRspPckg, KNullDesC, |
|
148 terminalRsp.iGeneralResult, termRespAddInfo.GetDataWithoutTopLevelTag()); |
|
149 |
|
150 AssertMockLtsyStatusL(); |
|
151 |
|
152 //------------------------------------------------------------------------- |
|
153 // TEST C3: Successful completion request of RSat::NotifyGetChannelStatusPCmd, |
|
154 // Channel 1 connected |
|
155 //------------------------------------------------------------------------- |
|
156 PrepareDispatchL(); |
|
157 |
|
158 iSat.NotifyGetChannelStatusPCmd(notifyStatus, chanPck); |
|
159 |
|
160 CompleteDispatchL( *tlvDscPtr ); |
|
161 |
|
162 User::WaitForRequest(notifyStatus); |
|
163 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
164 ASSERT_EQUALS( KCmdId, chan.PCmdNumber()); |
|
165 |
|
166 //terminal response |
|
167 terminalRsp.iInfoType = RSat::KChannelStatusInfo; |
|
168 terminalRsp.iAdditionalInfo.Zero(); |
|
169 terminalRsp.iAdditionalInfo.Append(KChannel1StatusOk); |
|
170 terminalRsp.iAdditionalInfo.Append(KChannelStatusByte2); |
|
171 |
|
172 termRespAddInfo.Begin(KTlvChannelStatusTag); |
|
173 termRespAddInfo.AddByte(KChannel1StatusOk); |
|
174 termRespAddInfo.AddByte(KChannelStatusByte2); |
|
175 |
|
176 GenerateTerminalResponseL(KCmdId, KGetChannelStatus, KCmdQualifier, |
|
177 RSat::EGetChannelStatus, terminalRspPckg, KNullDesC, |
|
178 terminalRsp.iGeneralResult, termRespAddInfo.GetDataWithoutTopLevelTag()); |
|
179 |
|
180 AssertMockLtsyStatusL(); |
|
181 |
|
182 //------------------------------------------------------------------------- |
|
183 // TEST C4: Testing all variants of terminal response |
|
184 //------------------------------------------------------------------------- |
|
185 |
|
186 DoTestTerminalResponseL(); |
|
187 |
|
188 //------------------------------------------------------------------------- |
|
189 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
190 //------------------------------------------------------------------------- |
|
191 PrepareDispatchL(); |
|
192 |
|
193 iSat.NotifyGetChannelStatusPCmd(notifyStatus, chanPck); |
|
194 |
|
195 CompleteDispatchL( *tlvDscPtr, KErrUnknown ); |
|
196 |
|
197 User::WaitForRequest(notifyStatus); |
|
198 ASSERT_EQUALS(KErrUnknown, notifyStatus.Int()); |
|
199 |
|
200 AssertMockLtsyStatusL(); |
|
201 |
|
202 //------------------------------------------------------------------------- |
|
203 // TEST E: Unsolicited completion of RSat::NotifyGetChannelStatusPCmd from LTSY. |
|
204 //------------------------------------------------------------------------- |
|
205 TRequestStatus mockLtsyStatus; |
|
206 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
207 |
|
208 tlvDscPack.SerialiseL(data); |
|
209 iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, KErrNone, data, KDelay); |
|
210 |
|
211 RSat::TAdditionalInfo addInfo; |
|
212 addInfo.Append(RSat::KNoSpecificMeProblem); |
|
213 |
|
214 |
|
215 PrepareTerminalResponseMockDataL( KCmdId, KGetChannelStatus, KCmdQualifier, |
|
216 addInfo, RSat::KMeUnableToProcessCmd, KNullDesC8); |
|
217 |
|
218 User::WaitForRequest(mockLtsyStatus); |
|
219 AssertMockLtsyStatusL(); |
|
220 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
221 |
|
222 CleanupStack::PopAndDestroy(2, this); // data, this |
|
223 } |
|
224 |
|
225 |
|
226 /** |
|
227 @SYMTestCaseID BA-CSAT-CHAN-SGCHANSPC-0002 |
|
228 @SYMPREQ 1780 |
|
229 @SYMComponent telephony_ctsy |
|
230 @SYMTestCaseDesc Test support in CTSY for cancelling of RSat::NotifyGetChannelStatusPCmd |
|
231 @SYMTestPriority High |
|
232 @SYMTestActions Invokes cancelling of RSat::NotifyGetChannelStatusPCmd |
|
233 @SYMTestExpectedResults Pass |
|
234 @SYMTestType CT |
|
235 */ |
|
236 void CCSatGetChannelStatusFU::TestNotifyGetChannelStatusPCmd0002L() |
|
237 { |
|
238 OpenEtelServerL(EUseExtendedError); |
|
239 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
240 OpenPhoneL(); |
|
241 OpenSatL(); |
|
242 |
|
243 TRequestStatus notifyStatus; |
|
244 RSat::TGetChannelStatusV2 chan; |
|
245 RSat::TGetChannelStatusV2Pckg chanPck(chan); |
|
246 |
|
247 PrepareDispatchL( ); |
|
248 |
|
249 iSat.NotifyGetChannelStatusPCmd(notifyStatus, chanPck); |
|
250 |
|
251 iSat.CancelAsyncRequest(ESatNotifyGetChannelStatusPCmd); |
|
252 |
|
253 User::WaitForRequest(notifyStatus); |
|
254 ASSERT_EQUALS(KErrCancel, notifyStatus.Int()); |
|
255 |
|
256 AssertMockLtsyStatusL(); |
|
257 |
|
258 CleanupStack::PopAndDestroy(1, this); |
|
259 } |
|
260 |
|
261 |
|
262 /** |
|
263 @SYMTestCaseID BA-CSAT-CHAN-SGCHANSPC-0004 |
|
264 @SYMPREQ 1780 |
|
265 @SYMComponent telephony_ctsy |
|
266 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RSat::NotifyGetChannelStatusPCmd |
|
267 @SYMTestPriority High |
|
268 @SYMTestActions Invokes multiple client requests to RSat::NotifyGetChannelStatusPCmd |
|
269 @SYMTestExpectedResults Pass |
|
270 @SYMTestType CT |
|
271 */ |
|
272 void CCSatGetChannelStatusFU::TestNotifyGetChannelStatusPCmd0004L() |
|
273 { |
|
274 OpenEtelServerL(EUseExtendedError); |
|
275 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
276 OpenPhoneL(); |
|
277 OpenSatL(); |
|
278 |
|
279 // Open second client |
|
280 RTelServer telServer2; |
|
281 TInt ret = telServer2.Connect(); |
|
282 ASSERT_EQUALS(KErrNone, ret); |
|
283 CleanupClosePushL(telServer2); |
|
284 |
|
285 RMobilePhone phone2; |
|
286 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
|
287 ASSERT_EQUALS(KErrNone, ret); |
|
288 CleanupClosePushL(phone2); |
|
289 |
|
290 RSat sat2; |
|
291 User::LeaveIfError(sat2.Open(phone2)); |
|
292 CleanupClosePushL(sat2); |
|
293 |
|
294 TTlv tlv; |
|
295 |
|
296 PrepareTlv( tlv ); |
|
297 |
|
298 TRequestStatus notifyStatus; |
|
299 RSat::TGetChannelStatusV2 chan; |
|
300 RSat::TGetChannelStatusV2Pckg chanPck(chan); |
|
301 |
|
302 PrepareDispatchL(); |
|
303 |
|
304 iSat.NotifyGetChannelStatusPCmd(notifyStatus, chanPck); |
|
305 |
|
306 CompleteDispatchL( tlv.End() ); |
|
307 |
|
308 TRequestStatus notifyStatus2; |
|
309 RSat::TGetChannelStatusV2 chan2; |
|
310 RSat::TGetChannelStatusV2Pckg chanPck2(chan2); |
|
311 |
|
312 sat2.NotifyGetChannelStatusPCmd(notifyStatus2, chanPck2); |
|
313 |
|
314 User::WaitForRequest(notifyStatus); |
|
315 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
316 ASSERT_EQUALS( KCmdId, chan.PCmdNumber()); |
|
317 |
|
318 User::WaitForRequest(notifyStatus2); |
|
319 |
|
320 //probably «KErrServerBusy?is more appropriate result here |
|
321 ASSERT_EQUALS(KErrNone, notifyStatus2.Int()); |
|
322 ASSERT_EQUALS( KCmdId, chan2.PCmdNumber()); |
|
323 |
|
324 AssertMockLtsyStatusL(); |
|
325 |
|
326 CleanupStack::PopAndDestroy(4, this); |
|
327 } |
|
328 |
|
329 /** |
|
330 * prepare tlv buffer for GetChannelStatus proactive command |
|
331 * @param aTlv - tlv buffer to prepare |
|
332 */ |
|
333 void CCSatGetChannelStatusFU::PrepareTlv(TTlv& aTlv ) |
|
334 { |
|
335 aTlv.Begin(KBerTlvProactiveSimCommandTag); |
|
336 aTlv.AddTag(KTlvCommandDetailsTag); |
|
337 aTlv.AddByte(KCmdId);//ETLV_CommandNumber |
|
338 aTlv.AddByte(KGetChannelStatus); //ETLV_TypeOfCommand |
|
339 aTlv.AddByte(KCmdQualifier); //ETLV_CommandQualifier |
|
340 |
|
341 aTlv.AddTag(KTlvDeviceIdentityTag); |
|
342 aTlv.AddByte(KSim); //ETLV_SourceDeviceIdentity |
|
343 aTlv.AddByte(KMe); //ETLV_DestinationDeviceIdentity |
|
344 } |
|
345 |
|
346 /** |
|
347 * prepare mock for processing of proactive command |
|
348 * @param aTlvDsc - tlv buffer to send |
|
349 * @param aRes - result for request completion |
|
350 */ |
|
351 void CCSatGetChannelStatusFU::CompleteDispatchL(TPtrC8 aTlvDsc, TInt aRes) |
|
352 { |
|
353 RBuf8 data; |
|
354 CleanupClosePushL(data); |
|
355 |
|
356 TDesC8* tlvDscPtr = &aTlvDsc; |
|
357 TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr); |
|
358 |
|
359 tlvDscPack.SerialiseL(data); |
|
360 iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, aRes, data, KDelay); |
|
361 |
|
362 CleanupStack::PopAndDestroy(1); |
|
363 } |
|
364 |
|
365 /** |
|
366 * prepare complete for dispatch of sat notification |
|
367 */ |
|
368 void CCSatGetChannelStatusFU::PrepareDispatchL() |
|
369 { |
|
370 RBuf8 data; |
|
371 CleanupClosePushL(data); |
|
372 |
|
373 TUint8 pcmdCode = KGetChannelStatus; |
|
374 TMockLtsyData1<TUint8> expLtsyData(pcmdCode); |
|
375 expLtsyData.SerialiseL(data); |
|
376 |
|
377 iMockLTSY.ExpectL(MLtsyDispatchSatPCmdNotification::KLtsyDispatchSatPCmdNotificationApiId,data); |
|
378 |
|
379 CleanupStack::PopAndDestroy(1); |
|
380 } |
|
381 |
|
382 |
|
383 /** |
|
384 * Tests all possible "TERMINAL RESPONSE" cases. |
|
385 * API should return KErrNone for all valid responses and KErrCorrupt |
|
386 * for those that can not be used with "Get Channel Status" command |
|
387 */ |
|
388 void CCSatGetChannelStatusFU::DoTestTerminalResponseL() |
|
389 { |
|
390 static const struct |
|
391 { |
|
392 RSat::TPCmdResult iGeneralResult; |
|
393 RSat::TAdditionalInfoType iInfoType; |
|
394 TBool iIntentionallyOmmitAdditionalInfo; |
|
395 TUint8 iAdditionalInfo; |
|
396 TInt iExpectedResult; |
|
397 } |
|
398 KResponsesToTest[] = |
|
399 { |
|
400 { |
|
401 // 0x01 - Command performed with partial comprehension; |
|
402 RSat::KPartialComprehension, |
|
403 RSat::KNoAdditionalInfo, |
|
404 ETrue, |
|
405 0, |
|
406 KErrNone |
|
407 }, |
|
408 { |
|
409 // 0x02 - Command performed, with missing information; |
|
410 RSat::KMissingInformation, |
|
411 RSat::KNoAdditionalInfo, |
|
412 ETrue, |
|
413 0, |
|
414 KErrNone |
|
415 }, |
|
416 { |
|
417 // 0x03 - REFRESH performed with additional EFs read; |
|
418 RSat::KRefreshAdditionEFRead, |
|
419 RSat::KNoAdditionalInfo, |
|
420 ETrue, |
|
421 0, |
|
422 KErrCorrupt |
|
423 }, |
|
424 { |
|
425 // 0x04 - Command performed successfully, but requested icon could not be displayed; |
|
426 RSat::KSuccessRequestedIconNotDisplayed, |
|
427 RSat::KNoAdditionalInfo, |
|
428 ETrue, |
|
429 0, |
|
430 KErrNone |
|
431 }, |
|
432 { |
|
433 // 0x05 - Command performed, but modified by call control by NAA; |
|
434 RSat::KModifiedByCallControl, |
|
435 RSat::KNoAdditionalInfo, |
|
436 ETrue, |
|
437 0, |
|
438 KErrCorrupt |
|
439 }, |
|
440 { |
|
441 // 0x06 - Command performed successfully, limited service; |
|
442 RSat::KSuccessLimitedService, |
|
443 RSat::KNoAdditionalInfo, |
|
444 ETrue, |
|
445 0, |
|
446 KErrCorrupt |
|
447 }, |
|
448 { |
|
449 // 0x07 - Command performed with modification; |
|
450 RSat::KPerformedWithModifications, |
|
451 RSat::KNoAdditionalInfo, |
|
452 ETrue, |
|
453 0, |
|
454 KErrCorrupt |
|
455 }, |
|
456 { |
|
457 // 0x08 - REFRESH performed but indicated NAA was not active; |
|
458 RSat::KRefreshUSIMNotActive, |
|
459 RSat::KNoAdditionalInfo, |
|
460 ETrue, |
|
461 0, |
|
462 KErrCorrupt |
|
463 }, |
|
464 { |
|
465 // 0x09 - Command performed successfully, tone not played; |
|
466 RSat::KPlayTonePerformedSuccessfully, |
|
467 RSat::KNoAdditionalInfo, |
|
468 ETrue, |
|
469 0, |
|
470 KErrCorrupt |
|
471 }, |
|
472 { |
|
473 // 0x10 - Proactive UICC session terminated by the user; |
|
474 RSat::KPSessionTerminatedByUser, |
|
475 RSat::KNoAdditionalInfo, |
|
476 ETrue, |
|
477 0, |
|
478 KErrNone |
|
479 }, |
|
480 { |
|
481 // 0x11 - Backward move in the proactive UICC session requested by the user; |
|
482 RSat::KBackwardModeRequestedByUser, |
|
483 RSat::KNoAdditionalInfo, |
|
484 ETrue, |
|
485 0, |
|
486 KErrCorrupt |
|
487 }, |
|
488 { |
|
489 // 0x12 - No response from user; |
|
490 RSat::KNoResponseFromUser, |
|
491 RSat::KNoAdditionalInfo, |
|
492 ETrue, |
|
493 0, |
|
494 KErrCorrupt |
|
495 }, |
|
496 { |
|
497 // 0x13 - Help information required by the user; |
|
498 RSat::KHelpRequestedByUser, |
|
499 RSat::KNoAdditionalInfo, |
|
500 ETrue, |
|
501 0, |
|
502 KErrCorrupt |
|
503 }, |
|
504 { |
|
505 // 0x14 - reserved for GSM/3G. |
|
506 RSat::KUssdTransactionTerminatedByUser, |
|
507 RSat::KNoAdditionalInfo, |
|
508 ETrue, |
|
509 0, |
|
510 KErrCorrupt |
|
511 }, |
|
512 { |
|
513 // 0x20 - terminal currently unable to process command; |
|
514 RSat::KMeUnableToProcessCmd, |
|
515 RSat::KNoAdditionalInfo, |
|
516 ETrue, |
|
517 0, |
|
518 KErrNone |
|
519 }, |
|
520 { |
|
521 // 0x21 - Network currently unable to process command; |
|
522 RSat::KNetworkUnableToProcessCmd, |
|
523 RSat::KNoAdditionalInfo, |
|
524 EFalse, |
|
525 0, |
|
526 KErrCorrupt |
|
527 }, |
|
528 { |
|
529 // 0x22 - User did not accept the proactive command; |
|
530 RSat::KPCmdNotAcceptedByUser, |
|
531 RSat::KNoAdditionalInfo, |
|
532 ETrue, |
|
533 0, |
|
534 KErrCorrupt |
|
535 }, |
|
536 { |
|
537 // 0x23 - User cleared down call before connection or network release; |
|
538 RSat::KCallClearedBeforeConnectionOrReleased, |
|
539 RSat::KNoAdditionalInfo, |
|
540 EFalse, |
|
541 0, |
|
542 KErrCorrupt |
|
543 }, |
|
544 { |
|
545 // 0x24 - Action in contradiction with the current timer state; |
|
546 RSat::KContradictionWithTimerState, |
|
547 RSat::KNoAdditionalInfo, |
|
548 EFalse, |
|
549 0, |
|
550 KErrCorrupt |
|
551 }, |
|
552 { |
|
553 // 0x25 - Interaction with call control by NAA, temporary problem; |
|
554 RSat::KInteractionWithCCTemporaryError, |
|
555 RSat::KNoAdditionalInfo, |
|
556 EFalse, |
|
557 0, |
|
558 KErrCorrupt |
|
559 }, |
|
560 { |
|
561 // 0x26 - Launch browser generic error code; |
|
562 RSat::KLaunchBrowserError, |
|
563 RSat::KNoAdditionalInfo, |
|
564 EFalse, |
|
565 0, |
|
566 KErrCorrupt |
|
567 }, |
|
568 { |
|
569 // 0x27 - MMS temporary problem. |
|
570 RSat::KMMSTemporaryProblem, |
|
571 RSat::KNoAdditionalInfo, |
|
572 EFalse, |
|
573 0, |
|
574 KErrCorrupt |
|
575 }, |
|
576 { |
|
577 // 0x30 - Command beyond terminal's capabilities; |
|
578 RSat::KCmdBeyondMeCapabilities, |
|
579 RSat::KNoAdditionalInfo, |
|
580 EFalse, |
|
581 0, |
|
582 KErrNone |
|
583 }, |
|
584 { |
|
585 // 0x31 - Command type not understood by terminal; |
|
586 RSat::KCmdTypeNotUnderstood, |
|
587 RSat::KNoAdditionalInfo, |
|
588 EFalse, |
|
589 0, |
|
590 KErrNone |
|
591 }, |
|
592 { |
|
593 // 0x32 - Command data not understood by terminal; |
|
594 RSat::KCmdDataNotUnderstood, |
|
595 RSat::KNoAdditionalInfo, |
|
596 EFalse, |
|
597 0, |
|
598 KErrNone |
|
599 }, |
|
600 { |
|
601 // 0x33 - Command number not known by terminal; |
|
602 RSat::KCmdNumberNotKnown, |
|
603 RSat::KNoAdditionalInfo, |
|
604 EFalse, |
|
605 0, |
|
606 KErrNone |
|
607 }, |
|
608 { |
|
609 // 0x34 - reserved for GSM/3G; |
|
610 RSat::KSsReturnError, |
|
611 RSat::KNoAdditionalInfo, |
|
612 ETrue, |
|
613 0, |
|
614 KErrCorrupt |
|
615 }, |
|
616 { |
|
617 // 0x35 - reserved for GSM/3G; |
|
618 RSat::KSmsRpError, |
|
619 RSat::KNoAdditionalInfo, |
|
620 ETrue, |
|
621 0, |
|
622 KErrCorrupt |
|
623 }, |
|
624 { |
|
625 // 0x36 - Error, required values are missing; |
|
626 RSat::KErrorRequiredValuesMissing, |
|
627 RSat::KNoAdditionalInfo, |
|
628 ETrue, |
|
629 0, |
|
630 KErrNone |
|
631 }, |
|
632 { |
|
633 // 0x37 - reserved for GSM/3G; |
|
634 RSat::KUssdReturnError, |
|
635 RSat::KNoAdditionalInfo, |
|
636 ETrue, |
|
637 0, |
|
638 KErrCorrupt |
|
639 }, |
|
640 { |
|
641 // 0x38 - MultipleCard commands error; |
|
642 RSat::KMultipleCardCmdsError, |
|
643 RSat::KNoAdditionalInfo, |
|
644 EFalse, |
|
645 0, |
|
646 KErrCorrupt |
|
647 }, |
|
648 { |
|
649 // 0x39 - Interaction with call control by NAA, permanent problem; |
|
650 RSat::KInteractionWithCCPermanentError, |
|
651 RSat::KNoAdditionalInfo, |
|
652 EFalse, |
|
653 0, |
|
654 KErrCorrupt |
|
655 }, |
|
656 { |
|
657 // 0x3A - Bearer Independent Protocol error; |
|
658 RSat::KBearerIndepProtocolError, |
|
659 RSat::KNoAdditionalInfo, |
|
660 EFalse, |
|
661 0, |
|
662 KErrCorrupt |
|
663 }, |
|
664 { |
|
665 // 0x3B - Access Technology unable to process command; |
|
666 RSat::KAccessTechUnableProcessCmd, |
|
667 RSat::KNoAdditionalInfo, |
|
668 EFalse, |
|
669 0, |
|
670 KErrCorrupt |
|
671 }, |
|
672 { |
|
673 // 0x3C - Frames error; |
|
674 RSat::KFramesError, |
|
675 RSat::KNoAdditionalInfo, |
|
676 EFalse, |
|
677 0, |
|
678 KErrCorrupt |
|
679 }, |
|
680 { |
|
681 // 0x3D - MMS Error. |
|
682 RSat::KMMSError, |
|
683 RSat::KNoAdditionalInfo, |
|
684 EFalse, |
|
685 0, |
|
686 KErrCorrupt |
|
687 } |
|
688 }; |
|
689 |
|
690 const TInt KNumberOfResponsesToTest = sizeof(KResponsesToTest)/ sizeof(KResponsesToTest[0]); |
|
691 |
|
692 TTlv tlv; |
|
693 |
|
694 PrepareTlv( tlv ); |
|
695 TDesC8* tlvDscPtr = &const_cast<TDesC8&>(tlv.End()); |
|
696 TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr); |
|
697 |
|
698 TRequestStatus notifyStatus; |
|
699 RSat::TGetChannelStatusV2 chan; |
|
700 RSat::TGetChannelStatusV2Pckg chanPck(chan); |
|
701 |
|
702 for(TInt i = 0; i <= KNumberOfResponsesToTest; i++) |
|
703 { |
|
704 // notify request |
|
705 PrepareDispatchL(); |
|
706 iSat.NotifyGetChannelStatusPCmd(notifyStatus, chanPck); |
|
707 CompleteDispatchL( *tlvDscPtr ); |
|
708 User::WaitForRequest(notifyStatus); |
|
709 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
710 |
|
711 AssertMockLtsyStatusL(); |
|
712 |
|
713 // now test a "TERMINAL RESPONSE" specific to this loop |
|
714 RSat::RSat::TGetChannelStatusRspV2 rsp; |
|
715 RSat::RSat::TGetChannelStatusRspV2Pckg rspPckg(rsp); |
|
716 rsp.SetPCmdNumber(KCmdId); |
|
717 |
|
718 if(i < KNumberOfResponsesToTest) |
|
719 { |
|
720 // looping through KResponsesToTest table |
|
721 rsp.iGeneralResult = KResponsesToTest[i].iGeneralResult; |
|
722 rsp.iInfoType = KResponsesToTest[i].iInfoType; |
|
723 if(rsp.iInfoType != RSat::KNoAdditionalInfo && |
|
724 !KResponsesToTest[i].iIntentionallyOmmitAdditionalInfo) |
|
725 { |
|
726 rsp.iAdditionalInfo.Append(KResponsesToTest[i].iAdditionalInfo); |
|
727 } |
|
728 GenerateTerminalResponseL(KCmdId, KGetChannelStatus, KCmdQualifier, |
|
729 RSat::EGetChannelStatus, rspPckg, rsp.iAdditionalInfo, |
|
730 rsp.iGeneralResult, KNullDesC8, KResponsesToTest[i].iExpectedResult); |
|
731 } |
|
732 else |
|
733 { |
|
734 // now tell Mock to return KErrUnknown when dispatching forthcoming RSat::TerminalRsp() |
|
735 rsp.iGeneralResult = RSat::KSuccess; |
|
736 rsp.iInfoType = RSat::KNoAdditionalInfo; |
|
737 |
|
738 PrepareTerminalResponseMockDataL( KCmdId, KGetChannelStatus, KCmdQualifier, |
|
739 rsp.iAdditionalInfo, rsp.iGeneralResult, KNullDesC8, KErrUnknown); |
|
740 |
|
741 TerminalResponseL( RSat::EGetChannelStatus, rspPckg, KErrUnknown); |
|
742 } |
|
743 |
|
744 AssertMockLtsyStatusL(); |
|
745 } |
|
746 } |