|
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 // Header for etel driver context class |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #ifndef CETELDRIVERCONTEXT_H |
|
24 #define CETELDRIVERCONTEXT_H |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <etelmm.h> |
|
28 #include <etelqos.h> |
|
29 #include <networking/umtsnifcontrolif.h> |
|
30 #include <pcktretrieve.h> |
|
31 |
|
32 #include "eteldrivernmspace.h" |
|
33 #include "PDPFSM.h" |
|
34 #include "meteldriverstrategy.h" |
|
35 #include "pdpfsmnmspace.h" |
|
36 |
|
37 |
|
38 class CEtelDriverFactory; |
|
39 |
|
40 //using namespace EtelDriver; |
|
41 /** |
|
42 A data storage for pdp context |
|
43 |
|
44 @internalComponent |
|
45 */ |
|
46 class CEtelDriverContext : public CActive |
|
47 { |
|
48 public: |
|
49 static CEtelDriverContext* NewL(TContextId aId, SpudMan::TPdpContextType aContextType, CEtelDriverFactory& aFactory); |
|
50 virtual ~CEtelDriverContext(); |
|
51 |
|
52 TInt Input (EtelDriver::TEtelInput aOperation); |
|
53 |
|
54 void StartNotifications() const; |
|
55 void StopNotifications() const; |
|
56 |
|
57 // CActive methods |
|
58 |
|
59 /** accessors, basic */ |
|
60 inline TContextId Id() const; |
|
61 inline SpudMan::TPdpContextType ContextType() const; |
|
62 inline TName& Name(); |
|
63 inline TRequestStatus& CompletionStatus(); |
|
64 MEtelDriverStrategy::TSequenceStep StrategyStep() const; |
|
65 inline void SetStrategyStep (MEtelDriverStrategy::TSequenceStep aStep); |
|
66 |
|
67 |
|
68 /** accessors, eTel objects */ |
|
69 inline RPacketQoS& PacketQoS(); |
|
70 inline RPacketContext& PacketContext(); |
|
71 |
|
72 inline RPacketMbmsContext& MbmsPacketContext(); |
|
73 |
|
74 |
|
75 RPhone& Phone() const; |
|
76 RPacketService& PacketService() const; |
|
77 CPdpFsmInterface& PdpFsmInterface() const; |
|
78 const TName& ExistingContextName() const; |
|
79 |
|
80 /** context data accessors */ |
|
81 |
|
82 inline TRequestedProfileBuffer& QosRequested(); |
|
83 inline TNegotiatedProfileBuffer& QosNegotiated(); |
|
84 |
|
85 inline TPacketDataConfigBase& ContextPacketDataConfigBase(); |
|
86 inline TDes8& ContextConfig(); |
|
87 inline RPacketMbmsContext::TContextConfigMbmsV1& ContextConfigMbms(); |
|
88 |
|
89 inline TRequestedProfileBufferPckg& QosRequestedPckg(); |
|
90 inline TNegotiatedProfileBufferPckg& QosNegotiatedPckg(); |
|
91 inline EtelDriver::TContextConfigGPRSPckg& ContextConfigGPRSPckg(); |
|
92 inline EtelDriver::TContextConfigMbmsV1Pckg& ContextConfigMbmsPckg(); |
|
93 inline TInt SessionId(); |
|
94 inline RPacketContext::TDataChannelV2& DataChannelV2(); |
|
95 inline RPacketContext::TDataChannelV2Pckg& DataChannelV2Pckg(); |
|
96 inline TTFTInfo& TftInfo(); |
|
97 inline RPacketContext::TPacketFilterV2& FilterV2(); |
|
98 inline RPacketContext::TPacketFilterV2Pckg& FilterV2Pckg(); |
|
99 inline TUint8 TftRequested() const; |
|
100 inline TInt FirstFilterV2(); |
|
101 inline TInt NextFilterV2(); |
|
102 inline TTFTOperationCode& TftOperationCode(); |
|
103 inline TSessionOperatioInfo& GetSessionInfo() ; |
|
104 inline TInt GetSessionIndex() const; |
|
105 inline void SetSessionIndex(const TInt aSessionIndex); |
|
106 inline void SetRetrievePcktMbmsSessionList(CRetrievePcktMbmsSessionList* aPcktContextSessionList); |
|
107 inline CRetrievePcktMbmsSessionList* RetrievePcktMbmsSessionList(); |
|
108 inline void SetMbmsSession(RPacketMbmsContext::CMbmsSession* aMbmsSesion); |
|
109 inline RPacketMbmsContext::CMbmsSession* MbmsSession(); |
|
110 |
|
111 inline RPacketContext::TContextStatus& ContextStatus(); |
|
112 |
|
113 #ifdef _DEBUG |
|
114 void DumpReqProfileParameters (); |
|
115 void DumpNegProfileParameters (); |
|
116 #endif |
|
117 |
|
118 protected: |
|
119 MEtelDriverStrategy& Strategy(EtelDriver::TEtelDriverStrategy aId) const; |
|
120 |
|
121 // CActive methods |
|
122 virtual void RunL(); |
|
123 virtual void DoCancel(); |
|
124 |
|
125 private: |
|
126 CEtelDriverContext (TContextId aId, SpudMan::TPdpContextType aContextType, CEtelDriverFactory& aFactory); |
|
127 void ConstructL(); |
|
128 |
|
129 protected: |
|
130 /** ID */ |
|
131 TContextId iId; |
|
132 /* context type */ |
|
133 SpudMan::TPdpContextType iContextType; |
|
134 /** tsy name of a context */ |
|
135 TName iName; |
|
136 /** request status */ |
|
137 TRequestStatus iCompletionStatus; |
|
138 /** active strategy step */ |
|
139 MEtelDriverStrategy::TSequenceStep iStrategyStep; |
|
140 /** id of active strategy */ |
|
141 EtelDriver::TEtelDriverStrategy iStrategyId; |
|
142 |
|
143 /** packet QoS */ |
|
144 RPacketQoS iPacketQoS; |
|
145 /** packet context */ |
|
146 RPacketContext iPacketContext; |
|
147 |
|
148 // factory data: |
|
149 /** etel driver factory */ |
|
150 CEtelDriverFactory& iFactory; |
|
151 |
|
152 // data from pdp fsm |
|
153 // all members below contain valid data for limited time only, |
|
154 // i.e. for the duration of a strategy OR a duration of a single call to etel |
|
155 /** Requested QoS */ |
|
156 TRequestedProfileBuffer iQosRequested; |
|
157 TRequestedProfileBufferPckg iQosRequestedPckg; |
|
158 |
|
159 /** Negotiated QoS */ |
|
160 TNegotiatedProfileBuffer iQosNegotiated; |
|
161 TNegotiatedProfileBufferPckg iQosNegotiatedPckg; |
|
162 |
|
163 /** context config */ |
|
164 RBuf8 iContextConfig; |
|
165 /** tft info */ |
|
166 TTFTInfo iTftInfo; |
|
167 /** data channel V2 */ |
|
168 RPacketContext::TDataChannelV2 iDataChannelV2; |
|
169 /** packaged data channel V2 */ |
|
170 RPacketContext::TDataChannelV2Pckg iDataChannelV2Pckg; |
|
171 |
|
172 /*mbms packet context*/ |
|
173 RPacketMbmsContext iMbmsPacketContext; |
|
174 CRetrievePcktMbmsSessionList* iPcktMbmsSessionList; |
|
175 RPacketMbmsContext::CMbmsSession* iMbmsSession; |
|
176 RPacketMbmsContext::TContextConfigMbmsV1 iContextConfigMbms; |
|
177 RPacketMbmsContext::TContextConfigMbmsV1Pckg iContextConfigMbmsPckg; |
|
178 TSessionOperatioInfo iSessionInfo; |
|
179 TInt iSessionIndex; |
|
180 |
|
181 |
|
182 private: |
|
183 // TFT data |
|
184 /** local var for tft count */ |
|
185 TUint8 iTftRequested; |
|
186 /** local V2 filter */ |
|
187 RPacketContext::TPacketFilterV2 iFilterV2; |
|
188 /** local packaged V2 filter */ |
|
189 EtelDriver::TPacketFilterV2Pckg iFilterV2Pckg; |
|
190 /** TFT Operation Code */ |
|
191 TTFTOperationCode iTftOperationCode; |
|
192 |
|
193 RPacketContext::TContextStatus iContextStatus; |
|
194 }; |
|
195 |
|
196 |
|
197 // inlines |
|
198 /** accessor |
|
199 |
|
200 @return id of first V2 filter |
|
201 */ |
|
202 inline TInt CEtelDriverContext::FirstFilterV2() |
|
203 { |
|
204 iTftInfo.SetToFirst(); |
|
205 iTftRequested = 0; |
|
206 return iTftInfo.NextPacketFilter(iFilterV2); |
|
207 } |
|
208 |
|
209 /** accessor |
|
210 |
|
211 @return id of next V2 filter |
|
212 */ |
|
213 inline TInt CEtelDriverContext::NextFilterV2() |
|
214 { |
|
215 TInt err = iTftInfo.NextPacketFilter(iFilterV2); |
|
216 if (err == KErrNone) |
|
217 { |
|
218 ++iTftRequested; |
|
219 } |
|
220 return err; |
|
221 } |
|
222 |
|
223 /** accessor |
|
224 |
|
225 @return context id |
|
226 */ |
|
227 inline TContextId CEtelDriverContext::Id() const |
|
228 { |
|
229 return iId; |
|
230 } |
|
231 |
|
232 |
|
233 /** accessor |
|
234 |
|
235 @return context id |
|
236 */ |
|
237 inline SpudMan::TPdpContextType CEtelDriverContext::ContextType() const |
|
238 { |
|
239 return iContextType; |
|
240 } |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 /** accessor |
|
246 |
|
247 @return reference to name of pdp context |
|
248 */ |
|
249 inline TName& CEtelDriverContext::Name() |
|
250 { |
|
251 return iName; |
|
252 } |
|
253 |
|
254 /** accessor |
|
255 |
|
256 @return reference to request status |
|
257 */ |
|
258 inline TRequestStatus& CEtelDriverContext::CompletionStatus() |
|
259 { |
|
260 return iCompletionStatus; |
|
261 } |
|
262 |
|
263 /** accessor |
|
264 |
|
265 @return strategy sequence step |
|
266 */ |
|
267 inline MEtelDriverStrategy::TSequenceStep CEtelDriverContext::StrategyStep() const |
|
268 { |
|
269 return iStrategyStep; |
|
270 } |
|
271 |
|
272 /** sets strategy sequence step |
|
273 |
|
274 @param aStep - strategy sequence step |
|
275 */ |
|
276 inline void CEtelDriverContext::SetStrategyStep(MEtelDriverStrategy::TSequenceStep aStep) |
|
277 { |
|
278 iStrategyStep = aStep; |
|
279 } |
|
280 |
|
281 /** accessor |
|
282 |
|
283 @return reference to etel packet QoS |
|
284 */ |
|
285 inline RPacketQoS& CEtelDriverContext::PacketQoS() |
|
286 { |
|
287 return iPacketQoS; |
|
288 } |
|
289 |
|
290 /** accessor |
|
291 |
|
292 @return reference to etel packet context |
|
293 */ |
|
294 inline RPacketContext& CEtelDriverContext::PacketContext() |
|
295 { |
|
296 return iPacketContext; |
|
297 } |
|
298 |
|
299 /** accessor |
|
300 |
|
301 @return reference to mbms etel packet context |
|
302 */ |
|
303 inline RPacketMbmsContext& CEtelDriverContext::MbmsPacketContext() |
|
304 { |
|
305 return iMbmsPacketContext; |
|
306 } |
|
307 |
|
308 |
|
309 inline TSessionOperatioInfo& CEtelDriverContext::GetSessionInfo() |
|
310 { |
|
311 return iSessionInfo; |
|
312 } |
|
313 inline TInt CEtelDriverContext::GetSessionIndex() const |
|
314 { |
|
315 return iSessionIndex; |
|
316 } |
|
317 inline void CEtelDriverContext::SetSessionIndex(const TInt aSessionIndex) |
|
318 { |
|
319 iSessionIndex=aSessionIndex; |
|
320 } |
|
321 |
|
322 |
|
323 inline void CEtelDriverContext::SetRetrievePcktMbmsSessionList(CRetrievePcktMbmsSessionList* aPcktContextSessionList) |
|
324 { |
|
325 iPcktMbmsSessionList= aPcktContextSessionList; |
|
326 } |
|
327 |
|
328 inline CRetrievePcktMbmsSessionList* CEtelDriverContext::RetrievePcktMbmsSessionList() |
|
329 { |
|
330 return iPcktMbmsSessionList; |
|
331 } |
|
332 |
|
333 inline void CEtelDriverContext::SetMbmsSession(RPacketMbmsContext::CMbmsSession* aMbmsSession) |
|
334 { |
|
335 iMbmsSession=aMbmsSession; |
|
336 } |
|
337 |
|
338 inline RPacketMbmsContext::CMbmsSession* CEtelDriverContext::MbmsSession() |
|
339 { |
|
340 return iMbmsSession; |
|
341 } |
|
342 |
|
343 |
|
344 // context data accessors |
|
345 /** |
|
346 accessor |
|
347 @return reference to QoSR5Requested |
|
348 */ |
|
349 |
|
350 inline TRequestedProfileBuffer& CEtelDriverContext::QosRequested() |
|
351 { |
|
352 return iQosRequested; |
|
353 } |
|
354 |
|
355 |
|
356 inline TNegotiatedProfileBuffer& CEtelDriverContext::QosNegotiated() |
|
357 { |
|
358 return iQosNegotiated; |
|
359 } |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 /** accessor |
|
367 |
|
368 @return reference to TRequestedProfileBufferPckg |
|
369 */ |
|
370 inline TRequestedProfileBufferPckg& CEtelDriverContext::QosRequestedPckg() |
|
371 { |
|
372 return iQosRequestedPckg; |
|
373 } |
|
374 |
|
375 /** |
|
376 accessor |
|
377 @return reference to TNegotiatedProfileBufferPckg |
|
378 */ |
|
379 inline TNegotiatedProfileBufferPckg& CEtelDriverContext::QosNegotiatedPckg() |
|
380 { |
|
381 return iQosNegotiatedPckg; |
|
382 } |
|
383 |
|
384 |
|
385 /** |
|
386 accessor |
|
387 @return reference to ContextConfig as PacketDataConfigBase |
|
388 */ |
|
389 inline TPacketDataConfigBase& CEtelDriverContext::ContextPacketDataConfigBase() |
|
390 { |
|
391 return *const_cast<TPacketDataConfigBase*>(reinterpret_cast<const TPacketDataConfigBase*>(iContextConfig.Ptr())); |
|
392 } |
|
393 /** accessor |
|
394 |
|
395 @return reference to ContextConfigMbmsPckg |
|
396 */ |
|
397 |
|
398 inline RPacketMbmsContext::TContextConfigMbmsV1& CEtelDriverContext::ContextConfigMbms() |
|
399 { |
|
400 return iContextConfigMbms; |
|
401 } |
|
402 |
|
403 |
|
404 |
|
405 /** accessor |
|
406 |
|
407 @return reference to ContextConfig |
|
408 */ |
|
409 inline TDes8& CEtelDriverContext::ContextConfig() |
|
410 { |
|
411 return iContextConfig; |
|
412 } |
|
413 |
|
414 |
|
415 |
|
416 inline EtelDriver::TContextConfigMbmsV1Pckg& CEtelDriverContext::ContextConfigMbmsPckg() |
|
417 { |
|
418 return iContextConfigMbmsPckg; |
|
419 } |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 /** accessor |
|
425 |
|
426 @return reference to packet context' DataChannelV2 |
|
427 */ |
|
428 inline RPacketContext::TDataChannelV2& CEtelDriverContext::DataChannelV2() |
|
429 { |
|
430 return iDataChannelV2; |
|
431 } |
|
432 |
|
433 /** accessor |
|
434 |
|
435 @return reference to packet context' DataChannelV2Pckg |
|
436 */ |
|
437 inline RPacketContext::TDataChannelV2Pckg& CEtelDriverContext::DataChannelV2Pckg() |
|
438 { |
|
439 return iDataChannelV2Pckg; |
|
440 } |
|
441 |
|
442 /** accessor |
|
443 |
|
444 @return reference to TFT info |
|
445 */ |
|
446 inline TTFTInfo& CEtelDriverContext::TftInfo() |
|
447 { |
|
448 return iTftInfo; |
|
449 } |
|
450 |
|
451 /** accessor |
|
452 |
|
453 @return reference to packet context' PacketFilterV2 |
|
454 */ |
|
455 inline RPacketContext::TPacketFilterV2& CEtelDriverContext::FilterV2() |
|
456 { |
|
457 return iFilterV2; |
|
458 } |
|
459 |
|
460 /** accessor |
|
461 |
|
462 @return reference to packet context' PacketFilterV2Pckg |
|
463 */ |
|
464 inline RPacketContext::TPacketFilterV2Pckg& CEtelDriverContext::FilterV2Pckg() |
|
465 { |
|
466 return iFilterV2Pckg; |
|
467 } |
|
468 |
|
469 /** accessor |
|
470 |
|
471 @return requested TFT |
|
472 */ |
|
473 inline TUint8 CEtelDriverContext::TftRequested() const |
|
474 { |
|
475 return iTftRequested; |
|
476 } |
|
477 |
|
478 /** accessor |
|
479 |
|
480 @return reference to TFT operation code |
|
481 */ |
|
482 inline TTFTOperationCode& CEtelDriverContext::TftOperationCode() |
|
483 { |
|
484 return iTftOperationCode; |
|
485 } |
|
486 |
|
487 |
|
488 /** accessor |
|
489 |
|
490 @return reference to ContextStatus |
|
491 */ |
|
492 inline RPacketContext::TContextStatus& CEtelDriverContext::ContextStatus() |
|
493 { |
|
494 return iContextStatus; |
|
495 } |
|
496 |
|
497 #endif |
|
498 // CETELDRIVERCONTEXT_H |