24
|
1 |
// Copyright (c) 1997-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 |
// PACKETQOSTSY.CPP
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#include "pckttsy.h"
|
|
19 |
#include "testdef.h"
|
|
20 |
#include "etelQoS.h"
|
|
21 |
#include <et_clsvr.h>
|
|
22 |
#include "dpcktlog.h"
|
|
23 |
#include <pcktcs.h>
|
|
24 |
|
|
25 |
#include "coretsy.h"
|
|
26 |
|
|
27 |
/**************************************************************************/
|
|
28 |
//
|
|
29 |
// CGprsQoSDGprsTsy
|
|
30 |
//
|
|
31 |
/**************************************************************************/
|
|
32 |
|
|
33 |
CGprsQoSDGprsTsy* CGprsQoSDGprsTsy::NewL(CPhoneFactoryDummyBase* aFac)
|
|
34 |
/**
|
|
35 |
* NewL method - Standard 2 phase constructor.
|
|
36 |
*/
|
|
37 |
{
|
|
38 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: NewL()"));
|
|
39 |
|
|
40 |
CGprsQoSDGprsTsy* subsession=new(ELeave) CGprsQoSDGprsTsy(aFac);
|
|
41 |
CleanupStack::PushL(subsession);
|
|
42 |
subsession->ConstructL();
|
|
43 |
CleanupStack::Pop();
|
|
44 |
return subsession;
|
|
45 |
}
|
|
46 |
|
|
47 |
void CGprsQoSDGprsTsy::Init()
|
|
48 |
{}
|
|
49 |
|
|
50 |
CGprsQoSDGprsTsy::CGprsQoSDGprsTsy(CPhoneFactoryDummyBase* aFac)
|
|
51 |
:CSubSessionExtDummyBase(aFac)
|
|
52 |
{
|
|
53 |
}
|
|
54 |
|
|
55 |
void CGprsQoSDGprsTsy::ConstructL()
|
|
56 |
/**
|
|
57 |
* ConstructL method
|
|
58 |
*/
|
|
59 |
{
|
|
60 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: Entered constructor"));
|
|
61 |
}
|
|
62 |
|
|
63 |
CGprsQoSDGprsTsy::~CGprsQoSDGprsTsy()
|
|
64 |
/**
|
|
65 |
* Destructor
|
|
66 |
*/
|
|
67 |
{
|
|
68 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: Entered destructor"));
|
|
69 |
}
|
|
70 |
|
|
71 |
CTelObject* CGprsQoSDGprsTsy::OpenNewObjectByNameL(const TDesC& /*aName*/)
|
|
72 |
/**
|
|
73 |
* Opening object(s) from RPacketQoS is not supported.
|
|
74 |
*/
|
|
75 |
{
|
|
76 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: OpenNewObjectByNameL() method"));
|
|
77 |
User::Leave(KErrNotSupported);
|
|
78 |
return NULL;
|
|
79 |
}
|
|
80 |
|
|
81 |
CTelObject* CGprsQoSDGprsTsy::OpenNewObjectL(TDes& /*aNewName*/)
|
|
82 |
/**
|
|
83 |
* Opening object(s) from RPacketQoS is not supported
|
|
84 |
*/
|
|
85 |
{
|
|
86 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: OpenNewObjectL() method"));
|
|
87 |
|
|
88 |
User::Leave(KErrNotSupported);
|
|
89 |
return NULL;
|
|
90 |
}
|
|
91 |
|
|
92 |
CTelObject::TReqMode CGprsQoSDGprsTsy::ReqModeL(const TInt aIpc)
|
|
93 |
/**
|
|
94 |
* ReqModeL is called from the server's CTelObject::ReqAnalyserL in order to check the
|
|
95 |
* type of request it has.
|
|
96 |
* The following are example request types for this dummy TSY. All TSYs do not have to
|
|
97 |
* have these request types but they have been given "sensible" values in this dummy TSY code.
|
|
98 |
*/
|
|
99 |
{
|
|
100 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: ReqModeL() method"));
|
|
101 |
|
|
102 |
CTelObject::TReqMode ret=0;
|
|
103 |
switch (aIpc)
|
|
104 |
{
|
|
105 |
case EPacketQoSSetProfileParamsCancel:
|
|
106 |
case EPacketQoSGetProfileParamsCancel:
|
|
107 |
case EPacketQoSGetProfileCapsCancel:
|
|
108 |
case EPacketQoSNotifyProfileChangedCancel:
|
|
109 |
// The server should not use ReqMode on Cancel requests
|
|
110 |
User::Leave(KErrNotSupported);
|
|
111 |
break;
|
|
112 |
|
|
113 |
case EPacketQoSSetProfileParams:
|
|
114 |
case EPacketQoSGetProfileParams:
|
|
115 |
case EPacketQoSGetProfileCaps:
|
|
116 |
break;
|
|
117 |
|
|
118 |
case EPacketQoSNotifyProfileChanged:
|
|
119 |
ret=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
|
|
120 |
break;
|
|
121 |
|
|
122 |
default:
|
|
123 |
User::Leave(KErrNotSupported);
|
|
124 |
break;
|
|
125 |
}
|
|
126 |
|
|
127 |
return ret;
|
|
128 |
}
|
|
129 |
|
|
130 |
TInt CGprsQoSDGprsTsy::RegisterNotification(const TInt aIpc)
|
|
131 |
/**
|
|
132 |
* RegisterNotification is called when the server recognises that this notification is
|
|
133 |
* being posted for the first time on this sub-session object.
|
|
134 |
* It enables the TSY to "turn on" any regular notification messages that it may receive
|
|
135 |
* from the phone.
|
|
136 |
*/
|
|
137 |
{
|
|
138 |
switch (aIpc)
|
|
139 |
{
|
|
140 |
case EPacketQoSNotifyProfileChanged:
|
|
141 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: RegisterNotification - Profile Changed"));
|
|
142 |
return KErrNone;
|
|
143 |
default:
|
|
144 |
// Unknown or invalid IPC
|
|
145 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: Register error, unknown IPC"));
|
|
146 |
return KErrNotSupported;
|
|
147 |
}
|
|
148 |
}
|
|
149 |
|
|
150 |
TInt CGprsQoSDGprsTsy::DeregisterNotification(const TInt aIpc)
|
|
151 |
/**
|
|
152 |
* DeregisterNotification is called when the server recognises that this notification
|
|
153 |
* will not be posted again because the last client to have a handle on this sub-session
|
|
154 |
* object has just closed the handle.
|
|
155 |
* It enables the TSY to "turn off" any regular notification messages that it may
|
|
156 |
* receive from the phone.
|
|
157 |
*/
|
|
158 |
{
|
|
159 |
switch (aIpc)
|
|
160 |
{
|
|
161 |
case EPacketQoSNotifyProfileChanged:
|
|
162 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: DeregisterNotification - Profile Changed"));
|
|
163 |
return KErrNone;
|
|
164 |
default:
|
|
165 |
// Unknown or invalid IPC
|
|
166 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: Deregister error, unknown IPC"));
|
|
167 |
return KErrNotSupported;
|
|
168 |
}
|
|
169 |
}
|
|
170 |
|
|
171 |
TInt CGprsQoSDGprsTsy::NumberOfSlotsL(const TInt aIpc)
|
|
172 |
/**
|
|
173 |
* NumberOfSlotsL is called by the server when it is registering a new notification.
|
|
174 |
* It enables the TSY to tell the server how many buffer slots to allocate for
|
|
175 |
* "repost immediately" notifications that may trigger before clients collect them.
|
|
176 |
*/
|
|
177 |
{
|
|
178 |
TInt numberOfSlots=1;
|
|
179 |
switch (aIpc)
|
|
180 |
{
|
|
181 |
case EPacketQoSNotifyProfileChanged:
|
|
182 |
LOGTEXT(_L8("CGprsDGprsTsy: Registered with 5 slots"));
|
|
183 |
numberOfSlots=5;
|
|
184 |
break;
|
|
185 |
default:
|
|
186 |
// Unknown or invalid IPC
|
|
187 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: Number of Slots error, unknown IPC"));
|
|
188 |
User::Leave(KErrNotSupported);
|
|
189 |
break;
|
|
190 |
}
|
|
191 |
return numberOfSlots;
|
|
192 |
}
|
|
193 |
|
|
194 |
|
|
195 |
TInt CGprsQoSDGprsTsy::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
|
|
196 |
const TDataPackage& aPackage)
|
|
197 |
/**
|
|
198 |
* ExtFunc is called by the server when it has an "extended", i.e. non-core ETel request
|
|
199 |
* for the TSY to process.
|
|
200 |
* A request handle, request type and request data are passed to the TSY.
|
|
201 |
*/
|
|
202 |
{
|
|
203 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: ExtFunc() method"));
|
|
204 |
|
|
205 |
switch (aIpc)
|
|
206 |
{
|
|
207 |
case EPacketQoSSetProfileParams:
|
|
208 |
return SetProfile(aTsyReqHandle, aPackage.Des1n());
|
|
209 |
case EPacketQoSSetProfileParamsCancel:
|
|
210 |
return SetProfileCancel(aTsyReqHandle);
|
|
211 |
case EPacketQoSGetProfileParams:
|
|
212 |
return GetProfile(aTsyReqHandle, aPackage.Des1n());
|
|
213 |
case EPacketQoSGetProfileParamsCancel:
|
|
214 |
return GetProfileCancel(aTsyReqHandle);
|
|
215 |
case EPacketQoSNotifyProfileChanged:
|
|
216 |
return NotifyProfileChanged(aTsyReqHandle, aPackage.Des1n());
|
|
217 |
case EPacketQoSNotifyProfileChangedCancel:
|
|
218 |
return NotifyProfileChangedCancel(aTsyReqHandle);
|
|
219 |
case EPacketQoSGetProfileCaps:
|
|
220 |
return GetProfileCaps(aTsyReqHandle, aPackage.Des1n());
|
|
221 |
case EPacketQoSGetProfileCapsCancel:
|
|
222 |
return GetProfileCapsCancel(aTsyReqHandle);
|
|
223 |
default:
|
|
224 |
return KErrNotSupported;
|
|
225 |
}
|
|
226 |
}
|
|
227 |
|
|
228 |
TInt CGprsQoSDGprsTsy::CancelService(const TInt aIpc,const TTsyReqHandle aTsyReqHandle)
|
|
229 |
/**
|
|
230 |
* CancelService is called by the server when it is "cleaning-up" any still outstanding
|
|
231 |
* asynchronous requests before closing a client's sub-session.
|
|
232 |
* This will happen if a client closes its R-class handle without cancelling outstanding
|
|
233 |
* asynchronous requests.
|
|
234 |
*/
|
|
235 |
{
|
|
236 |
LOGTEXT(_L8("CGprsQoSDGprsTsy: - CancelService called"));
|
|
237 |
switch (aIpc)
|
|
238 |
{
|
|
239 |
case EPacketQoSSetProfileParams:
|
|
240 |
return SetProfileCancel(aTsyReqHandle);
|
|
241 |
case EPacketQoSGetProfileParams:
|
|
242 |
return GetProfileCancel(aTsyReqHandle);
|
|
243 |
case EPacketQoSGetProfileCaps:
|
|
244 |
return GetProfileCapsCancel(aTsyReqHandle);
|
|
245 |
case EPacketQoSNotifyProfileChanged:
|
|
246 |
return NotifyProfileChangedCancel(aTsyReqHandle);
|
|
247 |
default:
|
|
248 |
return KErrGeneral;
|
|
249 |
}
|
|
250 |
}
|
|
251 |
|
|
252 |
/***********************************************************************************/
|
|
253 |
//
|
|
254 |
// The following methods are called from ExtFunc and/or CancelService.
|
|
255 |
// Each of these will process a TSY request or cancel a TSY request
|
|
256 |
// Here, example values are returned or checked within this dummy TSY in order to ensure
|
|
257 |
// that the integrity of the data passed to/from client is maintained
|
|
258 |
//
|
|
259 |
/***********************************************************************************/
|
|
260 |
|
|
261 |
TInt CGprsQoSDGprsTsy::SetProfile(const TTsyReqHandle aTsyReqHandle,const TDesC8* aConfig)
|
|
262 |
/**
|
|
263 |
* Set QoS Profile parameters
|
|
264 |
* This method is called by both the Hurricane and JetStream API tests.
|
|
265 |
* The iExtensionId parameter is checked to determine the packet service.
|
|
266 |
*/
|
|
267 |
{
|
|
268 |
LOGTEXT(_L8("CGprsQoSDGprsTsy::SetProfile called"));
|
|
269 |
|
|
270 |
User::After(300000); // wait to have KRequestPending
|
|
271 |
TInt proceed = 1; // Determines how the function finishes this request
|
|
272 |
TPacketDataConfigBase& aCheckId = (*(TPckg<TPacketDataConfigBase>*) aConfig)();
|
|
273 |
|
|
274 |
switch (aCheckId.ExtensionId())
|
|
275 |
{
|
|
276 |
case TPacketDataConfigBase::KConfigGPRS :
|
|
277 |
{
|
|
278 |
// If GPRS Rel97/98, validate the descriptor
|
|
279 |
TPckg<RPacketQoS::TQoSGPRSRequested>* qosConfigGPRSPckg = (TPckg<RPacketQoS::TQoSGPRSRequested>*)aConfig;
|
|
280 |
RPacketQoS::TQoSGPRSRequested& qosConfigV1 = (*qosConfigGPRSPckg)();
|
|
281 |
|
|
282 |
if ((qosConfigV1.iMinDelay != DPCKTTSY_DELAY_MIN1)||
|
|
283 |
(qosConfigV1.iMinMeanThroughput != DPCKTTSY_MEAN_THROUGHPUT_MIN1)||
|
|
284 |
(qosConfigV1.iMinPeakThroughput != DPCKTTSY_PEAK_THROUGHPUT_MIN1)||
|
|
285 |
(qosConfigV1.iMinPrecedence != DPCKTTSY_PRECEDENCE_MIN1)||
|
|
286 |
(qosConfigV1.iMinReliability != DPCKTTSY_RELIABILITY_MIN1)||
|
|
287 |
(qosConfigV1.iReqDelay != DPCKTTSY_DELAY_REQ1)||
|
|
288 |
(qosConfigV1.iReqMeanThroughput != DPCKTTSY_MEAN_THROUGHPUT_REQ1)||
|
|
289 |
(qosConfigV1.iReqPeakThroughput != DPCKTTSY_PEAK_THROUGHPUT_REQ1)||
|
|
290 |
(qosConfigV1.iReqPrecedence != DPCKTTSY_PRECEDENCE_REQ1)||
|
|
291 |
(qosConfigV1.iReqReliability != DPCKTTSY_RELIABILITY_REQ1))
|
|
292 |
{
|
|
293 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
294 |
proceed--; // The method should return with KErrNone after calling ReqCompleted().
|
|
295 |
}
|
|
296 |
}
|
|
297 |
break;
|
|
298 |
case TPacketDataConfigBase::KConfigRel99Rel4 :
|
|
299 |
{
|
|
300 |
// If Rel99/4, validate the descriptor and complete the request
|
|
301 |
TPckg<RPacketQoS::TQoSR99_R4Requested>* qosConfigR99R4Pckg = (TPckg<RPacketQoS::TQoSR99_R4Requested>*)aConfig;
|
|
302 |
RPacketQoS::TQoSR99_R4Requested& qosConfigV1 = (*qosConfigR99R4Pckg)();
|
|
303 |
|
|
304 |
if ((qosConfigV1.iMinTrafficClass != DPCKTTSY_TRAFFIC_CLASS_MIN)||
|
|
305 |
(qosConfigV1.iMinDeliveryOrderReqd != DPCKTTSY_DELIVERY_ORDER_MIN)||
|
|
306 |
(qosConfigV1.iMinDeliverErroneousSDU != DPCKTTSY_ERRONEOUS_SDU_DELIVERY_MIN)||
|
|
307 |
(qosConfigV1.iMinAcceptableMaxSDUSize != DPCKTTSY_MAX_SDU_SIZE_MIN)||
|
|
308 |
(qosConfigV1.iMinAcceptableMaxRate.iUplinkRate != DPCKTTSY_MAX_UPLINK_BITRATE_MIN)||
|
|
309 |
(qosConfigV1.iMinAcceptableMaxRate.iDownlinkRate != DPCKTTSY_MAX_DOWNLINK_BITRATE_MIN)||
|
|
310 |
(qosConfigV1.iMaxBER != DPCKTTSY_BER_MAX)||
|
|
311 |
(qosConfigV1.iMaxSDUErrorRatio != DPCKTTSY_SDU_ERROR_RATIO_MAX)||
|
|
312 |
(qosConfigV1.iMaxTransferDelay != DPCKTTSY_TRANSFER_DELAY_MAX)||
|
|
313 |
(qosConfigV1.iMinGuaranteedRate.iUplinkRate != DPCKTTSY_GRNT_UPLINK_BITRATE_MIN)||
|
|
314 |
(qosConfigV1.iMinGuaranteedRate.iDownlinkRate != DPCKTTSY_GRNT_DOWNLINK_BITRATE_MIN)||
|
|
315 |
|
|
316 |
(qosConfigV1.iReqTrafficClass != DPCKTTSY_TRAFFIC_CLASS_REQ)||
|
|
317 |
(qosConfigV1.iReqDeliveryOrderReqd != DPCKTTSY_DELIVERY_ORDER_REQ)||
|
|
318 |
(qosConfigV1.iReqDeliverErroneousSDU != DPCKTTSY_ERRONEOUS_SDU_DELIVERY_REQ)||
|
|
319 |
(qosConfigV1.iReqMaxSDUSize != DPCKTTSY_MAX_SDU_SIZE_REQ)||
|
|
320 |
(qosConfigV1.iReqMaxRate.iUplinkRate != DPCKTTSY_MAX_UPLINK_BITRATE_REQ)||
|
|
321 |
(qosConfigV1.iReqMaxRate.iDownlinkRate != DPCKTTSY_MAX_DOWNLINK_BITRATE_REQ)||
|
|
322 |
(qosConfigV1.iReqBER != DPCKTTSY_BER_REQ)||
|
|
323 |
(qosConfigV1.iReqSDUErrorRatio != DPCKTTSY_SDU_ERROR_RATIO_REQ)||
|
|
324 |
(qosConfigV1.iReqTransferDelay != DPCKTTSY_TRANSFER_DELAY_REQ)||
|
|
325 |
(qosConfigV1.iReqGuaranteedRate.iUplinkRate != DPCKTTSY_GRNT_UPLINK_BITRATE_REQ)||
|
|
326 |
(qosConfigV1.iReqGuaranteedRate.iDownlinkRate != DPCKTTSY_GRNT_DOWNLINK_BITRATE_REQ))
|
|
327 |
{
|
|
328 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
329 |
proceed--; // The method should return with KErrNone after calling ReqCompleted().
|
|
330 |
}
|
|
331 |
}
|
|
332 |
break;
|
|
333 |
case TPacketDataConfigBase::KConfigRel5 :
|
|
334 |
{
|
|
335 |
// If R5, validate the descriptor and complete the request
|
|
336 |
TPckg<RPacketQoS::TQoSR5Requested>* qosConfigR5Pckg = (TPckg<RPacketQoS::TQoSR5Requested>*)aConfig;
|
|
337 |
RPacketQoS::TQoSR5Requested& qosConfigV1 = (*qosConfigR5Pckg)();
|
|
338 |
|
|
339 |
if ((!qosConfigV1.iSignallingIndication)||
|
|
340 |
(qosConfigV1.iSourceStatisticsDescriptor != DPCKTTSY_SRC_STATSDESC))
|
|
341 |
{
|
|
342 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
343 |
proceed--; // The method should return with KErrNone after calling ReqCompleted().
|
|
344 |
}
|
|
345 |
}
|
|
346 |
break;
|
|
347 |
default:
|
|
348 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
349 |
proceed--; // The method should return with KErrNone after calling ReqCompleted().
|
|
350 |
break;
|
|
351 |
} // switch
|
|
352 |
|
|
353 |
// If the data is corrupt, proceed should be zero, and the method completes immediately.
|
|
354 |
if (!proceed)
|
|
355 |
return KErrNone;
|
|
356 |
else // Data is NOT corrupt, continue the implementation
|
|
357 |
{
|
|
358 |
if(!iSetProfile++)
|
|
359 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
360 |
switch(iSetProfile)
|
|
361 |
{
|
|
362 |
case 3:
|
|
363 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
364 |
break;
|
|
365 |
|
|
366 |
case 4:
|
|
367 |
break;
|
|
368 |
}
|
|
369 |
iTsyAsyncReqHandle = aTsyReqHandle;
|
|
370 |
return KErrNone;
|
|
371 |
}
|
|
372 |
}
|
|
373 |
|
|
374 |
TInt CGprsQoSDGprsTsy::SetProfileCancel(const TTsyReqHandle aTsyReqHandle)
|
|
375 |
{
|
|
376 |
LOGTEXT(_L8("CGprsQoSDGprsTsy::SetProfileCancel called"));
|
|
377 |
User::After(300000); // wait to have KRequestPending
|
|
378 |
if(aTsyReqHandle == iTsyAsyncReqHandle)
|
|
379 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
380 |
else
|
|
381 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
382 |
return KErrNone;
|
|
383 |
}
|
|
384 |
|
|
385 |
TInt CGprsQoSDGprsTsy::GetProfile(const TTsyReqHandle aTsyReqHandle,TDes8* aConfig)
|
|
386 |
/**
|
|
387 |
* Get QoS Profile parameters
|
|
388 |
* This method is called by both the Hurricane and JetStream API tests.
|
|
389 |
* The iExtensionId parameter is checked to determine the packet service.
|
|
390 |
*/
|
|
391 |
{
|
|
392 |
LOGTEXT(_L8("CGprsQoSDGprsTsy::GetProfile called"));
|
|
393 |
|
|
394 |
User::After(300000); // wait to have KRequestPending
|
|
395 |
if(!iGetProfile++)
|
|
396 |
{
|
|
397 |
TPacketDataConfigBase& aCheckId = (*(TPckg<TPacketDataConfigBase>*) aConfig)();
|
|
398 |
|
|
399 |
// CDMA QoS profiles are currently not supported in this Dummy TSY.
|
|
400 |
if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigCDMA)
|
|
401 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
402 |
|
|
403 |
// If GPRS Rel97/98, unpack the descriptor, get the QoS profile parameters
|
|
404 |
// and complete the request
|
|
405 |
if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigGPRS)
|
|
406 |
{
|
|
407 |
TPckg<RPacketQoS::TQoSGPRSNegotiated>* qosConfigGPRSPckg = (TPckg<RPacketQoS::TQoSGPRSNegotiated>*)aConfig;
|
|
408 |
RPacketQoS::TQoSGPRSNegotiated& qosConfigV1 = (*qosConfigGPRSPckg)();
|
|
409 |
|
|
410 |
qosConfigV1.iDelay = DPCKTTSY_DELAY_NEG2;
|
|
411 |
qosConfigV1.iMeanThroughput = DPCKTTSY_MEAN_THROUGHPUT_NEG2;
|
|
412 |
qosConfigV1.iPeakThroughput = DPCKTTSY_PEAK_THROUGHPUT_NEG2;
|
|
413 |
qosConfigV1.iPrecedence = DPCKTTSY_PRECEDENCE_NEG2;
|
|
414 |
qosConfigV1.iReliability = DPCKTTSY_RELIABILITY_NEG2;
|
|
415 |
|
|
416 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
417 |
}
|
|
418 |
else if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigRel99Rel4)
|
|
419 |
{
|
|
420 |
// If Rel99/Rel4 network, unpack the descriptor, set the QoS profile parameters
|
|
421 |
// and complete the request
|
|
422 |
TPckg<RPacketQoS::TQoSR99_R4Negotiated>* qosConfigR99R4Pckg = (TPckg<RPacketQoS::TQoSR99_R4Negotiated>*)aConfig;
|
|
423 |
RPacketQoS::TQoSR99_R4Negotiated& qosConfigV1 = (*qosConfigR99R4Pckg)();
|
|
424 |
|
|
425 |
qosConfigV1.iTrafficClass = DPCKTTSY_TRAFFIC_CLASS_NEG;
|
|
426 |
qosConfigV1.iDeliveryOrderReqd = DPCKTTSY_DELIVERY_ORDER_NEG;
|
|
427 |
qosConfigV1.iDeliverErroneousSDU = DPCKTTSY_ERRONEOUS_SDU_DELIVERY_NEG;
|
|
428 |
qosConfigV1.iMaxSDUSize = DPCKTTSY_MAX_SDU_SIZE_NEG;
|
|
429 |
qosConfigV1.iMaxRate.iUplinkRate = DPCKTTSY_MAX_UPLINK_BITRATE_NEG;
|
|
430 |
qosConfigV1.iMaxRate.iDownlinkRate = DPCKTTSY_MAX_DOWNLINK_BITRATE_NEG;
|
|
431 |
qosConfigV1.iBER = DPCKTTSY_BER_NEG;
|
|
432 |
qosConfigV1.iSDUErrorRatio = DPCKTTSY_SDU_ERROR_RATIO_NEG;
|
|
433 |
qosConfigV1.iTransferDelay = DPCKTTSY_TRANSFER_DELAY_NEG;
|
|
434 |
qosConfigV1.iGuaranteedRate.iUplinkRate = DPCKTTSY_GRNT_UPLINK_BITRATE_NEG;
|
|
435 |
qosConfigV1.iGuaranteedRate.iDownlinkRate = DPCKTTSY_GRNT_DOWNLINK_BITRATE_NEG;
|
|
436 |
|
|
437 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
438 |
}
|
|
439 |
} // !iGetProfile++
|
|
440 |
iTsyAsyncReqHandle = aTsyReqHandle;
|
|
441 |
return KErrNone;
|
|
442 |
}
|
|
443 |
|
|
444 |
TInt CGprsQoSDGprsTsy::GetProfileCancel(const TTsyReqHandle aTsyReqHandle)
|
|
445 |
{
|
|
446 |
LOGTEXT(_L8("CGprsQoSDGprsTsy::GetProfileCancel called"));
|
|
447 |
User::After(300000); // wait to have KRequestPending
|
|
448 |
if(aTsyReqHandle == iTsyAsyncReqHandle)
|
|
449 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
450 |
else
|
|
451 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
452 |
return KErrNone;
|
|
453 |
}
|
|
454 |
|
|
455 |
TInt CGprsQoSDGprsTsy::GetProfileCaps(const TTsyReqHandle aTsyReqHandle,TDes8* aConfig)
|
|
456 |
/**
|
|
457 |
* Get Profile capabilities.
|
|
458 |
* This method is called by both the Hurricane and JetStream API tests.
|
|
459 |
* The iExtensionId parameter is checked to determine the packet service.
|
|
460 |
*/
|
|
461 |
{
|
|
462 |
LOGTEXT(_L8("CGprsQoSDGprsTsy::GetProfileCaps called"));
|
|
463 |
|
|
464 |
User::After(300000); // wait to have KRequestPending
|
|
465 |
if(!iGetProfileCaps++)
|
|
466 |
{
|
|
467 |
TPacketDataConfigBase& aCheckId = (*(TPckg<TPacketDataConfigBase>*) aConfig)();
|
|
468 |
|
|
469 |
// CDMA QoS profiles are currently not supported in this Dummy TSY.
|
|
470 |
if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigCDMA)
|
|
471 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
472 |
|
|
473 |
// If GPRS Rel97/98, unpack the descriptor, set the QoS profile caps
|
|
474 |
// and complete the request
|
|
475 |
if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigGPRS)
|
|
476 |
{
|
|
477 |
TPckg<RPacketQoS::TQoSCapsGPRS>* qosCapsGPRSPckg = (TPckg<RPacketQoS::TQoSCapsGPRS>*)aConfig;
|
|
478 |
RPacketQoS::TQoSCapsGPRS& qosCaps = (*qosCapsGPRSPckg)();
|
|
479 |
|
|
480 |
qosCaps.iDelay = DPCKTTSY_DELAY;
|
|
481 |
qosCaps.iMean = DPCKTTSY_MEAN_THROUGHPUT;
|
|
482 |
qosCaps.iPeak = DPCKTTSY_PEAK_THROUGHPUT;
|
|
483 |
qosCaps.iPrecedence = DPCKTTSY_PRECEDENCE;
|
|
484 |
qosCaps.iReliability = DPCKTTSY_RELIABILITY;
|
|
485 |
|
|
486 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
487 |
}
|
|
488 |
else if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigRel99Rel4)
|
|
489 |
{
|
|
490 |
// If Rel99/Rel4 network, unpack the descriptor, set the QoS profile parameters
|
|
491 |
// and complete the request
|
|
492 |
TPckg<RPacketQoS::TQoSCapsR99_R4>* qosCapsR99R4Pckg = (TPckg<RPacketQoS::TQoSCapsR99_R4>*)aConfig;
|
|
493 |
RPacketQoS::TQoSCapsR99_R4& qosCaps = (*qosCapsR99R4Pckg)();
|
|
494 |
|
|
495 |
qosCaps.iTrafficClass = DPCKTTSY_TRAFFIC_CLASS;
|
|
496 |
qosCaps.iDeliveryOrderReqd = DPCKTTSY_DELIVERY_ORDER;
|
|
497 |
qosCaps.iDeliverErroneousSDU = DPCKTTSY_ERRONEOUS_SDU_DELIVERY;
|
|
498 |
qosCaps.iBER = DPCKTTSY_BER;
|
|
499 |
qosCaps.iSDUErrorRatio = DPCKTTSY_SDU_ERROR_RATIO;
|
|
500 |
qosCaps.iTrafficHandlingPriority = DPCKTTSY_TRFFC_HNDLG_PRIORITY;
|
|
501 |
|
|
502 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
503 |
}
|
|
504 |
} // !iGetProfileCaps++
|
|
505 |
iTsyAsyncReqHandle = aTsyReqHandle;
|
|
506 |
return KErrNone;
|
|
507 |
}
|
|
508 |
|
|
509 |
TInt CGprsQoSDGprsTsy::GetProfileCapsCancel(const TTsyReqHandle aTsyReqHandle)
|
|
510 |
{
|
|
511 |
LOGTEXT(_L8("CGprsQoSDGprsTsy::GetProfileCapsCancel called"));
|
|
512 |
User::After(300000); // wait to have KRequestPending
|
|
513 |
if(aTsyReqHandle == iTsyAsyncReqHandle)
|
|
514 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
515 |
else
|
|
516 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
517 |
return KErrNone;
|
|
518 |
}
|
|
519 |
|
|
520 |
|
|
521 |
TInt CGprsQoSDGprsTsy::NotifyProfileChanged(const TTsyReqHandle aTsyReqHandle, TDes8* aConfig)
|
|
522 |
/**
|
|
523 |
* This method is called by both the Hurricane API tests and the JetStream tests.
|
|
524 |
* The iExtensionId parameter is checked to determine the packet service.
|
|
525 |
*/
|
|
526 |
{
|
|
527 |
User::After(300000); // wait to have KRequestPending
|
|
528 |
TPacketDataConfigBase& aCheckId = (*(TPckg<TPacketDataConfigBase>*) aConfig)();
|
|
529 |
|
|
530 |
if (!iNotifyProfileChanged++)
|
|
531 |
{
|
|
532 |
LOGTEXT(_L8("CGprsQoSDGprsTsy::NotifyProfileChanged called"));
|
|
533 |
|
|
534 |
// CDMA QoS profiles are currently not supported in this Dummy TSY.
|
|
535 |
if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigCDMA)
|
|
536 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
537 |
|
|
538 |
// If GPRS Rel97/98, unpack the descriptor, set the QoS profile parameters
|
|
539 |
// and complete the request
|
|
540 |
if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigGPRS)
|
|
541 |
{
|
|
542 |
TPckg<RPacketQoS::TQoSGPRSNegotiated>* qosNegotiatedGPRSPckg = (TPckg<RPacketQoS::TQoSGPRSNegotiated>*)aConfig;
|
|
543 |
RPacketQoS::TQoSGPRSNegotiated& qosNotify = (*qosNegotiatedGPRSPckg)();
|
|
544 |
|
|
545 |
qosNotify.iDelay = DPCKTTSY_DELAY_MIN1;
|
|
546 |
qosNotify.iMeanThroughput = DPCKTTSY_MEAN_THROUGHPUT_MIN1;
|
|
547 |
qosNotify.iPeakThroughput = DPCKTTSY_PEAK_THROUGHPUT_MIN1;
|
|
548 |
qosNotify.iPrecedence = DPCKTTSY_PRECEDENCE_MIN1;
|
|
549 |
qosNotify.iReliability = DPCKTTSY_RELIABILITY_MIN1;
|
|
550 |
|
|
551 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
552 |
}
|
|
553 |
else if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigRel99Rel4)
|
|
554 |
{
|
|
555 |
// If Rel99/Rel4 network, unpack the descriptor, set the QoS profile parameters
|
|
556 |
// and complete the request
|
|
557 |
TPckg<RPacketQoS::TQoSR99_R4Negotiated>* qosNegotiatedR99_R4Pckg = (TPckg<RPacketQoS::TQoSR99_R4Negotiated>*)aConfig;
|
|
558 |
RPacketQoS::TQoSR99_R4Negotiated& qosNotifyR99_R4 = (*qosNegotiatedR99_R4Pckg)();
|
|
559 |
|
|
560 |
qosNotifyR99_R4.iTrafficClass = DPCKTTSY_TRAFFIC_CLASS_MIN;
|
|
561 |
qosNotifyR99_R4.iDeliveryOrderReqd = DPCKTTSY_DELIVERY_ORDER_MIN;
|
|
562 |
qosNotifyR99_R4.iDeliverErroneousSDU = DPCKTTSY_ERRONEOUS_SDU_DELIVERY_MIN;
|
|
563 |
qosNotifyR99_R4.iMaxSDUSize = DPCKTTSY_MAX_SDU_SIZE_MIN;
|
|
564 |
qosNotifyR99_R4.iMaxRate.iUplinkRate = DPCKTTSY_MAX_UPLINK_BITRATE_MIN;
|
|
565 |
qosNotifyR99_R4.iMaxRate.iDownlinkRate = DPCKTTSY_MAX_DOWNLINK_BITRATE_MIN;
|
|
566 |
qosNotifyR99_R4.iBER = DPCKTTSY_BER_MAX;
|
|
567 |
qosNotifyR99_R4.iSDUErrorRatio = DPCKTTSY_SDU_ERROR_RATIO_MAX;
|
|
568 |
qosNotifyR99_R4.iTrafficHandlingPriority = DPCKTTSY_TRFFC_HNDLG_PRIORITY_MIN;
|
|
569 |
qosNotifyR99_R4.iTransferDelay = DPCKTTSY_TRANSFER_DELAY_MAX;
|
|
570 |
qosNotifyR99_R4.iGuaranteedRate.iUplinkRate = DPCKTTSY_GRNT_UPLINK_BITRATE_MIN;
|
|
571 |
qosNotifyR99_R4.iGuaranteedRate.iDownlinkRate = DPCKTTSY_GRNT_DOWNLINK_BITRATE_MIN;
|
|
572 |
|
|
573 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
574 |
}
|
|
575 |
} // !iNotifyProfileChanged++
|
|
576 |
|
|
577 |
if (aCheckId.ExtensionId() == TPacketDataConfigBase::KConfigRel5)
|
|
578 |
{
|
|
579 |
TPckg<RPacketQoS::TQoSR5Negotiated>* qosNegotiatedR5Pckg = (TPckg<RPacketQoS::TQoSR5Negotiated>*)aConfig;
|
|
580 |
RPacketQoS::TQoSR5Negotiated& qosNotifyR5 = (*qosNegotiatedR5Pckg)();
|
|
581 |
switch(iNotifyProfileChanged)
|
|
582 |
{
|
|
583 |
case 3:
|
|
584 |
qosNotifyR5.iSignallingIndication = DPCKTTSY_SIG_IND;
|
|
585 |
qosNotifyR5.iSourceStatisticsDescriptor = DPCKTTSY_SRC_STATSDESC;
|
|
586 |
|
|
587 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
588 |
break;
|
|
589 |
|
|
590 |
case 4:
|
|
591 |
break;
|
|
592 |
|
|
593 |
default:
|
|
594 |
ReqCompleted(aTsyReqHandle,KErrArgument);
|
|
595 |
break;
|
|
596 |
}
|
|
597 |
}
|
|
598 |
|
|
599 |
iTsyAsyncReqHandle = aTsyReqHandle;
|
|
600 |
return KErrNone;
|
|
601 |
}
|
|
602 |
|
|
603 |
|
|
604 |
TInt CGprsQoSDGprsTsy::NotifyProfileChangedCancel(const TTsyReqHandle aTsyReqHandle)
|
|
605 |
{
|
|
606 |
LOGTEXT(_L8("CGprsQoSDGprsTsy::NotifyProfileChangedCancel called"));
|
|
607 |
User::After(300000); // wait to have KRequestPending
|
|
608 |
if(aTsyReqHandle == iTsyAsyncReqHandle)
|
|
609 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
610 |
else
|
|
611 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
612 |
return KErrNone;
|
|
613 |
}
|