|
1 // Copyright (c) 2001-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 #include "gprsqos.h" |
|
19 #include "mSLOGGER.H" |
|
20 #include <pcktcs.h> |
|
21 #include "atgprsqosprofile.h" |
|
22 #include "ATIO.H" |
|
23 #include <etelpckt.h> |
|
24 #include "NOTIFY.H" |
|
25 #include "Matstd.h" |
|
26 |
|
27 _LIT8(KGetCGQREQCommand,"AT+CGQREQ?\r"); |
|
28 _LIT8(KGetCGQMINCommand,"AT+CGQMIN?\r"); |
|
29 _LIT8(KCGQmin, "AT+CGQMIN=%d,%d,%d,%d,%d,%d\r"); |
|
30 _LIT8(KCGQreq, "AT+CGQREQ=%d,%d,%d,%d,%d,%d\r"); |
|
31 |
|
32 |
|
33 /** |
|
34 * @file |
|
35 * This file implements the CATGprsSetProfile class and the CATGprsGetProfile. These two classes are used by the |
|
36 * GPRS AT TSY library. |
|
37 * This state machine uses "AT+CGQREQ" "AT+CGQMIN" commands. |
|
38 */ |
|
39 CATGprsSetProfile* CATGprsSetProfile::NewL(TInt aCid, CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals) |
|
40 /** |
|
41 * Standard 2 phase constructor. |
|
42 * |
|
43 * @param aIo pointer to communication object. |
|
44 * @param aTelObject pointer to parent. |
|
45 * @param aPhoneGlobals pointer to phone global wide states. |
|
46 */ |
|
47 { |
|
48 CATGprsSetProfile* p=new(ELeave) CATGprsSetProfile(aCid, aIo, aTelObject, aInit, aPhoneGlobals); |
|
49 CleanupStack::PushL(p); |
|
50 p->ConstructL(); |
|
51 CleanupStack::Pop(); |
|
52 return p; |
|
53 } |
|
54 |
|
55 void CATGprsSetProfile::ConstructL() |
|
56 /** |
|
57 * Construct all objects that can leave. |
|
58 */ |
|
59 { |
|
60 CATCommands::ConstructL(); |
|
61 } |
|
62 |
|
63 |
|
64 CATGprsSetProfile::CATGprsSetProfile(TInt aCid, CATIO* aIo, CTelObject *aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals) |
|
65 : CATCommands(aIo, aTelObject, aInit, aPhoneGlobals), iCid(aCid) |
|
66 /** |
|
67 * Constructor. |
|
68 * |
|
69 * @param aIo pointer to communication object. |
|
70 * @param aTelObject pointer to parent. |
|
71 * @param aInit pointer to AT phone init object. |
|
72 * @param aPhoneGlobals pointer to phone global wide states. |
|
73 */ |
|
74 { |
|
75 LOGTEXT(_L8("CATGprsClass::CATGprsClass called")); |
|
76 } |
|
77 |
|
78 |
|
79 CATGprsSetProfile::~CATGprsSetProfile() |
|
80 /** |
|
81 * Destructor. |
|
82 */ |
|
83 { |
|
84 LOGTEXT(_L8("CATGprsSetProfile::~CATGprsSetProfile called")); |
|
85 } |
|
86 |
|
87 |
|
88 void CATGprsSetProfile::Start(TTsyReqHandle aTsyReqHandle, TAny* aConfig) |
|
89 /** |
|
90 * This starts the sending of the set commands. |
|
91 * |
|
92 * @param aConfig config package. |
|
93 * @param aTsyReqHandle handle to the client. |
|
94 */ |
|
95 { |
|
96 TPckg<RPacketQoS::TQoSGPRSRequested>* qoSProfileV1Pckg = (TPckg<RPacketQoS::TQoSGPRSRequested>*)aConfig; |
|
97 iGprsReqProfile = &(*qoSProfileV1Pckg)(); |
|
98 MakeupCGQMIN(); |
|
99 LOGTEXT(_L8("CATGprsSetProfile:\tCATConfigGPRS::Start function called in TSY")); |
|
100 |
|
101 __ASSERT_ALWAYS(iIo->AddExpectString(this,KNotifyMeIfErrorString) != NULL, Panic(EGeneral)); |
|
102 iReqHandle = aTsyReqHandle; |
|
103 iState=EWaitForSetCGQMINComplete; |
|
104 Write(KGprsCommandTimeOut); |
|
105 } |
|
106 |
|
107 void CATGprsSetProfile::Stop(TTsyReqHandle aTsyReqHandle) |
|
108 /** |
|
109 * This function cancels the outstanding read and sets the state to EWaitForDSR. |
|
110 * |
|
111 * @param aTsyReqHandle handle to the client. |
|
112 */ |
|
113 { |
|
114 LOGTEXT(_L8("CATGprsSetProfile::Stop called")); |
|
115 if(iState!=EATNotInProgress && aTsyReqHandle==iReqHandle) |
|
116 { |
|
117 LOGTEXT(_L8("CATGprsSetProfile::Stop Completing client request with KErrCancel")); |
|
118 Complete(KErrCancel,ETimeOutCompletion); |
|
119 } |
|
120 } |
|
121 |
|
122 |
|
123 void CATGprsSetProfile::CompleteWithIOError(TEventSource aSource,TInt aStatus) |
|
124 /** |
|
125 * This Function completes the command from the client whith an error. |
|
126 * |
|
127 * @param aSource source of event from communication class. |
|
128 * @param aStatus status of event. |
|
129 */ |
|
130 { |
|
131 Complete(aStatus, aSource); |
|
132 } |
|
133 |
|
134 |
|
135 void CATGprsSetProfile::Complete(TInt aErr, TEventSource aSource) |
|
136 /** |
|
137 * This Function completes the get or set command from the client. |
|
138 * |
|
139 * @param aErr an error code to relay to client. |
|
140 */ |
|
141 { |
|
142 LOGTEXT(_L8("CATGprsSetProfile::Complete")); |
|
143 RemoveStdExpectStrings(); |
|
144 iIo->WriteAndTimerCancel(this); |
|
145 iIo->RemoveExpectStrings(this); |
|
146 if (aErr == KErrNone) |
|
147 { |
|
148 ((CGprsQoS*)iTelObject)->SetReqQoSProfile(iGprsReqProfile); |
|
149 iPhoneGlobals->iNotificationStore->CheckNotification(iTelObject, EPacketQoSProfileChanged); |
|
150 } |
|
151 |
|
152 // Allow our base class to do its thing and then complete the client request |
|
153 CATCommands::Complete(aErr,aSource); |
|
154 iTelObject->ReqCompleted(iReqHandle,aErr); |
|
155 |
|
156 iState=EATNotInProgress; |
|
157 } |
|
158 |
|
159 |
|
160 void CATGprsSetProfile::EventSignal(TEventSource aSource) |
|
161 /** |
|
162 * This function contains the state machine for the command. The states flow consecutively in |
|
163 * get and set states and are described below. |
|
164 * |
|
165 * @par aSource Source of function call. |
|
166 * |
|
167 * @par EWaitForSetCGQMINComplete, |
|
168 * Wait for response from the phone on the set command. |
|
169 * |
|
170 * @par EWaitForSetCGQMINOK, |
|
171 * Validate phone response and send set AT+CGQREQ command. |
|
172 * |
|
173 * @par EWaitForSetCGQREQComplete, |
|
174 * Wait for response from the phone on the set command. |
|
175 * |
|
176 * @par EWaitForSetCGQREQOK, |
|
177 * Validate response and Complete set command. |
|
178 */ |
|
179 { |
|
180 LOGTEXT2(_L8("CATGprsSetProfile::EventSignal with iState %d"),iState); |
|
181 if ((aSource==ETimeOutCompletion)) |
|
182 { |
|
183 LOGTEXT(_L8("CATGprsSetProfile:\tTimeout Error during Config")); |
|
184 Complete(KErrTimedOut,aSource); |
|
185 return; |
|
186 } |
|
187 switch(iState) |
|
188 { |
|
189 case EWaitForSetCGQMINComplete: |
|
190 { |
|
191 LOGTEXT(_L8("CATGprsSetProfile::EventSignal, EWaitForSetCGQMINComplete")); |
|
192 iIo->WriteAndTimerCancel(this); |
|
193 StandardWriteCompletionHandler(aSource, KGprsCommandTimeOut); |
|
194 iState = EWaitForSetCGQMINOK; |
|
195 } |
|
196 break; |
|
197 case EWaitForSetCGQMINOK: |
|
198 { |
|
199 LOGTEXT(_L8("CATGprsSetProfile::EventSignal, EWaitForSetCGQMINOK")); |
|
200 __ASSERT_ALWAYS(aSource==EReadCompletion,Panic(EATCommand_IllegalCompletionReadExpected)); |
|
201 TInt ret = ValidateExpectString(); |
|
202 RemoveStdExpectStrings(); |
|
203 if(ret) |
|
204 { |
|
205 Complete(ret, aSource); |
|
206 return; |
|
207 } |
|
208 MakeupCGQREQ(); |
|
209 Write(KGprsCommandTimeOut); |
|
210 iState = EWaitForSetCGQREQComplete; |
|
211 } |
|
212 break; |
|
213 case EWaitForSetCGQREQComplete: |
|
214 { |
|
215 LOGTEXT(_L8("CATGprsSetProfile::EventSignal, EWaitForSetCGQREQComplete")); |
|
216 StandardWriteCompletionHandler(aSource, KGprsCommandTimeOut); |
|
217 iState = EWaitForSetCGQREQOK; |
|
218 } |
|
219 break; |
|
220 case EWaitForSetCGQREQOK: |
|
221 { |
|
222 LOGTEXT(_L8("CATGprsSetProfile::EventSignal, EWaitForSetCGQREQOK")); |
|
223 __ASSERT_ALWAYS(aSource==EReadCompletion,Panic(EATCommand_IllegalCompletionReadExpected)); |
|
224 TInt ret = ValidateExpectString(); |
|
225 Complete(ret, aSource); |
|
226 } |
|
227 break; |
|
228 case EATNotInProgress: |
|
229 break; |
|
230 default: |
|
231 { |
|
232 LOGTEXT(_L8("CATGprsSetProfile::EventSignal, default. Panic")); |
|
233 Panic(EIllegalEvent); |
|
234 } |
|
235 break; |
|
236 } |
|
237 } |
|
238 |
|
239 |
|
240 void CATGprsSetProfile::MakeupCGQMIN() |
|
241 /** |
|
242 * This Function creates the at set string for the AT+CGQMIN command. |
|
243 */ |
|
244 { |
|
245 TInt precedence, delay, reliability, peakthru, meanthru = 0; |
|
246 |
|
247 switch (iGprsReqProfile->iMinPrecedence) |
|
248 { |
|
249 case RPacketQoS::EPriorityHighPrecedence: |
|
250 precedence = 1; // high precedence |
|
251 break; |
|
252 |
|
253 case RPacketQoS::EPriorityMediumPrecedence: |
|
254 precedence = 2; // normal precedence |
|
255 break; |
|
256 |
|
257 case RPacketQoS::EPriorityLowPrecedence: |
|
258 precedence = 3; // low precedence |
|
259 break; |
|
260 |
|
261 default: |
|
262 precedence = 0; // unspecified or unknown precedence |
|
263 break; |
|
264 }; |
|
265 |
|
266 switch (iGprsReqProfile->iMinDelay) |
|
267 { |
|
268 case RPacketQoS::EDelayClass1: |
|
269 delay = 1; |
|
270 break; |
|
271 |
|
272 case RPacketQoS::EDelayClass2: |
|
273 delay = 2; |
|
274 break; |
|
275 |
|
276 case RPacketQoS::EDelayClass3: |
|
277 delay = 3; |
|
278 break; |
|
279 |
|
280 case RPacketQoS::EDelayClass4: |
|
281 delay = 4; |
|
282 break; |
|
283 |
|
284 default: |
|
285 delay = 0; |
|
286 break; |
|
287 }; |
|
288 |
|
289 switch (iGprsReqProfile->iMinReliability) |
|
290 { |
|
291 case RPacketQoS::EReliabilityClass1: |
|
292 reliability = 1; |
|
293 break; |
|
294 |
|
295 case RPacketQoS::EReliabilityClass2: |
|
296 reliability = 2; |
|
297 break; |
|
298 |
|
299 case RPacketQoS::EReliabilityClass3: |
|
300 reliability = 3; |
|
301 break; |
|
302 |
|
303 case RPacketQoS::EReliabilityClass4: |
|
304 reliability = 4; |
|
305 break; |
|
306 |
|
307 case RPacketQoS::EReliabilityClass5: |
|
308 reliability = 5; |
|
309 break; |
|
310 |
|
311 default: |
|
312 reliability = 0; // unspecified or unknown reliability |
|
313 break; |
|
314 }; |
|
315 |
|
316 switch (iGprsReqProfile->iMinPeakThroughput) |
|
317 { |
|
318 case RPacketQoS::EPeakThroughput1000: |
|
319 peakthru = 1; |
|
320 break; |
|
321 |
|
322 case RPacketQoS::EPeakThroughput2000: |
|
323 peakthru = 2; |
|
324 break; |
|
325 |
|
326 case RPacketQoS::EPeakThroughput4000: |
|
327 peakthru = 3; |
|
328 break; |
|
329 |
|
330 case RPacketQoS::EPeakThroughput8000: |
|
331 peakthru = 4; |
|
332 break; |
|
333 |
|
334 case RPacketQoS::EPeakThroughput16000: |
|
335 peakthru = 5; |
|
336 break; |
|
337 |
|
338 case RPacketQoS::EPeakThroughput32000: |
|
339 peakthru = 6; |
|
340 break; |
|
341 |
|
342 case RPacketQoS::EPeakThroughput64000: |
|
343 peakthru = 7; |
|
344 break; |
|
345 |
|
346 case RPacketQoS::EPeakThroughput128000: |
|
347 peakthru = 8; |
|
348 break; |
|
349 |
|
350 case RPacketQoS::EPeakThroughput256000: |
|
351 peakthru = 9; |
|
352 break; |
|
353 |
|
354 default: |
|
355 peakthru = 0; // unspecified or unknown peak throughput |
|
356 break; |
|
357 }; |
|
358 |
|
359 switch (iGprsReqProfile->iMinMeanThroughput) |
|
360 { |
|
361 case RPacketQoS::EMeanThroughput100: |
|
362 meanthru = 2; |
|
363 break; |
|
364 |
|
365 case RPacketQoS::EMeanThroughput200: |
|
366 meanthru = 3; |
|
367 break; |
|
368 |
|
369 case RPacketQoS::EMeanThroughput500: |
|
370 meanthru = 4; |
|
371 break; |
|
372 |
|
373 case RPacketQoS::EMeanThroughput1000: |
|
374 meanthru = 5; |
|
375 break; |
|
376 |
|
377 case RPacketQoS::EMeanThroughput2000: |
|
378 meanthru = 6; |
|
379 break; |
|
380 |
|
381 case RPacketQoS::EMeanThroughput5000: |
|
382 meanthru = 7; |
|
383 break; |
|
384 |
|
385 case RPacketQoS::EMeanThroughput10000: |
|
386 meanthru = 8; |
|
387 break; |
|
388 |
|
389 case RPacketQoS::EMeanThroughput20000: |
|
390 meanthru = 9; |
|
391 break; |
|
392 |
|
393 case RPacketQoS::EMeanThroughput50000: |
|
394 meanthru = 10; |
|
395 break; |
|
396 |
|
397 case RPacketQoS::EMeanThroughput100000: |
|
398 meanthru = 11; |
|
399 break; |
|
400 |
|
401 case RPacketQoS::EMeanThroughput200000: |
|
402 meanthru = 12; |
|
403 break; |
|
404 case RPacketQoS::EMeanThroughput500000: |
|
405 meanthru = 13; |
|
406 break; |
|
407 |
|
408 case RPacketQoS::EMeanThroughput1000000: |
|
409 meanthru = 14; |
|
410 break; |
|
411 |
|
412 case RPacketQoS::EMeanThroughput2000000: |
|
413 meanthru = 15; |
|
414 break; |
|
415 |
|
416 case RPacketQoS::EMeanThroughput5000000: |
|
417 meanthru = 16; |
|
418 break; |
|
419 |
|
420 case RPacketQoS::EMeanThroughput10000000: |
|
421 meanthru = 17; |
|
422 break; |
|
423 |
|
424 case RPacketQoS::EMeanThroughput20000000: |
|
425 meanthru = 18; |
|
426 break; |
|
427 |
|
428 case RPacketQoS::EUnspecifiedMeanThroughput: |
|
429 case RPacketQoS::EMeanThroughput50000000: |
|
430 meanthru = 31; |
|
431 break; |
|
432 |
|
433 default: |
|
434 meanthru = 0; // unspecified or unknown mean throughput |
|
435 break; |
|
436 }; |
|
437 |
|
438 |
|
439 iTxBuffer.Format(KCGQmin, iCid, |
|
440 precedence, |
|
441 delay, |
|
442 reliability, |
|
443 peakthru, |
|
444 meanthru); |
|
445 } |
|
446 |
|
447 |
|
448 void CATGprsSetProfile::MakeupCGQREQ() |
|
449 /** |
|
450 * This Function creates the at set string for the AT+CGQREQ command. |
|
451 */ |
|
452 { |
|
453 TInt precedence, delay, reliability, peakthru, meanthru = 0; |
|
454 |
|
455 switch (iGprsReqProfile->iReqPrecedence) |
|
456 { |
|
457 case RPacketQoS::EPriorityHighPrecedence: |
|
458 precedence = 1; // high precedence |
|
459 break; |
|
460 |
|
461 case RPacketQoS::EPriorityMediumPrecedence: |
|
462 precedence = 2; // normal precedence |
|
463 break; |
|
464 |
|
465 case RPacketQoS::EPriorityLowPrecedence: |
|
466 precedence = 3; // low precedence |
|
467 break; |
|
468 |
|
469 default: |
|
470 precedence = 0; // unspecified or unknown precedence |
|
471 break; |
|
472 }; |
|
473 |
|
474 switch (iGprsReqProfile->iReqDelay) |
|
475 { |
|
476 case RPacketQoS::EDelayClass1: |
|
477 delay = 1; |
|
478 break; |
|
479 |
|
480 case RPacketQoS::EDelayClass2: |
|
481 delay = 2; |
|
482 break; |
|
483 |
|
484 case RPacketQoS::EDelayClass3: |
|
485 delay = 3; |
|
486 break; |
|
487 |
|
488 case RPacketQoS::EDelayClass4: |
|
489 delay = 4; |
|
490 break; |
|
491 |
|
492 default: |
|
493 delay = 0; |
|
494 break; |
|
495 }; |
|
496 |
|
497 switch (iGprsReqProfile->iReqReliability) |
|
498 { |
|
499 case RPacketQoS::EReliabilityClass1: |
|
500 reliability = 1; |
|
501 break; |
|
502 |
|
503 case RPacketQoS::EReliabilityClass2: |
|
504 reliability = 2; |
|
505 break; |
|
506 |
|
507 case RPacketQoS::EReliabilityClass3: |
|
508 reliability = 3; |
|
509 break; |
|
510 |
|
511 case RPacketQoS::EReliabilityClass4: |
|
512 reliability = 4; |
|
513 break; |
|
514 |
|
515 case RPacketQoS::EReliabilityClass5: |
|
516 reliability = 5; |
|
517 break; |
|
518 |
|
519 default: |
|
520 reliability = 0; // unspecified or unknown reliability |
|
521 break; |
|
522 }; |
|
523 |
|
524 switch (iGprsReqProfile->iReqPeakThroughput) |
|
525 { |
|
526 case RPacketQoS::EPeakThroughput1000: |
|
527 peakthru = 1; |
|
528 break; |
|
529 |
|
530 case RPacketQoS::EPeakThroughput2000: |
|
531 peakthru = 2; |
|
532 break; |
|
533 |
|
534 case RPacketQoS::EPeakThroughput4000: |
|
535 peakthru = 3; |
|
536 break; |
|
537 |
|
538 case RPacketQoS::EPeakThroughput8000: |
|
539 peakthru = 4; |
|
540 break; |
|
541 |
|
542 case RPacketQoS::EPeakThroughput16000: |
|
543 peakthru = 5; |
|
544 break; |
|
545 |
|
546 case RPacketQoS::EPeakThroughput32000: |
|
547 peakthru = 6; |
|
548 break; |
|
549 |
|
550 case RPacketQoS::EPeakThroughput64000: |
|
551 peakthru = 7; |
|
552 break; |
|
553 |
|
554 case RPacketQoS::EPeakThroughput128000: |
|
555 peakthru = 8; |
|
556 break; |
|
557 |
|
558 case RPacketQoS::EPeakThroughput256000: |
|
559 peakthru = 9; |
|
560 break; |
|
561 |
|
562 default: |
|
563 peakthru = 0; // unspecified or unknown peak throughput |
|
564 break; |
|
565 }; |
|
566 |
|
567 switch (iGprsReqProfile->iReqMeanThroughput) |
|
568 { |
|
569 case RPacketQoS::EMeanThroughput100: |
|
570 meanthru = 2; |
|
571 break; |
|
572 |
|
573 case RPacketQoS::EMeanThroughput200: |
|
574 meanthru = 3; |
|
575 break; |
|
576 |
|
577 case RPacketQoS::EMeanThroughput500: |
|
578 meanthru = 4; |
|
579 break; |
|
580 |
|
581 case RPacketQoS::EMeanThroughput1000: |
|
582 meanthru = 5; |
|
583 break; |
|
584 |
|
585 case RPacketQoS::EMeanThroughput2000: |
|
586 meanthru = 6; |
|
587 break; |
|
588 |
|
589 case RPacketQoS::EMeanThroughput5000: |
|
590 meanthru = 7; |
|
591 break; |
|
592 |
|
593 case RPacketQoS::EMeanThroughput10000: |
|
594 meanthru = 8; |
|
595 break; |
|
596 |
|
597 case RPacketQoS::EMeanThroughput20000: |
|
598 meanthru = 9; |
|
599 break; |
|
600 |
|
601 case RPacketQoS::EMeanThroughput50000: |
|
602 meanthru = 10; |
|
603 break; |
|
604 |
|
605 case RPacketQoS::EMeanThroughput100000: |
|
606 meanthru = 11; |
|
607 break; |
|
608 |
|
609 case RPacketQoS::EMeanThroughput200000: |
|
610 meanthru = 12; |
|
611 break; |
|
612 case RPacketQoS::EMeanThroughput500000: |
|
613 meanthru = 13; |
|
614 break; |
|
615 |
|
616 case RPacketQoS::EMeanThroughput1000000: |
|
617 meanthru = 14; |
|
618 break; |
|
619 |
|
620 case RPacketQoS::EMeanThroughput2000000: |
|
621 meanthru = 15; |
|
622 break; |
|
623 |
|
624 case RPacketQoS::EMeanThroughput5000000: |
|
625 meanthru = 16; |
|
626 break; |
|
627 |
|
628 case RPacketQoS::EMeanThroughput10000000: |
|
629 meanthru = 17; |
|
630 break; |
|
631 |
|
632 case RPacketQoS::EMeanThroughput20000000: |
|
633 meanthru = 18; |
|
634 break; |
|
635 |
|
636 case RPacketQoS::EUnspecifiedMeanThroughput: |
|
637 case RPacketQoS::EMeanThroughput50000000: |
|
638 meanthru = 31; |
|
639 break; |
|
640 |
|
641 default: |
|
642 meanthru = 0; // unspecified or unknown mean throughput |
|
643 break; |
|
644 }; |
|
645 |
|
646 iTxBuffer.Format(KCGQreq,iCid, |
|
647 precedence, |
|
648 delay, |
|
649 reliability, |
|
650 peakthru, |
|
651 meanthru); |
|
652 } |
|
653 |
|
654 |
|
655 |
|
656 // |
|
657 // |
|
658 // CATGprsGetProfile |
|
659 // |
|
660 // |
|
661 // |
|
662 // |
|
663 |
|
664 CATGprsGetProfile* CATGprsGetProfile::NewL(TInt aCid, CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals) |
|
665 /** |
|
666 * Standard 2 phase constructor. |
|
667 * @param aIo pointer to communication object. |
|
668 * @param aTelObject pointer to parent. |
|
669 * @param aInit pointer to AT phone init object. |
|
670 * @param aPhoneGlobals pointer to phone global wide states. |
|
671 */ |
|
672 { |
|
673 CATGprsGetProfile* p=new(ELeave) CATGprsGetProfile(aCid, aIo, aTelObject, aInit, aPhoneGlobals); |
|
674 CleanupStack::PushL(p); |
|
675 p->ConstructL(); |
|
676 CleanupStack::Pop(); |
|
677 return p; |
|
678 } |
|
679 |
|
680 void CATGprsGetProfile::ConstructL() |
|
681 /** |
|
682 * Construct all objects that can leave. |
|
683 */ |
|
684 { |
|
685 CATCommands::ConstructL(); |
|
686 } |
|
687 |
|
688 CATGprsGetProfile::CATGprsGetProfile(TInt aCid, CATIO* aIo, CTelObject *aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals) |
|
689 : CATCommands(aIo, aTelObject, aInit, aPhoneGlobals), iCid(aCid) |
|
690 /** |
|
691 * Constructor. |
|
692 * @param aIo pointer to communication object. |
|
693 * @param aTelObject pointer to parent. |
|
694 * @param aInit pointer to AT phone init object. |
|
695 * @param aPhoneGlobals pointer to phone global wide states. |
|
696 */ |
|
697 {} |
|
698 |
|
699 |
|
700 CATGprsGetProfile::~CATGprsGetProfile() |
|
701 /** |
|
702 * Destructor. |
|
703 */ |
|
704 {} |
|
705 |
|
706 |
|
707 void CATGprsGetProfile::Start(TTsyReqHandle aTsyReqHandle, TAny* aConfig) |
|
708 /** |
|
709 * This starts the sending of the get commands. |
|
710 * |
|
711 * @param aTsyReqHandle handle to the client. |
|
712 * @param aConfig Pointer to a RPacketQoS::TQoSGPRSNegotiated |
|
713 */ |
|
714 |
|
715 { |
|
716 TPckg<RPacketQoS::TQoSGPRSNegotiated>* qoSProfileV1Pckg = (TPckg<RPacketQoS::TQoSGPRSNegotiated>*)aConfig; |
|
717 iGprsNegProfile= &(*qoSProfileV1Pckg)(); |
|
718 LOGTEXT(_L8("CATGprsGetProfile:\tCATConfigGPRS::Start function called in TSY")); |
|
719 |
|
720 __ASSERT_ALWAYS(iIo->AddExpectString(this,KNotifyMeIfErrorString) != NULL, Panic(EGeneral)); |
|
721 iReqHandle = aTsyReqHandle; |
|
722 iState=EWaitForGetCGQMINComplete; |
|
723 Write(KGetCGQMINCommand, KGprsCommandTimeOut); |
|
724 } |
|
725 |
|
726 void CATGprsGetProfile::Stop(TTsyReqHandle aTsyReqHandle) |
|
727 /** |
|
728 * This function cancels the outstanding read and sets the state to EWaitForDSR. |
|
729 * |
|
730 * @param aTsyReqHandle handle to the client. |
|
731 */ |
|
732 { |
|
733 LOGTEXT(_L8("CATGprsGetProfile::Stop called")); |
|
734 if(iState!=EATNotInProgress && aTsyReqHandle==iReqHandle) |
|
735 { |
|
736 LOGTEXT(_L8("CATGprsGetProfile::Stop Completing client request with KErrCancel")); |
|
737 Complete(KErrCancel,ETimeOutCompletion); |
|
738 } |
|
739 } |
|
740 |
|
741 void CATGprsGetProfile::Complete(TInt aErr, TEventSource aSource) |
|
742 /** |
|
743 * This Function completes the get or set command from the client. |
|
744 * @param aErr and error to relay to the client. |
|
745 */ |
|
746 { |
|
747 LOGTEXT(_L8("CATGprsGetProfile::Complete")); |
|
748 RemoveStdExpectStrings(); |
|
749 iIo->WriteAndTimerCancel(this); |
|
750 iIo->RemoveExpectStrings(this); |
|
751 if(aErr == KErrNone) |
|
752 { |
|
753 ((CGprsQoS*)iTelObject)->SetNegQoSProfile(iGprsNegProfile); |
|
754 } |
|
755 |
|
756 // Allow our base class to do its thing and then complete the client request |
|
757 CATCommands::Complete(aErr,aSource); |
|
758 iTelObject->ReqCompleted(iReqHandle,aErr); |
|
759 |
|
760 iState=EATNotInProgress; |
|
761 } |
|
762 |
|
763 |
|
764 void CATGprsGetProfile::CompleteWithIOError(TEventSource aSource,TInt aStatus) |
|
765 /** |
|
766 * This Function completes the command from the client whith an error. |
|
767 * |
|
768 * @param aSource source of event from communication class. |
|
769 * @param aStatus status of event. |
|
770 */ |
|
771 { |
|
772 Complete(aStatus, aSource); |
|
773 } |
|
774 |
|
775 |
|
776 |
|
777 void CATGprsGetProfile::EventSignal(TEventSource aSource) |
|
778 /** |
|
779 * This function contains the state machine for the command. The states flow consecutively in |
|
780 * get and set states and are described below. |
|
781 * |
|
782 * @par aSource Source of function call. |
|
783 * |
|
784 * |
|
785 * @par EWaitForGetCGQMINComplete, |
|
786 * Wait for response from the phone on the set command. |
|
787 * |
|
788 * @par EWaitForGetCGQMINOK, |
|
789 * Validate phone response and send set AT+CGQREQ command. |
|
790 * |
|
791 * @par EWaitForGetCGQREQComplete, |
|
792 * Wait for response from the phone on the set command. |
|
793 * |
|
794 * @par EWaitForGetCGQREQOK * |
|
795 * Validate phone response and complete get command. |
|
796 * |
|
797 */ |
|
798 { |
|
799 LOGTEXT2(_L8("CATGprsGetProfile::EventSignal with iState %d"),iState); |
|
800 if ((aSource==ETimeOutCompletion)) |
|
801 { |
|
802 LOGTEXT(_L8("CATGprsGetProfile:\tTimeout Error during Config")); |
|
803 Complete(KErrTimedOut,aSource); |
|
804 return; |
|
805 } |
|
806 switch(iState) |
|
807 { |
|
808 case EWaitForGetCGQMINComplete: |
|
809 { |
|
810 StandardWriteCompletionHandler(aSource, KGprsCommandTimeOut); |
|
811 iState = EWaitForGetCGQMINOK; |
|
812 } |
|
813 break; |
|
814 |
|
815 case EWaitForGetCGQMINOK: |
|
816 { |
|
817 __ASSERT_ALWAYS(aSource==EReadCompletion,Panic(EATCommand_IllegalCompletionReadExpected)); |
|
818 TInt ret = ValidateExpectString(); |
|
819 RemoveStdExpectStrings(); |
|
820 if(ret) |
|
821 { |
|
822 Complete(ret, aSource); |
|
823 return; |
|
824 } |
|
825 TRAPD(err,ParseCGQMINResponseL()); |
|
826 if (err != KErrNone) |
|
827 { |
|
828 LOGTEXT(_L8("ATGPRSCONFIG::\tError parsing +CGQMIN=?")); |
|
829 Complete(ret, aSource); |
|
830 return; |
|
831 } |
|
832 Write(KGetCGQREQCommand, KGprsCommandTimeOut); |
|
833 iState = EWaitForGetCGQREQComplete; |
|
834 } |
|
835 break; |
|
836 |
|
837 case EWaitForGetCGQREQComplete: |
|
838 { |
|
839 StandardWriteCompletionHandler(aSource, KGprsCommandTimeOut); |
|
840 iState = EWaitForGetCGQREQOK; |
|
841 } |
|
842 break; |
|
843 case EWaitForGetCGQREQOK: |
|
844 { |
|
845 __ASSERT_ALWAYS(aSource==EReadCompletion,Panic(EATCommand_IllegalCompletionReadExpected)); |
|
846 TInt ret = ValidateExpectString(); |
|
847 RemoveStdExpectStrings(); |
|
848 if(ret) |
|
849 { |
|
850 Complete(ret, aSource); |
|
851 return; |
|
852 } |
|
853 TRAPD(err,ParseCGQREQResponseL()); |
|
854 if (err != KErrNone) |
|
855 { |
|
856 LOGTEXT(_L8("ATGPRSCONFIG::\tError parsing +CGQREQ=?")); |
|
857 Complete(ret, aSource); |
|
858 return; |
|
859 } |
|
860 iIo->RemoveExpectStrings(this); |
|
861 Complete(ret, aSource); |
|
862 } |
|
863 break; |
|
864 case EATNotInProgress: |
|
865 break; |
|
866 default: |
|
867 { |
|
868 LOGTEXT(_L8("CATGprsGetProfile::EventSignal, Default, panic")); |
|
869 Panic(EIllegalEvent); |
|
870 } |
|
871 break; |
|
872 } |
|
873 } |
|
874 |
|
875 |
|
876 void CATGprsGetProfile::ParseCGQMINResponseL() |
|
877 /** |
|
878 * This Function parses the response from the get AT+CGQMIN command to the phone |
|
879 */ |
|
880 { |
|
881 ParseBufferLC(); |
|
882 CATParamListEntry* entry; |
|
883 TDblQueIter<CATParamListEntry> iter(iRxResults); |
|
884 while(entry = iter++,entry!=NULL) |
|
885 { |
|
886 if (entry->iResultPtr.MatchF(KCGQMINResponseString)!=0) |
|
887 continue; |
|
888 entry = iter++; |
|
889 if(entry == NULL) |
|
890 User::Leave(KErrGeneral); |
|
891 TLex8 lex(entry->iResultPtr); |
|
892 TInt val; |
|
893 (void)User::LeaveIfError(lex.Val(val)); |
|
894 if(iCid == val) |
|
895 { |
|
896 entry = iter++; |
|
897 break; |
|
898 } |
|
899 } |
|
900 if(entry == NULL) |
|
901 User::Leave(KErrGeneral); |
|
902 // we are now pointing to the correct context, just parse the values |
|
903 // Get precedence |
|
904 TLex8 lex(entry->iResultPtr); |
|
905 TInt val; |
|
906 (void)User::LeaveIfError(lex.Val(val)); |
|
907 switch(val) |
|
908 { |
|
909 case 0: |
|
910 iGprsNegProfile->iPrecedence = RPacketQoS::EUnspecifiedPrecedence; |
|
911 break; |
|
912 case 1: |
|
913 iGprsNegProfile->iPrecedence = RPacketQoS::EPriorityHighPrecedence; |
|
914 break; |
|
915 case 2: |
|
916 iGprsNegProfile->iPrecedence = RPacketQoS::EPriorityMediumPrecedence; |
|
917 break; |
|
918 case 3: |
|
919 iGprsNegProfile->iPrecedence = RPacketQoS::EPriorityLowPrecedence; |
|
920 break; |
|
921 default: |
|
922 iGprsNegProfile->iPrecedence = RPacketQoS::EUnspecifiedPrecedence; |
|
923 } |
|
924 // Get delay class |
|
925 entry = iter++; |
|
926 if(entry == NULL) |
|
927 User::Leave(KErrGeneral); |
|
928 lex = entry->iResultPtr; |
|
929 (void)User::LeaveIfError(lex.Val(val)); |
|
930 switch(val) |
|
931 { |
|
932 case 0: |
|
933 iGprsNegProfile->iDelay = RPacketQoS::EUnspecifiedDelayClass; |
|
934 break; |
|
935 case 1: |
|
936 iGprsNegProfile->iDelay = RPacketQoS::EDelayClass1; |
|
937 break; |
|
938 case 2: |
|
939 iGprsNegProfile->iDelay = RPacketQoS::EDelayClass2; |
|
940 break; |
|
941 case 3: |
|
942 iGprsNegProfile->iDelay = RPacketQoS::EDelayClass3; |
|
943 break; |
|
944 case 4: |
|
945 iGprsNegProfile->iDelay = RPacketQoS::EDelayClass4; |
|
946 break; |
|
947 default: |
|
948 iGprsNegProfile->iDelay = RPacketQoS::EUnspecifiedDelayClass; |
|
949 } |
|
950 // Get reliability class |
|
951 entry = iter++; |
|
952 if(entry == NULL) |
|
953 User::Leave(KErrGeneral); |
|
954 lex = entry->iResultPtr; |
|
955 (void)User::LeaveIfError(lex.Val(val)); |
|
956 |
|
957 switch(val) |
|
958 { |
|
959 case 0: |
|
960 iGprsNegProfile->iReliability = RPacketQoS::EUnspecifiedReliabilityClass; |
|
961 break; |
|
962 case 1: |
|
963 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass1; |
|
964 break; |
|
965 case 2: |
|
966 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass2; |
|
967 break; |
|
968 case 3: |
|
969 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass3; |
|
970 break; |
|
971 case 4: |
|
972 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass4; |
|
973 break; |
|
974 case 5: |
|
975 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass5; |
|
976 break; |
|
977 default: |
|
978 iGprsNegProfile->iReliability = RPacketQoS::EUnspecifiedReliabilityClass; |
|
979 } |
|
980 |
|
981 |
|
982 // Get peak |
|
983 entry = iter++; |
|
984 if(entry == NULL) |
|
985 User::Leave(KErrGeneral); |
|
986 lex = entry->iResultPtr; |
|
987 (void)User::LeaveIfError(lex.Val(val)); |
|
988 switch(val) |
|
989 { |
|
990 case 0: |
|
991 iGprsNegProfile->iPeakThroughput = RPacketQoS::EUnspecifiedPeakThroughput; |
|
992 break; |
|
993 case 1: |
|
994 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput1000; |
|
995 break; |
|
996 case 2: |
|
997 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput2000; |
|
998 break; |
|
999 case 3: |
|
1000 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput4000; |
|
1001 break; |
|
1002 case 4: |
|
1003 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput8000; |
|
1004 break; |
|
1005 case 5: |
|
1006 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput16000; |
|
1007 break; |
|
1008 case 6: |
|
1009 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput32000; |
|
1010 break; |
|
1011 case 7: |
|
1012 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput64000; |
|
1013 break; |
|
1014 case 8: |
|
1015 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput128000; |
|
1016 break; |
|
1017 case 9: |
|
1018 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput256000; |
|
1019 break; |
|
1020 default: |
|
1021 iGprsNegProfile->iPeakThroughput = RPacketQoS::EUnspecifiedPeakThroughput; |
|
1022 } |
|
1023 // Get mean |
|
1024 entry = iter++; |
|
1025 if(entry == NULL) |
|
1026 User::Leave(KErrGeneral); |
|
1027 lex = entry->iResultPtr; |
|
1028 (void)User::LeaveIfError(lex.Val(val)); |
|
1029 |
|
1030 switch(val) |
|
1031 { |
|
1032 case 0: |
|
1033 iGprsNegProfile->iMeanThroughput = RPacketQoS::EUnspecifiedMeanThroughput; |
|
1034 break; |
|
1035 case 2: |
|
1036 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput100; |
|
1037 break; |
|
1038 case 3: |
|
1039 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput200; |
|
1040 break; |
|
1041 case 4: |
|
1042 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput500; |
|
1043 break; |
|
1044 case 5: |
|
1045 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput1000; |
|
1046 break; |
|
1047 case 6: |
|
1048 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput2000; |
|
1049 break; |
|
1050 case 7: |
|
1051 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput5000; |
|
1052 break; |
|
1053 case 8: |
|
1054 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput10000; |
|
1055 break; |
|
1056 case 9: |
|
1057 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput20000; |
|
1058 break; |
|
1059 case 10: |
|
1060 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput50000; |
|
1061 break; |
|
1062 case 11: |
|
1063 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput100000; |
|
1064 break; |
|
1065 case 12: |
|
1066 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput200000; |
|
1067 break; |
|
1068 case 13: |
|
1069 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput500000; |
|
1070 break; |
|
1071 case 14: |
|
1072 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput1000000; |
|
1073 break; |
|
1074 case 15: |
|
1075 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput2000000; |
|
1076 break; |
|
1077 case 16: |
|
1078 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput5000000; |
|
1079 break; |
|
1080 case 17: |
|
1081 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput10000000; |
|
1082 break; |
|
1083 case 18: |
|
1084 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput20000000; |
|
1085 break; |
|
1086 case 31: |
|
1087 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput50000000; |
|
1088 break; |
|
1089 default: |
|
1090 iGprsNegProfile->iMeanThroughput = RPacketQoS::EUnspecifiedMeanThroughput; |
|
1091 } |
|
1092 CleanupStack::PopAndDestroy(); |
|
1093 } |
|
1094 |
|
1095 |
|
1096 void CATGprsGetProfile::ParseCGQREQResponseL() |
|
1097 /** |
|
1098 * This Function parses the response from the get CGQREQ command to the phone |
|
1099 */ |
|
1100 { |
|
1101 ParseBufferLC(); |
|
1102 CATParamListEntry* entry; |
|
1103 TDblQueIter<CATParamListEntry> iter(iRxResults); |
|
1104 while(entry = iter++,entry!=NULL) |
|
1105 { |
|
1106 if (entry->iResultPtr.MatchF(KCGQREQResponseString)!=0) |
|
1107 continue; |
|
1108 entry = iter++; |
|
1109 if(entry == NULL) |
|
1110 User::Leave(KErrGeneral); |
|
1111 TLex8 lex(entry->iResultPtr); |
|
1112 TInt val; |
|
1113 (void)User::LeaveIfError(lex.Val(val)); |
|
1114 if(iCid == val) |
|
1115 { |
|
1116 entry = iter++; |
|
1117 break; |
|
1118 } |
|
1119 |
|
1120 } |
|
1121 if(entry == NULL) |
|
1122 User::Leave(KErrGeneral); |
|
1123 // we are now pointing to the correct context, just parse the values |
|
1124 // Get precedence |
|
1125 TLex8 lex(entry->iResultPtr); |
|
1126 TInt val; |
|
1127 (void)User::LeaveIfError(lex.Val(val)); |
|
1128 switch(val) |
|
1129 { |
|
1130 case 0: |
|
1131 iGprsNegProfile->iPrecedence = RPacketQoS::EUnspecifiedPrecedence; |
|
1132 break; |
|
1133 case 1: |
|
1134 iGprsNegProfile->iPrecedence = RPacketQoS::EPriorityHighPrecedence; |
|
1135 break; |
|
1136 case 2: |
|
1137 iGprsNegProfile->iPrecedence = RPacketQoS::EPriorityMediumPrecedence; |
|
1138 break; |
|
1139 case 3: |
|
1140 iGprsNegProfile->iPrecedence = RPacketQoS::EPriorityLowPrecedence; |
|
1141 break; |
|
1142 default: |
|
1143 iGprsNegProfile->iPrecedence = RPacketQoS::EUnspecifiedPrecedence; |
|
1144 } |
|
1145 |
|
1146 // Get delay class |
|
1147 entry = iter++; |
|
1148 if(entry == NULL) |
|
1149 User::Leave(KErrGeneral); |
|
1150 lex = entry->iResultPtr; |
|
1151 (void)User::LeaveIfError(lex.Val(val)); |
|
1152 switch(val) |
|
1153 { |
|
1154 case 0: |
|
1155 iGprsNegProfile->iDelay = RPacketQoS::EUnspecifiedDelayClass; |
|
1156 break; |
|
1157 case 1: |
|
1158 iGprsNegProfile->iDelay = RPacketQoS::EDelayClass1; |
|
1159 break; |
|
1160 case 2: |
|
1161 iGprsNegProfile->iDelay = RPacketQoS::EDelayClass2; |
|
1162 break; |
|
1163 case 3: |
|
1164 iGprsNegProfile->iDelay = RPacketQoS::EDelayClass3; |
|
1165 break; |
|
1166 case 4: |
|
1167 iGprsNegProfile->iDelay = RPacketQoS::EDelayClass4; |
|
1168 break; |
|
1169 default: |
|
1170 iGprsNegProfile->iDelay = RPacketQoS::EUnspecifiedDelayClass; |
|
1171 } |
|
1172 |
|
1173 |
|
1174 // Get reliability class |
|
1175 entry = iter++; |
|
1176 if(entry == NULL) |
|
1177 User::Leave(KErrGeneral); |
|
1178 lex = entry->iResultPtr; |
|
1179 (void)User::LeaveIfError(lex.Val(val)); |
|
1180 |
|
1181 switch(val) |
|
1182 { |
|
1183 case 0: |
|
1184 iGprsNegProfile->iReliability = RPacketQoS::EUnspecifiedReliabilityClass; |
|
1185 break; |
|
1186 case 1: |
|
1187 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass1; |
|
1188 break; |
|
1189 case 2: |
|
1190 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass2; |
|
1191 break; |
|
1192 case 3: |
|
1193 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass3; |
|
1194 break; |
|
1195 case 4: |
|
1196 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass4; |
|
1197 break; |
|
1198 case 5: |
|
1199 iGprsNegProfile->iReliability = RPacketQoS::EReliabilityClass5; |
|
1200 break; |
|
1201 default: |
|
1202 iGprsNegProfile->iReliability = RPacketQoS::EUnspecifiedReliabilityClass; |
|
1203 } |
|
1204 |
|
1205 |
|
1206 // Get peak |
|
1207 entry = iter++; |
|
1208 if(entry == NULL) |
|
1209 User::Leave(KErrGeneral); |
|
1210 lex = entry->iResultPtr; |
|
1211 (void)User::LeaveIfError(lex.Val(val)); |
|
1212 switch(val) |
|
1213 { |
|
1214 case 0: |
|
1215 iGprsNegProfile->iPeakThroughput = RPacketQoS::EUnspecifiedPeakThroughput; |
|
1216 break; |
|
1217 case 1: |
|
1218 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput1000; |
|
1219 break; |
|
1220 case 2: |
|
1221 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput2000; |
|
1222 break; |
|
1223 case 3: |
|
1224 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput4000; |
|
1225 break; |
|
1226 case 4: |
|
1227 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput8000; |
|
1228 break; |
|
1229 case 5: |
|
1230 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput16000; |
|
1231 break; |
|
1232 case 6: |
|
1233 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput32000; |
|
1234 break; |
|
1235 case 7: |
|
1236 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput64000; |
|
1237 break; |
|
1238 case 8: |
|
1239 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput128000; |
|
1240 break; |
|
1241 case 9: |
|
1242 iGprsNegProfile->iPeakThroughput = RPacketQoS::EPeakThroughput256000; |
|
1243 break; |
|
1244 default: |
|
1245 iGprsNegProfile->iPeakThroughput = RPacketQoS::EUnspecifiedPeakThroughput; |
|
1246 } |
|
1247 // Get mean |
|
1248 entry = iter++; |
|
1249 if(entry == NULL) |
|
1250 User::Leave(KErrGeneral); |
|
1251 lex = entry->iResultPtr; |
|
1252 (void)User::LeaveIfError(lex.Val(val)); |
|
1253 |
|
1254 switch(val) |
|
1255 { |
|
1256 case 0: |
|
1257 case 1: |
|
1258 iGprsNegProfile->iMeanThroughput = RPacketQoS::EUnspecifiedMeanThroughput; |
|
1259 break; |
|
1260 // case 1: |
|
1261 // iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughputBestEffort; |
|
1262 // break; |
|
1263 // |
|
1264 // Best Effort & Subscribed are now contained in the EUnspecifiedMeanThroughput |
|
1265 // |
|
1266 case 2: |
|
1267 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput100; |
|
1268 break; |
|
1269 case 3: |
|
1270 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput200; |
|
1271 break; |
|
1272 case 4: |
|
1273 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput500; |
|
1274 break; |
|
1275 case 5: |
|
1276 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput1000; |
|
1277 break; |
|
1278 case 6: |
|
1279 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput2000; |
|
1280 break; |
|
1281 case 7: |
|
1282 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput5000; |
|
1283 break; |
|
1284 case 8: |
|
1285 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput10000; |
|
1286 break; |
|
1287 case 9: |
|
1288 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput20000; |
|
1289 break; |
|
1290 case 10: |
|
1291 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput50000; |
|
1292 break; |
|
1293 case 11: |
|
1294 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput100000; |
|
1295 break; |
|
1296 case 12: |
|
1297 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput200000; |
|
1298 break; |
|
1299 case 13: |
|
1300 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput500000; |
|
1301 break; |
|
1302 case 14: |
|
1303 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput1000000; |
|
1304 break; |
|
1305 case 15: |
|
1306 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput2000000; |
|
1307 break; |
|
1308 case 16: |
|
1309 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput5000000; |
|
1310 break; |
|
1311 case 17: |
|
1312 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput10000000; |
|
1313 break; |
|
1314 case 18: |
|
1315 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput20000000; |
|
1316 break; |
|
1317 case 31: |
|
1318 iGprsNegProfile->iMeanThroughput = RPacketQoS::EMeanThroughput50000000; |
|
1319 break; |
|
1320 default: |
|
1321 iGprsNegProfile->iMeanThroughput = RPacketQoS::EUnspecifiedMeanThroughput; |
|
1322 } |
|
1323 CleanupStack::PopAndDestroy(); |
|
1324 |
|
1325 } |
|
1326 |
|
1327 |