44
|
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 |
|
|
31 |
#include "eteldrivernmspace.h"
|
|
32 |
#include "PDPFSM.h"
|
|
33 |
#include "meteldriverstrategy.h"
|
|
34 |
#include "pdpfsmnmspace.h"
|
|
35 |
|
|
36 |
|
|
37 |
class CEtelDriverFactory;
|
|
38 |
|
|
39 |
//using namespace EtelDriver;
|
|
40 |
/**
|
|
41 |
A data storage for pdp context
|
|
42 |
|
|
43 |
@internalComponent
|
|
44 |
*/
|
|
45 |
class CEtelDriverContext : public CActive
|
|
46 |
{
|
|
47 |
public:
|
|
48 |
CEtelDriverContext (TContextId aId, CEtelDriverFactory& aFactory);
|
|
49 |
virtual ~CEtelDriverContext();
|
|
50 |
|
|
51 |
TInt Input (EtelDriver::TEtelInput aOperation);
|
|
52 |
|
|
53 |
void StartNotifications() const;
|
|
54 |
void StopNotifications() const;
|
|
55 |
|
|
56 |
void PdpStatusChangeNotifierCancel();
|
|
57 |
void QoSChangeNotifierCancel();
|
|
58 |
void PdpConfigChangeNotifierCancel();
|
|
59 |
|
|
60 |
// CActive methods
|
|
61 |
|
|
62 |
/** accessors, basic */
|
|
63 |
inline TContextId Id() const;
|
|
64 |
inline TName& Name();
|
|
65 |
inline TRequestStatus& CompletionStatus();
|
|
66 |
MEtelDriverStrategy::TSequenceStep StrategyStep() const;
|
|
67 |
inline void SetStrategyStep (MEtelDriverStrategy::TSequenceStep aStep);
|
|
68 |
|
|
69 |
|
|
70 |
/** accessors, eTel objects */
|
|
71 |
inline RPacketQoS& PacketQoS();
|
|
72 |
inline RPacketContext& PacketContext();
|
|
73 |
RPhone& Phone() const;
|
|
74 |
RPacketService& PacketService() const;
|
|
75 |
CPdpFsmInterface& PdpFsmInterface() const;
|
|
76 |
const TName& ExistingContextName() const;
|
|
77 |
|
|
78 |
/** context data accessors */
|
|
79 |
|
|
80 |
inline TRequestedProfileBuffer& QosRequested();
|
|
81 |
inline TNegotiatedProfileBuffer& QosNegotiated();
|
|
82 |
|
|
83 |
inline RPacketContext::TContextConfigGPRS& ContextConfigGPRS();
|
|
84 |
|
|
85 |
inline TRequestedProfileBufferPckg& QosRequestedPckg();
|
|
86 |
inline TNegotiatedProfileBufferPckg& QosNegotiatedPckg();
|
|
87 |
inline EtelDriver::TContextConfigGPRSPckg& ContextConfigGPRSPckg();
|
|
88 |
inline RPacketContext::TDataChannelV2& DataChannelV2();
|
|
89 |
inline RPacketContext::TDataChannelV2Pckg& DataChannelV2Pckg();
|
|
90 |
inline TTFTInfo& TftInfo();
|
|
91 |
inline RPacketContext::TPacketFilterV2& FilterV2();
|
|
92 |
inline RPacketContext::TPacketFilterV2Pckg& FilterV2Pckg();
|
|
93 |
inline TUint8 TftRequested() const;
|
|
94 |
inline TInt FirstFilterV2();
|
|
95 |
inline TInt NextFilterV2();
|
|
96 |
inline TTFTOperationCode& TftOperationCode();
|
|
97 |
|
|
98 |
#ifdef _DEBUG
|
|
99 |
void DumpReqProfileParameters ();
|
|
100 |
void DumpNegProfileParameters ();
|
|
101 |
#endif
|
|
102 |
|
|
103 |
protected:
|
|
104 |
MEtelDriverStrategy& Strategy(EtelDriver::TEtelDriverStrategy aId) const;
|
|
105 |
|
|
106 |
// CActive methods
|
|
107 |
virtual void RunL();
|
|
108 |
virtual void DoCancel();
|
|
109 |
|
|
110 |
protected:
|
|
111 |
/** ID */
|
|
112 |
TContextId iId;
|
|
113 |
/** tsy name of a context */
|
|
114 |
TName iName;
|
|
115 |
/** request status */
|
|
116 |
TRequestStatus iCompletionStatus;
|
|
117 |
/** active strategy step */
|
|
118 |
MEtelDriverStrategy::TSequenceStep iStrategyStep;
|
|
119 |
/** id of active strategy */
|
|
120 |
EtelDriver::TEtelDriverStrategy iStrategyId;
|
|
121 |
|
|
122 |
/** packet QoS */
|
|
123 |
RPacketQoS iPacketQoS;
|
|
124 |
/** packet context */
|
|
125 |
RPacketContext iPacketContext;
|
|
126 |
|
|
127 |
// factory data:
|
|
128 |
/** etel driver factory */
|
|
129 |
CEtelDriverFactory& iFactory;
|
|
130 |
|
|
131 |
// data from pdp fsm
|
|
132 |
// all members below contain valid data for limited time only,
|
|
133 |
// i.e. for the duration of a strategy OR a duration of a single call to etel
|
|
134 |
/** Requested QoS */
|
|
135 |
TRequestedProfileBuffer iQosRequested;
|
|
136 |
TRequestedProfileBufferPckg iQosRequestedPckg;
|
|
137 |
|
|
138 |
/** Negotiated QoS */
|
|
139 |
TNegotiatedProfileBuffer iQosNegotiated;
|
|
140 |
TNegotiatedProfileBufferPckg iQosNegotiatedPckg;
|
|
141 |
|
|
142 |
|
|
143 |
/** context config */
|
|
144 |
RPacketContext::TContextConfigGPRS iContextConfigGPRS;
|
|
145 |
/** packaged context config */
|
|
146 |
EtelDriver::TContextConfigGPRSPckg iContextConfigGPRSPckg;
|
|
147 |
/** tft info */
|
|
148 |
TTFTInfo iTftInfo;
|
|
149 |
/** data channel V2 */
|
|
150 |
RPacketContext::TDataChannelV2 iDataChannelV2;
|
|
151 |
/** packaged data channel V2 */
|
|
152 |
RPacketContext::TDataChannelV2Pckg iDataChannelV2Pckg;
|
|
153 |
|
|
154 |
private:
|
|
155 |
// TFT data
|
|
156 |
/** local var for tft count */
|
|
157 |
TUint8 iTftRequested;
|
|
158 |
/** local V2 filter */
|
|
159 |
RPacketContext::TPacketFilterV2 iFilterV2;
|
|
160 |
/** local packaged V2 filter */
|
|
161 |
EtelDriver::TPacketFilterV2Pckg iFilterV2Pckg;
|
|
162 |
/** TFT Operation Code */
|
|
163 |
TTFTOperationCode iTftOperationCode;
|
|
164 |
};
|
|
165 |
|
|
166 |
|
|
167 |
// inlines
|
|
168 |
/** accessor
|
|
169 |
|
|
170 |
@return id of first V2 filter
|
|
171 |
*/
|
|
172 |
inline TInt CEtelDriverContext::FirstFilterV2()
|
|
173 |
{
|
|
174 |
iTftInfo.SetToFirst();
|
|
175 |
iTftRequested = 0;
|
|
176 |
return iTftInfo.NextPacketFilter(iFilterV2);
|
|
177 |
}
|
|
178 |
|
|
179 |
/** accessor
|
|
180 |
|
|
181 |
@return id of next V2 filter
|
|
182 |
*/
|
|
183 |
inline TInt CEtelDriverContext::NextFilterV2()
|
|
184 |
{
|
|
185 |
TInt err = iTftInfo.NextPacketFilter(iFilterV2);
|
|
186 |
if (err == KErrNone)
|
|
187 |
{
|
|
188 |
++iTftRequested;
|
|
189 |
}
|
|
190 |
return err;
|
|
191 |
}
|
|
192 |
|
|
193 |
/** accessor
|
|
194 |
|
|
195 |
@return context id
|
|
196 |
*/
|
|
197 |
inline TContextId CEtelDriverContext::Id() const
|
|
198 |
{
|
|
199 |
return iId;
|
|
200 |
}
|
|
201 |
|
|
202 |
/** accessor
|
|
203 |
|
|
204 |
@return reference to name of pdp context
|
|
205 |
*/
|
|
206 |
inline TName& CEtelDriverContext::Name()
|
|
207 |
{
|
|
208 |
return iName;
|
|
209 |
}
|
|
210 |
|
|
211 |
/** accessor
|
|
212 |
|
|
213 |
@return reference to request status
|
|
214 |
*/
|
|
215 |
inline TRequestStatus& CEtelDriverContext::CompletionStatus()
|
|
216 |
{
|
|
217 |
return iCompletionStatus;
|
|
218 |
}
|
|
219 |
|
|
220 |
/** accessor
|
|
221 |
|
|
222 |
@return strategy sequence step
|
|
223 |
*/
|
|
224 |
inline MEtelDriverStrategy::TSequenceStep CEtelDriverContext::StrategyStep() const
|
|
225 |
{
|
|
226 |
return iStrategyStep;
|
|
227 |
}
|
|
228 |
|
|
229 |
/** sets strategy sequence step
|
|
230 |
|
|
231 |
@param aStep - strategy sequence step
|
|
232 |
*/
|
|
233 |
inline void CEtelDriverContext::SetStrategyStep(MEtelDriverStrategy::TSequenceStep aStep)
|
|
234 |
{
|
|
235 |
iStrategyStep = aStep;
|
|
236 |
}
|
|
237 |
|
|
238 |
/** accessor
|
|
239 |
|
|
240 |
@return reference to etel packet QoS
|
|
241 |
*/
|
|
242 |
inline RPacketQoS& CEtelDriverContext::PacketQoS()
|
|
243 |
{
|
|
244 |
return iPacketQoS;
|
|
245 |
}
|
|
246 |
|
|
247 |
/** accessor
|
|
248 |
|
|
249 |
@return reference to etel packet context
|
|
250 |
*/
|
|
251 |
inline RPacketContext& CEtelDriverContext::PacketContext()
|
|
252 |
{
|
|
253 |
return iPacketContext;
|
|
254 |
}
|
|
255 |
|
|
256 |
|
|
257 |
// context data accessors
|
|
258 |
/**
|
|
259 |
accessor
|
|
260 |
@return reference to QoSR5Requested
|
|
261 |
*/
|
|
262 |
|
|
263 |
inline TRequestedProfileBuffer& CEtelDriverContext::QosRequested()
|
|
264 |
{
|
|
265 |
return iQosRequested;
|
|
266 |
}
|
|
267 |
|
|
268 |
|
|
269 |
inline TNegotiatedProfileBuffer& CEtelDriverContext::QosNegotiated()
|
|
270 |
{
|
|
271 |
return iQosNegotiated;
|
|
272 |
}
|
|
273 |
|
|
274 |
|
|
275 |
|
|
276 |
|
|
277 |
|
|
278 |
|
|
279 |
/** accessor
|
|
280 |
|
|
281 |
@return reference to TRequestedProfileBufferPckg
|
|
282 |
*/
|
|
283 |
inline TRequestedProfileBufferPckg& CEtelDriverContext::QosRequestedPckg()
|
|
284 |
{
|
|
285 |
return iQosRequestedPckg;
|
|
286 |
}
|
|
287 |
|
|
288 |
/**
|
|
289 |
accessor
|
|
290 |
@return reference to TNegotiatedProfileBufferPckg
|
|
291 |
*/
|
|
292 |
inline TNegotiatedProfileBufferPckg& CEtelDriverContext::QosNegotiatedPckg()
|
|
293 |
{
|
|
294 |
return iQosNegotiatedPckg;
|
|
295 |
}
|
|
296 |
|
|
297 |
|
|
298 |
/**
|
|
299 |
accessor
|
|
300 |
@return reference to ContextConfigGPRS
|
|
301 |
*/
|
|
302 |
inline RPacketContext::TContextConfigGPRS& CEtelDriverContext::ContextConfigGPRS()
|
|
303 |
{
|
|
304 |
return iContextConfigGPRS;
|
|
305 |
}
|
|
306 |
|
|
307 |
/** accessor
|
|
308 |
|
|
309 |
@return reference to ContextConfigGPRSPckg
|
|
310 |
*/
|
|
311 |
inline EtelDriver::TContextConfigGPRSPckg& CEtelDriverContext::ContextConfigGPRSPckg()
|
|
312 |
{
|
|
313 |
return iContextConfigGPRSPckg;
|
|
314 |
}
|
|
315 |
|
|
316 |
/** accessor
|
|
317 |
|
|
318 |
@return reference to packet context' DataChannelV2
|
|
319 |
*/
|
|
320 |
inline RPacketContext::TDataChannelV2& CEtelDriverContext::DataChannelV2()
|
|
321 |
{
|
|
322 |
return iDataChannelV2;
|
|
323 |
}
|
|
324 |
|
|
325 |
/** accessor
|
|
326 |
|
|
327 |
@return reference to packet context' DataChannelV2Pckg
|
|
328 |
*/
|
|
329 |
inline RPacketContext::TDataChannelV2Pckg& CEtelDriverContext::DataChannelV2Pckg()
|
|
330 |
{
|
|
331 |
return iDataChannelV2Pckg;
|
|
332 |
}
|
|
333 |
|
|
334 |
/** accessor
|
|
335 |
|
|
336 |
@return reference to TFT info
|
|
337 |
*/
|
|
338 |
inline TTFTInfo& CEtelDriverContext::TftInfo()
|
|
339 |
{
|
|
340 |
return iTftInfo;
|
|
341 |
}
|
|
342 |
|
|
343 |
/** accessor
|
|
344 |
|
|
345 |
@return reference to packet context' PacketFilterV2
|
|
346 |
*/
|
|
347 |
inline RPacketContext::TPacketFilterV2& CEtelDriverContext::FilterV2()
|
|
348 |
{
|
|
349 |
return iFilterV2;
|
|
350 |
}
|
|
351 |
|
|
352 |
/** accessor
|
|
353 |
|
|
354 |
@return reference to packet context' PacketFilterV2Pckg
|
|
355 |
*/
|
|
356 |
inline RPacketContext::TPacketFilterV2Pckg& CEtelDriverContext::FilterV2Pckg()
|
|
357 |
{
|
|
358 |
return iFilterV2Pckg;
|
|
359 |
}
|
|
360 |
|
|
361 |
/** accessor
|
|
362 |
|
|
363 |
@return requested TFT
|
|
364 |
*/
|
|
365 |
inline TUint8 CEtelDriverContext::TftRequested() const
|
|
366 |
{
|
|
367 |
return iTftRequested;
|
|
368 |
}
|
|
369 |
|
|
370 |
/** accessor
|
|
371 |
|
|
372 |
@return reference to TFT operation code
|
|
373 |
*/
|
|
374 |
inline TTFTOperationCode& CEtelDriverContext::TftOperationCode()
|
|
375 |
{
|
|
376 |
return iTftOperationCode;
|
|
377 |
}
|
|
378 |
|
|
379 |
|
|
380 |
#endif // CETELDRIVERCONTEXT_H
|