|
1 // Copyright (c) 2005-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 // Implementation file for the PDP Context Finite State Machine |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 |
|
23 #include "PDPFSM.h" |
|
24 #include "cpdpfsmfactory.h" |
|
25 #include "spudfsmdebuglogger.h" |
|
26 #include "UmtsGprs_defaultSubconnProv.h" |
|
27 |
|
28 |
|
29 //-========================================================= |
|
30 // Custom methods |
|
31 //-========================================================= |
|
32 CPdpFsmInterface::CPdpFsmInterface(CUmtsGprsDefaultSubConnProvd& aOwner) |
|
33 :iPdpFsmFactory(NULL), |
|
34 iNetworkStatus(RPacketService::EStatusUnattached), |
|
35 iDefaultSubConnProvd(aOwner) |
|
36 { |
|
37 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::()"); |
|
38 } |
|
39 |
|
40 CPdpFsmInterface::~CPdpFsmInterface() |
|
41 { |
|
42 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::()"); |
|
43 |
|
44 CPdpFsmInterface::Close(); |
|
45 delete iPdpFsmFactory; |
|
46 } |
|
47 |
|
48 |
|
49 void CPdpFsmInterface::SpudInput(TContextId aPdpId, TInt aNotification, TInt aParam) |
|
50 { |
|
51 switch (aNotification) |
|
52 { |
|
53 //------------------------------ |
|
54 // responses - these are explicitly responses to previously issued requests. |
|
55 // These should only reach the entity that sent the request. |
|
56 //------------------------------ |
|
57 case KContextTFTModifiedEvent: |
|
58 { |
|
59 TTFTOperationCode opCode; |
|
60 Get(aPdpId, opCode); |
|
61 if (opCode == KDeleteTFT && aParam == KErrNone) |
|
62 { |
|
63 //captured response to a successful delete TFT request. We now |
|
64 //have a new default. |
|
65 #ifdef _DEBUG |
|
66 TTFTInfo ttfinfo; |
|
67 Get(aPdpId, ttfinfo); |
|
68 ASSERT(ttfinfo.FilterCount() == 0); |
|
69 #endif //_DEBUG |
|
70 |
|
71 iDefaultSubConnProvd.NewDefaultElected(aPdpId); |
|
72 } |
|
73 |
|
74 iSpudManInterface.Input(aPdpId, aNotification, aParam); |
|
75 } |
|
76 break; |
|
77 |
|
78 case KSecondaryContextCreated: |
|
79 case KContextQoSSetEvent: |
|
80 case KContextActivateEvent: |
|
81 case KContextModifyActiveEvent: |
|
82 { |
|
83 if (aPdpId == iDefaultSubConnProvd.GetContextId()) |
|
84 { |
|
85 TBool handled = iDefaultSubConnProvd.PdpFsmEvent(aPdpId, aNotification, aParam); |
|
86 if (!handled) |
|
87 { |
|
88 // Chances are the default context is in fact a promoted secondary context |
|
89 // We must be careful to make sure that GuQoS gets the notification it expects |
|
90 // otherwise it can cause problems. On the other hand if it gets notifications |
|
91 // or events its not expecting it will Panic. |
|
92 iSpudManInterface.Input(aPdpId, aNotification, aParam); |
|
93 } |
|
94 } |
|
95 else |
|
96 { |
|
97 iSpudManInterface.Input(aPdpId, aNotification, aParam); |
|
98 } |
|
99 } |
|
100 break; |
|
101 |
|
102 //------------------------------ |
|
103 // events - Received either as responses to previously sent requests |
|
104 // or as indications of network initiated actions. |
|
105 //------------------------------ |
|
106 case KContextDeleteEvent: |
|
107 case KNetworkStatusEvent: |
|
108 case KContextParametersChangeEvent: |
|
109 case KContextBlockedEvent: |
|
110 case KContextUnblockedEvent: |
|
111 case KPrimaryContextCreated: |
|
112 case KGetNegQoSEvent: |
|
113 { |
|
114 if ( aPdpId == iDefaultSubConnProvd.GetContextId() || aPdpId == KAllContexts) |
|
115 { |
|
116 iDefaultSubConnProvd.PdpFsmEvent(iDefaultSubConnProvd.GetContextId(), aNotification, aParam); |
|
117 } |
|
118 iSpudManInterface.Input(aPdpId, aNotification, aParam); |
|
119 } |
|
120 break; |
|
121 } |
|
122 } |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 //-========================================================= |
|
128 // MPdpFsmInterface methods |
|
129 //-========================================================= |
|
130 /** request to open the FSM |
|
131 |
|
132 @param aSpudManInterface reference to SpudMan interface |
|
133 */ |
|
134 void CPdpFsmInterface::OpenL(MSpudManInterface * aSpudManInterface, TName& aTsyName) |
|
135 { |
|
136 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::OpenL()"); |
|
137 |
|
138 if (aSpudManInterface == NULL) |
|
139 { |
|
140 User::Leave(KErrBadHandle); |
|
141 } |
|
142 |
|
143 iSpudManInterface.Init(aSpudManInterface); |
|
144 |
|
145 iPdpFsmFactory = CPdpFsmFactory::NewL(); |
|
146 |
|
147 iPdpFsmFactory->InitL(aTsyName, this); |
|
148 } |
|
149 |
|
150 /** closes the FSM and frees underlying resources |
|
151 */ |
|
152 void CPdpFsmInterface::Close() |
|
153 { |
|
154 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Close()"); |
|
155 |
|
156 iSpudManInterface.Close (); |
|
157 |
|
158 if (iPdpFsmFactory) |
|
159 { |
|
160 iPdpFsmFactory->Close(); |
|
161 } |
|
162 } |
|
163 |
|
164 |
|
165 /** |
|
166 Performs and input action/notification for context ID aPdpId |
|
167 If aPdpId is KAllContexts, the notification is sent to every context, unless it is of type EServiceStatusChangeNetwork |
|
168 |
|
169 @param aPdpId the PDP context ID, 0 to KMaxPdpContexts |
|
170 @param aOperation the operation id to perform |
|
171 @param aParam extra id for ETelDriver errors |
|
172 @return error code for the synchronus patrt of the operation |
|
173 */ |
|
174 TInt CPdpFsmInterface::Input(TContextId aPdpId, const TInt aOperation, const TInt aParam) |
|
175 { |
|
176 TInt ret = KErrNone; |
|
177 |
|
178 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Input(aParam)"); |
|
179 |
|
180 ASSERT(iPdpFsmFactory); |
|
181 |
|
182 |
|
183 // Control structure is in order of the most frequent operation first (hopefully) |
|
184 // |
|
185 if (iPdpFsmFactory->ContextIsValid(aPdpId)) |
|
186 { |
|
187 // We have a valid PDP FSM Context, so go ahead with the operation... |
|
188 // |
|
189 ret = (iPdpFsmFactory->GetFsmContext(aPdpId))->Input(aOperation, aParam); |
|
190 if (aOperation == PdpFsm::EContextStatusChangeNetwork && aParam != KErrNone) |
|
191 { |
|
192 SPUDFSMVERBOSE_LOG1(_L("iSpudManInterface.SetContextTerminationErrorAndStop %d"),aParam); |
|
193 iSpudManInterface.SetContextTerminationErrorAndStop(aPdpId, aParam); |
|
194 } |
|
195 |
|
196 // Recovering memory by deleting the Fsm Context |
|
197 // |
|
198 // Tricky, definitely don't try with 'SpudMan::EContextDelete' it's far too early. |
|
199 // You can get a bit further deleting on 'PdpFsm::EContextDeleted' (and 'PdpFsm::EContextDeletedFailed') |
|
200 // from TContextDeleteStrategy::NotifyFsm(), but you then find that GuQoS is calling into Spud in order to |
|
201 // transfer data from the deleted context to another... |
|
202 // |
|
203 // Additionally, the spud unit test is expecting to be able to "reuse" deleted contexts... |
|
204 } |
|
205 else if (aPdpId == KAllContexts) |
|
206 { |
|
207 TInt err = KErrNone; |
|
208 |
|
209 // this has to be here to avoid sending it from every context |
|
210 // |
|
211 if (aOperation == PdpFsm::EServiceStatusChangeNetwork) |
|
212 { |
|
213 iPdpFsmFactory->SpudInput(KAllContexts, KNetworkStatusEvent, KErrNone); |
|
214 } |
|
215 else |
|
216 { |
|
217 for (TContextId i = 0; (i < KMaxPdpContexts) && iPdpFsmFactory->HaveFsmContext(i); i++) |
|
218 { |
|
219 // Process any current PDP contexts. |
|
220 |
|
221 err = (iPdpFsmFactory->GetFsmContext(i))->Input(aOperation, aParam); |
|
222 |
|
223 // See above about trials and tribulations of trying to recover the memory taken by these |
|
224 // CPdpFsm objects. |
|
225 |
|
226 if (err != KErrNone) |
|
227 { |
|
228 // We return the last error found, ignoring any earlier ones |
|
229 // |
|
230 ret = err; |
|
231 } |
|
232 } |
|
233 } |
|
234 } |
|
235 else |
|
236 { |
|
237 ret = KErrBadHandle; |
|
238 } |
|
239 |
|
240 return ret; |
|
241 } |
|
242 |
|
243 |
|
244 |
|
245 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
246 |
|
247 void CPdpFsmInterface::SetIMCNSignalling(TBool aImCnSignalling) |
|
248 /** |
|
249 Sets the IM CN signalling Parameters |
|
250 |
|
251 @param aImCnSignalling The status of the IMCN signalling Flag |
|
252 */ |
|
253 { |
|
254 TRAP_IGNORE(iDefaultSubConnProvd.AddIMCNInformationToParameterBundleL(aImCnSignalling)); |
|
255 } |
|
256 |
|
257 |
|
258 /** |
|
259 Set context parameters |
|
260 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts - 1 |
|
261 @param aParam - RPacketQoS::TQoSR5Requested data to set |
|
262 @return - KErrBadHandle or KErrNone |
|
263 */ |
|
264 TInt CPdpFsmInterface::Set(TContextId aPdpId, const RPacketQoS::TQoSR5Requested& aParam) |
|
265 { |
|
266 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(RPacketQoS::TQoSR5Requested)"); |
|
267 |
|
268 ASSERT(iPdpFsmFactory); |
|
269 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
270 |
|
271 TInt ret; |
|
272 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
273 { |
|
274 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
275 { |
|
276 return ret; |
|
277 } |
|
278 } |
|
279 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
280 return KErrNone; |
|
281 } |
|
282 |
|
283 |
|
284 /** |
|
285 Set context parameters |
|
286 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts - 1 |
|
287 @param aParam - RPacketQoS::TQoSR5Negotiated data to set |
|
288 @return - KErrBadHandle or KErrNone |
|
289 */ |
|
290 TInt CPdpFsmInterface::Set(TContextId aPdpId, const RPacketQoS::TQoSR5Negotiated& aParam) |
|
291 { |
|
292 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(RPacketQoS::TQoSR5Negotiated)"); |
|
293 |
|
294 ASSERT(iPdpFsmFactory); |
|
295 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
296 |
|
297 TInt ret; |
|
298 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
299 { |
|
300 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
301 { |
|
302 return ret; |
|
303 } |
|
304 } |
|
305 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
306 return KErrNone; |
|
307 } |
|
308 |
|
309 |
|
310 #else |
|
311 // !SYMBIAN_NETWORKING_UMTSR5 |
|
312 |
|
313 /** |
|
314 Set context parameters |
|
315 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
316 @param aParam - RPacketQoS::TQoSR99_R4Requested data to set |
|
317 @return - KErrBadHandle or KErrNone |
|
318 */ |
|
319 TInt CPdpFsmInterface::Set(TContextId aPdpId, const RPacketQoS::TQoSR99_R4Requested& aParam) |
|
320 { |
|
321 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(RPacketQoS::TQoSR99_R4Requested)"); |
|
322 |
|
323 ASSERT(iPdpFsmFactory); |
|
324 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
325 TInt ret; |
|
326 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
327 { |
|
328 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
329 { |
|
330 return ret; |
|
331 } |
|
332 } |
|
333 |
|
334 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
335 return KErrNone; |
|
336 } |
|
337 |
|
338 |
|
339 /** |
|
340 Set context parameters |
|
341 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
342 @param aParam - RPacketQoS::TQoSR99_R4Negotiated data to set |
|
343 @return - KErrBadHandle or KErrNone |
|
344 */ |
|
345 TInt CPdpFsmInterface::Set(TContextId aPdpId, const RPacketQoS::TQoSR99_R4Negotiated& aParam) |
|
346 { |
|
347 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(RPacketQoS::TQoSR99_R4Negotiated)"); |
|
348 |
|
349 ASSERT(iPdpFsmFactory); |
|
350 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
351 TInt ret; |
|
352 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
353 { |
|
354 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
355 { |
|
356 return ret; |
|
357 } |
|
358 } |
|
359 |
|
360 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
361 return KErrNone; |
|
362 } |
|
363 |
|
364 #endif |
|
365 // SYMBIAN_NETWORKING_UMTSR5 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 /** Set context parameters |
|
371 |
|
372 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
373 @param aParam - TFTInfo data to set |
|
374 @return - KErrBadHandle or KErrNone |
|
375 */ |
|
376 TInt CPdpFsmInterface::Set(TContextId aPdpId, const TTFTInfo& aParam) |
|
377 { |
|
378 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(TFTInfo)"); |
|
379 |
|
380 ASSERT(iPdpFsmFactory); |
|
381 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
382 |
|
383 TInt ret; |
|
384 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
385 { |
|
386 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
387 { |
|
388 return ret; |
|
389 } |
|
390 } |
|
391 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
392 return KErrNone; |
|
393 } |
|
394 |
|
395 /** Set context parameters |
|
396 |
|
397 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
398 @param aParam - TFTOperationCode to set to go with the data |
|
399 @return - KErrBadHandle or KErrNone |
|
400 */ |
|
401 TInt CPdpFsmInterface::Set(TContextId aPdpId, const TTFTOperationCode& aParam) |
|
402 { |
|
403 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(TTFTOperationCode)"); |
|
404 |
|
405 ASSERT(iPdpFsmFactory); |
|
406 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
407 |
|
408 TInt ret; |
|
409 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
410 { |
|
411 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
412 { |
|
413 return ret; |
|
414 } |
|
415 } |
|
416 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
417 return KErrNone; |
|
418 } |
|
419 |
|
420 /** Set context parameters |
|
421 |
|
422 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
423 @param aParam - RPacketContext::TDataChannelV2 data to set |
|
424 @return - KErrBadHandle or KErrNone |
|
425 */ |
|
426 TInt CPdpFsmInterface::Set(TContextId aPdpId, const RPacketContext::TDataChannelV2& aParam) |
|
427 { |
|
428 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(RPacketContext::TDataChannelV2)"); |
|
429 |
|
430 ASSERT(iPdpFsmFactory); |
|
431 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
432 |
|
433 TInt ret; |
|
434 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
435 { |
|
436 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
437 { |
|
438 return ret; |
|
439 } |
|
440 } |
|
441 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
442 return KErrNone; |
|
443 } |
|
444 |
|
445 /** Set context parameters |
|
446 |
|
447 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
448 @param aParam - RPacketContext::TContextStatus data to set |
|
449 @return - KErrBadHandle or KErrNone |
|
450 */ |
|
451 TInt CPdpFsmInterface::Set(TContextId aPdpId, const RPacketContext::TContextStatus& aParam) |
|
452 { |
|
453 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(RPacketContext::TContextStatus)"); |
|
454 |
|
455 ASSERT(iPdpFsmFactory); |
|
456 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
457 |
|
458 TInt ret; |
|
459 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
460 { |
|
461 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
462 { |
|
463 return ret; |
|
464 } |
|
465 } |
|
466 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
467 return KErrNone; |
|
468 } |
|
469 |
|
470 /** Set context parameters |
|
471 |
|
472 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
473 @param aParam - RPacketContext::TContextConfigGPRS& data to set |
|
474 @return - KErrBadHandle or KErrNone |
|
475 */ |
|
476 TInt CPdpFsmInterface::Set(TContextId aPdpId, const RPacketContext::TContextConfigGPRS& aParam) |
|
477 { |
|
478 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(RPacketContext::TContextConfigGPRS)"); |
|
479 |
|
480 ASSERT(iPdpFsmFactory); |
|
481 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
482 |
|
483 TInt ret; |
|
484 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
485 { |
|
486 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
487 { |
|
488 return ret; |
|
489 } |
|
490 } |
|
491 iPdpFsmFactory->GetFsmContext(aPdpId)->Set(aParam); |
|
492 return KErrNone; |
|
493 } |
|
494 |
|
495 /** Set network status |
|
496 |
|
497 @param aParam - RPacketService::TStatus data to set |
|
498 */ |
|
499 void CPdpFsmInterface::Set(const RPacketService::TStatus aParam) |
|
500 { |
|
501 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Set(RPacketService::TStatus)"); |
|
502 |
|
503 ASSERT(iPdpFsmFactory); |
|
504 |
|
505 iNetworkStatus = aParam; |
|
506 } |
|
507 |
|
508 /** Set ETel termination error and stop context |
|
509 |
|
510 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
511 @param aErrorCode - the Etel error code detected on this context |
|
512 */ |
|
513 void CPdpFsmInterface::SetContextTerminationErrorAndStop(TContextId aPdpId, TInt aErrorCode) |
|
514 { |
|
515 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::SetContextTerminationErrorAndStop(TContextId aPdpId, TInt aErrorCode)"); |
|
516 |
|
517 iSpudManInterface.SetContextTerminationErrorAndStop(aPdpId, aErrorCode); |
|
518 |
|
519 } |
|
520 |
|
521 |
|
522 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
523 /** |
|
524 Get context parameters |
|
525 |
|
526 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
527 @param aParam - RPacketQoS::TQoSR5Requested data to get |
|
528 @return - KErrBadHandle or KErrNone |
|
529 */ |
|
530 TInt CPdpFsmInterface::Get(TContextId aPdpId, RPacketQoS::TQoSR5Requested& aParam) const |
|
531 { |
|
532 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(RPacketQos::TQoSR5Requested)"); |
|
533 |
|
534 ASSERT(iPdpFsmFactory); |
|
535 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
536 |
|
537 TInt ret; |
|
538 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
539 { |
|
540 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
541 { |
|
542 return ret; |
|
543 } |
|
544 } |
|
545 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
546 return KErrNone; |
|
547 } |
|
548 |
|
549 |
|
550 /** |
|
551 Get context parameters |
|
552 |
|
553 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
554 @param aParam - RPacketQoS::TQoSR5Negotiated data to get |
|
555 @return - KErrBadHandle or KErrNone |
|
556 */ |
|
557 TInt CPdpFsmInterface::Get(TContextId aPdpId, RPacketQoS::TQoSR5Negotiated& aParam) const |
|
558 { |
|
559 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(RPacketQoS::TQoSR5Negotiated)"); |
|
560 |
|
561 ASSERT(iPdpFsmFactory); |
|
562 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
563 |
|
564 TInt ret; |
|
565 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
566 { |
|
567 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
568 { |
|
569 return ret; |
|
570 } |
|
571 } |
|
572 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
573 return KErrNone; |
|
574 } |
|
575 |
|
576 #else |
|
577 // !SYMBIAN_NETWORKING_UMTSR5 |
|
578 |
|
579 /** |
|
580 Get context parameters |
|
581 |
|
582 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
583 @param aParam - RPacketQoS::TQoSR99_R4Requested data to get |
|
584 @return - KErrBadHandle or KErrNone |
|
585 */ |
|
586 TInt CPdpFsmInterface::Get(TContextId aPdpId, RPacketQoS::TQoSR99_R4Requested& aParam) const |
|
587 { |
|
588 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(RPacketQos::TQoSRequestedR99_R4)"); |
|
589 |
|
590 ASSERT(iPdpFsmFactory); |
|
591 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
592 |
|
593 TInt ret; |
|
594 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
595 { |
|
596 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
597 { |
|
598 return ret; |
|
599 } |
|
600 } |
|
601 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
602 return KErrNone; |
|
603 } |
|
604 |
|
605 |
|
606 /** |
|
607 Get context parameters |
|
608 |
|
609 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
610 @param aParam - RPacketQoS::TQoSR99_R4Negotiated data to get |
|
611 @return - KErrBadHandle or KErrNone |
|
612 */ |
|
613 TInt CPdpFsmInterface::Get(TContextId aPdpId, RPacketQoS::TQoSR99_R4Negotiated& aParam) const |
|
614 { |
|
615 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(RPacketQoS::TQoSR99_R4Negotiated)"); |
|
616 |
|
617 ASSERT(iPdpFsmFactory); |
|
618 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
619 |
|
620 TInt ret; |
|
621 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
622 { |
|
623 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
624 { |
|
625 return ret; |
|
626 } |
|
627 } |
|
628 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
629 return KErrNone; |
|
630 } |
|
631 |
|
632 #endif |
|
633 // SYMBIAN_NETWORKING_UMTSR5 |
|
634 |
|
635 |
|
636 |
|
637 /** Get context parameters |
|
638 |
|
639 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
640 @param aParam - TTFTInfo data to get |
|
641 @return - KErrBadHandle or KErrNone |
|
642 */ |
|
643 TInt CPdpFsmInterface::Get(TContextId aPdpId, TTFTInfo& aParam) const |
|
644 { |
|
645 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(TFTInfo)"); |
|
646 |
|
647 ASSERT(iPdpFsmFactory); |
|
648 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
649 |
|
650 TInt ret; |
|
651 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
652 { |
|
653 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
654 { |
|
655 return ret; |
|
656 } |
|
657 } |
|
658 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
659 return KErrNone; |
|
660 } |
|
661 |
|
662 /** Get context parameters |
|
663 |
|
664 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
665 @param aParam - TTFTOperationCode for the TFT data |
|
666 @return - KErrBadHandle or KErrNone |
|
667 */ |
|
668 TInt CPdpFsmInterface::Get(TContextId aPdpId, TTFTOperationCode& aParam) const |
|
669 { |
|
670 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(TFTInfo)"); |
|
671 |
|
672 ASSERT(iPdpFsmFactory); |
|
673 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
674 |
|
675 TInt ret; |
|
676 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
677 { |
|
678 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
679 { |
|
680 return ret; |
|
681 } |
|
682 } |
|
683 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
684 return KErrNone; |
|
685 } |
|
686 |
|
687 |
|
688 |
|
689 /** Get context parameters |
|
690 |
|
691 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
692 @param aParam - RPacketContext::TDataChannelV2 data to set |
|
693 @return - KErrBadHandle or KErrNone |
|
694 */ |
|
695 TInt CPdpFsmInterface::Get(TContextId aPdpId, RPacketContext::TDataChannelV2& aParam) const |
|
696 { |
|
697 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(RPacketContext::TDataChannelV2)"); |
|
698 |
|
699 ASSERT(iPdpFsmFactory); |
|
700 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
701 |
|
702 TInt ret; |
|
703 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
704 { |
|
705 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
706 { |
|
707 return ret; |
|
708 } |
|
709 } |
|
710 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
711 return KErrNone; |
|
712 } |
|
713 |
|
714 /** Get context parameters |
|
715 |
|
716 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
717 @param aParam - RPacketContext::TContextConfigGPRS data to set |
|
718 @return - KErrBadHandle or KErrNone |
|
719 */ |
|
720 TInt CPdpFsmInterface::Get(TContextId aPdpId, RPacketContext::TContextConfigGPRS& aParam) const |
|
721 { |
|
722 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(RPacketContext::TContextConfigGPRS)"); |
|
723 |
|
724 ASSERT(iPdpFsmFactory); |
|
725 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
726 |
|
727 TInt ret; |
|
728 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
729 { |
|
730 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
731 { |
|
732 return ret; |
|
733 } |
|
734 } |
|
735 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
736 return KErrNone; |
|
737 } |
|
738 |
|
739 /** Get context parameters |
|
740 |
|
741 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
742 @param aParam - RPacketContext::TContextStatus data to get |
|
743 @return - KErrBadHandle or KErrNone |
|
744 */ |
|
745 TInt CPdpFsmInterface::Get(TContextId aPdpId, RPacketContext::TContextStatus& aParam) const |
|
746 { |
|
747 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(RPacketContext::TContextStatus)"); |
|
748 |
|
749 ASSERT(iPdpFsmFactory); |
|
750 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
751 |
|
752 TInt ret; |
|
753 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
754 { |
|
755 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
756 { |
|
757 return ret; |
|
758 } |
|
759 } |
|
760 iPdpFsmFactory->GetFsmContext(aPdpId)->Get(aParam); |
|
761 return KErrNone; |
|
762 } |
|
763 |
|
764 /** Get context parameters |
|
765 |
|
766 @param aPdpId - the PDP context ID, 0 to KMaxPdpContexts |
|
767 @param aParam - RPacketContext::TContextConfigGPRS data to set |
|
768 @return - KErrBadHandle or KErrNone |
|
769 */ |
|
770 void CPdpFsmInterface::Get(RPacketService::TStatus& aParam) |
|
771 { |
|
772 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::Get(RPacketService::TStatus)"); |
|
773 |
|
774 ASSERT(iPdpFsmFactory); |
|
775 |
|
776 aParam = iNetworkStatus; |
|
777 } |
|
778 |
|
779 |
|
780 TInt CPdpFsmInterface::GetLastErrorCause(TContextId aPdpId, TInt& aLastErrorCause) const |
|
781 { |
|
782 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::GetLastErrorCause(RPacketContext::GetLastErrorCause)"); |
|
783 |
|
784 ASSERT(iPdpFsmFactory); |
|
785 ASSERT(iPdpFsmFactory->ContextIdIsValid(aPdpId)); |
|
786 |
|
787 TInt ret; |
|
788 if (!iPdpFsmFactory->HaveFsmContext(aPdpId)) |
|
789 { |
|
790 if ((ret = iPdpFsmFactory->NewFsmContext(aPdpId)) != KErrNone) |
|
791 { |
|
792 return ret; |
|
793 } |
|
794 } |
|
795 |
|
796 iPdpFsmFactory->GetFsmContext(aPdpId)->GetLastErrorCause(aLastErrorCause); |
|
797 |
|
798 return KErrNone; |
|
799 } |
|
800 |
|
801 /** Get the TsyName |
|
802 |
|
803 @return - TsyName in a TName |
|
804 */ |
|
805 const TName& CPdpFsmInterface::TsyName(void) |
|
806 { |
|
807 SPUDFSMVERBOSE_FNLOG("CPdpFsmInterface::TsyName"); |
|
808 |
|
809 ASSERT(iPdpFsmFactory); |
|
810 |
|
811 return iPdpFsmFactory->TsyName(); |
|
812 } |
|
813 |
|
814 |