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