24
|
1 |
// Copyright (c) 2006-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 |
//
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "Cmmpacketservicetsy.h"
|
|
20 |
#include <ctsy/tflogger.h>
|
|
21 |
#include <ctsy/serviceapi/mmtsy_defaults.h>
|
|
22 |
#include "MmTsy_timeoutdefs.h"
|
|
23 |
#include "MmTsy_numberOfSlots.h"
|
|
24 |
#include "CMmCommonStaticUtility.h"
|
|
25 |
#include "Cmmpacketcontextlist.h"
|
|
26 |
#include "cmmpacketservicegsmwcdmaext.h"
|
|
27 |
#include "cmmcalllist.h"
|
|
28 |
#include "cmmcalltsy.h"
|
|
29 |
#include "CMmCustomTsy.h"
|
|
30 |
#include "CMmPacketTsy.h"
|
|
31 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
32 |
#include <ctsy/pluginapi/cmmdatapackage.h>
|
|
33 |
|
|
34 |
#include "cmmmbmscontextlist.h"
|
|
35 |
#include "cmmmbmsmonitoredlist.h"
|
|
36 |
|
|
37 |
// ======== MEMBER FUNCTIONS ========
|
|
38 |
|
|
39 |
CMmPacketServiceTsy::CMmPacketServiceTsy():
|
|
40 |
iReqHandleType(EMultimodePacketServiceReqHandleUnknown)
|
|
41 |
{
|
|
42 |
}
|
|
43 |
|
|
44 |
CMmPacketServiceTsy* CMmPacketServiceTsy::NewL(
|
|
45 |
CMmPhoneTsy* const aMmPhone,
|
|
46 |
CMmMessageManagerBase* const aMessageManager,
|
|
47 |
MLtsyFactoryBase* aFactory )
|
|
48 |
{
|
|
49 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NewL" );
|
|
50 |
CMmPacketServiceTsy* const packetService =
|
|
51 |
new ( ELeave ) CMmPacketServiceTsy();
|
|
52 |
|
|
53 |
CleanupClosePushL( *packetService );
|
|
54 |
packetService->iMmPhone = aMmPhone;
|
|
55 |
packetService->iMessageManager = aMessageManager;
|
|
56 |
packetService->ConstructL( aFactory );
|
|
57 |
CleanupStack::Pop();
|
|
58 |
|
|
59 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NewL." );
|
|
60 |
return packetService;
|
|
61 |
|
|
62 |
}
|
|
63 |
|
|
64 |
void CMmPacketServiceTsy::ConstructL( MLtsyFactoryBase* aFactory )
|
|
65 |
{
|
|
66 |
|
|
67 |
InitModulesL( aFactory );
|
|
68 |
|
|
69 |
InitStoresAndListsL();
|
|
70 |
|
|
71 |
iMessageManager->RegisterTsyObject( CMmMessageManagerBase::EPacketDataTsy,
|
|
72 |
this );
|
|
73 |
|
|
74 |
// Current Network Mode is initialized to be EMSClassUnknown
|
|
75 |
iCurrentMode = RMobilePhone::ENetworkModeGsm;
|
|
76 |
|
|
77 |
}
|
|
78 |
|
|
79 |
CMmPacketServiceTsy::~CMmPacketServiceTsy()
|
|
80 |
{
|
|
81 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::~CMmPacketServiceTsy" );
|
|
82 |
|
|
83 |
if ( iMmPhone )
|
|
84 |
{
|
|
85 |
// deregister tsy object from message manager
|
|
86 |
iMmPhone->MessageManager()->DeregisterTsyObject(this);
|
|
87 |
|
|
88 |
// Reset packet data session pointer in phone
|
|
89 |
iMmPhone->ResetPacketDataSession();
|
|
90 |
}
|
|
91 |
|
|
92 |
// Delete CMmTsyReqHandleStore object
|
|
93 |
delete iTsyReqHandleStore;
|
|
94 |
// Delete CMmPacketContextList object
|
|
95 |
delete iPacketContextList;
|
|
96 |
// Delete CMmPacketServiceGsmWcdmaExt object
|
|
97 |
delete iMmPacketServiceGsmWcdmaExt;
|
|
98 |
if(iMBMSContextList != NULL)
|
|
99 |
{
|
|
100 |
// Delete CMmMBMSContextList object
|
|
101 |
delete iMBMSContextList;
|
|
102 |
}
|
|
103 |
if(iGetMbmsMonitoredServiceLists != NULL)
|
|
104 |
{
|
|
105 |
// Delete CArrayPtrFlat object
|
|
106 |
delete iGetMbmsMonitoredServiceLists;
|
|
107 |
}
|
|
108 |
|
|
109 |
if ( NULL != iDialUpContext )
|
|
110 |
{
|
|
111 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::~CMmPacketServiceTsy: Close Dial-up Object." );
|
|
112 |
|
|
113 |
iDialUpContext->Close();
|
|
114 |
}
|
|
115 |
|
|
116 |
if ( NULL != iSecondaryDialUpContext )
|
|
117 |
{
|
|
118 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::~CMmPacketServiceTsy: Close Secondary Dial-up Object." );
|
|
119 |
|
|
120 |
iSecondaryDialUpContext->Close();
|
|
121 |
}
|
|
122 |
|
|
123 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::~CMmPacketServiceTsy: Closing iMutex Object." );
|
|
124 |
iMutex.Close();
|
|
125 |
|
|
126 |
#ifdef USING_CTSY_DISPATCHER
|
|
127 |
//CTSY defect (memory leak) this maybe allocated, but it is never deleted.
|
|
128 |
//no need for NULL check as C++ guarantees that operator delete checks its argument for null-ness.
|
|
129 |
delete iMBMSMonitoredList;
|
|
130 |
iMBMSMonitoredList = NULL;
|
|
131 |
#endif //USING_CTSY_DISPATCHER
|
|
132 |
}
|
|
133 |
|
|
134 |
|
|
135 |
//----------------------------------------------------------------------------
|
|
136 |
// CMmPacketServiceTsy::InitModulesL
|
|
137 |
// Initialises extension modules for CMmPacketServiceTsy.
|
|
138 |
// if GSM flag is defined
|
|
139 |
// allocate memory for CMmPacketServiceGsmWcdmaExt object
|
|
140 |
//----------------------------------------------------------------------------
|
|
141 |
//
|
|
142 |
void CMmPacketServiceTsy::InitModulesL( MLtsyFactoryBase* aFactory )
|
|
143 |
{
|
|
144 |
// Create Packet Service Gsm extension
|
|
145 |
iMmPacketServiceGsmWcdmaExt =
|
|
146 |
CMmPacketServiceGsmWcdmaExt::NewL( this, aFactory );
|
|
147 |
}
|
|
148 |
|
|
149 |
//----------------------------------------------------------------------------
|
|
150 |
// CMmPacketServiceTsy::InitStoresAndListsL
|
|
151 |
// Initialises needed stores and lists.
|
|
152 |
//----------------------------------------------------------------------------
|
|
153 |
//
|
|
154 |
void CMmPacketServiceTsy::InitStoresAndListsL()
|
|
155 |
{
|
|
156 |
|
|
157 |
#ifdef REQHANDLE_TIMER
|
|
158 |
// Create req handle store
|
|
159 |
iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( this, iMmPhone,
|
|
160 |
ENumOfMultimodePacketServiceRequests, iPacketServiceReqHandles );
|
|
161 |
#else
|
|
162 |
// Create req handle store
|
|
163 |
iTsyReqHandleStore = CMmTsyReqHandleStore::NewL(
|
|
164 |
ENumOfMultimodePacketServiceRequests, iPacketServiceReqHandles );
|
|
165 |
|
|
166 |
#endif // REQHANDLE_TIMER
|
|
167 |
|
|
168 |
// Create Packet Context List
|
|
169 |
iPacketContextList = CMmPacketContextList::NewL( this );
|
|
170 |
|
|
171 |
// create mbms context list
|
|
172 |
iMBMSContextList = CMmMBMSContextList::NewL();
|
|
173 |
|
|
174 |
// create MBMS monitored service list
|
|
175 |
iGetMbmsMonitoredServiceLists = new CArrayPtrFlat<CListReadAllAttempt>(1);
|
|
176 |
|
|
177 |
|
|
178 |
// Set pointer to externally created dial-up context to be NULL
|
|
179 |
iDialUpContext = NULL;
|
|
180 |
|
|
181 |
// Set pointer to externally created dial-up context to be NULL
|
|
182 |
iSecondaryDialUpContext = NULL;
|
|
183 |
|
|
184 |
// Set phone not attached to the network
|
|
185 |
iInternalSavedData.iServiceStatus = RPacketService::EStatusUnattached;
|
|
186 |
|
|
187 |
// Current Mobile Station Class is initialized to be EMSClassUnknown
|
|
188 |
iInternalSavedData.iMsClass = RPacketService::EMSClassUnknown;
|
|
189 |
|
|
190 |
// If Gpds is suspended this flag is ETrue, otherwise EFalse
|
|
191 |
iSuspended = EFalse;
|
|
192 |
|
|
193 |
}
|
|
194 |
|
|
195 |
//----------------------------------------------------------------------------
|
|
196 |
// CMmPacketServiceTsy::Init
|
|
197 |
// Initialisation method that is called from ETel Server.
|
|
198 |
//----------------------------------------------------------------------------
|
|
199 |
//
|
|
200 |
void CMmPacketServiceTsy::Init()
|
|
201 |
{
|
|
202 |
}
|
|
203 |
|
|
204 |
//----------------------------------------------------------------------------
|
|
205 |
// CMmPacketServiceTsy::CustomTsy
|
|
206 |
// Returns a pointer to Custom TSY object.
|
|
207 |
// return custom tsy owned by phone tsy
|
|
208 |
//----------------------------------------------------------------------------
|
|
209 |
//
|
|
210 |
CMmCustomTsy* CMmPacketServiceTsy::CustomTsy() const
|
|
211 |
{
|
|
212 |
// Return custom tsy
|
|
213 |
return iMmPhone->GetCustomTsy();
|
|
214 |
}
|
|
215 |
|
|
216 |
//----------------------------------------------------------------------------
|
|
217 |
// CMmPacketServiceTsy::ActivePacketServiceExtension
|
|
218 |
// Returns a pointer to the active packet service extension.
|
|
219 |
// The packet data extension implements functionality that is specific for
|
|
220 |
// selected mode. There should always be some extension active.
|
|
221 |
//----------------------------------------------------------------------------
|
|
222 |
//
|
|
223 |
CMmPacketServiceGsmWcdmaExt* CMmPacketServiceTsy::ActivePacketServiceExtension()
|
|
224 |
{
|
|
225 |
// Return active packet service extension
|
|
226 |
return iMmPacketServiceGsmWcdmaExt;
|
|
227 |
}
|
|
228 |
|
|
229 |
//----------------------------------------------------------------------------
|
|
230 |
// CMmPacketServiceTsy::TsyReqHandleStore
|
|
231 |
// Returns a pointer to the tsy request handle store.
|
|
232 |
// return tsy request handle store
|
|
233 |
//----------------------------------------------------------------------------
|
|
234 |
//
|
|
235 |
CMmTsyReqHandleStore* CMmPacketServiceTsy::TsyReqHandleStore()
|
|
236 |
{
|
|
237 |
// Return tsy request handle store
|
|
238 |
return iTsyReqHandleStore;
|
|
239 |
}
|
|
240 |
|
|
241 |
//----------------------------------------------------------------------------
|
|
242 |
// CMmPacketServiceTsy::IsContextStatusActive
|
|
243 |
// Checks if context status is active from service point of view
|
|
244 |
//----------------------------------------------------------------------------
|
|
245 |
//
|
|
246 |
TBool CMmPacketServiceTsy::IsContextStatusActive(
|
|
247 |
const RPacketContext::TContextStatus aContextStatus ) const
|
|
248 |
{
|
|
249 |
|
|
250 |
if ( ( RPacketContext::EStatusActive == aContextStatus ) ||
|
|
251 |
( RPacketContext::EStatusDeactivating == aContextStatus ) )
|
|
252 |
{
|
|
253 |
// Context is active from the service point of view
|
|
254 |
return ETrue;
|
|
255 |
}
|
|
256 |
|
|
257 |
return EFalse;
|
|
258 |
}
|
|
259 |
|
|
260 |
//----------------------------------------------------------------------------
|
|
261 |
// CMmPacketServiceTsy::UpdateAttachedPacketStatus
|
|
262 |
// Sets service status to active or attached and completes status changed
|
|
263 |
// notification to the client if needed.
|
|
264 |
//----------------------------------------------------------------------------
|
|
265 |
//
|
|
266 |
void CMmPacketServiceTsy::UpdateAttachedPacketStatus(
|
|
267 |
const TBool aIsActiveContext ) //is context active
|
|
268 |
{
|
|
269 |
TBool isActive( aIsActiveContext );
|
|
270 |
|
|
271 |
// If external context exist and there are no active internal context
|
|
272 |
if ( iDialUpContext != NULL && isActive == EFalse )
|
|
273 |
{
|
|
274 |
// If external context is active then active context found
|
|
275 |
isActive = IsContextStatusActive( iDialUpContext->ContextStatus() );
|
|
276 |
}
|
|
277 |
|
|
278 |
// If external context exist and there are no active internal context
|
|
279 |
if ( iSecondaryDialUpContext != NULL && isActive == EFalse )
|
|
280 |
{
|
|
281 |
// If external context is active then active context found
|
|
282 |
isActive = IsContextStatusActive(
|
|
283 |
iSecondaryDialUpContext->ContextStatus() );
|
|
284 |
}
|
|
285 |
|
|
286 |
if ( isActive && ( RPacketService::EStatusActive !=
|
|
287 |
iInternalSavedData.iServiceStatus ) )
|
|
288 |
{
|
|
289 |
// Complete status change notification to the client and
|
|
290 |
// set service status EStatusActive
|
|
291 |
CMmPacketServiceTsy::CompleteNotifyStatusChange(
|
|
292 |
RPacketService::EStatusActive, KErrNone );
|
|
293 |
|
|
294 |
}
|
|
295 |
else if ( !isActive && ( RPacketService::EStatusAttached !=
|
|
296 |
iInternalSavedData.iServiceStatus ) )
|
|
297 |
{
|
|
298 |
|
|
299 |
// Complete status change notification to the client and
|
|
300 |
// set service status EStatusAttached
|
|
301 |
CMmPacketServiceTsy::CompleteNotifyStatusChange(
|
|
302 |
RPacketService::EStatusAttached, KErrNone );
|
|
303 |
|
|
304 |
}
|
|
305 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::UpdateAttachedPacketStatus. Service Status: %d", iInternalSavedData.iServiceStatus );
|
|
306 |
}
|
|
307 |
|
|
308 |
//----------------------------------------------------------------------------
|
|
309 |
// CMmPacketServiceTsy::CompletePacketStatusChanged
|
|
310 |
// Called from active extension to notify service that transfer status
|
|
311 |
// is changed.
|
|
312 |
//----------------------------------------------------------------------------
|
|
313 |
//
|
|
314 |
void CMmPacketServiceTsy::CompletePacketStatusChanged(
|
|
315 |
CMmDataPackage* aDataPackage,
|
|
316 |
TInt aErrorCode )
|
|
317 |
{
|
|
318 |
RPacketService::TStatus packetStatus;
|
|
319 |
TBool isresumed;
|
|
320 |
TBool isActiveContext( EFalse );
|
|
321 |
|
|
322 |
//Pack data
|
|
323 |
aDataPackage->UnPackData( packetStatus, isresumed );
|
|
324 |
|
|
325 |
// Get number of created contexts
|
|
326 |
const TInt numberOfContext( iPacketContextList->NumberOfContexts() );
|
|
327 |
|
|
328 |
if ( isresumed )
|
|
329 |
{
|
|
330 |
// If current status is suspended
|
|
331 |
if ( iSuspended )
|
|
332 |
{
|
|
333 |
|
|
334 |
CMmPacketContextTsy* packetContext;
|
|
335 |
CMmMBMSContextTsy* mbmsContext;
|
|
336 |
|
|
337 |
// check pdp context's
|
|
338 |
for ( TInt i = 0; i < numberOfContext; i++ )
|
|
339 |
{
|
|
340 |
// Get context by index from context list
|
|
341 |
packetContext = iPacketContextList->PacketContextByIndex( i );
|
|
342 |
|
|
343 |
if ( NULL != packetContext )
|
|
344 |
{
|
|
345 |
// Inform context that service resumed from suspend
|
|
346 |
packetContext->ContextResumed();
|
|
347 |
}
|
|
348 |
}
|
|
349 |
|
|
350 |
// check mbms context's
|
|
351 |
for ( TInt i = 0; i < iMBMSContextList->NumberOfContexts(); i++ )
|
|
352 |
{
|
|
353 |
// Get context by index from context list
|
|
354 |
mbmsContext = iMBMSContextList->ContextByIndex( i );
|
|
355 |
|
|
356 |
if ( NULL != mbmsContext )
|
|
357 |
{
|
|
358 |
// Inform context that service resumed from suspend
|
|
359 |
mbmsContext->ContextResumed();
|
|
360 |
}
|
|
361 |
}
|
|
362 |
|
|
363 |
if ( iDialUpContext != NULL )
|
|
364 |
{
|
|
365 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompletePacketStatusChanged. DialUp Context Resumed" );
|
|
366 |
|
|
367 |
iDialUpContext->ContextResumed();
|
|
368 |
}
|
|
369 |
|
|
370 |
if ( iSecondaryDialUpContext != NULL )
|
|
371 |
{
|
|
372 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompletePacketStatusChanged. Secondary DialUp Context Resumed" );
|
|
373 |
|
|
374 |
iSecondaryDialUpContext->ContextResumed();
|
|
375 |
}
|
|
376 |
|
|
377 |
// Get service status before suspend
|
|
378 |
packetStatus = iInternalSavedData.iServiceStatusBeforeSuspend;
|
|
379 |
// Current status is not suspended
|
|
380 |
iSuspended = EFalse;
|
|
381 |
|
|
382 |
}
|
|
383 |
else
|
|
384 |
{
|
|
385 |
// Resumed without suspend, continue with current status
|
|
386 |
packetStatus = iInternalSavedData.iServiceStatus;
|
|
387 |
}
|
|
388 |
}
|
|
389 |
|
|
390 |
// If current status is not suspended or
|
|
391 |
// current status is suspended and new status is unattached
|
|
392 |
if ( !iSuspended || ( RPacketService::EStatusUnattached == packetStatus ) )
|
|
393 |
{
|
|
394 |
switch ( packetStatus )
|
|
395 |
{
|
|
396 |
case RPacketService::EStatusUnattached:
|
|
397 |
if ( iSuspended )
|
|
398 |
{
|
|
399 |
// If previous status was suspended it is not valid
|
|
400 |
// anymore
|
|
401 |
iSuspended = EFalse;
|
|
402 |
}
|
|
403 |
|
|
404 |
// Complete status change notification with EStatusUnattached
|
|
405 |
CMmPacketServiceTsy::CompleteNotifyStatusChange(
|
|
406 |
RPacketService::EStatusUnattached, aErrorCode );
|
|
407 |
|
|
408 |
break;
|
|
409 |
case RPacketService::EStatusAttached:
|
|
410 |
case RPacketService::EStatusActive:
|
|
411 |
CMmPacketContextTsy* packetContext;
|
|
412 |
|
|
413 |
for ( TInt i = 0; i < numberOfContext; i++ )
|
|
414 |
{
|
|
415 |
packetContext =
|
|
416 |
iPacketContextList->PacketContextByIndex( i );
|
|
417 |
|
|
418 |
// If no active context found yet
|
|
419 |
if ( NULL != packetContext )
|
|
420 |
{
|
|
421 |
// Get context status
|
|
422 |
RPacketContext::TContextStatus contextStatus =
|
|
423 |
packetContext->ContextStatus();
|
|
424 |
|
|
425 |
// Check if context is active ( from service point
|
|
426 |
// of view )
|
|
427 |
isActiveContext =
|
|
428 |
IsContextStatusActive( contextStatus );
|
|
429 |
}
|
|
430 |
if ( isActiveContext )
|
|
431 |
{
|
|
432 |
// Active context found, break
|
|
433 |
i = numberOfContext;
|
|
434 |
}
|
|
435 |
}
|
|
436 |
|
|
437 |
// no active pdp context's, check if any mbms context is active
|
|
438 |
if( !isActiveContext )
|
|
439 |
{
|
|
440 |
CMmMBMSContextTsy* mbmsContext;
|
|
441 |
|
|
442 |
// check mbms context's
|
|
443 |
for ( TInt i = 0; i < iMBMSContextList->NumberOfContexts(); i++ )
|
|
444 |
{
|
|
445 |
// Get context by index from context list
|
|
446 |
mbmsContext = iMBMSContextList->ContextByIndex( i );
|
|
447 |
|
|
448 |
if ( NULL != mbmsContext )
|
|
449 |
{
|
|
450 |
// Get context status
|
|
451 |
RPacketContext::TContextStatus contextStatus =
|
|
452 |
mbmsContext->ContextStatus();
|
|
453 |
|
|
454 |
// Check if context is active ( from service point
|
|
455 |
// of view )
|
|
456 |
isActiveContext =
|
|
457 |
IsContextStatusActive( contextStatus );
|
|
458 |
}
|
|
459 |
if ( isActiveContext )
|
|
460 |
{
|
|
461 |
// Active context found, break
|
|
462 |
i = iMBMSContextList->NumberOfContexts();
|
|
463 |
}
|
|
464 |
}
|
|
465 |
}
|
|
466 |
|
|
467 |
// Update service status
|
|
468 |
UpdateAttachedPacketStatus( isActiveContext );
|
|
469 |
|
|
470 |
break;
|
|
471 |
case RPacketService::EStatusSuspended:
|
|
472 |
if ( !iSuspended && ( RPacketService::EStatusUnattached !=
|
|
473 |
iInternalSavedData.iServiceStatus ) )
|
|
474 |
{
|
|
475 |
// Save status before suspend internally
|
|
476 |
iInternalSavedData.iServiceStatusBeforeSuspend =
|
|
477 |
iInternalSavedData.iServiceStatus;
|
|
478 |
|
|
479 |
// Set iSuspended to be ETrue
|
|
480 |
iSuspended = ETrue;
|
|
481 |
|
|
482 |
CMmPacketContextTsy* packetContext;
|
|
483 |
|
|
484 |
for ( TInt i = 0; i < numberOfContext; i++ )
|
|
485 |
{
|
|
486 |
// Get next context
|
|
487 |
packetContext =
|
|
488 |
iPacketContextList->PacketContextByIndex( i );
|
|
489 |
|
|
490 |
if ( NULL != packetContext )
|
|
491 |
{
|
|
492 |
// Inform context that service is suspend
|
|
493 |
packetContext->ContextSuspended();
|
|
494 |
}
|
|
495 |
}
|
|
496 |
CMmMBMSContextTsy* mbmsContext;
|
|
497 |
|
|
498 |
// check mbms context's
|
|
499 |
for ( TInt i = 0; i < iMBMSContextList->NumberOfContexts(); i++ )
|
|
500 |
{
|
|
501 |
// Get context by index from context list
|
|
502 |
mbmsContext = iMBMSContextList->ContextByIndex( i );
|
|
503 |
|
|
504 |
if ( NULL != mbmsContext )
|
|
505 |
{
|
|
506 |
// Inform context that service is suspend
|
|
507 |
mbmsContext->ContextSuspended();
|
|
508 |
}
|
|
509 |
}
|
|
510 |
|
|
511 |
if ( iDialUpContext != NULL )
|
|
512 |
{
|
|
513 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompletePacketStatusChanged. DialUp Context Suspended" );
|
|
514 |
iDialUpContext->ContextSuspended();
|
|
515 |
}
|
|
516 |
|
|
517 |
if ( iSecondaryDialUpContext != NULL )
|
|
518 |
{
|
|
519 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompletePacketStatusChanged. DialUp Context Suspended" );
|
|
520 |
iSecondaryDialUpContext->ContextSuspended();
|
|
521 |
}
|
|
522 |
|
|
523 |
// Complete status change notification with
|
|
524 |
// EStatusSuspended
|
|
525 |
CMmPacketServiceTsy::CompleteNotifyStatusChange(
|
|
526 |
RPacketService::EStatusSuspended, aErrorCode );
|
|
527 |
|
|
528 |
}
|
|
529 |
|
|
530 |
break;
|
|
531 |
default:
|
|
532 |
break;
|
|
533 |
}
|
|
534 |
}
|
|
535 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompletePacketStatusChanged. Service Status: %d", iInternalSavedData.iServiceStatus );
|
|
536 |
}
|
|
537 |
|
|
538 |
//----------------------------------------------------------------------------
|
|
539 |
// CMmPacketServiceTsy::ContextStatusChanged
|
|
540 |
// Context status is changed from the Service point of view.
|
|
541 |
// Called from CMmPacketContextTsy to notify service that context status is
|
|
542 |
// changed to inactive, activate or deleted state. These states indicate that
|
|
543 |
// context is changed to inactive or active state from the Packet Service
|
|
544 |
// point of view.
|
|
545 |
//----------------------------------------------------------------------------
|
|
546 |
//
|
|
547 |
void CMmPacketServiceTsy::ContextStatusChanged(
|
|
548 |
const RPacketContext::TContextStatus aContextStatus )
|
|
549 |
{
|
|
550 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::ContextStatusChanged. Context Status: %d", aContextStatus );
|
|
551 |
|
|
552 |
if ( !iSuspended && ( RPacketService::EStatusUnattached !=
|
|
553 |
iInternalSavedData.iServiceStatus ) )
|
|
554 |
{
|
|
555 |
|
|
556 |
TBool isActiveContext( EFalse );
|
|
557 |
|
|
558 |
if ( ( RPacketContext::EStatusInactive == aContextStatus ) ||
|
|
559 |
( RPacketContext::EStatusDeleted == aContextStatus ) )
|
|
560 |
{
|
|
561 |
const TInt numberOfContext(
|
|
562 |
iPacketContextList->NumberOfContexts() );
|
|
563 |
|
|
564 |
RPacketContext::TContextStatus contextStatus;
|
|
565 |
|
|
566 |
for ( TInt i = 0; i < numberOfContext; i++ )
|
|
567 |
{
|
|
568 |
TInt ret( iPacketContextList->GetContextStatusByIndex(
|
|
569 |
i, contextStatus ) );
|
|
570 |
|
|
571 |
if ( KErrNone == ret )
|
|
572 |
{
|
|
573 |
isActiveContext = IsContextStatusActive( contextStatus );
|
|
574 |
|
|
575 |
if ( isActiveContext )
|
|
576 |
{
|
|
577 |
// Active context found, break
|
|
578 |
i = numberOfContext;
|
|
579 |
}
|
|
580 |
}
|
|
581 |
}
|
|
582 |
}
|
|
583 |
|
|
584 |
else if ( RPacketContext::EStatusActive == aContextStatus )
|
|
585 |
{
|
|
586 |
|
|
587 |
isActiveContext = ETrue;
|
|
588 |
|
|
589 |
}
|
|
590 |
|
|
591 |
UpdateAttachedPacketStatus( isActiveContext );
|
|
592 |
}
|
|
593 |
}
|
|
594 |
|
|
595 |
//----------------------------------------------------------------------------
|
|
596 |
// CMmPacketServiceTsy::PreferredBearerChanged
|
|
597 |
// Preferred bearer has been changed save new
|
|
598 |
//----------------------------------------------------------------------------
|
|
599 |
//
|
|
600 |
void CMmPacketServiceTsy::PreferredBearerChanged(
|
|
601 |
CMmDataPackage* aPackage )
|
|
602 |
{
|
|
603 |
RPacketService::TPreferredBearer preferredBearer;
|
|
604 |
|
|
605 |
aPackage->UnPackData( preferredBearer );
|
|
606 |
|
|
607 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::PreferredBearerChanged. PreferredBearer: %d", preferredBearer );
|
|
608 |
|
|
609 |
iInternalSavedData.iPreferredBearer = preferredBearer;
|
|
610 |
|
|
611 |
}
|
|
612 |
|
|
613 |
//----------------------------------------------------------------------------
|
|
614 |
// CMmPacketServiceTsy::Attach
|
|
615 |
// Starts asynchronous attach request to the network.
|
|
616 |
// This function will cause the phone to attempt an attach to the packet
|
|
617 |
// network, if it is not already attached. If it is, the error
|
|
618 |
// KErrAlreadyExists should be returned.
|
|
619 |
//----------------------------------------------------------------------------
|
|
620 |
//
|
|
621 |
TInt CMmPacketServiceTsy::AttachL()
|
|
622 |
{
|
|
623 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::AttachL." );
|
|
624 |
|
|
625 |
TInt ret( KErrAlreadyExists );
|
|
626 |
|
|
627 |
if ( RPacketService::EStatusUnattached ==
|
|
628 |
iInternalSavedData.iServiceStatus )
|
|
629 |
{
|
|
630 |
|
|
631 |
const TTsyReqHandle attachHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
632 |
EMultimodePacketServiceAttach ) );
|
|
633 |
|
|
634 |
if ( EMultimodePacketServiceReqHandleUnknown != attachHandle )
|
|
635 |
{
|
|
636 |
ret = KErrServerBusy;
|
|
637 |
}
|
|
638 |
else
|
|
639 |
{
|
|
640 |
// Attach
|
|
641 |
ret = iMmPacketServiceGsmWcdmaExt->AttachL();
|
|
642 |
|
|
643 |
if ( KErrNone == ret )
|
|
644 |
{
|
|
645 |
// Set request handle
|
|
646 |
iReqHandleType = EMultimodePacketServiceAttach;
|
|
647 |
}
|
|
648 |
else
|
|
649 |
{
|
|
650 |
// Sending to the phonet failed for some reason
|
|
651 |
ret = CMmCommonStaticUtility::EpocErrorCode(
|
|
652 |
KErrGeneral, KErrGsmMMNetworkFailure );
|
|
653 |
}
|
|
654 |
}
|
|
655 |
}
|
|
656 |
|
|
657 |
return ret;
|
|
658 |
}
|
|
659 |
|
|
660 |
//----------------------------------------------------------------------------
|
|
661 |
// CMmPacketServiceTsy::CompleteAttach
|
|
662 |
// Completes asynchronous attach request.
|
|
663 |
//----------------------------------------------------------------------------
|
|
664 |
//
|
|
665 |
void CMmPacketServiceTsy::CompleteAttach(
|
|
666 |
const TInt aError ) //error value
|
|
667 |
{
|
|
668 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteAttach. Error Value: %d", aError );
|
|
669 |
|
|
670 |
// Reset request handle. Returns the deleted request handle
|
|
671 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
672 |
EMultimodePacketServiceAttach ) );
|
|
673 |
|
|
674 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
675 |
{
|
|
676 |
// Complete the client request
|
|
677 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aError );
|
|
678 |
}
|
|
679 |
}
|
|
680 |
|
|
681 |
//----------------------------------------------------------------------------
|
|
682 |
// CMmPacketServiceTsy::Detach
|
|
683 |
// Starts asynchronous detach request to the network.
|
|
684 |
// This function will cause the phone to attempt to detach from the packet
|
|
685 |
// network, if it is not already detached. If it is, the error
|
|
686 |
// KErrAlreadyExists should be returned. If at least one context is active the
|
|
687 |
// error KErrInUse should be returned.
|
|
688 |
//----------------------------------------------------------------------------
|
|
689 |
//
|
|
690 |
TInt CMmPacketServiceTsy::DetachL()
|
|
691 |
{
|
|
692 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::DetachL." );
|
|
693 |
|
|
694 |
TInt ret( KErrAlreadyExists );
|
|
695 |
|
|
696 |
if ( RPacketService::EStatusUnattached !=
|
|
697 |
iInternalSavedData.iServiceStatus )
|
|
698 |
{
|
|
699 |
|
|
700 |
// Get number of created contexts
|
|
701 |
const TInt numberOfContext( iPacketContextList->NumberOfContexts() );
|
|
702 |
RPacketContext::TContextStatus contextStatus;
|
|
703 |
|
|
704 |
for ( TInt i = 0; i < numberOfContext; i++ )
|
|
705 |
{
|
|
706 |
ret = iPacketContextList->GetContextStatusByIndex(
|
|
707 |
i, contextStatus );
|
|
708 |
|
|
709 |
if ( KErrNone == ret )
|
|
710 |
{
|
|
711 |
if ( IsContextStatusActive( contextStatus ) )
|
|
712 |
{
|
|
713 |
// Atleast one of the contexts is active.
|
|
714 |
ret = KErrInUse;
|
|
715 |
i= numberOfContext;
|
|
716 |
}
|
|
717 |
}
|
|
718 |
}
|
|
719 |
|
|
720 |
// If not KErrInUse, no active contexts found and detach can be done
|
|
721 |
if ( KErrInUse != ret )
|
|
722 |
{
|
|
723 |
|
|
724 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->
|
|
725 |
GetTsyReqHandle( EMultimodePacketServiceDetach ) );
|
|
726 |
|
|
727 |
if ( EMultimodePacketServiceReqHandleUnknown == reqHandle )
|
|
728 |
{
|
|
729 |
// Detach
|
|
730 |
ret = iMmPacketServiceGsmWcdmaExt->DetachL();
|
|
731 |
|
|
732 |
if ( KErrNone == ret )
|
|
733 |
{
|
|
734 |
// Set request handle
|
|
735 |
iReqHandleType = EMultimodePacketServiceDetach;
|
|
736 |
}
|
|
737 |
else
|
|
738 |
{
|
|
739 |
// Sending to the phonet failed for some reason
|
|
740 |
ret = CMmCommonStaticUtility::EpocErrorCode(
|
|
741 |
KErrGeneral, KErrGsmMMNetworkFailure );
|
|
742 |
}
|
|
743 |
}
|
|
744 |
else
|
|
745 |
{
|
|
746 |
// The request is already in processing because of previous
|
|
747 |
// request. Complete request with KErrServerBusy informing the
|
|
748 |
// client about the situation.
|
|
749 |
ret = KErrServerBusy;
|
|
750 |
}
|
|
751 |
}
|
|
752 |
}
|
|
753 |
|
|
754 |
return ret;
|
|
755 |
}
|
|
756 |
|
|
757 |
//----------------------------------------------------------------------------
|
|
758 |
// CMmPacketServiceTsy::CompleteDetachL
|
|
759 |
// Completes asynchronous detach request.
|
|
760 |
//----------------------------------------------------------------------------
|
|
761 |
//
|
|
762 |
void CMmPacketServiceTsy::CompleteDetachL(
|
|
763 |
const TInt aError )
|
|
764 |
{
|
|
765 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteDetachL. Error Value: %d", aError );
|
|
766 |
|
|
767 |
// Reset request handle. Returns the deleted request handle
|
|
768 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
769 |
EMultimodePacketServiceDetach ) );
|
|
770 |
|
|
771 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
772 |
{
|
|
773 |
// Complete the client request
|
|
774 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aError );
|
|
775 |
}
|
|
776 |
if ( RPacketService::EAttachWhenPossible == iAttachMode )
|
|
777 |
{
|
|
778 |
SetAttachModeL( &iAttachMode );
|
|
779 |
iReqHandleType = EMultimodePacketServiceReqHandleUnknown;
|
|
780 |
}
|
|
781 |
}
|
|
782 |
|
|
783 |
//----------------------------------------------------------------------------
|
|
784 |
// CMmPacketServiceTsy::EnumerateContexts
|
|
785 |
// Enumerates contexts.
|
|
786 |
// This function will retrieve both the number of opened contexts in the TSY,
|
|
787 |
// the aCount parameter containing this value on completion of the function,
|
|
788 |
// and the maximum possible number of contexts, passed back in the aMaxAllowed
|
|
789 |
// parameter. Note that this is not the maximum number of simultaneously
|
|
790 |
// active contexts, but the total number allowed.
|
|
791 |
//----------------------------------------------------------------------------
|
|
792 |
//
|
|
793 |
TInt CMmPacketServiceTsy::EnumerateContexts(
|
|
794 |
TInt* const aCount,
|
|
795 |
TInt* const aMaxAllowed )
|
|
796 |
{
|
|
797 |
*aCount = iPacketContextList->NumberOfContexts();
|
|
798 |
*aMaxAllowed = KMmMaxNumberOfContexts;
|
|
799 |
|
|
800 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::EnumerateContexts. Count: %d Max Allowed: %d", *aCount, *aMaxAllowed );
|
|
801 |
// Complete the request with KErrNone
|
|
802 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
803 |
|
|
804 |
return KErrNone;
|
|
805 |
}
|
|
806 |
|
|
807 |
//----------------------------------------------------------------------------
|
|
808 |
// CMmPacketServiceTsy::GetAttachMode
|
|
809 |
// Retrieves the current mode of GPRS Attach operation.
|
|
810 |
//----------------------------------------------------------------------------
|
|
811 |
//
|
|
812 |
TInt CMmPacketServiceTsy::GetAttachModeL(
|
|
813 |
RPacketService::TAttachMode* const aMode )
|
|
814 |
{
|
|
815 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::GetAttachModeL. Mode:%d", *aMode );
|
|
816 |
|
|
817 |
TInt ret( KErrServerBusy );
|
|
818 |
|
|
819 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
820 |
EMultimodePacketServiceGetAttachMode ) );
|
|
821 |
|
|
822 |
if ( EMultimodePacketServiceReqHandleUnknown == reqHandle )
|
|
823 |
{
|
|
824 |
// Get attach mode
|
|
825 |
ret = iMmPacketServiceGsmWcdmaExt->GetAttachModeL();
|
|
826 |
|
|
827 |
if ( KErrNone == ret )
|
|
828 |
{
|
|
829 |
// Save pointer to aMode internally
|
|
830 |
iTemporarySavedData.iGetAttachMode = aMode;
|
|
831 |
// Set req handle
|
|
832 |
iReqHandleType = EMultimodePacketServiceGetAttachMode;
|
|
833 |
}
|
|
834 |
}
|
|
835 |
return ret;
|
|
836 |
}
|
|
837 |
|
|
838 |
//----------------------------------------------------------------------------
|
|
839 |
// CMmPacketServiceTsy::CompleteGetAttachMode
|
|
840 |
// Completes asynchronous attach request.
|
|
841 |
//----------------------------------------------------------------------------
|
|
842 |
//
|
|
843 |
void CMmPacketServiceTsy::CompleteGetAttachMode(
|
|
844 |
const RPacketService::TAttachMode aAttachMode, TInt aResult )
|
|
845 |
{
|
|
846 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteGetAttachMode. Attach Mode: %d", aAttachMode );
|
|
847 |
|
|
848 |
// Reset request handle. Returns the deleted request handle
|
|
849 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
850 |
EMultimodePacketServiceGetAttachMode ) );
|
|
851 |
|
|
852 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
853 |
{
|
|
854 |
*iTemporarySavedData.iGetAttachMode = aAttachMode;
|
|
855 |
iTemporarySavedData.iGetAttachMode = NULL;
|
|
856 |
|
|
857 |
// Complete the client request
|
|
858 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aResult );
|
|
859 |
}
|
|
860 |
}
|
|
861 |
|
|
862 |
//----------------------------------------------------------------------------
|
|
863 |
// CMmPacketServiceTsy::GetContextInfo
|
|
864 |
// Gets Context info of the context defined by aIndex.
|
|
865 |
//----------------------------------------------------------------------------
|
|
866 |
//
|
|
867 |
TInt CMmPacketServiceTsy::GetContextInfo(
|
|
868 |
const TInt* const aIndex,
|
|
869 |
RPacketService::TContextInfo* const aInfo )
|
|
870 |
{
|
|
871 |
TInt ret( KErrNone );
|
|
872 |
|
|
873 |
// Call ContextStatusByIndex() to set context status to aInfo->iStatus
|
|
874 |
ret = iPacketContextList->GetContextStatusByIndex(
|
|
875 |
*aIndex, aInfo->iStatus );
|
|
876 |
|
|
877 |
if ( KErrNone == ret )
|
|
878 |
{
|
|
879 |
// Call GetContextNameByIndex() to set context name to aInfo->iName
|
|
880 |
ret = iPacketContextList->GetContextNameByIndex(
|
|
881 |
*aIndex, aInfo->iName );
|
|
882 |
|
|
883 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::GetContextInfo. Context Status: %d Context Name: %S", aInfo->iStatus, &aInfo->iName );
|
|
884 |
}
|
|
885 |
|
|
886 |
// Complete request with ret
|
|
887 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, ret );
|
|
888 |
|
|
889 |
return KErrNone;
|
|
890 |
}
|
|
891 |
|
|
892 |
//----------------------------------------------------------------------------
|
|
893 |
// CMmPacketServiceTsy::GetDynamicCaps
|
|
894 |
// Returns the dynamic capabilities of the phone.
|
|
895 |
// call active extension to get dynamic capabilities to aCaps
|
|
896 |
// complete request with KErrNone
|
|
897 |
// return KErrNone
|
|
898 |
//----------------------------------------------------------------------------
|
|
899 |
//
|
|
900 |
TInt CMmPacketServiceTsy::GetDynamicCaps(
|
|
901 |
RPacketService::TDynamicCapsFlags* const aCaps )
|
|
902 |
{
|
|
903 |
// Call DynamicCaps() from extension
|
|
904 |
iMmPacketServiceGsmWcdmaExt->GetDynamicCaps( aCaps );
|
|
905 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetDynamicCaps." );
|
|
906 |
|
|
907 |
// Complete the request with KErrNone
|
|
908 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
909 |
|
|
910 |
return KErrNone;
|
|
911 |
}
|
|
912 |
|
|
913 |
//----------------------------------------------------------------------------
|
|
914 |
// CMmPacketServiceTsy::GetMSClass
|
|
915 |
// Gets current and maximum value of the Mobile Station Class.
|
|
916 |
// This function will retrieve both the current class and the highest class of
|
|
917 |
// the mobile station. The parameters aCurrentClass and aMaxClass may take one
|
|
918 |
// of the following values which are ordered in terms of class from highest to
|
|
919 |
// lowest:
|
|
920 |
//----------------------------------------------------------------------------
|
|
921 |
//
|
|
922 |
TInt CMmPacketServiceTsy::GetMSClass(
|
|
923 |
RPacketService::TMSClass* const aCurrentClass,
|
|
924 |
RPacketService::TMSClass* const aMaxClass )
|
|
925 |
{
|
|
926 |
*aCurrentClass = iInternalSavedData.iMsClass;
|
|
927 |
*aMaxClass = KMaxMsClass;
|
|
928 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::GetMSClass. Current Class: %d Max Class: %d", *aCurrentClass, *aMaxClass );
|
|
929 |
|
|
930 |
// Complete the request with KErrNone
|
|
931 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
932 |
|
|
933 |
return KErrNone;
|
|
934 |
}
|
|
935 |
|
|
936 |
//----------------------------------------------------------------------------
|
|
937 |
// CMmPacketServiceTsy::GetNtwkRegStatus
|
|
938 |
// Gets network registration status.
|
|
939 |
// This function allows the client to retrieve the current registration status
|
|
940 |
// of the phone on the packet network as defined by the enum
|
|
941 |
// TRegistrationStatus.
|
|
942 |
//------------------------------------------------------------------------------
|
|
943 |
//
|
|
944 |
TInt CMmPacketServiceTsy::GetNtwkRegStatusL(
|
|
945 |
RPacketService::TRegistrationStatus* const aRegistrationStatus )
|
|
946 |
{
|
|
947 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::GetNtwkRegStatusL. Tsy Req Handle: %d", iTsyReqHandle );
|
|
948 |
|
|
949 |
const TTsyReqHandle regHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
950 |
EMultimodePacketServiceGetNtwkRegStatus ) );
|
|
951 |
|
|
952 |
TInt ret( KErrServerBusy );
|
|
953 |
|
|
954 |
if ( EMultimodePacketServiceReqHandleUnknown == regHandle )
|
|
955 |
{
|
|
956 |
|
|
957 |
// Get network registration status
|
|
958 |
ret = iMmPacketServiceGsmWcdmaExt->GetNtwkRegStatusL();
|
|
959 |
|
|
960 |
if ( KErrNone == ret )
|
|
961 |
{
|
|
962 |
iRegistrationStatus = aRegistrationStatus;
|
|
963 |
// Set request handle type
|
|
964 |
iReqHandleType = EMultimodePacketServiceGetNtwkRegStatus;
|
|
965 |
}
|
|
966 |
}
|
|
967 |
|
|
968 |
return ret;
|
|
969 |
}
|
|
970 |
|
|
971 |
//----------------------------------------------------------------------------
|
|
972 |
// CMmPacketServiceTsy::CompleteGetNtwkRegStatus
|
|
973 |
// Completes get network registration status request.
|
|
974 |
//----------------------------------------------------------------------------
|
|
975 |
//
|
|
976 |
void CMmPacketServiceTsy::CompleteGetNtwkRegStatus(
|
|
977 |
const RPacketService::TRegistrationStatus aRegistrationStatus,
|
|
978 |
const TInt aError )
|
|
979 |
{
|
|
980 |
// Reset request handle. Returns the deleted request handle
|
|
981 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
982 |
EMultimodePacketServiceGetNtwkRegStatus ) );
|
|
983 |
|
|
984 |
// If request handle ok
|
|
985 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
986 |
{
|
|
987 |
|
|
988 |
if ( KErrNone == aError )
|
|
989 |
{
|
|
990 |
*iRegistrationStatus = aRegistrationStatus;
|
|
991 |
iRegistrationStatus = NULL;
|
|
992 |
}
|
|
993 |
// Complete the client request
|
|
994 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aError );
|
|
995 |
|
|
996 |
}
|
|
997 |
else
|
|
998 |
{
|
|
999 |
// Request was sent during initialisation from active extension
|
|
1000 |
CMmPacketServiceTsy::CompleteNotifyChangeOfNtwkRegStatus(
|
|
1001 |
aRegistrationStatus );
|
|
1002 |
}
|
|
1003 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::CompleteGetNtwkRegStatus. TSY Req Handle: %d Registration Status: %d", reqHandle, aRegistrationStatus );
|
|
1004 |
}
|
|
1005 |
|
|
1006 |
//----------------------------------------------------------------------------
|
|
1007 |
// CMmPacketServiceTsy::GetPreferredBearer
|
|
1008 |
// Returns preferred bearer.
|
|
1009 |
// This function will retrieve the currently selected preferred bearer to
|
|
1010 |
// attach to when in Class C operation. The TSY should cache this value, so
|
|
1011 |
// the function should return quickly meaning there is no need for an
|
|
1012 |
// asynchronous version.
|
|
1013 |
//----------------------------------------------------------------------------
|
|
1014 |
//
|
|
1015 |
TInt CMmPacketServiceTsy::GetPreferredBearer(
|
|
1016 |
RPacketService::TPreferredBearer* const aBearer )
|
|
1017 |
{
|
|
1018 |
*aBearer = iInternalSavedData.iPreferredBearer;
|
|
1019 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::GetPreferredBearer. Preferred Bearer: %d", *aBearer );
|
|
1020 |
|
|
1021 |
// Complete the request with KErrNone
|
|
1022 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
1023 |
|
|
1024 |
return KErrNone;
|
|
1025 |
}
|
|
1026 |
|
|
1027 |
//----------------------------------------------------------------------------
|
|
1028 |
// CMmPacketServiceTsy::GetStaticCaps
|
|
1029 |
// Retrieves those capabilities of the TSY that are constant.
|
|
1030 |
// call active extension to set static capabilities to aCaps
|
|
1031 |
//----------------------------------------------------------------------------
|
|
1032 |
//
|
|
1033 |
TInt CMmPacketServiceTsy::GetStaticCaps(
|
|
1034 |
TUint* const aCaps,
|
|
1035 |
const RPacketContext::TProtocolType* const aPdpType)
|
|
1036 |
{
|
|
1037 |
TInt ret = KErrNone;
|
|
1038 |
|
|
1039 |
switch (*aPdpType)
|
|
1040 |
{
|
|
1041 |
case RPacketContext::EPdpTypeIPv4:
|
|
1042 |
case RPacketContext::EPdpTypeIPv6:
|
|
1043 |
case RPacketContext::EPdpTypeX25:
|
|
1044 |
case RPacketContext::EPdpTypePPP:
|
|
1045 |
case RPacketContext::EPdpTypeCDPD:
|
|
1046 |
iMmPacketServiceGsmWcdmaExt->GetStaticCaps( aCaps );
|
|
1047 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetStaticCaps." );
|
|
1048 |
|
|
1049 |
// Complete the request with KErrNone
|
|
1050 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, ret );
|
|
1051 |
break;
|
|
1052 |
default:
|
|
1053 |
ret = KErrArgument;
|
|
1054 |
break;
|
|
1055 |
}
|
|
1056 |
|
|
1057 |
return ret;
|
|
1058 |
}
|
|
1059 |
|
|
1060 |
//----------------------------------------------------------------------------
|
|
1061 |
// CMmPacketServiceTsy::GetStatus
|
|
1062 |
// Returns current status of the packet service.
|
|
1063 |
//----------------------------------------------------------------------------
|
|
1064 |
//
|
|
1065 |
TInt CMmPacketServiceTsy::GetStatus(
|
|
1066 |
RPacketService::TStatus* const aPacketStatus )
|
|
1067 |
{
|
|
1068 |
*aPacketStatus = iInternalSavedData.iServiceStatus;
|
|
1069 |
|
|
1070 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::GetStatus. Service Status: %d", *aPacketStatus );
|
|
1071 |
|
|
1072 |
// Complete the request with KErrNone
|
|
1073 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
1074 |
|
|
1075 |
return KErrNone;
|
|
1076 |
}
|
|
1077 |
|
|
1078 |
//----------------------------------------------------------------------------
|
|
1079 |
// CMmPacketServiceTsy::NotifyChangeOfNtwkRegStatus
|
|
1080 |
// Requests notification of network registration status change.
|
|
1081 |
// Allows a client to be notified whenever a change in the status of the
|
|
1082 |
// packet network registration is detected.
|
|
1083 |
//----------------------------------------------------------------------------
|
|
1084 |
//
|
|
1085 |
TInt CMmPacketServiceTsy::NotifyChangeOfNtwkRegStatus(
|
|
1086 |
RPacketService::TRegistrationStatus* const aRegistrationStatus )
|
|
1087 |
{
|
|
1088 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NotifyChangeOfNtwkRegStatus." );
|
|
1089 |
|
|
1090 |
// Set request handle and save pointer to aRegistrationStatus
|
|
1091 |
iNotifyDataPointers.iChangeOfNtwkRegStatus = aRegistrationStatus;
|
|
1092 |
iReqHandleType = EMultimodePacketServiceNotifyNtwkRegStatusChange;
|
|
1093 |
|
|
1094 |
return KErrNone;
|
|
1095 |
}
|
|
1096 |
|
|
1097 |
//----------------------------------------------------------------------------
|
|
1098 |
// CMmPacketServiceTsy::CompleteNotifyChangeOfNtwkRegStatus
|
|
1099 |
// Completes notify change of ntwk registration status to client.
|
|
1100 |
//----------------------------------------------------------------------------
|
|
1101 |
//
|
|
1102 |
void CMmPacketServiceTsy::CompleteNotifyChangeOfNtwkRegStatus(
|
|
1103 |
const RPacketService::TRegistrationStatus aRegistrationStatus )
|
|
1104 |
{
|
|
1105 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::CompleteNotifyChangeOfNtwkRegStatus. Current reg Status: %d New reg Status: %d", iInternalSavedData.iRegistrationStatus, aRegistrationStatus );
|
|
1106 |
|
|
1107 |
// If registration status changed
|
|
1108 |
if ( aRegistrationStatus != iInternalSavedData.iRegistrationStatus )
|
|
1109 |
{
|
|
1110 |
// Save new status internally
|
|
1111 |
iInternalSavedData.iRegistrationStatus = aRegistrationStatus;
|
|
1112 |
|
|
1113 |
// Reset request handle. Returns the deleted request handle
|
|
1114 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1115 |
EMultimodePacketServiceNotifyNtwkRegStatusChange ) );
|
|
1116 |
|
|
1117 |
// If notification is requested by client
|
|
1118 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1119 |
{
|
|
1120 |
// Set aRegistrationStatus to the etel side memory
|
|
1121 |
*iNotifyDataPointers.iChangeOfNtwkRegStatus = aRegistrationStatus;
|
|
1122 |
iNotifyDataPointers.iChangeOfNtwkRegStatus = NULL;
|
|
1123 |
|
|
1124 |
// Complete request with KErrNone
|
|
1125 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1126 |
}
|
|
1127 |
}
|
|
1128 |
}
|
|
1129 |
|
|
1130 |
//----------------------------------------------------------------------------
|
|
1131 |
// CMmPacketServiceTsy::CompleteNotifyChangeOfNtwkRegStatus
|
|
1132 |
// Completes notify change of ntwk registration status to client.
|
|
1133 |
// Handles request coming from MessHandler
|
|
1134 |
//----------------------------------------------------------------------------
|
|
1135 |
//
|
|
1136 |
void CMmPacketServiceTsy::CompleteNotifyChangeOfNtwkRegStatus(
|
|
1137 |
CMmDataPackage* aDataPackage, TInt aResult )
|
|
1138 |
{
|
|
1139 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyChangeOfNtwkRegStatus.");
|
|
1140 |
|
|
1141 |
//Unpack necessary data from datapackage
|
|
1142 |
RPacketService::TRegistrationStatus registrationStatus;
|
|
1143 |
aDataPackage->UnPackData( registrationStatus );
|
|
1144 |
|
|
1145 |
// If registration status changed
|
|
1146 |
if ( registrationStatus != iInternalSavedData.iRegistrationStatus )
|
|
1147 |
{
|
|
1148 |
|
|
1149 |
// Save new status internally
|
|
1150 |
iInternalSavedData.iRegistrationStatus = registrationStatus;
|
|
1151 |
|
|
1152 |
// Reset request handle. Returns the deleted request handle
|
|
1153 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1154 |
EMultimodePacketServiceNotifyNtwkRegStatusChange ) );
|
|
1155 |
|
|
1156 |
// If notification is requested by client
|
|
1157 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1158 |
{
|
|
1159 |
|
|
1160 |
// Set registrationStatus to the etel side memory
|
|
1161 |
*iNotifyDataPointers.iChangeOfNtwkRegStatus = registrationStatus;
|
|
1162 |
iNotifyDataPointers.iChangeOfNtwkRegStatus = NULL;
|
|
1163 |
|
|
1164 |
// Complete the client request
|
|
1165 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aResult );
|
|
1166 |
|
|
1167 |
}
|
|
1168 |
}
|
|
1169 |
}
|
|
1170 |
|
|
1171 |
//----------------------------------------------------------------------------
|
|
1172 |
// CMmPacketServiceTsy::NotifyContextActivationRequested
|
|
1173 |
// Requests notification of network requests context activation.
|
|
1174 |
// This function will complete when the phone receives a request from the
|
|
1175 |
// packet network to activate a PDP context. Depending on the type of
|
|
1176 |
// network, this request may contain the PDP type requested, the PDP address
|
|
1177 |
// for this context, and possibly the Access Point Name (APN) of the gateway
|
|
1178 |
// to connect to.
|
|
1179 |
//----------------------------------------------------------------------------
|
|
1180 |
//
|
|
1181 |
TInt CMmPacketServiceTsy::NotifyContextActivationRequested(
|
|
1182 |
TPacketDataConfigBase* const aContextParameters )
|
|
1183 |
{
|
|
1184 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NotifyContextActivationRequested." );
|
|
1185 |
|
|
1186 |
TInt ret = KErrNone;
|
|
1187 |
|
|
1188 |
// If class of aContextParameters is TContextConfigGPRS
|
|
1189 |
if ( TPacketDataConfigBase::KConfigGPRS ==
|
|
1190 |
aContextParameters->ExtensionId() )
|
|
1191 |
{
|
|
1192 |
// Cast aContextParameters from TPacketDataConfigBase to
|
|
1193 |
// TContextConfigGPRS and save internally
|
|
1194 |
iNotifyDataPointers.iContextActivationRequested =
|
|
1195 |
( RPacketContext::TContextConfigGPRS* ) aContextParameters;
|
|
1196 |
|
|
1197 |
// Set request handle
|
|
1198 |
iReqHandleType =
|
|
1199 |
EMultimodePacketServiceNotifyContextActivationRequested;
|
|
1200 |
}
|
|
1201 |
// Else if class of aContextParameters is TContextConfigR99_R4
|
|
1202 |
else if ( TPacketDataConfigBase::KConfigRel99Rel4 ==
|
|
1203 |
aContextParameters->ExtensionId() )
|
|
1204 |
{
|
|
1205 |
// Cast aContextParameters from TPacketDataConfigBase to
|
|
1206 |
// TContextConfigR99_R4 and save internally
|
|
1207 |
iNotifyDataPointers.iContextActivationRequested99 =
|
|
1208 |
( RPacketContext::TContextConfigR99_R4* ) aContextParameters;
|
|
1209 |
|
|
1210 |
// Set request handle
|
|
1211 |
iReqHandleType =
|
|
1212 |
EMultimodePacketServiceNotifyContextActivationRequested99;
|
|
1213 |
}
|
|
1214 |
// Else if class of aContextParameters is TContextConfigR5
|
|
1215 |
else if ( TPacketDataConfigBase::KConfigRel5 ==
|
|
1216 |
aContextParameters->ExtensionId() )
|
|
1217 |
{
|
|
1218 |
// Cast aContextParameters from TPacketDataConfigBase to
|
|
1219 |
// TContextConfig_R5 and save internally
|
|
1220 |
iNotifyDataPointers.iContextActivationRequested5 =
|
|
1221 |
( RPacketContext::TContextConfig_R5* ) aContextParameters;
|
|
1222 |
|
|
1223 |
// Set request handle
|
|
1224 |
iReqHandleType =
|
|
1225 |
EMultimodePacketServiceNotifyContextActivationRequested5;
|
|
1226 |
}
|
|
1227 |
// Else class of aContextParameters is not supported
|
|
1228 |
else
|
|
1229 |
{
|
|
1230 |
ret = KErrNotSupported;
|
|
1231 |
}
|
|
1232 |
|
|
1233 |
return ret;
|
|
1234 |
}
|
|
1235 |
|
|
1236 |
//----------------------------------------------------------------------------
|
|
1237 |
// CMmPacketServiceTsy::CompleteNotifyContextActivationRequested
|
|
1238 |
// Completes context activation requested notification to client.
|
|
1239 |
//----------------------------------------------------------------------------
|
|
1240 |
//
|
|
1241 |
void CMmPacketServiceTsy::CompleteNotifyContextActivationRequested(
|
|
1242 |
CMmDataPackage* aDataPackage ) //contains initial data
|
|
1243 |
{
|
|
1244 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyContextActivationRequested.");
|
|
1245 |
|
|
1246 |
//Check if there is client request
|
|
1247 |
if ( EMultimodePacketServiceReqHandleUnknown !=
|
|
1248 |
CMmPacketServiceTsy::TsyReqHandleStore()->GetTsyReqHandle(
|
|
1249 |
CMmPacketServiceTsy::
|
|
1250 |
EMultimodePacketServiceNotifyContextActivationRequested ) ||
|
|
1251 |
EMultimodePacketServiceReqHandleUnknown !=
|
|
1252 |
CMmPacketServiceTsy::TsyReqHandleStore()->
|
|
1253 |
GetTsyReqHandle( CMmPacketServiceTsy::
|
|
1254 |
EMultimodePacketServiceNotifyContextActivationRequested99 ) ||
|
|
1255 |
EMultimodePacketServiceReqHandleUnknown !=
|
|
1256 |
CMmPacketServiceTsy::TsyReqHandleStore()->
|
|
1257 |
GetTsyReqHandle( CMmPacketServiceTsy::
|
|
1258 |
EMultimodePacketServiceNotifyContextActivationRequested5 ) )
|
|
1259 |
{
|
|
1260 |
//ETel API client may call RPacketService::NotifyContextActivationRequested
|
|
1261 |
//method using one of following parameter class:
|
|
1262 |
//RPacketContext::TContextConfigGPRS, RPacketContext::TContextConfigR99_R4
|
|
1263 |
//or RPacketContext::TContextConfig_R5. LTSY may complete
|
|
1264 |
//NotifyContextActivationRequested request using one of these parameter
|
|
1265 |
//classes. CTSY has to complete RPacketService::NotifyContextActivationRequested
|
|
1266 |
//requests in all situations.
|
|
1267 |
|
|
1268 |
//Copy data temporary from aDataPackage to
|
|
1269 |
//RPacketContext::TContextConfig_R5
|
|
1270 |
|
|
1271 |
RPacketContext::TContextConfig_R5 config_R5;
|
|
1272 |
TBool config_R5Filled = ETrue;
|
|
1273 |
|
|
1274 |
//Before copying initialize GPRS specific fields
|
|
1275 |
TUint iPdpCompression = 0;
|
|
1276 |
RPacketContext::TAnonymousAccess iAnonymousAccessReqd =
|
|
1277 |
RPacketContext::ENotApplicable;
|
|
1278 |
|
|
1279 |
//Before copying reset R99_R4 and R5 specific fields
|
|
1280 |
config_R5.iPFI = RPacketContext::EBestEffort;
|
|
1281 |
config_R5.iPdpHeaderCompression = RPacketContext::ENoHeaderCompression;
|
|
1282 |
config_R5.iPdpDataCompression = RPacketContext::ENoDataCompression;
|
|
1283 |
|
|
1284 |
|
|
1285 |
TPacketDataConfigBase configBase;
|
|
1286 |
aDataPackage->UnPackData( configBase );
|
|
1287 |
if ( configBase.ExtensionId() == TPacketDataConfigBase::KConfigGPRS )
|
|
1288 |
{
|
|
1289 |
RPacketContext::TContextConfigGPRS configGPRS;
|
|
1290 |
aDataPackage->UnPackData( configGPRS );
|
|
1291 |
|
|
1292 |
config_R5.iPdpType =configGPRS.iPdpType;
|
|
1293 |
config_R5.iAccessPointName = configGPRS.iAccessPointName;
|
|
1294 |
config_R5.iPdpAddress = configGPRS.iPdpAddress;
|
|
1295 |
iPdpCompression = configGPRS.iPdpCompression;
|
|
1296 |
iAnonymousAccessReqd = configGPRS.iAnonymousAccessReqd;
|
|
1297 |
config_R5.iUseEdge = configGPRS.iUseEdge;
|
|
1298 |
config_R5.iProtocolConfigOption.iAuthInfo =
|
|
1299 |
configGPRS.iProtocolConfigOption.iAuthInfo;
|
|
1300 |
config_R5.iProtocolConfigOption.iChallenge =
|
|
1301 |
configGPRS.iProtocolConfigOption.iChallenge;
|
|
1302 |
config_R5.iProtocolConfigOption.iResponse =
|
|
1303 |
configGPRS.iProtocolConfigOption.iResponse;
|
|
1304 |
config_R5.iProtocolConfigOption.iId =
|
|
1305 |
configGPRS.iProtocolConfigOption.iId;
|
|
1306 |
config_R5.iProtocolConfigOption.iDnsAddresses =
|
|
1307 |
configGPRS.iProtocolConfigOption.iDnsAddresses;
|
|
1308 |
config_R5.iProtocolConfigOption.iMiscBuffer =
|
|
1309 |
configGPRS.iProtocolConfigOption.iMiscBuffer;
|
|
1310 |
config_R5.iNWIContext = configGPRS.iNWIContext;
|
|
1311 |
}
|
|
1312 |
else if ( configBase.ExtensionId() == TPacketDataConfigBase::KConfigRel99Rel4 )
|
|
1313 |
{
|
|
1314 |
RPacketContext::TContextConfigR99_R4 config_R99_R4;
|
|
1315 |
aDataPackage->UnPackData( config_R99_R4 );
|
|
1316 |
|
|
1317 |
config_R5.iPdpType = config_R99_R4.iPdpType;
|
|
1318 |
config_R5.iAccessPointName = config_R99_R4.iAccessPointName;
|
|
1319 |
config_R5.iPdpAddress = config_R99_R4.iPdpAddress;
|
|
1320 |
config_R5.iUseEdge = config_R99_R4.iUseEdge;
|
|
1321 |
config_R5.iProtocolConfigOption.iAuthInfo =
|
|
1322 |
config_R99_R4.iProtocolConfigOption.iAuthInfo;
|
|
1323 |
config_R5.iProtocolConfigOption.iChallenge =
|
|
1324 |
config_R99_R4.iProtocolConfigOption.iChallenge;
|
|
1325 |
config_R5.iProtocolConfigOption.iResponse =
|
|
1326 |
config_R99_R4.iProtocolConfigOption.iResponse;
|
|
1327 |
config_R5.iProtocolConfigOption.iId =
|
|
1328 |
config_R99_R4.iProtocolConfigOption.iId;
|
|
1329 |
config_R5.iProtocolConfigOption.iDnsAddresses =
|
|
1330 |
config_R99_R4.iProtocolConfigOption.iDnsAddresses;
|
|
1331 |
config_R5.iProtocolConfigOption.iMiscBuffer =
|
|
1332 |
config_R99_R4.iProtocolConfigOption.iMiscBuffer;
|
|
1333 |
config_R5.iNWIContext = config_R99_R4.iNWIContext;
|
|
1334 |
config_R5.iPFI = config_R99_R4.iPFI;
|
|
1335 |
}
|
|
1336 |
else if ( configBase.ExtensionId() == TPacketDataConfigBase::KConfigRel5 )
|
|
1337 |
{
|
|
1338 |
//Just unpack to config_R5
|
|
1339 |
aDataPackage->UnPackData( config_R5 );
|
|
1340 |
}
|
|
1341 |
else
|
|
1342 |
{
|
|
1343 |
//Unknown parameter class.
|
|
1344 |
config_R5Filled = EFalse;
|
|
1345 |
}
|
|
1346 |
|
|
1347 |
//Copy data to clients and complete client requests
|
|
1348 |
|
|
1349 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1350 |
EMultimodePacketServiceNotifyContextActivationRequested );
|
|
1351 |
if ( config_R5Filled &&
|
|
1352 |
EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1353 |
{
|
|
1354 |
// Deliver R97/98 parameters to the ETel Packet API client
|
|
1355 |
iNotifyDataPointers.iContextActivationRequested->iPdpType =
|
|
1356 |
config_R5.iPdpType;
|
|
1357 |
iNotifyDataPointers.iContextActivationRequested->iAccessPointName =
|
|
1358 |
config_R5.iAccessPointName;
|
|
1359 |
iNotifyDataPointers.iContextActivationRequested->iPdpAddress =
|
|
1360 |
config_R5.iPdpAddress;
|
|
1361 |
iNotifyDataPointers.iContextActivationRequested->iPdpCompression =
|
|
1362 |
iPdpCompression;
|
|
1363 |
iNotifyDataPointers.iContextActivationRequested->iAnonymousAccessReqd =
|
|
1364 |
iAnonymousAccessReqd;
|
|
1365 |
iNotifyDataPointers.iContextActivationRequested->iUseEdge =
|
|
1366 |
config_R5.iUseEdge;
|
|
1367 |
iNotifyDataPointers.iContextActivationRequested->iProtocolConfigOption.iAuthInfo =
|
|
1368 |
config_R5.iProtocolConfigOption.iAuthInfo;
|
|
1369 |
iNotifyDataPointers.iContextActivationRequested->iProtocolConfigOption.iChallenge =
|
|
1370 |
config_R5.iProtocolConfigOption.iChallenge;
|
|
1371 |
iNotifyDataPointers.iContextActivationRequested->iProtocolConfigOption.iResponse =
|
|
1372 |
config_R5.iProtocolConfigOption.iResponse;
|
|
1373 |
iNotifyDataPointers.iContextActivationRequested->iProtocolConfigOption.iId =
|
|
1374 |
config_R5.iProtocolConfigOption.iId;
|
|
1375 |
iNotifyDataPointers.iContextActivationRequested->iProtocolConfigOption.iDnsAddresses =
|
|
1376 |
config_R5.iProtocolConfigOption.iDnsAddresses;
|
|
1377 |
iNotifyDataPointers.iContextActivationRequested->iProtocolConfigOption.iMiscBuffer =
|
|
1378 |
config_R5.iProtocolConfigOption.iMiscBuffer;
|
|
1379 |
iNotifyDataPointers.iContextActivationRequested->iNWIContext =
|
|
1380 |
config_R5.iNWIContext;
|
|
1381 |
iNotifyDataPointers.iContextActivationRequested = NULL;
|
|
1382 |
|
|
1383 |
// Complete request with KErrNone
|
|
1384 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1385 |
}
|
|
1386 |
|
|
1387 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1388 |
EMultimodePacketServiceNotifyContextActivationRequested99 );
|
|
1389 |
if ( config_R5Filled &&
|
|
1390 |
EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1391 |
{
|
|
1392 |
// Deliver R99_R4 parameters to the ETel Packet API client
|
|
1393 |
iNotifyDataPointers.iContextActivationRequested99->iPdpType =
|
|
1394 |
config_R5.iPdpType;
|
|
1395 |
iNotifyDataPointers.iContextActivationRequested99->iAccessPointName =
|
|
1396 |
config_R5.iAccessPointName;
|
|
1397 |
iNotifyDataPointers.iContextActivationRequested99->iPdpAddress =
|
|
1398 |
config_R5.iPdpAddress;
|
|
1399 |
iNotifyDataPointers.iContextActivationRequested99->iUseEdge =
|
|
1400 |
config_R5.iUseEdge;
|
|
1401 |
iNotifyDataPointers.iContextActivationRequested99->iProtocolConfigOption.iAuthInfo =
|
|
1402 |
config_R5.iProtocolConfigOption.iAuthInfo;
|
|
1403 |
iNotifyDataPointers.iContextActivationRequested99->iProtocolConfigOption.iChallenge =
|
|
1404 |
config_R5.iProtocolConfigOption.iChallenge;
|
|
1405 |
iNotifyDataPointers.iContextActivationRequested99->iProtocolConfigOption.iResponse =
|
|
1406 |
config_R5.iProtocolConfigOption.iResponse;
|
|
1407 |
iNotifyDataPointers.iContextActivationRequested99->iProtocolConfigOption.iId =
|
|
1408 |
config_R5.iProtocolConfigOption.iId;
|
|
1409 |
iNotifyDataPointers.iContextActivationRequested99->iProtocolConfigOption.iDnsAddresses =
|
|
1410 |
config_R5.iProtocolConfigOption.iDnsAddresses;
|
|
1411 |
iNotifyDataPointers.iContextActivationRequested99->iProtocolConfigOption.iMiscBuffer =
|
|
1412 |
config_R5.iProtocolConfigOption.iMiscBuffer;
|
|
1413 |
iNotifyDataPointers.iContextActivationRequested99->iNWIContext =
|
|
1414 |
config_R5.iNWIContext;
|
|
1415 |
iNotifyDataPointers.iContextActivationRequested99->iPFI =
|
|
1416 |
config_R5.iPFI;
|
|
1417 |
iNotifyDataPointers.iContextActivationRequested99 = NULL;
|
|
1418 |
|
|
1419 |
// Complete request with KErrNone
|
|
1420 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1421 |
}
|
|
1422 |
|
|
1423 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1424 |
EMultimodePacketServiceNotifyContextActivationRequested5 );
|
|
1425 |
if ( config_R5Filled &&
|
|
1426 |
EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1427 |
{
|
|
1428 |
// Deliver R5 parameters to the ETel Packet API client
|
|
1429 |
iNotifyDataPointers.iContextActivationRequested5->iPdpType =
|
|
1430 |
config_R5.iPdpType;
|
|
1431 |
iNotifyDataPointers.iContextActivationRequested5->iAccessPointName =
|
|
1432 |
config_R5.iAccessPointName;
|
|
1433 |
iNotifyDataPointers.iContextActivationRequested5->iPdpAddress =
|
|
1434 |
config_R5.iPdpAddress;
|
|
1435 |
iNotifyDataPointers.iContextActivationRequested5->iUseEdge =
|
|
1436 |
config_R5.iUseEdge;
|
|
1437 |
iNotifyDataPointers.iContextActivationRequested5->iProtocolConfigOption.iAuthInfo =
|
|
1438 |
config_R5.iProtocolConfigOption.iAuthInfo;
|
|
1439 |
iNotifyDataPointers.iContextActivationRequested5->iProtocolConfigOption.iChallenge =
|
|
1440 |
config_R5.iProtocolConfigOption.iChallenge;
|
|
1441 |
iNotifyDataPointers.iContextActivationRequested5->iProtocolConfigOption.iResponse =
|
|
1442 |
config_R5.iProtocolConfigOption.iResponse;
|
|
1443 |
iNotifyDataPointers.iContextActivationRequested5->iProtocolConfigOption.iId =
|
|
1444 |
config_R5.iProtocolConfigOption.iId;
|
|
1445 |
iNotifyDataPointers.iContextActivationRequested5->iProtocolConfigOption.iDnsAddresses =
|
|
1446 |
config_R5.iProtocolConfigOption.iDnsAddresses;
|
|
1447 |
iNotifyDataPointers.iContextActivationRequested5->iProtocolConfigOption.iMiscBuffer =
|
|
1448 |
config_R5.iProtocolConfigOption.iMiscBuffer;
|
|
1449 |
iNotifyDataPointers.iContextActivationRequested5->iNWIContext =
|
|
1450 |
config_R5.iNWIContext;
|
|
1451 |
iNotifyDataPointers.iContextActivationRequested5->iPFI =
|
|
1452 |
config_R5.iPFI;
|
|
1453 |
iNotifyDataPointers.iContextActivationRequested5->iPdpHeaderCompression =
|
|
1454 |
config_R5.iPdpHeaderCompression;
|
|
1455 |
iNotifyDataPointers.iContextActivationRequested5->iPdpDataCompression =
|
|
1456 |
config_R5.iPdpDataCompression;
|
|
1457 |
iNotifyDataPointers.iContextActivationRequested5 = NULL;
|
|
1458 |
|
|
1459 |
// Complete request with KErrNone
|
|
1460 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1461 |
}
|
|
1462 |
}
|
|
1463 |
}
|
|
1464 |
|
|
1465 |
//----------------------------------------------------------------------------
|
|
1466 |
// CMmPacketServiceTsy::NotifyContextAdded
|
|
1467 |
// Requests notification of context has been added.
|
|
1468 |
// Allows a client to be notified whenever a new context has been created. It
|
|
1469 |
// should be noted that once the notification completes, the client must then
|
|
1470 |
// re-post the notification if they wish to continue receiving further
|
|
1471 |
// notifications.
|
|
1472 |
//----------------------------------------------------------------------------
|
|
1473 |
//
|
|
1474 |
TInt CMmPacketServiceTsy::NotifyContextAdded(
|
|
1475 |
const TDataPackage& aPackage )
|
|
1476 |
{
|
|
1477 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NotifyContextAdded." );
|
|
1478 |
|
|
1479 |
TDes* const context = aPackage.Des1u();
|
|
1480 |
|
|
1481 |
// Save request handle type and context Name
|
|
1482 |
iReqHandleType = EMultimodePacketServiceNotifyContextAdded;
|
|
1483 |
iNotifyDataPointers.iContextAdded = context;
|
|
1484 |
|
|
1485 |
return KErrNone;
|
|
1486 |
}
|
|
1487 |
|
|
1488 |
//----------------------------------------------------------------------------
|
|
1489 |
// CMmPacketServiceTsy::CompleteNotifyContextAdded
|
|
1490 |
// Completes the context added notification to client.
|
|
1491 |
//----------------------------------------------------------------------------
|
|
1492 |
//
|
|
1493 |
void CMmPacketServiceTsy::CompleteNotifyContextAdded(
|
|
1494 |
CMmDataPackage* aPackage )
|
|
1495 |
{
|
|
1496 |
TInfoName tempHostCID;
|
|
1497 |
tempHostCID.Zero();
|
|
1498 |
|
|
1499 |
//Variables needed for unpacking data
|
|
1500 |
|
|
1501 |
TInfoName contextName;
|
|
1502 |
contextName.Zero();
|
|
1503 |
TInt result ( 0 );
|
|
1504 |
|
|
1505 |
TInt trapError( KErrNone );
|
|
1506 |
TInt ret( KErrNone );
|
|
1507 |
|
|
1508 |
aPackage->UnPackData( contextName, result );
|
|
1509 |
|
|
1510 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyContextAdded." );
|
|
1511 |
|
|
1512 |
if ( KErrNone != result )
|
|
1513 |
{
|
|
1514 |
//if one Dial-up context is created
|
|
1515 |
if ( iDialUpContext )
|
|
1516 |
{
|
|
1517 |
// External context, service has no control to the context.
|
|
1518 |
// Context name forced to External2.
|
|
1519 |
contextName.Copy( KStringExternal2 );
|
|
1520 |
|
|
1521 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyContextAdded :Create Secondary Dial-up Object." );
|
|
1522 |
|
|
1523 |
// Create object for externally created dial-up context
|
|
1524 |
TRAP( trapError, iSecondaryDialUpContext = CMmPacketContextTsy::NewL(
|
|
1525 |
this, tempHostCID, contextName ); );
|
|
1526 |
}
|
|
1527 |
|
|
1528 |
else
|
|
1529 |
{
|
|
1530 |
// External context, service has no control to the context.
|
|
1531 |
// Context name forced to External.
|
|
1532 |
contextName.Copy( KStringExternal );
|
|
1533 |
|
|
1534 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyContextAdded :Create Dial-up Object." );
|
|
1535 |
|
|
1536 |
// Create object for externally created dial-up context
|
|
1537 |
TRAP( trapError, iDialUpContext = CMmPacketContextTsy::NewL(
|
|
1538 |
this, tempHostCID, contextName ); );
|
|
1539 |
}
|
|
1540 |
|
|
1541 |
if ( KErrNone == trapError )
|
|
1542 |
{
|
|
1543 |
if ( contextName.Compare( KStringExternal2 ) == 0 )
|
|
1544 |
{
|
|
1545 |
ret = iPacketContextList->AddObject(
|
|
1546 |
iSecondaryDialUpContext, 0x00, 0x00,
|
|
1547 |
contextName );
|
|
1548 |
}
|
|
1549 |
else if ( contextName.Compare( KStringExternal ) == 0 )
|
|
1550 |
{
|
|
1551 |
ret = iPacketContextList->AddObject( iDialUpContext,
|
|
1552 |
0x00, 0x00, contextName );
|
|
1553 |
}
|
|
1554 |
|
|
1555 |
if( KErrNone != ret )
|
|
1556 |
{
|
|
1557 |
|
|
1558 |
if ( contextName.Compare( KStringExternal2 ) == 0 )
|
|
1559 |
{
|
|
1560 |
iSecondaryDialUpContext->Close();
|
|
1561 |
}
|
|
1562 |
else if ( contextName.Compare( KStringExternal ) == 0 )
|
|
1563 |
{
|
|
1564 |
iDialUpContext->Close();
|
|
1565 |
}
|
|
1566 |
}
|
|
1567 |
|
|
1568 |
if ( KErrNone != ret || KErrNone != trapError )
|
|
1569 |
{
|
|
1570 |
if ( contextName.Compare( KStringExternal2 ) == 0 )
|
|
1571 |
{
|
|
1572 |
iSecondaryDialUpContext = NULL;
|
|
1573 |
}
|
|
1574 |
else if ( contextName.Compare( KStringExternal ) == 0 )
|
|
1575 |
{
|
|
1576 |
iDialUpContext = NULL;
|
|
1577 |
}
|
|
1578 |
}
|
|
1579 |
}
|
|
1580 |
|
|
1581 |
//Check if dial-up context is created, and set default params
|
|
1582 |
if ( contextName.Compare( KStringExternal2 ) == 0 )
|
|
1583 |
{
|
|
1584 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyContextAdded :Reset Secondary Dial-up Object." );
|
|
1585 |
// Reset secondary dial-up context
|
|
1586 |
if(iSecondaryDialUpContext)
|
|
1587 |
{
|
|
1588 |
iSecondaryDialUpContext->ResetDialUpContext();
|
|
1589 |
}
|
|
1590 |
|
|
1591 |
}
|
|
1592 |
else if ( contextName.Compare( KStringExternal ) == 0 )
|
|
1593 |
{
|
|
1594 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyContextAdded :Reset Dial-up Object." );
|
|
1595 |
// Reset dial-up context
|
|
1596 |
if(iDialUpContext)
|
|
1597 |
{
|
|
1598 |
iDialUpContext->ResetDialUpContext();
|
|
1599 |
}
|
|
1600 |
}
|
|
1601 |
}
|
|
1602 |
|
|
1603 |
// Reset request handle. Returns the deleted request handle
|
|
1604 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1605 |
EMultimodePacketServiceNotifyContextAdded ) );
|
|
1606 |
|
|
1607 |
// Check that request handle is valid
|
|
1608 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1609 |
{
|
|
1610 |
// Add context name to the etel side memory
|
|
1611 |
*iNotifyDataPointers.iContextAdded = contextName;
|
|
1612 |
iNotifyDataPointers.iContextAdded = NULL;
|
|
1613 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteNotifyContextAdded. Context Name: %S", &contextName );
|
|
1614 |
|
|
1615 |
// Complete request with KErrNone
|
|
1616 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1617 |
}
|
|
1618 |
}
|
|
1619 |
|
|
1620 |
//----------------------------------------------------------------------------
|
|
1621 |
// CMmPacketServiceTsy::NotifyDynamicCapsChange
|
|
1622 |
// Requests notification of dynamic capabilities change.
|
|
1623 |
// This function will complete when the dynamic packet data capabilities
|
|
1624 |
// change; that is, either some action has become possible and/or some action
|
|
1625 |
// is no longer possible. A common usage of the dynamic capabilities functions
|
|
1626 |
// would be for GetDynamicCaps() to be called first to retrieve the current
|
|
1627 |
// set of capabilities, and then the NotifyDynamicCapsChange() request to be
|
|
1628 |
// posted to be kept informed of any changes.
|
|
1629 |
//----------------------------------------------------------------------------
|
|
1630 |
//
|
|
1631 |
TInt CMmPacketServiceTsy::NotifyDynamicCapsChange(
|
|
1632 |
RPacketService::TDynamicCapsFlags* const aCaps )
|
|
1633 |
{
|
|
1634 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NotifyDynamicCapsChange." );
|
|
1635 |
|
|
1636 |
// Save pointer to aCaps
|
|
1637 |
iNotifyDataPointers.iDynamicCapsChange = aCaps;
|
|
1638 |
|
|
1639 |
// Set request handle type
|
|
1640 |
iReqHandleType = EMultimodePacketServiceNotifyDynamicCapsChange;
|
|
1641 |
|
|
1642 |
return KErrNone;
|
|
1643 |
}
|
|
1644 |
|
|
1645 |
//----------------------------------------------------------------------------
|
|
1646 |
// CMmPacketServiceTsy::CompleteNotifyDynamicCapsChange
|
|
1647 |
// Completes dynamic capabilities notification to client.
|
|
1648 |
//----------------------------------------------------------------------------
|
|
1649 |
//
|
|
1650 |
void CMmPacketServiceTsy::CompleteNotifyDynamicCapsChange(
|
|
1651 |
const RPacketService::TDynamicCapsFlags aCaps )
|
|
1652 |
{
|
|
1653 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyDynamicCapsChange." );
|
|
1654 |
|
|
1655 |
// Reset request handle. Returns the deleted request handle
|
|
1656 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1657 |
EMultimodePacketServiceNotifyDynamicCapsChange ) );
|
|
1658 |
|
|
1659 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1660 |
{
|
|
1661 |
*iNotifyDataPointers.iDynamicCapsChange = aCaps;
|
|
1662 |
iNotifyDataPointers.iDynamicCapsChange = NULL;
|
|
1663 |
|
|
1664 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1665 |
}
|
|
1666 |
}
|
|
1667 |
|
|
1668 |
//----------------------------------------------------------------------------
|
|
1669 |
// CMmPacketServiceTsy::NotifyMSClassChange
|
|
1670 |
// Requests notification of mobile station class change.
|
|
1671 |
// This function will complete when there is a change in the current GPRS
|
|
1672 |
// class of the mobile station. The new class is passed back in the aNewClass
|
|
1673 |
// parameter.
|
|
1674 |
//----------------------------------------------------------------------------
|
|
1675 |
//
|
|
1676 |
TInt CMmPacketServiceTsy::NotifyMSClassChange(
|
|
1677 |
RPacketService::TMSClass* const aNewClass )
|
|
1678 |
{
|
|
1679 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NotifyMSClassChange." );
|
|
1680 |
|
|
1681 |
// Save aNewClass internally
|
|
1682 |
iNotifyDataPointers.iMSClassChange = aNewClass;
|
|
1683 |
|
|
1684 |
iReqHandleType = EMultimodePacketServiceNotifyMSClassChange;
|
|
1685 |
|
|
1686 |
return KErrNone;
|
|
1687 |
}
|
|
1688 |
|
|
1689 |
//----------------------------------------------------------------------------
|
|
1690 |
// CMmPacketServiceTsy::CompleteNotifyMSClassChange
|
|
1691 |
// Completes mobile station class notification to client.
|
|
1692 |
//----------------------------------------------------------------------------
|
|
1693 |
//
|
|
1694 |
void CMmPacketServiceTsy::CompleteNotifyMSClassChange(
|
|
1695 |
CMmDataPackage* aDataPackage )
|
|
1696 |
{
|
|
1697 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyMSClassChange." );
|
|
1698 |
|
|
1699 |
RPacketService::TMSClass newClass;
|
|
1700 |
aDataPackage->UnPackData( newClass );
|
|
1701 |
|
|
1702 |
if ( newClass != iInternalSavedData.iMsClass )
|
|
1703 |
{
|
|
1704 |
// Save new ms class internally
|
|
1705 |
iInternalSavedData.iMsClass = newClass;
|
|
1706 |
|
|
1707 |
// Reset request handle. Returns the deleted request handle
|
|
1708 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1709 |
EMultimodePacketServiceNotifyMSClassChange ) );
|
|
1710 |
|
|
1711 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1712 |
{
|
|
1713 |
// Save changed MS Class to ETel side memory
|
|
1714 |
*iNotifyDataPointers.iMSClassChange = newClass;
|
|
1715 |
iNotifyDataPointers.iMSClassChange = NULL;
|
|
1716 |
|
|
1717 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteNotifyMSClassChange. New Ms Class: %d", newClass );
|
|
1718 |
// Complete request with KErrNone
|
|
1719 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1720 |
}
|
|
1721 |
}
|
|
1722 |
}
|
|
1723 |
|
|
1724 |
//----------------------------------------------------------------------------
|
|
1725 |
// CMmPacketServiceTsy::NotifyStatusChange
|
|
1726 |
// informs client that service status change.
|
|
1727 |
// Allows a client to be notified of a change in the status
|
|
1728 |
// of the connection to the packet service. The new status is
|
|
1729 |
// passed back to the client via aPacketStatus parameter.
|
|
1730 |
//----------------------------------------------------------------------------
|
|
1731 |
//
|
|
1732 |
TInt CMmPacketServiceTsy::NotifyStatusChange(
|
|
1733 |
RPacketService::TStatus* const aPacketStatus )
|
|
1734 |
{
|
|
1735 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NotifyStatusChange." );
|
|
1736 |
|
|
1737 |
// Save aPacketStatus to internal memory
|
|
1738 |
iNotifyDataPointers.iStatusChange = aPacketStatus;
|
|
1739 |
|
|
1740 |
// Set request handle type
|
|
1741 |
iReqHandleType = EMultimodePacketServiceNotifyStatusChange;
|
|
1742 |
|
|
1743 |
return KErrNone;
|
|
1744 |
}
|
|
1745 |
|
|
1746 |
//----------------------------------------------------------------------------
|
|
1747 |
// CMmPacketServiceTsy::CompleteNotifyStatusChange
|
|
1748 |
// Completes service status notification to client.
|
|
1749 |
//----------------------------------------------------------------------------
|
|
1750 |
//
|
|
1751 |
void CMmPacketServiceTsy::CompleteNotifyStatusChange(
|
|
1752 |
const RPacketService::TStatus& aPacketStatus,
|
|
1753 |
TInt aErrorCode )
|
|
1754 |
{
|
|
1755 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyStatusChange." );
|
|
1756 |
if ( aPacketStatus != iInternalSavedData.iServiceStatus )
|
|
1757 |
{
|
|
1758 |
iInternalSavedData.iServiceStatus = aPacketStatus;
|
|
1759 |
|
|
1760 |
// Reset req handle. Returns the deleted req handle
|
|
1761 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1762 |
EMultimodePacketServiceNotifyStatusChange ) );
|
|
1763 |
|
|
1764 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1765 |
{
|
|
1766 |
*iNotifyDataPointers.iStatusChange = aPacketStatus;
|
|
1767 |
iNotifyDataPointers.iStatusChange = NULL;
|
|
1768 |
|
|
1769 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteNotifyStatusChange. Service Status:%d", aPacketStatus );
|
|
1770 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aErrorCode );
|
|
1771 |
}
|
|
1772 |
}
|
|
1773 |
}
|
|
1774 |
|
|
1775 |
//----------------------------------------------------------------------------
|
|
1776 |
// CMmPacketServiceTsy::RejectActivationRequest
|
|
1777 |
// Reject activation request from the network.
|
|
1778 |
// This function will cause the phone to reject the network's request for a
|
|
1779 |
// PDP context activation. Note, there is no corresponding "accept" message
|
|
1780 |
// for the phone to send. To accept, the phone should simply begin to activate
|
|
1781 |
// a PDP context with the appropriate IP address before the network's timer
|
|
1782 |
// expires. On GPRS, this timer is between 5 and 8 seconds, but may
|
|
1783 |
// effectively be between around 25 and 40 seconds as the specifications state
|
|
1784 |
// that the activation request should be re-sent up to five times.
|
|
1785 |
//----------------------------------------------------------------------------
|
|
1786 |
//
|
|
1787 |
TInt CMmPacketServiceTsy::RejectActivationRequestL()
|
|
1788 |
{
|
|
1789 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::RejectActivationRequestL." );
|
|
1790 |
|
|
1791 |
const TTsyReqHandle tsyRegHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
1792 |
EMultimodePacketServiceRejectActivationRequest ) );
|
|
1793 |
|
|
1794 |
TInt ret( KErrServerBusy );
|
|
1795 |
|
|
1796 |
if ( EMultimodePacketServiceReqHandleUnknown == tsyRegHandle )
|
|
1797 |
{
|
|
1798 |
// Reject network activation
|
|
1799 |
ret = iMessageManager->HandleRequestL(
|
|
1800 |
EPacketRejectActivationRequest );
|
|
1801 |
|
|
1802 |
if ( KErrNone == ret )
|
|
1803 |
{
|
|
1804 |
// Set request handle
|
|
1805 |
iReqHandleType = EMultimodePacketServiceRejectActivationRequest;
|
|
1806 |
}
|
|
1807 |
}
|
|
1808 |
|
|
1809 |
return ret;
|
|
1810 |
}
|
|
1811 |
|
|
1812 |
//----------------------------------------------------------------------------
|
|
1813 |
// CMmPacketServiceTsy::CompleteRejectActivationRequest
|
|
1814 |
// Completes asynchronous reject activation request.
|
|
1815 |
//----------------------------------------------------------------------------
|
|
1816 |
//
|
|
1817 |
void CMmPacketServiceTsy::CompleteRejectActivationRequest()
|
|
1818 |
{
|
|
1819 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteRejectActivationRequest." );
|
|
1820 |
|
|
1821 |
// Reset request handle. Returns the deleted request handle
|
|
1822 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1823 |
EMultimodePacketServiceRejectActivationRequest ) );
|
|
1824 |
|
|
1825 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1826 |
{
|
|
1827 |
// Complete the client request
|
|
1828 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1829 |
}
|
|
1830 |
}
|
|
1831 |
|
|
1832 |
//----------------------------------------------------------------------------
|
|
1833 |
// CMmPacketServiceTsy::SetAttachMode
|
|
1834 |
// Sets attach mode given in parameter to the server.
|
|
1835 |
//----------------------------------------------------------------------------
|
|
1836 |
//
|
|
1837 |
TInt CMmPacketServiceTsy::SetAttachModeL(
|
|
1838 |
const RPacketService::TAttachMode* aMode )
|
|
1839 |
{
|
|
1840 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::SetAttachModeL." );
|
|
1841 |
|
|
1842 |
iAttachMode = *aMode;
|
|
1843 |
|
|
1844 |
TInt ret( KErrServerBusy );
|
|
1845 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
1846 |
EMultimodePacketServiceSetAttachMode ) );
|
|
1847 |
|
|
1848 |
if ( EMultimodePacketServiceReqHandleUnknown == reqHandle )
|
|
1849 |
{
|
|
1850 |
//Set attach mode
|
|
1851 |
ret = iMmPacketServiceGsmWcdmaExt->SetAttachModeL( *aMode );
|
|
1852 |
|
|
1853 |
if ( KErrNone == ret )
|
|
1854 |
{
|
|
1855 |
// Set req handle
|
|
1856 |
iReqHandleType = EMultimodePacketServiceSetAttachMode;
|
|
1857 |
}
|
|
1858 |
}
|
|
1859 |
|
|
1860 |
return ret;
|
|
1861 |
}
|
|
1862 |
|
|
1863 |
//----------------------------------------------------------------------------
|
|
1864 |
// CMmPacketServiceTsy::CompleteSetAttachMode
|
|
1865 |
// Completes the Set Attach Mode request.
|
|
1866 |
//----------------------------------------------------------------------------
|
|
1867 |
//
|
|
1868 |
void CMmPacketServiceTsy::CompleteSetAttachMode(
|
|
1869 |
const TInt aError ) //error value
|
|
1870 |
{
|
|
1871 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteSetAttachMode. Error Value: %d", aError );
|
|
1872 |
|
|
1873 |
// Reset request handle. Returns the deleted request handle
|
|
1874 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1875 |
EMultimodePacketServiceSetAttachMode ) );
|
|
1876 |
|
|
1877 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1878 |
{
|
|
1879 |
// Complete the client request
|
|
1880 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aError );
|
|
1881 |
}
|
|
1882 |
}
|
|
1883 |
|
|
1884 |
//----------------------------------------------------------------------------
|
|
1885 |
// CMmPacketServiceTsy::SetPreferredBearer
|
|
1886 |
// Sets preferred bearer given in parameter to the GPDS server.
|
|
1887 |
// This function will set the preferred bearer for the MT to default to when
|
|
1888 |
// dropping from Class B operation to Class C, for instance when the MT moves
|
|
1889 |
// into a Routing Area of cells or new GPRS network which operates in Network
|
|
1890 |
// Mode III. Class C operation requires that the MT is attached to either GSM
|
|
1891 |
// or GPRS, not both.
|
|
1892 |
//----------------------------------------------------------------------------
|
|
1893 |
//
|
|
1894 |
TInt CMmPacketServiceTsy::SetPreferredBearerL(
|
|
1895 |
const TDataPackage& aPackage )
|
|
1896 |
{
|
|
1897 |
TAny* const dataPtr = aPackage.Ptr1();
|
|
1898 |
|
|
1899 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::SetPreferredBearerL. Preferred Bearer: %d", &dataPtr );
|
|
1900 |
|
|
1901 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
1902 |
EMultimodePacketServiceSetPreferredBearer ) );
|
|
1903 |
|
|
1904 |
TInt ret( KErrServerBusy );
|
|
1905 |
|
|
1906 |
if ( EMultimodePacketServiceReqHandleUnknown == reqHandle )
|
|
1907 |
{
|
|
1908 |
RPacketService::TPreferredBearer* abearer = REINTERPRET_CAST(
|
|
1909 |
RPacketService::TPreferredBearer*, dataPtr );
|
|
1910 |
|
|
1911 |
// Set preferred beareraPackage
|
|
1912 |
ret = iMmPacketServiceGsmWcdmaExt->SetPreferredBearerL( aPackage );
|
|
1913 |
|
|
1914 |
if ( KErrNone == ret )
|
|
1915 |
{
|
|
1916 |
iTemporarySavedData.iPreferredBearer = *abearer;
|
|
1917 |
|
|
1918 |
// Set request handle type
|
|
1919 |
iReqHandleType = EMultimodePacketServiceSetPreferredBearer;
|
|
1920 |
}
|
|
1921 |
}
|
|
1922 |
|
|
1923 |
return ret;
|
|
1924 |
}
|
|
1925 |
|
|
1926 |
//----------------------------------------------------------------------------
|
|
1927 |
// CMmPacketServiceTsy::CompleteSetPreferredBearer
|
|
1928 |
// Completes the Set Preferred Bearer request.
|
|
1929 |
//----------------------------------------------------------------------------
|
|
1930 |
//
|
|
1931 |
void CMmPacketServiceTsy::CompleteSetPreferredBearer(
|
|
1932 |
const TInt aError ) //epoc error code
|
|
1933 |
{
|
|
1934 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteSetPreferredBearer. Error: %d", aError );
|
|
1935 |
|
|
1936 |
// Reset request handle. Returns the deleted request handle
|
|
1937 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1938 |
EMultimodePacketServiceSetPreferredBearer ) );
|
|
1939 |
|
|
1940 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
1941 |
{
|
|
1942 |
if ( KErrNone == aError )
|
|
1943 |
{
|
|
1944 |
iInternalSavedData.iPreferredBearer =
|
|
1945 |
iTemporarySavedData.iPreferredBearer;
|
|
1946 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteSetPreferredBearer. Preferred Bearer: %d", iInternalSavedData.iPreferredBearer );
|
|
1947 |
}
|
|
1948 |
|
|
1949 |
// Complete the client request
|
|
1950 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aError );
|
|
1951 |
}
|
|
1952 |
}
|
|
1953 |
|
|
1954 |
//----------------------------------------------------------------------------
|
|
1955 |
// CMmPacketServiceTsy::ExtFunc
|
|
1956 |
// ExtFunc is called by the ETel when it has request for the TSY.
|
|
1957 |
// For TSY to process request a request handle, request type and request data
|
|
1958 |
// are passed to the TSY.
|
|
1959 |
//----------------------------------------------------------------------------
|
|
1960 |
//
|
|
1961 |
TInt CMmPacketServiceTsy::ExtFunc(
|
|
1962 |
const TTsyReqHandle aTsyReqHandle,
|
|
1963 |
const TInt aIpc,
|
|
1964 |
const TDataPackage& aPackage )
|
|
1965 |
{
|
|
1966 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::ExtFunc. IPC: %d", aIpc );
|
|
1967 |
|
|
1968 |
TInt ret( KErrNone );
|
|
1969 |
TInt trapError( KErrNone );
|
|
1970 |
|
|
1971 |
// Ensure the ReqHandleType is unset.
|
|
1972 |
// This will detect cases where this method indirectly calls itself
|
|
1973 |
// (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
|
|
1974 |
// Such cases are not supported because iReqHandleType is in the context of this class instance,
|
|
1975 |
// not this request, and we don't want the values set by the inner request and the outer request
|
|
1976 |
// interfering with each other.
|
|
1977 |
__ASSERT_DEBUG(iReqHandleType==EMultimodePacketServiceReqHandleUnknown, User::Invariant());
|
|
1978 |
|
|
1979 |
// Set tsy request handle
|
|
1980 |
iTsyReqHandle = aTsyReqHandle;
|
|
1981 |
|
|
1982 |
// Call DoExtFuncL()
|
|
1983 |
TRAP( trapError, ret = DoExtFuncL( aIpc, aPackage ); );
|
|
1984 |
|
|
1985 |
if ( KErrNone != trapError )
|
|
1986 |
{
|
|
1987 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, trapError );
|
|
1988 |
}
|
|
1989 |
else if ( KErrNone != ret )
|
|
1990 |
{
|
|
1991 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, ret );
|
|
1992 |
}
|
|
1993 |
|
|
1994 |
if ( EMultimodePacketServiceReqHandleUnknown != iReqHandleType )
|
|
1995 |
{
|
|
1996 |
// Save request handle type
|
|
1997 |
|
|
1998 |
#ifdef REQHANDLE_TIMER
|
|
1999 |
SetTypeOfResponse( iReqHandleType );
|
|
2000 |
#else
|
|
2001 |
iTsyReqHandleStore->SetTsyReqHandle( iReqHandleType, iTsyReqHandle );
|
|
2002 |
#endif // REQHANDLE_TIMER
|
|
2003 |
// We've finished with this value now. Clear it so it doesn't leak
|
|
2004 |
// up to any other instances of this method down the call stack
|
|
2005 |
iReqHandleType = EMultimodePacketServiceReqHandleUnknown;
|
|
2006 |
}
|
|
2007 |
|
|
2008 |
return KErrNone;
|
|
2009 |
}
|
|
2010 |
|
|
2011 |
//----------------------------------------------------------------------------
|
|
2012 |
// CMmPacketServiceTsy::DoExtFuncL
|
|
2013 |
// Calls correct method to handle ETel server request.
|
|
2014 |
// unpack packaged parameters
|
|
2015 |
// call correct method implemention using the IPC number and return the
|
|
2016 |
// return value back to the caller.
|
|
2017 |
// in case IPC number is not understood by switch, KErrNotSupported will
|
|
2018 |
// be returned.
|
|
2019 |
//----------------------------------------------------------------------------
|
|
2020 |
//
|
|
2021 |
TInt CMmPacketServiceTsy::DoExtFuncL(
|
|
2022 |
const TInt aIpc,
|
|
2023 |
const TDataPackage& aPackage )
|
|
2024 |
{
|
|
2025 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::DoExtFuncL. IPC: %d TSY Req Handle:%d", aIpc, iTsyReqHandle);
|
|
2026 |
|
|
2027 |
TInt ret( KErrNotSupported );
|
|
2028 |
|
|
2029 |
TAny* const dataPtr = aPackage.Ptr1();
|
|
2030 |
TAny* const dataPtr2 = aPackage.Ptr2();
|
|
2031 |
|
|
2032 |
switch ( aIpc )
|
|
2033 |
{
|
|
2034 |
case EPacketNotifyContextAdded:
|
|
2035 |
ret = NotifyContextAdded( aPackage );
|
|
2036 |
break;
|
|
2037 |
case EPacketAttach:
|
|
2038 |
ret = AttachL();
|
|
2039 |
break;
|
|
2040 |
case EPacketDetach:
|
|
2041 |
ret = DetachL();
|
|
2042 |
break;
|
|
2043 |
case EPacketGetStatus:
|
|
2044 |
ret = GetStatus(
|
|
2045 |
REINTERPRET_CAST( RPacketService::TStatus*, dataPtr ) );
|
|
2046 |
break;
|
|
2047 |
case EPacketNotifyStatusChange:
|
|
2048 |
ret = NotifyStatusChange(
|
|
2049 |
REINTERPRET_CAST( RPacketService::TStatus*, dataPtr ) );
|
|
2050 |
break;
|
|
2051 |
case EPacketNotifyContextActivationRequested:
|
|
2052 |
ret = NotifyContextActivationRequested(
|
|
2053 |
REINTERPRET_CAST( TPacketDataConfigBase*, dataPtr ) );
|
|
2054 |
break;
|
|
2055 |
case EPacketRejectActivationRequest:
|
|
2056 |
ret = RejectActivationRequestL();
|
|
2057 |
break;
|
|
2058 |
case EPacketEnumerateContexts:
|
|
2059 |
ret = EnumerateContexts(
|
|
2060 |
REINTERPRET_CAST( TInt*, dataPtr ),
|
|
2061 |
REINTERPRET_CAST( TInt*, dataPtr2 ) );
|
|
2062 |
break;
|
|
2063 |
case EPacketGetContextInfo:
|
|
2064 |
ret = GetContextInfo(
|
|
2065 |
REINTERPRET_CAST( TInt*, dataPtr ),
|
|
2066 |
REINTERPRET_CAST( RPacketService::TContextInfo*, dataPtr2 ) );
|
|
2067 |
break;
|
|
2068 |
case EPacketGetNtwkRegStatus:
|
|
2069 |
ret = GetNtwkRegStatusL(
|
|
2070 |
REINTERPRET_CAST( RPacketService::TRegistrationStatus*,
|
|
2071 |
dataPtr ) );
|
|
2072 |
break;
|
|
2073 |
case EPacketNotifyChangeOfNtwkRegStatus:
|
|
2074 |
ret = NotifyChangeOfNtwkRegStatus(
|
|
2075 |
REINTERPRET_CAST( RPacketService::TRegistrationStatus*,
|
|
2076 |
dataPtr ) );
|
|
2077 |
break;
|
|
2078 |
case EPacketGetMSClass:
|
|
2079 |
ret = GetMSClass(
|
|
2080 |
REINTERPRET_CAST( RPacketService::TMSClass*, dataPtr ),
|
|
2081 |
REINTERPRET_CAST( RPacketService::TMSClass*, dataPtr2 ) );
|
|
2082 |
break;
|
|
2083 |
case EPacketNotifyMSClassChange:
|
|
2084 |
ret = NotifyMSClassChange(
|
|
2085 |
REINTERPRET_CAST( RPacketService::TMSClass*, dataPtr ) );
|
|
2086 |
break;
|
|
2087 |
case EPacketSetPrefBearer:
|
|
2088 |
ret = SetPreferredBearerL( aPackage );
|
|
2089 |
break;
|
|
2090 |
case EPacketGetPrefBearer:
|
|
2091 |
ret = GetPreferredBearer( REINTERPRET_CAST(
|
|
2092 |
RPacketService::TPreferredBearer*, dataPtr ) );
|
|
2093 |
break;
|
|
2094 |
case EPacketGetStaticCaps:
|
|
2095 |
ret = GetStaticCaps(
|
|
2096 |
REINTERPRET_CAST( TUint*, dataPtr ),
|
|
2097 |
REINTERPRET_CAST( RPacketContext::TProtocolType*, dataPtr2 ) );
|
|
2098 |
break;
|
|
2099 |
case EPacketGetDynamicCaps:
|
|
2100 |
ret = GetDynamicCaps( REINTERPRET_CAST(
|
|
2101 |
RPacketService::TDynamicCapsFlags*, dataPtr ) );
|
|
2102 |
break;
|
|
2103 |
case EPacketNotifyDynamicCapsChange:
|
|
2104 |
ret = NotifyDynamicCapsChange( REINTERPRET_CAST(
|
|
2105 |
RPacketService::TDynamicCapsFlags*, dataPtr ) );
|
|
2106 |
break;
|
|
2107 |
case EPacketSetAttachMode:
|
|
2108 |
ret = SetAttachModeL(
|
|
2109 |
REINTERPRET_CAST( RPacketService::TAttachMode*, dataPtr ) );
|
|
2110 |
break;
|
|
2111 |
case EPacketGetAttachMode:
|
|
2112 |
ret = GetAttachModeL(
|
|
2113 |
REINTERPRET_CAST( RPacketService::TAttachMode*, dataPtr ) );
|
|
2114 |
break;
|
|
2115 |
case EPacketPrepareOpenSecondary:
|
|
2116 |
ret = PrepareOpenSecondary( aPackage.Des1u() );
|
|
2117 |
break;
|
|
2118 |
case EPacketEnumerateNifs:
|
|
2119 |
ret = EnumerateNifs( REINTERPRET_CAST ( TInt*, dataPtr ) );
|
|
2120 |
break;
|
|
2121 |
case EPacketGetNifInfo:
|
|
2122 |
// Check that dataPtr2 is not null
|
|
2123 |
if (dataPtr2)
|
|
2124 |
{
|
|
2125 |
// Get the TDes8 version of the parameter and find its MaxLength()
|
|
2126 |
TInt parameterLength = aPackage.Des2n()->MaxLength();
|
|
2127 |
|
|
2128 |
// Create a temporary object of the expected type and find the expected MaxLength()
|
|
2129 |
RPacketService::TNifInfoV2 temp;
|
|
2130 |
RPacketService::TNifInfoV2Pckg tempPckg(temp);
|
|
2131 |
TInt expectedLength = tempPckg.MaxLength();
|
|
2132 |
|
|
2133 |
// Compare the expected length with the actual length of the sent parameter
|
|
2134 |
if ( parameterLength == expectedLength )
|
|
2135 |
{
|
|
2136 |
ret = GetNifInfo( REINTERPRET_CAST( TInt*, dataPtr ),
|
|
2137 |
REINTERPRET_CAST( RPacketService::TNifInfoV2*, dataPtr2 ) );
|
|
2138 |
}
|
|
2139 |
else
|
|
2140 |
{
|
|
2141 |
ret = KErrArgument;
|
|
2142 |
}
|
|
2143 |
}
|
|
2144 |
else
|
|
2145 |
{
|
|
2146 |
ret = KErrArgument;
|
|
2147 |
}
|
|
2148 |
break;
|
|
2149 |
case EPacketEnumerateContextsInNif:
|
|
2150 |
ret = EnumerateContextsInNif( aPackage.Des2u(),
|
|
2151 |
REINTERPRET_CAST( TInt*, dataPtr ) );
|
|
2152 |
break;
|
|
2153 |
case EPacketGetContextNameInNif:
|
|
2154 |
ret = GetContextNameInNif(
|
|
2155 |
REINTERPRET_CAST( RPacketService::TContextNameInNif*,
|
|
2156 |
dataPtr ), aPackage.Des2u() );
|
|
2157 |
break;
|
|
2158 |
case EPacketSetDefaultContextParams:
|
|
2159 |
ret = SetDefaultContextParamsL( aPackage );
|
|
2160 |
break;
|
|
2161 |
case EPacketGetDefaultContextParams:
|
|
2162 |
ret = GetDefaultContextParams(
|
|
2163 |
REINTERPRET_CAST( TPacketDataConfigBase*, dataPtr ) );
|
|
2164 |
break;
|
|
2165 |
case EPacketNotifyMbmsNetworkServiceStatusChange:
|
|
2166 |
ret = NotifyMbmsNetworkServiceStatusChange(
|
|
2167 |
reinterpret_cast<TMbmsNetworkServiceStatus*> (dataPtr ) );
|
|
2168 |
break;
|
|
2169 |
case EPacketNotifyMbmsServiceAvailabilityChange:
|
|
2170 |
ret = NotifyMbmsServiceAvailabilityChange();
|
|
2171 |
break;
|
|
2172 |
case EPacketGetMbmsNetworkServiceStatus:
|
|
2173 |
ret = GetMbmsNetworkServiceStatus(
|
|
2174 |
*reinterpret_cast<TBool*> (dataPtr ),
|
|
2175 |
reinterpret_cast<TMbmsNetworkServiceStatus*> (dataPtr2 ) );
|
|
2176 |
break;
|
|
2177 |
case EPacketEnumerateMbmsMonitorServiceList:
|
|
2178 |
ret = EnumerateMonitorServiceList(
|
|
2179 |
*reinterpret_cast<TInt*> ( dataPtr ),
|
|
2180 |
*reinterpret_cast<TInt*> ( dataPtr2 ) );
|
|
2181 |
break;
|
|
2182 |
case EPacketEnumerateMbmsActiveServiceList:
|
|
2183 |
ret = EnumerateMbmsActiveServiceList(
|
|
2184 |
*reinterpret_cast<TInt*> ( dataPtr),
|
|
2185 |
*reinterpret_cast<TInt*>(dataPtr2) );
|
|
2186 |
break;
|
|
2187 |
case EPacketUpdateMbmsMonitorServiceList:
|
|
2188 |
TMbmsAction action;
|
|
2189 |
action = *reinterpret_cast< TMbmsAction*> (dataPtr );
|
|
2190 |
if(dataPtr2)
|
|
2191 |
{
|
|
2192 |
ret = UpdateMbmsMonitorServiceListL(
|
|
2193 |
action,
|
|
2194 |
aPackage.Des2n() );
|
|
2195 |
}
|
|
2196 |
else
|
|
2197 |
{
|
|
2198 |
ret = UpdateMbmsMonitorServiceListL(
|
|
2199 |
action, NULL );
|
|
2200 |
}
|
|
2201 |
break;
|
|
2202 |
case EPacketGetMbmsMonitoredServicesPhase1:
|
|
2203 |
ret = GetMbmsMonitoredServicesPhase1L(
|
|
2204 |
reinterpret_cast<RMobilePhone::TClientId*> (dataPtr),
|
|
2205 |
*reinterpret_cast<TUint*>(dataPtr2 ) );
|
|
2206 |
break;
|
|
2207 |
case EPacketGetMbmsMonitoredServicesPhase2:
|
|
2208 |
ret = GetMbmsMonitoredServicesPhase2(
|
|
2209 |
reinterpret_cast<RMobilePhone::TClientId*>( dataPtr ),
|
|
2210 |
aPackage.Des2n());
|
|
2211 |
break;
|
|
2212 |
//case EPacketSetMSClass:
|
|
2213 |
default:
|
|
2214 |
break;
|
|
2215 |
}
|
|
2216 |
|
|
2217 |
return ret;
|
|
2218 |
}
|
|
2219 |
|
|
2220 |
|
|
2221 |
|
|
2222 |
//----------------------------------------------------------------------------
|
|
2223 |
// CMmPacketServiceTsy::ReqModeL
|
|
2224 |
// Returns request mode for given IPC.
|
|
2225 |
// leave if given IPC is not supported
|
|
2226 |
// return request mode for IPC number given in parameter
|
|
2227 |
//----------------------------------------------------------------------------
|
|
2228 |
//
|
|
2229 |
CTelObject::TReqMode CMmPacketServiceTsy::ReqModeL(
|
|
2230 |
const TInt aIpc )
|
|
2231 |
{
|
|
2232 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::ReqModeL. IPC: %d", aIpc );
|
|
2233 |
|
|
2234 |
CTelObject::TReqMode reqMode( 0 );
|
|
2235 |
switch ( aIpc )
|
|
2236 |
{
|
|
2237 |
// All disabled TSYs wishing to implement their own buffering
|
|
2238 |
// algorithm will place all requests in this category.
|
|
2239 |
|
|
2240 |
// Get methods that do not use DOS and return immediately.
|
|
2241 |
// Other methods that return immediately.
|
|
2242 |
// Methods that can propably take a long time flow control not
|
|
2243 |
// required.
|
|
2244 |
case EPacketGetNtwkRegStatus:
|
|
2245 |
case EPacketGetDynamicCaps:
|
|
2246 |
case EPacketGetStatus:
|
|
2247 |
case EPacketEnumerateContexts:
|
|
2248 |
case EPacketGetContextInfo:
|
|
2249 |
case EPacketGetAttachMode:
|
|
2250 |
case EPacketGetStaticCaps:
|
|
2251 |
case EPacketRejectActivationRequest:
|
|
2252 |
case EPacketSetAttachMode:
|
|
2253 |
case EPacketAttach:
|
|
2254 |
case EPacketDetach:
|
|
2255 |
case EPacketSetPrefBearer:
|
|
2256 |
case EPacketGetPrefBearer:
|
|
2257 |
case EPacketPrepareOpenSecondary:
|
|
2258 |
case EPacketEnumerateNifs:
|
|
2259 |
case EPacketGetNifInfo:
|
|
2260 |
case EPacketEnumerateContextsInNif:
|
|
2261 |
case EPacketGetContextNameInNif:
|
|
2262 |
case EPacketSetDefaultContextParams:
|
|
2263 |
case EPacketGetDefaultContextParams:
|
|
2264 |
case EPacketUpdateMbmsMonitorServiceList:
|
|
2265 |
case EPacketEnumerateMbmsMonitorServiceList:
|
|
2266 |
case EPacketGetMbmsNetworkServiceStatus:
|
|
2267 |
case EPacketEnumerateMbmsActiveServiceList:
|
|
2268 |
case EPacketGetMbmsMonitoredServicesPhase1:
|
|
2269 |
case EPacketGetMbmsMonitoredServicesPhase2:
|
|
2270 |
break;
|
|
2271 |
|
|
2272 |
// Commands that change the state of the phone.
|
|
2273 |
case EPacketGetMSClass:
|
|
2274 |
reqMode = KReqModeFlowControlObeyed;
|
|
2275 |
break;
|
|
2276 |
|
|
2277 |
// Requests that notify a client about a change of state.
|
|
2278 |
case EPacketNotifyContextAdded:
|
|
2279 |
case EPacketNotifyStatusChange:
|
|
2280 |
case EPacketNotifyChangeOfNtwkRegStatus:
|
|
2281 |
case EPacketNotifyContextActivationRequested:
|
|
2282 |
case EPacketNotifyDynamicCapsChange:
|
|
2283 |
case EPacketNotifyMSClassChange:
|
|
2284 |
case EPacketNotifyMbmsNetworkServiceStatusChange:
|
|
2285 |
reqMode = KReqModeMultipleCompletionEnabled |
|
|
2286 |
KReqModeRePostImmediately;
|
|
2287 |
case EPacketNotifyMbmsServiceAvailabilityChange:
|
|
2288 |
break;
|
|
2289 |
|
|
2290 |
// Following requests are not supported
|
|
2291 |
//case EPacketSetMSClass:
|
|
2292 |
default:
|
|
2293 |
User::Leave( KErrNotSupported );
|
|
2294 |
break;
|
|
2295 |
}
|
|
2296 |
|
|
2297 |
return reqMode;
|
|
2298 |
}
|
|
2299 |
|
|
2300 |
//----------------------------------------------------------------------------
|
|
2301 |
// CMmPacketServiceTsy::NumberOfSlotsL
|
|
2302 |
// Returns number of slots to be used for given IPC.
|
|
2303 |
// return number of slots to be used for IPC number given in parameter
|
|
2304 |
// leave with KErrNotSupported if invalid IPC
|
|
2305 |
//----------------------------------------------------------------------------
|
|
2306 |
//
|
|
2307 |
TInt CMmPacketServiceTsy::NumberOfSlotsL(
|
|
2308 |
const TInt aIpc )
|
|
2309 |
{
|
|
2310 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::NumberOfSlotsL. IPC: %d", aIpc );
|
|
2311 |
|
|
2312 |
TInt numberOfSlots( 0 );
|
|
2313 |
switch ( aIpc )
|
|
2314 |
{
|
|
2315 |
|
|
2316 |
case EPacketNotifyStatusChange:
|
|
2317 |
numberOfSlots = KMmPacketServiceNotifyStatusChangeSlots;
|
|
2318 |
break;
|
|
2319 |
case EPacketNotifyDynamicCapsChange:
|
|
2320 |
numberOfSlots = KMmPacketServiceNotifyDynamicCapsChangeSlots;
|
|
2321 |
break;
|
|
2322 |
case EPacketNotifyContextAdded:
|
|
2323 |
numberOfSlots = KMmPacketServiceNotifyContextAddedSlots;
|
|
2324 |
break;
|
|
2325 |
case EPacketNotifyContextActivationRequested:
|
|
2326 |
numberOfSlots =
|
|
2327 |
KMmPacketServiceNotifyContextActivationRequestedSlots;
|
|
2328 |
break;
|
|
2329 |
case EPacketNotifyChangeOfNtwkRegStatus:
|
|
2330 |
numberOfSlots = KMmPacketServiceNotifyChangeOfNtwkRegStatusSlots;
|
|
2331 |
break;
|
|
2332 |
case EPacketNotifyMSClassChange:
|
|
2333 |
numberOfSlots = KMmPacketServiceNotifyMSClassChangeSlots;
|
|
2334 |
break;
|
|
2335 |
case EPacketNotifyMbmsNetworkServiceStatusChange:
|
|
2336 |
numberOfSlots = KMmPacketServiceNotifyMBMSServiceStatusSlots;
|
|
2337 |
break;
|
|
2338 |
default:
|
|
2339 |
// Unknown or invalid IPC
|
|
2340 |
User::Leave( KErrNotSupported );
|
|
2341 |
break;
|
|
2342 |
}
|
|
2343 |
|
|
2344 |
return numberOfSlots;
|
|
2345 |
}
|
|
2346 |
|
|
2347 |
//----------------------------------------------------------------------------
|
|
2348 |
// CMmPacketServiceTsy::CancelService
|
|
2349 |
// When the clients close their sub-sessions (eg. by calling RPhone::Close),
|
|
2350 |
// they may not have cancelled all their outstanding asynchronous requests
|
|
2351 |
// before closing. It is up to the ETel server to clean up in this situation,
|
|
2352 |
// so the server will find the list of outstanding requests related to that
|
|
2353 |
// sub-session object and pass these outstanding IPC request numbers, one at a
|
|
2354 |
// time, to the CancelService function in the TSY.
|
|
2355 |
// This method is also called when client initiates normal cancel to the
|
|
2356 |
// request.
|
|
2357 |
//----------------------------------------------------------------------------
|
|
2358 |
//
|
|
2359 |
TInt CMmPacketServiceTsy::CancelService(
|
|
2360 |
const TInt aIpc,
|
|
2361 |
const TTsyReqHandle aTsyReqHandle )
|
|
2362 |
{
|
|
2363 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::CancelService. IPC: %d Tsy Req Handle:%d", aIpc, aTsyReqHandle);
|
|
2364 |
|
|
2365 |
TInt ret( KErrNone );
|
|
2366 |
|
|
2367 |
// Ensure the ReqHandleType is unset.
|
|
2368 |
// This will detect cases where this method indirectly calls itself
|
|
2369 |
// (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
|
|
2370 |
// Such cases are not supported because iReqHandleType is in the context of this class instance,
|
|
2371 |
// not this request, and we don't want the values set by the inner request and the outer request
|
|
2372 |
// interfering with each other.
|
|
2373 |
__ASSERT_DEBUG(iReqHandleType==EMultimodePacketServiceReqHandleUnknown, User::Invariant());
|
|
2374 |
|
|
2375 |
// When the clients close their sub-sessions (eg. by calling
|
|
2376 |
// RPacketService::Close), they may not have cancelled all their
|
|
2377 |
// outstanding asynchronous requests before closing. It is up to the ETel
|
|
2378 |
// server to clean up in this situation, so the server will find the list
|
|
2379 |
// of outstanding requests related to that sub-session object and pass
|
|
2380 |
// these outstanding IPC request numbers, one at a time, to the
|
|
2381 |
// CancelService method in the TSY.
|
|
2382 |
|
|
2383 |
switch ( aIpc )
|
|
2384 |
{
|
|
2385 |
case EPacketNotifyContextAdded:
|
|
2386 |
iNotifyDataPointers.iContextAdded = NULL;
|
|
2387 |
iReqHandleType = EMultimodePacketServiceNotifyContextAdded;
|
|
2388 |
break;
|
|
2389 |
case EPacketNotifyStatusChange:
|
|
2390 |
iNotifyDataPointers.iStatusChange = NULL;
|
|
2391 |
iReqHandleType = EMultimodePacketServiceNotifyStatusChange;
|
|
2392 |
break;
|
|
2393 |
case EPacketNotifyContextActivationRequested:
|
|
2394 |
if ( aTsyReqHandle == iTsyReqHandleStore->GetTsyReqHandle(
|
|
2395 |
EMultimodePacketServiceNotifyContextActivationRequested ) )
|
|
2396 |
{
|
|
2397 |
iNotifyDataPointers.iContextActivationRequested = NULL;
|
|
2398 |
iReqHandleType =
|
|
2399 |
EMultimodePacketServiceNotifyContextActivationRequested;
|
|
2400 |
}
|
|
2401 |
else if ( aTsyReqHandle == iTsyReqHandleStore->GetTsyReqHandle(
|
|
2402 |
EMultimodePacketServiceNotifyContextActivationRequested99 ) )
|
|
2403 |
{
|
|
2404 |
iNotifyDataPointers.iContextActivationRequested99 = NULL;
|
|
2405 |
iReqHandleType =
|
|
2406 |
EMultimodePacketServiceNotifyContextActivationRequested99;
|
|
2407 |
}
|
|
2408 |
else if ( aTsyReqHandle == iTsyReqHandleStore->GetTsyReqHandle(
|
|
2409 |
EMultimodePacketServiceNotifyContextActivationRequested5 ) )
|
|
2410 |
{
|
|
2411 |
iNotifyDataPointers.iContextActivationRequested5 = NULL;
|
|
2412 |
iReqHandleType =
|
|
2413 |
EMultimodePacketServiceNotifyContextActivationRequested5;
|
|
2414 |
}
|
|
2415 |
break;
|
|
2416 |
case EPacketNotifyChangeOfNtwkRegStatus:
|
|
2417 |
iNotifyDataPointers.iChangeOfNtwkRegStatus = NULL;
|
|
2418 |
iReqHandleType = EMultimodePacketServiceNotifyNtwkRegStatusChange;
|
|
2419 |
break;
|
|
2420 |
case EPacketNotifyMSClassChange:
|
|
2421 |
iNotifyDataPointers.iMSClassChange = NULL;
|
|
2422 |
iReqHandleType = EMultimodePacketServiceNotifyMSClassChange;
|
|
2423 |
break;
|
|
2424 |
case EPacketNotifyDynamicCapsChange:
|
|
2425 |
iNotifyDataPointers.iDynamicCapsChange = NULL;
|
|
2426 |
iReqHandleType = EMultimodePacketServiceNotifyDynamicCapsChange;
|
|
2427 |
break;
|
|
2428 |
case EPacketNotifyMbmsNetworkServiceStatusChange:
|
|
2429 |
iNotifyDataPointers.iMBMSStatusChange = NULL;
|
|
2430 |
iReqHandleType = EMultimodePacketServiceNotifyMBMSStatusChange;
|
|
2431 |
break;
|
|
2432 |
case EPacketNotifyMbmsServiceAvailabilityChange:
|
|
2433 |
iReqHandleType = EMultimodePacketServiceNotifyMbmsServiceAvailabilityChange;
|
|
2434 |
break;
|
|
2435 |
case EPacketGetMbmsNetworkServiceStatus:
|
|
2436 |
iReqHandleType = EMultimodePacketServiceGetMBMSStatus;
|
|
2437 |
break;
|
|
2438 |
case EPacketGetMbmsMonitoredServicesPhase1:
|
|
2439 |
case EPacketGetMbmsMonitoredServicesPhase2:
|
|
2440 |
GetMbmsMonitoredServicesCancel( aTsyReqHandle );
|
|
2441 |
break;
|
|
2442 |
case EPacketUpdateMbmsMonitorServiceList:
|
|
2443 |
UpdateMbmsMonitorServiceListCancel(aTsyReqHandle);
|
|
2444 |
break;
|
|
2445 |
// TSY has started a request and it is not possible to then
|
|
2446 |
// cancel this request. The best thing for the TSY to do in this case
|
|
2447 |
// is to proceed as though the Cancel never happened. The server's
|
|
2448 |
// call to the TSY cancel function will return synchronously.
|
|
2449 |
case EPacketAttach:
|
|
2450 |
case EPacketDetach:
|
|
2451 |
case EPacketGetStatus:
|
|
2452 |
case EPacketRejectActivationRequest:
|
|
2453 |
case EPacketEnumerateContexts:
|
|
2454 |
case EPacketGetContextInfo:
|
|
2455 |
case EPacketGetNtwkRegStatus:
|
|
2456 |
case EPacketGetMSClass:
|
|
2457 |
case EPacketSetPrefBearer:
|
|
2458 |
case EPacketGetPrefBearer:
|
|
2459 |
case EPacketGetStaticCaps:
|
|
2460 |
case EPacketGetDynamicCaps:
|
|
2461 |
case EPacketSetAttachMode:
|
|
2462 |
case EPacketGetAttachMode:
|
|
2463 |
case EPacketEnumerateNifs:
|
|
2464 |
case EPacketGetNifInfo:
|
|
2465 |
case EPacketEnumerateContextsInNif:
|
|
2466 |
case EPacketGetContextNameInNif:
|
|
2467 |
case EPacketSetDefaultContextParams:
|
|
2468 |
case EPacketGetDefaultContextParams:
|
|
2469 |
case EPacketEnumerateMbmsMonitorServiceList:
|
|
2470 |
case EPacketEnumerateMbmsActiveServiceList:
|
|
2471 |
break;
|
|
2472 |
|
|
2473 |
// Cancel methods that are not supported.
|
|
2474 |
//case EPacketSetMSClass:
|
|
2475 |
default:
|
|
2476 |
ret = KErrNotSupported;
|
|
2477 |
break;
|
|
2478 |
}
|
|
2479 |
|
|
2480 |
if ( EMultimodePacketServiceReqHandleUnknown != iReqHandleType )
|
|
2481 |
{
|
|
2482 |
// Reset tsy request handle
|
|
2483 |
iTsyReqHandleStore->ResetTsyReqHandle( iReqHandleType );
|
|
2484 |
|
|
2485 |
// We've finished with this value now. Clear it so it doesn't leak
|
|
2486 |
// up to any other instances of this method down the call stack
|
|
2487 |
iReqHandleType = EMultimodePacketServiceReqHandleUnknown;
|
|
2488 |
|
|
2489 |
// Complete request with KErrCancel
|
|
2490 |
CMmPacketServiceTsy::ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
2491 |
}
|
|
2492 |
|
|
2493 |
return ret;
|
|
2494 |
}
|
|
2495 |
|
|
2496 |
//----------------------------------------------------------------------------
|
|
2497 |
// TInt CMmPacketServiceTsy::RegisterNotification
|
|
2498 |
// Register notification.
|
|
2499 |
// Returns KErrNone to ETel server in case of known notification request type.
|
|
2500 |
//----------------------------------------------------------------------------
|
|
2501 |
//
|
|
2502 |
TInt CMmPacketServiceTsy::RegisterNotification(
|
|
2503 |
const TInt aIpc )
|
|
2504 |
{
|
|
2505 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::RegisterNotification. IPC: %d", aIpc );
|
|
2506 |
|
|
2507 |
TInt ret( KErrNone );
|
|
2508 |
|
|
2509 |
switch ( aIpc )
|
|
2510 |
{
|
|
2511 |
case EPacketNotifyContextAdded:
|
|
2512 |
case EPacketNotifyStatusChange:
|
|
2513 |
case EPacketNotifyContextActivationRequested:
|
|
2514 |
case EPacketNotifyChangeOfNtwkRegStatus:
|
|
2515 |
case EPacketNotifyMSClassChange:
|
|
2516 |
case EPacketNotifyDynamicCapsChange:
|
|
2517 |
case EPacketNotifyMbmsNetworkServiceStatusChange:
|
|
2518 |
case EPacketNotifyMbmsServiceAvailabilityChange:
|
|
2519 |
break;
|
|
2520 |
default:
|
|
2521 |
// Not supported
|
|
2522 |
ret = KErrNotSupported;
|
|
2523 |
break;
|
|
2524 |
}
|
|
2525 |
|
|
2526 |
return ret;
|
|
2527 |
}
|
|
2528 |
|
|
2529 |
//----------------------------------------------------------------------------
|
|
2530 |
// CMmPacketServiceTsy::DeregisterNotification
|
|
2531 |
// Deregister notification.
|
|
2532 |
// Returns KErrNone to ETel server in case of known notification request type.
|
|
2533 |
//----------------------------------------------------------------------------
|
|
2534 |
//
|
|
2535 |
TInt CMmPacketServiceTsy::DeregisterNotification(
|
|
2536 |
const TInt aIpc )
|
|
2537 |
{
|
|
2538 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::DeregisterNotification. IPC: %d", aIpc );
|
|
2539 |
|
|
2540 |
TInt ret( KErrNone );
|
|
2541 |
|
|
2542 |
switch ( aIpc )
|
|
2543 |
{
|
|
2544 |
case EPacketNotifyContextAdded:
|
|
2545 |
case EPacketNotifyStatusChange:
|
|
2546 |
case EPacketNotifyContextActivationRequested:
|
|
2547 |
case EPacketNotifyChangeOfNtwkRegStatus:
|
|
2548 |
case EPacketNotifyMSClassChange:
|
|
2549 |
case EPacketNotifyDynamicCapsChange:
|
|
2550 |
case EPacketNotifyMbmsNetworkServiceStatusChange:
|
|
2551 |
case EPacketNotifyMbmsServiceAvailabilityChange:
|
|
2552 |
break;
|
|
2553 |
default:
|
|
2554 |
// Not supported
|
|
2555 |
ret = KErrNotSupported;
|
|
2556 |
break;
|
|
2557 |
}
|
|
2558 |
|
|
2559 |
return ret;
|
|
2560 |
}
|
|
2561 |
|
|
2562 |
|
|
2563 |
|
|
2564 |
//-----------------------------------------------------------------------------
|
|
2565 |
// TInt CMmPacketServiceTsy::GetMbmsNetworkServiceStatus
|
|
2566 |
// Requests Get MBMS network service status
|
|
2567 |
//-----------------------------------------------------------------------------
|
|
2568 |
//
|
|
2569 |
TInt CMmPacketServiceTsy::GetMbmsNetworkServiceStatus(
|
|
2570 |
TBool aAttemptAttach,
|
|
2571 |
TMbmsNetworkServiceStatus* aMBMSServiceStatus )
|
|
2572 |
{
|
|
2573 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy:: TMbmsNetworkServiceStatus = %d", aMBMSServiceStatus );
|
|
2574 |
|
|
2575 |
const TTsyReqHandle regHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
2576 |
EMultimodePacketServiceGetMBMSStatus ) );
|
|
2577 |
|
|
2578 |
TInt ret( KErrServerBusy );
|
|
2579 |
if ( !iMbmsStatusCached )
|
|
2580 |
{
|
|
2581 |
if ( EMultimodePacketServiceReqHandleUnknown == regHandle )
|
|
2582 |
{
|
|
2583 |
// Save pointer to aMBMSServiceStatus
|
|
2584 |
iTemporarySavedData.iMbmsStatus = aMBMSServiceStatus;
|
|
2585 |
|
|
2586 |
// Get MBMS network service status
|
|
2587 |
CMmDataPackage dataPackage;
|
|
2588 |
dataPackage.PackData( &aAttemptAttach );
|
|
2589 |
TRAPD(err, ret = iMessageManager->HandleRequestL( EPacketGetMbmsNetworkServiceStatus, &dataPackage));
|
|
2590 |
if(err != KErrNone)
|
|
2591 |
{
|
|
2592 |
ret = err;
|
|
2593 |
}
|
|
2594 |
}
|
|
2595 |
if ( KErrNone == ret )
|
|
2596 |
{
|
|
2597 |
// Set request handle type
|
|
2598 |
iReqHandleType = EMultimodePacketServiceGetMBMSStatus;
|
|
2599 |
}
|
|
2600 |
|
|
2601 |
}
|
|
2602 |
else // iMbmsStatusCached == ETrue
|
|
2603 |
{
|
|
2604 |
|
|
2605 |
*aMBMSServiceStatus = iInternalSavedData.iMbmsStatus;
|
|
2606 |
|
|
2607 |
// Complete the request with KErrNone
|
|
2608 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
2609 |
|
|
2610 |
ret = KErrNone;
|
|
2611 |
|
|
2612 |
}
|
|
2613 |
|
|
2614 |
return ret;
|
|
2615 |
}
|
|
2616 |
|
|
2617 |
//-----------------------------------------------------------------------------
|
|
2618 |
// void CMmPacketServiceTsy::CompleteGetMbmsNetworkServiceStatus
|
|
2619 |
// Completes Get MBMS network service status request
|
|
2620 |
//-----------------------------------------------------------------------------
|
|
2621 |
//
|
|
2622 |
void CMmPacketServiceTsy::CompleteGetMbmsNetworkServiceStatus(
|
|
2623 |
CMmDataPackage* aDataPackage, TInt aError )
|
|
2624 |
{
|
|
2625 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteGetMbmsNetworkServiceStatus.");
|
|
2626 |
|
|
2627 |
//Update the cache
|
|
2628 |
TMbmsNetworkServiceStatus mbmsNetworkServiceStatus = EMbmsSupportUnknown;
|
|
2629 |
if ( KErrNone == aError )
|
|
2630 |
{
|
|
2631 |
//Unpack necessary data from datapackage
|
|
2632 |
if ( aDataPackage )
|
|
2633 |
{
|
|
2634 |
aDataPackage->UnPackData( mbmsNetworkServiceStatus );
|
|
2635 |
}
|
|
2636 |
|
|
2637 |
// Change MBMS cache indicator value
|
|
2638 |
iMbmsStatusCached = ETrue;
|
|
2639 |
iInternalSavedData.iMbmsStatus = mbmsNetworkServiceStatus;
|
|
2640 |
}
|
|
2641 |
|
|
2642 |
// Reset request handle. Returns the deleted request handle
|
|
2643 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2644 |
EMultimodePacketServiceGetMBMSStatus ) );
|
|
2645 |
|
|
2646 |
// If request handle ok
|
|
2647 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
2648 |
{
|
|
2649 |
*iTemporarySavedData.iMbmsStatus = mbmsNetworkServiceStatus;
|
|
2650 |
// Complete the client request
|
|
2651 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aError );
|
|
2652 |
}
|
|
2653 |
}
|
|
2654 |
|
|
2655 |
//-----------------------------------------------------------------------------
|
|
2656 |
// TInt CMmPacketServiceTsy::NotifyMbmsNetworkServiceStatusChange
|
|
2657 |
// Requests notification of MBMS network service status change.
|
|
2658 |
// Allows a client to be notified whenever a change in the status of the
|
|
2659 |
// MBMS network service is detected.
|
|
2660 |
//-----------------------------------------------------------------------------
|
|
2661 |
//
|
|
2662 |
|
|
2663 |
TInt CMmPacketServiceTsy::NotifyMbmsNetworkServiceStatusChange(
|
|
2664 |
TMbmsNetworkServiceStatus* aMBMSServiceStatus )
|
|
2665 |
{
|
|
2666 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::NotifyMbmsNetworkServiceStatusChange TMbmsNetworkServiceStatus = %d", aMBMSServiceStatus );
|
|
2667 |
|
|
2668 |
// Set request handle and save pointer to aMBMSServiceStatus
|
|
2669 |
iNotifyDataPointers.iMBMSStatusChange = aMBMSServiceStatus;
|
|
2670 |
iReqHandleType = EMultimodePacketServiceNotifyMBMSStatusChange;
|
|
2671 |
|
|
2672 |
return KErrNone;
|
|
2673 |
}
|
|
2674 |
|
|
2675 |
//-----------------------------------------------------------------------------
|
|
2676 |
// Void CMmPacketServiceTsy::NotifyMbmsNetworkServiceStatusChange
|
|
2677 |
// Completes notification of MBMS network service status request
|
|
2678 |
//-----------------------------------------------------------------------------
|
|
2679 |
//
|
|
2680 |
void CMmPacketServiceTsy::CompleteNotifyMbmsNetworkServiceStatusChange(
|
|
2681 |
CMmDataPackage* aDataPackage, TInt aResult )
|
|
2682 |
{
|
|
2683 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NotifyMbmsNetworkServiceStatusChange.");
|
|
2684 |
|
|
2685 |
TInt result = aResult;
|
|
2686 |
if (aResult == KErrNone)
|
|
2687 |
{
|
|
2688 |
//Unpack necessary data from datapackage
|
|
2689 |
TMbmsNetworkServiceStatus newMbmsNetworkServiceStatus;
|
|
2690 |
aDataPackage->UnPackData( newMbmsNetworkServiceStatus );
|
|
2691 |
|
|
2692 |
// If Mbms network service status changed
|
|
2693 |
if ( newMbmsNetworkServiceStatus != iInternalSavedData.iMbmsStatus )
|
|
2694 |
{
|
|
2695 |
|
|
2696 |
// Save new status internally
|
|
2697 |
iInternalSavedData.iMbmsStatus = newMbmsNetworkServiceStatus;
|
|
2698 |
iMbmsStatusCached = ETrue;
|
|
2699 |
|
|
2700 |
// Reset request handle. Returns the deleted request handle
|
|
2701 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2702 |
EMultimodePacketServiceNotifyMBMSStatusChange ) );
|
|
2703 |
|
|
2704 |
// If request handle ok
|
|
2705 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
2706 |
{
|
|
2707 |
// Set MbmsNetworkServiceStatus to the etel side memory
|
|
2708 |
*iNotifyDataPointers.iMBMSStatusChange = newMbmsNetworkServiceStatus;
|
|
2709 |
iNotifyDataPointers.iMBMSStatusChange = NULL;
|
|
2710 |
|
|
2711 |
// Complete the client request
|
|
2712 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, result );
|
|
2713 |
|
|
2714 |
}
|
|
2715 |
}
|
|
2716 |
|
|
2717 |
}
|
|
2718 |
else // result is != KErrNone
|
|
2719 |
{
|
|
2720 |
// Reset request handle. Returns the deleted request handle
|
|
2721 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2722 |
EMultimodePacketServiceNotifyMBMSStatusChange ) );
|
|
2723 |
// Complete the client request
|
|
2724 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, result );
|
|
2725 |
}
|
|
2726 |
}
|
|
2727 |
|
|
2728 |
//-----------------------------------------------------------------------------
|
|
2729 |
// TInt CMmPacketServiceTsy::NotifyMbmsServiceAvailabilityChange
|
|
2730 |
// Requests notification of MBMS service availability status change.
|
|
2731 |
// Allows a client to be notified whenever a change in the status of the
|
|
2732 |
// MBMS network service is detected.
|
|
2733 |
//-----------------------------------------------------------------------------
|
|
2734 |
//
|
|
2735 |
TInt CMmPacketServiceTsy::NotifyMbmsServiceAvailabilityChange()
|
|
2736 |
{
|
|
2737 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::NotifyMbmsServiceAvailabilityChange.");
|
|
2738 |
|
|
2739 |
// Set request handle
|
|
2740 |
iReqHandleType = EMultimodePacketServiceNotifyMbmsServiceAvailabilityChange;
|
|
2741 |
|
|
2742 |
return KErrNone;
|
|
2743 |
}
|
|
2744 |
|
|
2745 |
//-----------------------------------------------------------------------------
|
|
2746 |
// Void CMmPacketServiceTsy::CompleteNotifyMbmsServiceAvailabilityChange
|
|
2747 |
// Completes notification of MBMS service availability status request
|
|
2748 |
//-----------------------------------------------------------------------------
|
|
2749 |
//
|
|
2750 |
void CMmPacketServiceTsy::CompleteNotifyMbmsServiceAvailabilityChangeL(CMmDataPackage* aDataPackage, TInt aResult)
|
|
2751 |
{
|
|
2752 |
// Reset request handle. Returns the deleted request handle
|
|
2753 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2754 |
EMultimodePacketServiceNotifyMbmsServiceAvailabilityChange ) );
|
|
2755 |
|
|
2756 |
// If request handle ok
|
|
2757 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
2758 |
{
|
|
2759 |
#ifdef USING_CTSY_DISPATCHER
|
|
2760 |
//three defects,
|
|
2761 |
//1) no need to allocate a list all we need is a pointer and we unpack over this
|
|
2762 |
//2) PopAndDestroy at the end could cause issues, in the iMBMSMonitoredList null case
|
|
2763 |
//3) if completed with an Error,this will cause subsequent notifys to have no effect as
|
|
2764 |
//the request handle has been removed from the store. Here as before the request is completed
|
|
2765 |
//with aResult on aDataPackage or iMBMSMonitoredList being null.
|
|
2766 |
if((aResult == KErrNone) && aDataPackage && iMBMSMonitoredList)
|
|
2767 |
{
|
|
2768 |
CPcktMbmsMonitoredServiceList* updatedMonitorList = NULL;
|
|
2769 |
//Unpack necessary data from datapackage
|
|
2770 |
aDataPackage->UnPackData(&updatedMonitorList);
|
|
2771 |
iMBMSMonitoredList->SetServicesAvailabilityL(updatedMonitorList);
|
|
2772 |
}
|
|
2773 |
|
|
2774 |
// Complete the client request
|
|
2775 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aResult );
|
|
2776 |
|
|
2777 |
#else
|
|
2778 |
if (aResult == KErrNone)
|
|
2779 |
{
|
|
2780 |
if (aDataPackage)
|
|
2781 |
{
|
|
2782 |
if(iMBMSMonitoredList != NULL)
|
|
2783 |
{
|
|
2784 |
// Create new list for changes
|
|
2785 |
CPcktMbmsMonitoredServiceList* updatedMonitorList = CPcktMbmsMonitoredServiceList::NewL();
|
|
2786 |
CleanupStack::PushL(updatedMonitorList);
|
|
2787 |
|
|
2788 |
//Unpack necessary data from datapackage
|
|
2789 |
aDataPackage->UnPackData( &updatedMonitorList );
|
|
2790 |
iMBMSMonitoredList->SetServicesAvailabilityL(updatedMonitorList);
|
|
2791 |
}
|
|
2792 |
// Complete the client request
|
|
2793 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aResult );
|
|
2794 |
CleanupStack::PopAndDestroy();
|
|
2795 |
}
|
|
2796 |
else
|
|
2797 |
{
|
|
2798 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aResult );
|
|
2799 |
}
|
|
2800 |
}
|
|
2801 |
#endif //USING_CTSY_DISPATCHER
|
|
2802 |
}
|
|
2803 |
}
|
|
2804 |
|
|
2805 |
//----------------------------------------------------------------------------
|
|
2806 |
// CMmPacketServiceTsy::EnumerateMonitorServiceList
|
|
2807 |
// Enumrates monitored service list
|
|
2808 |
//----------------------------------------------------------------------------
|
|
2809 |
//
|
|
2810 |
TInt CMmPacketServiceTsy::EnumerateMonitorServiceList( TInt& aCount, TInt& aMaxAllowed )
|
|
2811 |
{
|
|
2812 |
if (iMBMSMonitoredList != NULL)
|
|
2813 |
{
|
|
2814 |
aCount = iMBMSMonitoredList->NumberOfMonitoredList( );
|
|
2815 |
}
|
|
2816 |
else
|
|
2817 |
{
|
|
2818 |
aCount = 0;
|
|
2819 |
}
|
|
2820 |
aMaxAllowed = iMaxMonitoredServices;
|
|
2821 |
|
|
2822 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::EnumerateMonitorServiceList." );
|
|
2823 |
|
|
2824 |
// Complete the request with KErrNone
|
|
2825 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
2826 |
|
|
2827 |
return KErrNone;
|
|
2828 |
}
|
|
2829 |
|
|
2830 |
//----------------------------------------------------------------------------
|
|
2831 |
// CMmPacketServiceTsy::CompleteMaxMonitoredServicesChange
|
|
2832 |
// Enumrates monitored service list
|
|
2833 |
//----------------------------------------------------------------------------
|
|
2834 |
//
|
|
2835 |
void CMmPacketServiceTsy::CompleteMaxMonitoredServicesChange( TInt aMaxMonitorValue )
|
|
2836 |
{
|
|
2837 |
iMaxMonitoredServices = aMaxMonitorValue;
|
|
2838 |
}
|
|
2839 |
//----------------------------------------------------------------------------
|
|
2840 |
// CMmPacketServiceTsy::UpdateMbmsMonitorServiceListL
|
|
2841 |
// Request to update monitored service list
|
|
2842 |
//----------------------------------------------------------------------------
|
|
2843 |
//
|
|
2844 |
TInt CMmPacketServiceTsy::UpdateMbmsMonitorServiceListL( TMbmsAction aAction,
|
|
2845 |
TDes8* aList )
|
|
2846 |
{
|
|
2847 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
2848 |
EMultimodePacketServiceUpdateMBMSMonitorServiceList ) );
|
|
2849 |
|
|
2850 |
TInt ret( KErrServerBusy );
|
|
2851 |
|
|
2852 |
if ( EMultimodePacketServiceReqHandleUnknown == reqHandle )
|
|
2853 |
{
|
|
2854 |
if (iMBMSMonitoredList == NULL)
|
|
2855 |
{
|
|
2856 |
// create MBMS monitored service list
|
|
2857 |
iMBMSMonitoredList = CMmMBMSMonitoredList::NewL( this, iMaxMonitoredServices );
|
|
2858 |
}
|
|
2859 |
iActionType = aAction;
|
|
2860 |
// Save changes of Monitored service list and action
|
|
2861 |
ret = iMBMSMonitoredList->SaveUpdateValuesToTempL(aList, aAction);
|
|
2862 |
|
|
2863 |
// temp list was ok
|
|
2864 |
if( KErrNone == ret )
|
|
2865 |
{
|
|
2866 |
// Get correct data packet and send it to LTSY
|
|
2867 |
ret = iMBMSMonitoredList->PackDataL();
|
|
2868 |
|
|
2869 |
if ( KErrNone == ret )
|
|
2870 |
{
|
|
2871 |
// Set request handle type
|
|
2872 |
iReqHandleType = EMultimodePacketServiceUpdateMBMSMonitorServiceList;
|
|
2873 |
}
|
|
2874 |
}
|
|
2875 |
else if( KErrAlreadyExists == ret )
|
|
2876 |
{
|
|
2877 |
// there were no new entries client tried to supply. Complete with KErrNone
|
|
2878 |
// to client to think updating was ok
|
|
2879 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
2880 |
ret = KErrNone;
|
|
2881 |
}
|
|
2882 |
else if( KErrNotFound == ret )
|
|
2883 |
{
|
|
2884 |
// there were no new entries client tried to supply. Complete with KErrNotfound
|
|
2885 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, ret );
|
|
2886 |
ret = KErrNone;
|
|
2887 |
}
|
|
2888 |
}
|
|
2889 |
|
|
2890 |
return ret;
|
|
2891 |
|
|
2892 |
}
|
|
2893 |
|
|
2894 |
//----------------------------------------------------------------------------
|
|
2895 |
// CMmPacketServiceTsy::CompleteUpdateMbmsMonitorServiceList
|
|
2896 |
// Completes update monitored service list request
|
|
2897 |
//----------------------------------------------------------------------------
|
|
2898 |
//
|
|
2899 |
void CMmPacketServiceTsy::CompleteUpdateMbmsMonitorServiceList(
|
|
2900 |
CMmDataPackage* aDataPackage,
|
|
2901 |
const TInt aResult)
|
|
2902 |
{
|
|
2903 |
TFLOGSTRING( "TSY: CMmPacketServiceTsy::CompleteUpdateMbmsMonitorServiceListL." );
|
|
2904 |
|
|
2905 |
TInt result= aResult;
|
|
2906 |
TInt err(KErrNone);
|
|
2907 |
// Reset request handle. Returns the deleted request handle
|
|
2908 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2909 |
EMultimodePacketServiceUpdateMBMSMonitorServiceList ) );
|
|
2910 |
|
|
2911 |
if( aResult == KErrNone )
|
|
2912 |
{
|
|
2913 |
TRAP( err, result = iMBMSMonitoredList->ProcessEntriesL( NULL, iActionType ) );
|
|
2914 |
if ( !err )
|
|
2915 |
TRAP( err, CompleteNotifyMbmsServiceAvailabilityChangeL( NULL, aResult ) );
|
|
2916 |
}
|
|
2917 |
//there were problem managing entries
|
|
2918 |
else if( (aResult == KErrMbmsImpreciseServiceEntries) && (aDataPackage != NULL) )
|
|
2919 |
{
|
|
2920 |
CPcktMbmsMonitoredServiceList* failedMonitorEntries = NULL;
|
|
2921 |
aDataPackage->UnPackData( &failedMonitorEntries );
|
|
2922 |
// there were a problems with some entries,
|
|
2923 |
// Check failed entries exists and add succesful entries to main list
|
|
2924 |
if( failedMonitorEntries != NULL )
|
|
2925 |
{
|
|
2926 |
TRAP( err, iMBMSMonitoredList->ProcessEntriesL( failedMonitorEntries, iActionType ) );
|
|
2927 |
}
|
|
2928 |
else // There was a general error, don't add anything to main list
|
|
2929 |
{
|
|
2930 |
TRAP( err, iMBMSMonitoredList->ResetTempListL() );
|
|
2931 |
}
|
|
2932 |
}
|
|
2933 |
if( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
2934 |
{
|
|
2935 |
// If there was an error due to a function leaving, complete to the client with that error.
|
|
2936 |
if (err)
|
|
2937 |
{
|
|
2938 |
result = err;
|
|
2939 |
}
|
|
2940 |
//complete with error to client
|
|
2941 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, result );
|
|
2942 |
}
|
|
2943 |
|
|
2944 |
}
|
|
2945 |
|
|
2946 |
//----------------------------------------------------------------------------
|
|
2947 |
// CMmPacketServiceTsy::UpdateMbmsMonitorServiceListCancel
|
|
2948 |
// Completes update monitored service list request
|
|
2949 |
//----------------------------------------------------------------------------
|
|
2950 |
//
|
|
2951 |
TInt CMmPacketServiceTsy::UpdateMbmsMonitorServiceListCancel( TTsyReqHandle aTsyReqHandle )
|
|
2952 |
{
|
|
2953 |
TFLOGSTRING2( "TSY: CMmPacketServiceTsy::UpdateMbmsMonitorServiceListCancel ReqHandle %d", aTsyReqHandle );
|
|
2954 |
|
|
2955 |
if ( aTsyReqHandle != EMultimodePacketServiceReqHandleUnknown )
|
|
2956 |
{
|
|
2957 |
// Reset tsy request handle
|
|
2958 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePacketServiceUpdateMBMSMonitorServiceList );
|
|
2959 |
|
|
2960 |
// Complete request to client with KErrCancel
|
|
2961 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
2962 |
}
|
|
2963 |
|
|
2964 |
return KErrNone;
|
|
2965 |
}
|
|
2966 |
|
|
2967 |
|
|
2968 |
|
|
2969 |
//----------------------------------------------------------------------------
|
|
2970 |
// CMmPacketServiceTsy::GetMbmsMonitoredServicesPhase1L
|
|
2971 |
// Returns size of the monitored service list.
|
|
2972 |
//----------------------------------------------------------------------------
|
|
2973 |
//
|
|
2974 |
TInt CMmPacketServiceTsy::GetMbmsMonitoredServicesPhase1L(RMobilePhone::TClientId* aClient, TUint& aBufSize)
|
|
2975 |
{
|
|
2976 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetMbmsMonitoredServicesPhase1L called.");
|
|
2977 |
// Initialize ret value
|
|
2978 |
TInt ret( KErrNone );
|
|
2979 |
TInt leaveCode( KErrNone );
|
|
2980 |
|
|
2981 |
|
|
2982 |
if( !iMBMSMonitoredList )
|
|
2983 |
{
|
|
2984 |
// No current monitor servece list exist. Complete error.
|
|
2985 |
ReqCompleted( iTsyReqHandle, KErrNotFound );
|
|
2986 |
}
|
|
2987 |
else
|
|
2988 |
{
|
|
2989 |
// Get current size of monitor service list
|
|
2990 |
TRAP( leaveCode, ret = GetSizeOfMonitoredServiceListL( aClient, aBufSize ) );
|
|
2991 |
if (leaveCode == KErrNone)
|
|
2992 |
{
|
|
2993 |
leaveCode = ret;
|
|
2994 |
}
|
|
2995 |
if ( leaveCode != KErrNone )
|
|
2996 |
{
|
|
2997 |
ReqCompleted( iTsyReqHandle, leaveCode );
|
|
2998 |
}
|
|
2999 |
}
|
|
3000 |
|
|
3001 |
return leaveCode;
|
|
3002 |
}
|
|
3003 |
|
|
3004 |
// ---------------------------------------------------------------------------
|
|
3005 |
// CMmMBMSMonitoredList::GetSizeOfMonitoredServiceList
|
|
3006 |
// This function returns size of monitored servicelist.
|
|
3007 |
// ---------------------------------------------------------------------------
|
|
3008 |
//
|
|
3009 |
TInt CMmPacketServiceTsy::GetSizeOfMonitoredServiceListL(RMobilePhone::TClientId* aClient, TUint& aBufSize)
|
|
3010 |
{
|
|
3011 |
// read the list, store its content and then return size of this buffer to client
|
|
3012 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetSizeOfMonitoredServiceList called.");
|
|
3013 |
// create new list
|
|
3014 |
CPcktMbmsMonitoredServiceList* currentList=CPcktMbmsMonitoredServiceList::NewL();
|
|
3015 |
CleanupStack::PushL(currentList);
|
|
3016 |
RPacketService::TMbmsServiceAvailabilityV1 entry;
|
|
3017 |
|
|
3018 |
if (!iMBMSMonitoredList)
|
|
3019 |
{
|
|
3020 |
// create MBMS monitored service list
|
|
3021 |
iMBMSMonitoredList = CMmMBMSMonitoredList::NewL( this, iMaxMonitoredServices );
|
|
3022 |
}
|
|
3023 |
|
|
3024 |
// fill TMbmsServiceAvailabilityV1 information
|
|
3025 |
for (TInt i=0; i < iMBMSMonitoredList->ServiceList()->Enumerate(); i++)
|
|
3026 |
{
|
|
3027 |
|
|
3028 |
entry = iMBMSMonitoredList->ServiceList()->GetEntryL(i);
|
|
3029 |
// Add the entry into the list, at the next empty location
|
|
3030 |
currentList->AddEntryL(entry);
|
|
3031 |
}
|
|
3032 |
// Store the streamed list and the client ID
|
|
3033 |
CListReadAllAttempt* read = CListReadAllAttempt::NewL( aClient );
|
|
3034 |
CleanupStack::PushL(read);
|
|
3035 |
|
|
3036 |
read->iListBuf = currentList->StoreLC();
|
|
3037 |
CleanupStack::Pop(); // pop the CBufFlat allocated by StoreLC; iListBuf will be destroy by read destructor
|
|
3038 |
|
|
3039 |
iGetMbmsMonitoredServiceLists->AppendL(read);
|
|
3040 |
CleanupStack::Pop(); // pop the CListReadAllAttempt; the read will be destroy in phase 2
|
|
3041 |
|
|
3042 |
// return the CBufFlat's size to client
|
|
3043 |
aBufSize=(read->iListBuf)->Size();
|
|
3044 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::GetSizeOfMonitoredServiceList: size=%d",aBufSize);
|
|
3045 |
// Complete first phase of list retrieval
|
|
3046 |
ReqCompleted( iTsyReqHandle, KErrNone );
|
|
3047 |
CleanupStack::PopAndDestroy( currentList ); // Pop & destroy list
|
|
3048 |
return KErrNone;
|
|
3049 |
}
|
|
3050 |
|
|
3051 |
//----------------------------------------------------------------------------
|
|
3052 |
// CMmPacketServiceTsy::GetMbmsMonitoredServicesPhase2
|
|
3053 |
// Returns monitored service list.
|
|
3054 |
//----------------------------------------------------------------------------
|
|
3055 |
//
|
|
3056 |
TInt CMmPacketServiceTsy::GetMbmsMonitoredServicesPhase2(RMobilePhone::TClientId* aClient, TDes8* aBuf)
|
|
3057 |
{
|
|
3058 |
// Initialize ret value
|
|
3059 |
TInt ret( KErrNotFound );
|
|
3060 |
|
|
3061 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetMbmsMonitoredServicesPhase2 called");
|
|
3062 |
CListReadAllAttempt* read=NULL;
|
|
3063 |
|
|
3064 |
// Find the get Mbms monitored services from this client
|
|
3065 |
for (TInt i=0; i<iGetMbmsMonitoredServiceLists->Count(); ++i)
|
|
3066 |
{
|
|
3067 |
// Check that session and client are rigth ones
|
|
3068 |
read = iGetMbmsMonitoredServiceLists->At(i);
|
|
3069 |
|
|
3070 |
if ((read->iClient.iSessionHandle == aClient->iSessionHandle) &&
|
|
3071 |
(read->iClient.iSubSessionHandle == aClient->iSubSessionHandle))
|
|
3072 |
{
|
|
3073 |
TPtr8 bufPtr((read->iListBuf)->Ptr(0));
|
|
3074 |
|
|
3075 |
|
|
3076 |
if ( bufPtr.Length() <= aBuf->Length() )
|
|
3077 |
{
|
|
3078 |
// Copy the streamed list to the client
|
|
3079 |
// Set pointer to list buffer
|
|
3080 |
aBuf->Copy( bufPtr );
|
|
3081 |
ret = KErrNone;
|
|
3082 |
}
|
|
3083 |
else
|
|
3084 |
{
|
|
3085 |
ret = KErrArgument;
|
|
3086 |
}
|
|
3087 |
|
|
3088 |
// Delete read and item from internal array
|
|
3089 |
delete read;
|
|
3090 |
iGetMbmsMonitoredServiceLists->Delete(i);
|
|
3091 |
|
|
3092 |
// Complete request
|
|
3093 |
ReqCompleted(iTsyReqHandle, ret);
|
|
3094 |
|
|
3095 |
return ret;
|
|
3096 |
}
|
|
3097 |
}
|
|
3098 |
|
|
3099 |
// Doesn't found the matching client for read all phase 1
|
|
3100 |
return ret;
|
|
3101 |
}
|
|
3102 |
|
|
3103 |
//-----------------------------------------------------------------------------
|
|
3104 |
// TInt CMmPacketServiceTsy::GetMbmsMonitoredServicesPhase1LCancel
|
|
3105 |
// Cancels Set Always On request
|
|
3106 |
//-----------------------------------------------------------------------------
|
|
3107 |
//
|
|
3108 |
TInt CMmPacketServiceTsy::GetMbmsMonitoredServicesCancel( TTsyReqHandle aTsyReqHandle )
|
|
3109 |
{
|
|
3110 |
|
|
3111 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetMbmsMonitoredServicesPhase1LCancel called");
|
|
3112 |
// Remove the read all attempt
|
|
3113 |
CListReadAllAttempt* read = NULL;
|
|
3114 |
|
|
3115 |
// Check that read all array does not contain any data.
|
|
3116 |
// If it does, delete it.
|
|
3117 |
// NOTE: functions request mode "Flow control obeyed" currently blocks
|
|
3118 |
// request so that only one client can request data at the time.
|
|
3119 |
// Therefore, loop-functionality is not needed.
|
|
3120 |
if ( iGetMbmsMonitoredServiceLists->Count() > 0 )
|
|
3121 |
{
|
|
3122 |
read = iGetMbmsMonitoredServiceLists->At( 0 );
|
|
3123 |
delete read;
|
|
3124 |
iGetMbmsMonitoredServiceLists->Delete( 0 );
|
|
3125 |
}
|
|
3126 |
|
|
3127 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
3128 |
|
|
3129 |
return KErrNone;
|
|
3130 |
}
|
|
3131 |
|
|
3132 |
//----------------------------------------------------------------------------
|
|
3133 |
// CMmPacketServiceTsy::MBMSContextList
|
|
3134 |
// Returns pointer to MBMS context list.
|
|
3135 |
//----------------------------------------------------------------------------
|
|
3136 |
//
|
|
3137 |
CMmMBMSContextList* CMmPacketServiceTsy::MBMSContextList()
|
|
3138 |
{
|
|
3139 |
return iMBMSContextList;
|
|
3140 |
}
|
|
3141 |
|
|
3142 |
|
|
3143 |
//----------------------------------------------------------------------------
|
|
3144 |
// CMmPacketServiceTsy::OpenNewObjectL
|
|
3145 |
// Creates new Context object and returns a pointer to it.
|
|
3146 |
//----------------------------------------------------------------------------
|
|
3147 |
//
|
|
3148 |
CTelObject* CMmPacketServiceTsy::OpenNewObjectL(
|
|
3149 |
TDes& aNewName )
|
|
3150 |
{
|
|
3151 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::OpenNewObjectL. %S", &aNewName );
|
|
3152 |
CTelObject* newContext = NULL;
|
|
3153 |
TUint8 proxyId( 0 );
|
|
3154 |
TInt ret( KErrNone );
|
|
3155 |
|
|
3156 |
if(0 == aNewName.Compare(KMBMSContextName))
|
|
3157 |
{
|
|
3158 |
ret = iMBMSContextList->GenerateNewContextName( aNewName, proxyId, iMaxActiveServices );
|
|
3159 |
|
|
3160 |
if( KErrNone != ret )
|
|
3161 |
{
|
|
3162 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::OpenNewObjectL. Mbms Leaves with: %d", ret );
|
|
3163 |
User::Leave( ret );
|
|
3164 |
}
|
|
3165 |
|
|
3166 |
CMmMBMSContextTsy* context = CMmMBMSContextTsy::NewL( this, aNewName, proxyId );
|
|
3167 |
ret = iMBMSContextList->AddObject( context );
|
|
3168 |
if( KErrNone != ret )
|
|
3169 |
{
|
|
3170 |
// Created context couldn't save.
|
|
3171 |
// Call Close() to context to remove it completely
|
|
3172 |
context->Close();
|
|
3173 |
context = NULL;
|
|
3174 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::OpenNewObjectL. Mbms Leaves with: %d", ret );
|
|
3175 |
User::Leave( ret );
|
|
3176 |
}
|
|
3177 |
else
|
|
3178 |
{
|
|
3179 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::OpenNewObjectL. New MBMS Context Name: %S Proxy Id: %d",&aNewName, proxyId );
|
|
3180 |
newContext = context;
|
|
3181 |
}
|
|
3182 |
}
|
|
3183 |
else
|
|
3184 |
{
|
|
3185 |
ret = iPacketContextList->GenerateNewContextName( aNewName, proxyId );
|
|
3186 |
|
|
3187 |
if ( KErrNone != ret )
|
|
3188 |
{
|
|
3189 |
// Reason to leave is that maximum number of Contexts already exists.
|
|
3190 |
// Leaving from here requires that TSY is configurated with max number
|
|
3191 |
// of context supported by this phone ( value KMmMaxNumberOfContexts )
|
|
3192 |
ret = CMmCommonStaticUtility::EpocErrorCode(
|
|
3193 |
KErrOverflow, KErrUmtsMaxNumOfContextExceededByPhone );
|
|
3194 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::OpenNewObjectL. Leaves with: %d", ret );
|
|
3195 |
User::Leave( ret );
|
|
3196 |
}
|
|
3197 |
CMmPacketContextTsy* context = CMmPacketContextTsy::NewL( this, iHostCID, aNewName, proxyId );
|
|
3198 |
|
|
3199 |
// reset cotext name
|
|
3200 |
iHostCID.Zero();
|
|
3201 |
ret = iPacketContextList->AddObject( context, proxyId, 0x00, aNewName );
|
|
3202 |
if( KErrNone != ret )
|
|
3203 |
{
|
|
3204 |
// Created context couldn't save.
|
|
3205 |
// Call Close() to context to remove it completely
|
|
3206 |
context->Close();
|
|
3207 |
context = NULL;
|
|
3208 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::OpenNewObjectL. Leaves with: %d", ret );
|
|
3209 |
User::Leave( ret );
|
|
3210 |
}
|
|
3211 |
else
|
|
3212 |
{
|
|
3213 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::OpenNewObjectL. New Context Name: %S Proxy Id: %d",&aNewName, proxyId );
|
|
3214 |
newContext = context;
|
|
3215 |
}
|
|
3216 |
}
|
|
3217 |
return newContext;
|
|
3218 |
}
|
|
3219 |
|
|
3220 |
//----------------------------------------------------------------------------
|
|
3221 |
// CMmPacketServiceTsy::OpenNewObjectByNameL
|
|
3222 |
// Returns context object defined in parameter aName.
|
|
3223 |
//----------------------------------------------------------------------------
|
|
3224 |
//
|
|
3225 |
CTelObject* CMmPacketServiceTsy::OpenNewObjectByNameL(
|
|
3226 |
const TDesC& aName )
|
|
3227 |
{
|
|
3228 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::OpenNewObjectByNameL. Context Name: %S", &aName );
|
|
3229 |
|
|
3230 |
// length of object's name cannot be over 16 chars
|
|
3231 |
if ( 16 < aName.Length() )
|
|
3232 |
{
|
|
3233 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::OpenNewObjectByNameL. Leaves with: %d", KErrOverflow );
|
|
3234 |
User::Leave( KErrOverflow );
|
|
3235 |
}
|
|
3236 |
|
|
3237 |
const TInfoName mmPacketContextName( aName );
|
|
3238 |
CMmPacketContextTsy* mmPacketContext = NULL;
|
|
3239 |
|
|
3240 |
if ( mmPacketContextName.Compare( KStringExternal ) == 0 )
|
|
3241 |
{
|
|
3242 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::OpenNewObjectByNameL :Open Existing Dial-up Object." );
|
|
3243 |
mmPacketContext = iDialUpContext;
|
|
3244 |
}
|
|
3245 |
else if ( mmPacketContextName.Compare( KStringExternal2 ) == 0 )
|
|
3246 |
{
|
|
3247 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::OpenNewObjectByNameL :Open Existing Secondary Dial-up Object." );
|
|
3248 |
mmPacketContext = iSecondaryDialUpContext;
|
|
3249 |
}
|
|
3250 |
else
|
|
3251 |
{
|
|
3252 |
mmPacketContext =
|
|
3253 |
iPacketContextList->PacketContextByName( &mmPacketContextName );
|
|
3254 |
}
|
|
3255 |
|
|
3256 |
// If not found, Leaves
|
|
3257 |
if ( NULL == mmPacketContext )
|
|
3258 |
{
|
|
3259 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::OpenNewObjectByNameL. Leaves with: %d", KErrNotFound );
|
|
3260 |
User::Leave( KErrNotFound );
|
|
3261 |
}
|
|
3262 |
|
|
3263 |
return mmPacketContext;
|
|
3264 |
}
|
|
3265 |
|
|
3266 |
//----------------------------------------------------------------------------
|
|
3267 |
// CMmPacketServiceTsy::PacketContextList
|
|
3268 |
// Returns pointer to the context list object.
|
|
3269 |
//----------------------------------------------------------------------------
|
|
3270 |
//
|
|
3271 |
CMmPacketContextList* CMmPacketServiceTsy::PacketContextList()
|
|
3272 |
{
|
|
3273 |
return iPacketContextList;
|
|
3274 |
}
|
|
3275 |
|
|
3276 |
//----------------------------------------------------------------------------
|
|
3277 |
// CMmPacketServiceTsy::ServiceStatus
|
|
3278 |
// Returns current status of Packet Service.
|
|
3279 |
//----------------------------------------------------------------------------
|
|
3280 |
//
|
|
3281 |
RPacketService::TStatus CMmPacketServiceTsy::ServiceStatus() const
|
|
3282 |
{
|
|
3283 |
return iInternalSavedData.iServiceStatus;
|
|
3284 |
}
|
|
3285 |
//----------------------------------------------------------------------------
|
|
3286 |
// CMmPacketServiceTsy::DialUpContext
|
|
3287 |
// Returns externally created dial-up context.
|
|
3288 |
//----------------------------------------------------------------------------
|
|
3289 |
//
|
|
3290 |
CMmPacketContextTsy* CMmPacketServiceTsy::DialUpContext(
|
|
3291 |
const TInfoName aContextName )
|
|
3292 |
{
|
|
3293 |
|
|
3294 |
CMmPacketContextTsy* mmpacketContext = NULL;
|
|
3295 |
|
|
3296 |
if ( aContextName.Compare( KStringExternal ) == 0 )
|
|
3297 |
{
|
|
3298 |
mmpacketContext = iDialUpContext;
|
|
3299 |
}
|
|
3300 |
|
|
3301 |
else if ( aContextName.Compare( KStringExternal2 ) == 0 )
|
|
3302 |
{
|
|
3303 |
mmpacketContext = iSecondaryDialUpContext;
|
|
3304 |
}
|
|
3305 |
|
|
3306 |
return mmpacketContext;
|
|
3307 |
}
|
|
3308 |
|
|
3309 |
//----------------------------------------------------------------------------
|
|
3310 |
// CMmPacketServiceTsy::ResetPointerToDialUpContex
|
|
3311 |
// Resets pointer to dial-up context.
|
|
3312 |
//----------------------------------------------------------------------------
|
|
3313 |
//
|
|
3314 |
void CMmPacketServiceTsy::ResetPointerToDialUpContext(
|
|
3315 |
const TInfoName aContextName )
|
|
3316 |
{
|
|
3317 |
|
|
3318 |
if ( aContextName.Compare( KStringExternal ) == 0 )
|
|
3319 |
{
|
|
3320 |
iDialUpContext = NULL;
|
|
3321 |
}
|
|
3322 |
|
|
3323 |
else if ( aContextName.Compare( KStringExternal2 ) == 0 )
|
|
3324 |
{
|
|
3325 |
iSecondaryDialUpContext = NULL;
|
|
3326 |
}
|
|
3327 |
}
|
|
3328 |
|
|
3329 |
#ifdef REQHANDLE_TIMER
|
|
3330 |
|
|
3331 |
//---------------------------------------------------------------------------
|
|
3332 |
// CMmPacketServiceTsy::PhoneTsy
|
|
3333 |
// Returns pointer to the phone tsy object.
|
|
3334 |
//---------------------------------------------------------------------------
|
|
3335 |
//
|
|
3336 |
CMmPhoneTsy* CMmPacketServiceTsy::PhoneTsy()
|
|
3337 |
{
|
|
3338 |
return iMmPhone;
|
|
3339 |
}
|
|
3340 |
|
|
3341 |
//----------------------------------------------------------------------------
|
|
3342 |
// CMmPacketServiceTsy::SetTypeOfResponse
|
|
3343 |
// Sets the type of response for a given Handle.
|
|
3344 |
// Automatic mode includes an automatic response in case of non response from
|
|
3345 |
// the DOS in a specified time.
|
|
3346 |
//----------------------------------------------------------------------------
|
|
3347 |
//
|
|
3348 |
void CMmPacketServiceTsy::SetTypeOfResponse(
|
|
3349 |
const TInt aReqHandleType )
|
|
3350 |
{
|
|
3351 |
|
|
3352 |
TInt timeOut( 0 );
|
|
3353 |
|
|
3354 |
switch ( aReqHandleType )
|
|
3355 |
{
|
|
3356 |
case EMultimodePacketServiceAttach:
|
|
3357 |
timeOut = KMmPacketServiceAttachTimeOut;
|
|
3358 |
break;
|
|
3359 |
case EMultimodePacketServiceDetach:
|
|
3360 |
timeOut = KMmPacketServiceDetachTimeOut;
|
|
3361 |
break;
|
|
3362 |
case EMultimodePacketServiceGetNtwkRegStatus:
|
|
3363 |
timeOut = KMmPacketServiceGetNtwkRegStatusTimeOut;
|
|
3364 |
break;
|
|
3365 |
case EMultimodePacketServiceSetPreferredBearer:
|
|
3366 |
timeOut = KMmPacketServiceSetPreferredBearerTimeOut;
|
|
3367 |
break;
|
|
3368 |
case EMultimodePacketServiceRejectActivationRequest:
|
|
3369 |
timeOut = KMmPacketServiceRejectActivationRequest;
|
|
3370 |
break;
|
|
3371 |
case EMultimodePacketServiceSetAttachMode:
|
|
3372 |
timeOut = KMmPacketServiceSetAttachModeTimeOut;
|
|
3373 |
break;
|
|
3374 |
case EMultimodePacketServiceGetAttachMode:
|
|
3375 |
timeOut = KMmPacketServiceGetAttachModeTimeOut;
|
|
3376 |
break;
|
|
3377 |
case EMultimodePacketServiceSetDefaultContextParams:
|
|
3378 |
timeOut = KMmPacketSetDefaultContextParamsTimeOut;
|
|
3379 |
break;
|
|
3380 |
case EMultimodePacketServiceGetMBMSStatus:
|
|
3381 |
timeOut = KMmPacketServiceGetMbmsNetworkServiceStatusTimeOut;
|
|
3382 |
break;
|
|
3383 |
case EMultimodePacketServiceUpdateMBMSMonitorServiceList:
|
|
3384 |
timeOut = KMmPacketServiceUpdateMbmsMonitorServiceListTimeOut;
|
|
3385 |
break;
|
|
3386 |
// Can't use timer:
|
|
3387 |
// - all notifications
|
|
3388 |
//case EMultimodePacketServiceNotifyNtwkRegStatusChange:
|
|
3389 |
//case EMultimodePacketServiceNotifyContextActivationRequested:
|
|
3390 |
//case EMultimodePacketServiceNotifyContextAdded:
|
|
3391 |
//case EMultimodePacketServiceNotifyDynamicCapsChange:
|
|
3392 |
//case EMultimodePacketServiceNotifyMSClassChange:
|
|
3393 |
//case EMultimodePacketServiceNotifyStatusChange:
|
|
3394 |
|
|
3395 |
default:
|
|
3396 |
// Does not use timer
|
|
3397 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
3398 |
aReqHandleType, iTsyReqHandle );
|
|
3399 |
break;
|
|
3400 |
}
|
|
3401 |
|
|
3402 |
if ( 0 < timeOut )
|
|
3403 |
{
|
|
3404 |
// The timeout parameter is given in seconds.
|
|
3405 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
3406 |
aReqHandleType, iTsyReqHandle, timeOut );
|
|
3407 |
}
|
|
3408 |
}
|
|
3409 |
|
|
3410 |
//----------------------------------------------------------------------------
|
|
3411 |
// CMmPacketServiceTsy::Complete
|
|
3412 |
// Completes the request due timer expiration
|
|
3413 |
//----------------------------------------------------------------------------
|
|
3414 |
//
|
|
3415 |
void CMmPacketServiceTsy::Complete(
|
|
3416 |
const CTelObject* const aObject,
|
|
3417 |
const TInt aReqHandleType,
|
|
3418 |
const TInt aError )
|
|
3419 |
{
|
|
3420 |
|
|
3421 |
if ( this == aObject )
|
|
3422 |
{
|
|
3423 |
// Call service's Complete()
|
|
3424 |
Complete( aReqHandleType, aError );
|
|
3425 |
}
|
|
3426 |
else if ( aObject == iDialUpContext && NULL != iDialUpContext )
|
|
3427 |
{
|
|
3428 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::OpenNewObjectByNameL :Complete Dial-up Object Request." );
|
|
3429 |
|
|
3430 |
iDialUpContext->Complete( aReqHandleType, aError );
|
|
3431 |
}
|
|
3432 |
else if ( aObject == iSecondaryDialUpContext
|
|
3433 |
&& NULL != iSecondaryDialUpContext )
|
|
3434 |
{
|
|
3435 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::OpenNewObjectByNameL :Complete Dial-up Object Request." );
|
|
3436 |
|
|
3437 |
iSecondaryDialUpContext->Complete( aReqHandleType, aError );
|
|
3438 |
|
|
3439 |
}
|
|
3440 |
else
|
|
3441 |
{
|
|
3442 |
|
|
3443 |
CMmPacketContextTsy* context;
|
|
3444 |
|
|
3445 |
const TInt numberOfContexts( iPacketContextList->NumberOfContexts() );
|
|
3446 |
|
|
3447 |
// Check if the object is a Context object
|
|
3448 |
for ( TInt i = 0; i < numberOfContexts; i++ )
|
|
3449 |
{
|
|
3450 |
|
|
3451 |
// Get context object
|
|
3452 |
context = iPacketContextList->PacketContextByIndex( i );
|
|
3453 |
|
|
3454 |
if (context == NULL)
|
|
3455 |
{
|
|
3456 |
continue;
|
|
3457 |
}
|
|
3458 |
// Check if the current context is the object that we are
|
|
3459 |
// trying to find
|
|
3460 |
if ( context == aObject )
|
|
3461 |
{
|
|
3462 |
// Call context's Complete() method
|
|
3463 |
context->Complete( aReqHandleType, aError );
|
|
3464 |
// Object found, break
|
|
3465 |
return ;
|
|
3466 |
}
|
|
3467 |
|
|
3468 |
else if ( context->PacketQoSTsy() == aObject )
|
|
3469 |
{
|
|
3470 |
// Call qos's Complete() method
|
|
3471 |
context->PacketQoSTsy()->Complete( aReqHandleType, aError );
|
|
3472 |
|
|
3473 |
// Object found, break
|
|
3474 |
return ;
|
|
3475 |
}
|
|
3476 |
}
|
|
3477 |
|
|
3478 |
CMmMBMSContextTsy* mbms;
|
|
3479 |
|
|
3480 |
const TInt numberOfMbms( iMBMSContextList->GetNumberOfObjects() );
|
|
3481 |
|
|
3482 |
for( TInt i = 0; i < numberOfMbms; i++ )
|
|
3483 |
{
|
|
3484 |
mbms = MBMSContextList( )->ContextByIndex( i );
|
|
3485 |
|
|
3486 |
// Check if the current context is the object that we are
|
|
3487 |
// trying to find
|
|
3488 |
if ( mbms == aObject )
|
|
3489 |
{
|
|
3490 |
// Call context's Complete() method
|
|
3491 |
mbms->Complete( aReqHandleType, aError );
|
|
3492 |
// Object found, break
|
|
3493 |
return ;
|
|
3494 |
}
|
|
3495 |
}
|
|
3496 |
}
|
|
3497 |
}
|
|
3498 |
|
|
3499 |
//----------------------------------------------------------------------------
|
|
3500 |
// CMmPacketServiceTsy::Complete
|
|
3501 |
// Completes the request due timer expiration.
|
|
3502 |
//----------------------------------------------------------------------------
|
|
3503 |
|
|
3504 |
void CMmPacketServiceTsy::Complete(
|
|
3505 |
const TInt aReqHandleType,
|
|
3506 |
const TInt aError )
|
|
3507 |
{
|
|
3508 |
// All possible TSY req handle types are listed in the
|
|
3509 |
// switch case below.
|
|
3510 |
switch ( aReqHandleType )
|
|
3511 |
{
|
|
3512 |
|
|
3513 |
case EMultimodePacketServiceAttach:
|
|
3514 |
CMmPacketServiceTsy::CompleteAttach( aError );
|
|
3515 |
break;
|
|
3516 |
case EMultimodePacketServiceDetach:
|
|
3517 |
TRAP_IGNORE( CMmPacketServiceTsy::CompleteDetachL( aError ));
|
|
3518 |
break;
|
|
3519 |
case EMultimodePacketServiceGetNtwkRegStatus:
|
|
3520 |
CMmPacketServiceTsy::CompleteGetNtwkRegStatus(
|
|
3521 |
RPacketService::EUnknown, aError );
|
|
3522 |
break;
|
|
3523 |
case EMultimodePacketServiceSetPreferredBearer:
|
|
3524 |
CMmPacketServiceTsy::CompleteSetPreferredBearer( aError );
|
|
3525 |
break;
|
|
3526 |
case EMultimodePacketServiceSetAttachMode:
|
|
3527 |
CMmPacketServiceTsy::CompleteSetAttachMode( aError );
|
|
3528 |
break;
|
|
3529 |
case EMultimodePacketServiceSetDefaultContextParams:
|
|
3530 |
CMmPacketServiceTsy::CompleteSetDefaultContextParams( aError );
|
|
3531 |
break;
|
|
3532 |
case EMultimodePacketServiceGetMBMSStatus:
|
|
3533 |
CMmPacketServiceTsy::CompleteGetMbmsNetworkServiceStatus( NULL, aError );
|
|
3534 |
break;
|
|
3535 |
case EMultimodePacketServiceEnumerateMbmsActiveServices:
|
|
3536 |
CMmPacketServiceTsy::CompleteEnumerateMbmsActiveServiceList( NULL, aError );
|
|
3537 |
break;
|
|
3538 |
case EMultimodePacketServiceUpdateMBMSMonitorServiceList:
|
|
3539 |
CMmPacketServiceTsy::CompleteUpdateMbmsMonitorServiceList( NULL, aError );
|
|
3540 |
break;
|
|
3541 |
|
|
3542 |
// Can't use timer:
|
|
3543 |
// - all notifications
|
|
3544 |
//case EMultimodePacketServiceNotifyNtwkRegStatusChange:
|
|
3545 |
//case EMultimodePacketServiceNotifyContextActivationRequested:
|
|
3546 |
//case EMultimodePacketServiceNotifyContextAdded:
|
|
3547 |
//case EMultimodePacketServiceNotifyDynamicCapsChange:
|
|
3548 |
//case EMultimodePacketServiceNotifyMSClassChange:
|
|
3549 |
//case EMultimodePacketServiceNotifyStatusChange:
|
|
3550 |
|
|
3551 |
default:
|
|
3552 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandleStore->
|
|
3553 |
ResetTsyReqHandle( aReqHandleType ), aError );
|
|
3554 |
break;
|
|
3555 |
}
|
|
3556 |
}
|
|
3557 |
#endif // REQHANDLE_TIMER
|
|
3558 |
|
|
3559 |
|
|
3560 |
#ifdef TF_LOGGING_ENABLED
|
|
3561 |
|
|
3562 |
|
|
3563 |
//----------------------------------------------------------------------------
|
|
3564 |
// CMmPacketServiceTsy::ReqCompleted
|
|
3565 |
// Overloads CTelObject::ReqCompleted for logging purposes.
|
|
3566 |
// Prints the aTsyReqHandle and aError variable in the log file and then
|
|
3567 |
// calls CTelObject::ReqCompleted.
|
|
3568 |
//----------------------------------------------------------------------------
|
|
3569 |
//
|
|
3570 |
void CMmPacketServiceTsy::ReqCompleted(
|
|
3571 |
const TTsyReqHandle aTsyReqHandle,
|
|
3572 |
const TInt aError )
|
|
3573 |
{
|
|
3574 |
TFLOGSTRING3("TSY: CMmPacketServiceTsy::Request Completed. TSY Req Handle: %d Error:%d", aTsyReqHandle, aError );
|
|
3575 |
|
|
3576 |
CTelObject::ReqCompleted( aTsyReqHandle, aError );
|
|
3577 |
}
|
|
3578 |
|
|
3579 |
#endif // TF_LOGGING_ENABLED
|
|
3580 |
|
|
3581 |
|
|
3582 |
//----------------------------------------------------------------------------
|
|
3583 |
// CMmPacketServiceTsy::PrepareOpenSecondary
|
|
3584 |
// Prepares to open secondary from given primary context
|
|
3585 |
// Next Context that client wants to open is secondary context. Secondary
|
|
3586 |
// context copies configuration from context given by client
|
|
3587 |
//----------------------------------------------------------------------------
|
|
3588 |
//
|
|
3589 |
TInt CMmPacketServiceTsy::PrepareOpenSecondary(
|
|
3590 |
TDes16* aPrimaryContextName )
|
|
3591 |
{
|
|
3592 |
|
|
3593 |
if ( aPrimaryContextName->Length() <= iHostCID.MaxLength() )
|
|
3594 |
{
|
|
3595 |
// Check if primary context exists; return KErrArgument if it doesn't
|
|
3596 |
TInfoName primaryContextName = *aPrimaryContextName;
|
|
3597 |
CMmPacketContextTsy* mmPacketContextTsy = iPacketContextList->PacketContextByName(&primaryContextName );
|
|
3598 |
|
|
3599 |
if( NULL == mmPacketContextTsy )
|
|
3600 |
{
|
|
3601 |
return KErrArgument;
|
|
3602 |
}
|
|
3603 |
|
|
3604 |
iHostCID = *aPrimaryContextName;
|
|
3605 |
// Complete request with ret
|
|
3606 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
3607 |
return KErrNone;
|
|
3608 |
}
|
|
3609 |
|
|
3610 |
return KErrArgument;
|
|
3611 |
}
|
|
3612 |
|
|
3613 |
//----------------------------------------------------------------------------
|
|
3614 |
// CMmPacketServiceTsy::EnumerateNifs
|
|
3615 |
// Method returns number of network interfaces
|
|
3616 |
// call method EnumerateNifs from CMmPacketContextList
|
|
3617 |
// complete request to client
|
|
3618 |
// return KErrNone
|
|
3619 |
//----------------------------------------------------------------------------
|
|
3620 |
//
|
|
3621 |
TInt CMmPacketServiceTsy::EnumerateNifs(
|
|
3622 |
TInt* aCount )
|
|
3623 |
{
|
|
3624 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::EnumerateNifs." );
|
|
3625 |
|
|
3626 |
iPacketContextList->EnumerateNifs( aCount );
|
|
3627 |
|
|
3628 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
3629 |
|
|
3630 |
return KErrNone;
|
|
3631 |
}
|
|
3632 |
|
|
3633 |
//----------------------------------------------------------------------------
|
|
3634 |
// CMmPacketServiceTsy::GetNifInfo
|
|
3635 |
// Return information about network interface
|
|
3636 |
//----------------------------------------------------------------------------
|
|
3637 |
//
|
|
3638 |
TInt CMmPacketServiceTsy::GetNifInfo(
|
|
3639 |
TInt* aIndex,
|
|
3640 |
RPacketService::TNifInfoV2* aNifInfoV2 )
|
|
3641 |
{
|
|
3642 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetNifInfo." );
|
|
3643 |
|
|
3644 |
TInt ret = iPacketContextList->GetNifInfo( aIndex, aNifInfoV2 );
|
|
3645 |
|
|
3646 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, ret );
|
|
3647 |
|
|
3648 |
return KErrNone;
|
|
3649 |
}
|
|
3650 |
|
|
3651 |
//----------------------------------------------------------------------------
|
|
3652 |
// CMmPacketServiceTsy::EnumerateContextsInNif
|
|
3653 |
// Returns number of contexts in Nif
|
|
3654 |
// get existingContextName from parameter aExistingContextName
|
|
3655 |
// call method EnumerateContextsInNif from CMmPacketContextList
|
|
3656 |
// complete request to client
|
|
3657 |
// return KErrNone
|
|
3658 |
//----------------------------------------------------------------------------
|
|
3659 |
//
|
|
3660 |
TInt CMmPacketServiceTsy::EnumerateContextsInNif(
|
|
3661 |
TDesC* aExistingContextName,
|
|
3662 |
TInt* aCount )
|
|
3663 |
{
|
|
3664 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::EnumerateContextsInNif." );
|
|
3665 |
|
|
3666 |
TInt ret = KErrNone;
|
|
3667 |
if (aExistingContextName->Length() > KMaxInfoName)
|
|
3668 |
{
|
|
3669 |
ret = KErrArgument;
|
|
3670 |
}
|
|
3671 |
else
|
|
3672 |
{
|
|
3673 |
TInfoName existingContextName = *aExistingContextName;
|
|
3674 |
|
|
3675 |
iPacketContextList->EnumerateContextsInNif( existingContextName, aCount );
|
|
3676 |
|
|
3677 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
3678 |
}
|
|
3679 |
|
|
3680 |
return ret;
|
|
3681 |
}
|
|
3682 |
|
|
3683 |
//----------------------------------------------------------------------------
|
|
3684 |
// CMmPacketServiceTsy::GetContextNameInNif
|
|
3685 |
// Returns name of context in network interface
|
|
3686 |
//----------------------------------------------------------------------------
|
|
3687 |
//
|
|
3688 |
TInt CMmPacketServiceTsy::GetContextNameInNif(
|
|
3689 |
RPacketService::TContextNameInNif* aContextNameInNif,
|
|
3690 |
TDes* aContextName )
|
|
3691 |
{
|
|
3692 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetContextNameInNif." );
|
|
3693 |
|
|
3694 |
TInt ret = iPacketContextList->GetContextNameInNif( aContextNameInNif,
|
|
3695 |
aContextName );
|
|
3696 |
|
|
3697 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, ret );
|
|
3698 |
|
|
3699 |
return KErrNone;
|
|
3700 |
}
|
|
3701 |
|
|
3702 |
//----------------------------------------------------------------------------
|
|
3703 |
// CMmPacketServiceTsy::SetDefaultContextParams
|
|
3704 |
// Sets default context parameters
|
|
3705 |
//----------------------------------------------------------------------------
|
|
3706 |
//
|
|
3707 |
TInt CMmPacketServiceTsy::SetDefaultContextParamsL(
|
|
3708 |
const TDataPackage& aPackage )
|
|
3709 |
{
|
|
3710 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::SetDefaultContextParamsL." );
|
|
3711 |
|
|
3712 |
TInt ret(KErrServerBusy);
|
|
3713 |
|
|
3714 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->GetTsyReqHandle(
|
|
3715 |
EMultimodePacketServiceSetDefaultContextParams ) );
|
|
3716 |
|
|
3717 |
if ( EMultimodePacketServiceReqHandleUnknown == reqHandle )
|
|
3718 |
{
|
|
3719 |
ret = iMmPacketServiceGsmWcdmaExt->
|
|
3720 |
SetDefaultContextParamsL( aPackage );
|
|
3721 |
|
|
3722 |
if ( KErrNone == ret )
|
|
3723 |
{
|
|
3724 |
// Set req handle
|
|
3725 |
iReqHandleType = EMultimodePacketServiceSetDefaultContextParams;
|
|
3726 |
}
|
|
3727 |
}
|
|
3728 |
|
|
3729 |
return ret;
|
|
3730 |
}
|
|
3731 |
|
|
3732 |
//----------------------------------------------------------------------------
|
|
3733 |
// CMmPacketServiceTsy::CompleteSetDefaultContextParams
|
|
3734 |
// Completes call SetDefaultContextParameters
|
|
3735 |
//----------------------------------------------------------------------------
|
|
3736 |
//
|
|
3737 |
void CMmPacketServiceTsy::CompleteSetDefaultContextParams(
|
|
3738 |
TInt aCause )
|
|
3739 |
{
|
|
3740 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteSetDefaultContextParams. aCause: %d", aCause );
|
|
3741 |
|
|
3742 |
// Reset request handle. Returns the deleted request handle
|
|
3743 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
3744 |
EMultimodePacketServiceSetDefaultContextParams ) );
|
|
3745 |
|
|
3746 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
3747 |
{
|
|
3748 |
// Complete the client request
|
|
3749 |
CMmPacketServiceTsy::ReqCompleted( reqHandle, aCause );
|
|
3750 |
}
|
|
3751 |
}
|
|
3752 |
|
|
3753 |
//----------------------------------------------------------------------------
|
|
3754 |
// CMmPacketServiceTsy::GetDefaultContextParams
|
|
3755 |
// Gets default context parameters
|
|
3756 |
//----------------------------------------------------------------------------
|
|
3757 |
//
|
|
3758 |
TInt CMmPacketServiceTsy::GetDefaultContextParams(
|
|
3759 |
TPacketDataConfigBase* aContextConfig )
|
|
3760 |
{
|
|
3761 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GetDefaultContextParams." );
|
|
3762 |
|
|
3763 |
TInt ret = iMmPacketServiceGsmWcdmaExt->GetDefaultContextParams(
|
|
3764 |
aContextConfig );
|
|
3765 |
|
|
3766 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, ret );
|
|
3767 |
|
|
3768 |
return KErrNone;
|
|
3769 |
}
|
|
3770 |
|
|
3771 |
//----------------------------------------------------------------------------
|
|
3772 |
// CMmPacketServiceTsy::IsActivationAllowed
|
|
3773 |
// Returns true if Packet Data is currently allowed
|
|
3774 |
//----------------------------------------------------------------------------
|
|
3775 |
//
|
|
3776 |
TBool CMmPacketServiceTsy::IsActivationAllowed()
|
|
3777 |
{
|
|
3778 |
TBool isAllowed = ETrue;
|
|
3779 |
|
|
3780 |
if ( RMobilePhone::ENetworkModeGsm == iCurrentMode &&
|
|
3781 |
RPacketService::EMSClassDualMode != iInternalSavedData.iMsClass )
|
|
3782 |
{
|
|
3783 |
//Check if the object is a Call object
|
|
3784 |
for( TInt i = 0; i < iMmPhone->CallList()->GetNumberOfObjects() ; i++ )
|
|
3785 |
{
|
|
3786 |
//Get call object
|
|
3787 |
CMmCallTsy* call = iMmPhone->CallList()->GetMmCallByIndex( i );
|
|
3788 |
//check if the current call object exist
|
|
3789 |
if( call != NULL )
|
|
3790 |
{
|
|
3791 |
//call the complete method
|
|
3792 |
RCall::TStatus status = call->Status();
|
|
3793 |
|
|
3794 |
if ( RCall::EStatusUnknown != status &&
|
|
3795 |
RCall::EStatusIdle != status )
|
|
3796 |
{
|
|
3797 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::IsActivationAllowed. CS call active, Context Activation not allowed" );
|
|
3798 |
isAllowed = EFalse;
|
|
3799 |
i = iMmPhone->CallList()->GetNumberOfObjects();
|
|
3800 |
}
|
|
3801 |
}
|
|
3802 |
}
|
|
3803 |
}
|
|
3804 |
|
|
3805 |
return isAllowed;
|
|
3806 |
}
|
|
3807 |
|
|
3808 |
//----------------------------------------------------------------------------
|
|
3809 |
// CMmPacketServiceTsy::MessageManagerBase
|
|
3810 |
// returns pointer to CMmMessageManager
|
|
3811 |
//----------------------------------------------------------------------------
|
|
3812 |
//
|
|
3813 |
CMmMessageManagerBase* CMmPacketServiceTsy::MessageManager()
|
|
3814 |
{
|
|
3815 |
return iMessageManager;
|
|
3816 |
}
|
|
3817 |
|
|
3818 |
//----------------------------------------------------------------------------
|
|
3819 |
// CMmPacketServiceTsy::CompleteNotifyEGprsInfoChange
|
|
3820 |
// Completes notification t
|
|
3821 |
//----------------------------------------------------------------------------
|
|
3822 |
//
|
|
3823 |
void CMmPacketServiceTsy::CompleteNotifyEGprsInfoChange(
|
|
3824 |
CMmDataPackage* aDataPackage )
|
|
3825 |
{
|
|
3826 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::CompleteNotifyEGprsInfoChange." );
|
|
3827 |
|
|
3828 |
//Unpack data
|
|
3829 |
TBool lastEdgeGprsSupport;
|
|
3830 |
aDataPackage->UnPackData( lastEdgeGprsSupport );
|
|
3831 |
|
|
3832 |
iMmPacketServiceGsmWcdmaExt->SetEdgeGprsSupport( lastEdgeGprsSupport );
|
|
3833 |
|
|
3834 |
CMmCustomTsy* customTsy = CMmPacketServiceTsy::CustomTsy();
|
|
3835 |
|
|
3836 |
if ( NULL != customTsy )
|
|
3837 |
{
|
|
3838 |
CMmPacketTsy* packetTsy = customTsy->PacketTsy();
|
|
3839 |
|
|
3840 |
if ( NULL != packetTsy )
|
|
3841 |
{
|
|
3842 |
packetTsy->
|
|
3843 |
CompleteNotifyEGprsInfoChange( lastEdgeGprsSupport );
|
|
3844 |
}
|
|
3845 |
}
|
|
3846 |
}
|
|
3847 |
|
|
3848 |
//----------------------------------------------------------------------------
|
|
3849 |
// CMmPacketServiceTsy::QosTsy
|
|
3850 |
// Gets pointer to right qos by context name given as parameter.
|
|
3851 |
//----------------------------------------------------------------------------
|
|
3852 |
//
|
|
3853 |
CMmPacketQoSTsy* CMmPacketServiceTsy::QosTsy(
|
|
3854 |
TInfoName aMmPacketContextName )
|
|
3855 |
{
|
|
3856 |
CMmPacketQoSTsy* packetQoSTsy = NULL;
|
|
3857 |
|
|
3858 |
CMmPacketContextTsy* mmPacketContextTsy = iPacketContextList->
|
|
3859 |
PacketContextByName( &aMmPacketContextName );
|
|
3860 |
|
|
3861 |
if ( NULL != mmPacketContextTsy )
|
|
3862 |
{
|
|
3863 |
packetQoSTsy = mmPacketContextTsy->PacketQoSTsy();
|
|
3864 |
}
|
|
3865 |
|
|
3866 |
if ( NULL != packetQoSTsy )
|
|
3867 |
{
|
|
3868 |
return packetQoSTsy;
|
|
3869 |
}
|
|
3870 |
|
|
3871 |
else
|
|
3872 |
{
|
|
3873 |
return NULL;
|
|
3874 |
}
|
|
3875 |
}
|
|
3876 |
|
|
3877 |
//----------------------------------------------------------------------------
|
|
3878 |
// CMmPacketServiceTsy::CompleteNetworkModeChange
|
|
3879 |
// Completes Network Mode Change
|
|
3880 |
//----------------------------------------------------------------------------
|
|
3881 |
//
|
|
3882 |
void CMmPacketServiceTsy::CompleteNetworkModeChange(
|
|
3883 |
CMmDataPackage* aDataPackage )
|
|
3884 |
{
|
|
3885 |
RMobilePhone::TMobilePhoneNetworkMode ntwkMode(
|
|
3886 |
RMobilePhone::ENetworkModeUnknown );
|
|
3887 |
//Unpack data
|
|
3888 |
aDataPackage->UnPackData( ntwkMode );
|
|
3889 |
|
|
3890 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::CompleteNetworkModeChange. ntwkMode: %d", ntwkMode );
|
|
3891 |
iCurrentMode = ntwkMode;
|
|
3892 |
}
|
|
3893 |
|
|
3894 |
//----------------------------------------------------------------------------
|
|
3895 |
// CMmPacketServiceTsy::Context
|
|
3896 |
// Accessory method to get right context.
|
|
3897 |
//----------------------------------------------------------------------------
|
|
3898 |
//
|
|
3899 |
CMmPacketContextTsy* CMmPacketServiceTsy::ContextTsy(
|
|
3900 |
TInfoName& contextName )
|
|
3901 |
{
|
|
3902 |
CMmPacketContextTsy* mmPacketContextTsy = iPacketContextList->
|
|
3903 |
PacketContextByName( &contextName );
|
|
3904 |
|
|
3905 |
if( NULL == mmPacketContextTsy )
|
|
3906 |
{
|
|
3907 |
mmPacketContextTsy = iMBMSContextList->ContextByName( contextName );
|
|
3908 |
}
|
|
3909 |
return mmPacketContextTsy;
|
|
3910 |
}
|
|
3911 |
|
|
3912 |
//----------------------------------------------------------------------------
|
|
3913 |
// CMmPacketServiceTsy::GlobalKernelObjectHandle
|
|
3914 |
// Returns unnamed mutex handle owned by TSY
|
|
3915 |
//----------------------------------------------------------------------------
|
|
3916 |
//
|
|
3917 |
RHandleBase* CMmPacketServiceTsy::GlobalKernelObjectHandle()
|
|
3918 |
{
|
|
3919 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GlobalKernelObjectHandle" );
|
|
3920 |
|
|
3921 |
if ( KNullHandle == iMutex.Handle() )
|
|
3922 |
{
|
|
3923 |
TInt ret = iMutex.CreateLocal( EOwnerProcess );
|
|
3924 |
|
|
3925 |
if ( KErrNone == ret )
|
|
3926 |
{
|
|
3927 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GlobalKernelObjectHandle - Mutex created" );
|
|
3928 |
}
|
|
3929 |
else
|
|
3930 |
{
|
|
3931 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GlobalKernelObjectHandle - Mutex creation failed" );
|
|
3932 |
}
|
|
3933 |
}
|
|
3934 |
else
|
|
3935 |
{
|
|
3936 |
TFLOGSTRING("TSY: CMmPacketServiceTsy::GlobalKernelObjectHandle - Mutex creation skipped" );
|
|
3937 |
}
|
|
3938 |
|
|
3939 |
return &iMutex;
|
|
3940 |
}
|
|
3941 |
|
|
3942 |
//-----------------------------------------------------------------------------
|
|
3943 |
// CMmPacketServiceTsy::SetAlwaysOnL
|
|
3944 |
// Requests Set Always On with mode given as parameter aMode
|
|
3945 |
//-----------------------------------------------------------------------------
|
|
3946 |
//
|
|
3947 |
TInt CMmPacketServiceTsy::SetAlwaysOnL(
|
|
3948 |
TTsyReqHandle aTsyReqHandle,
|
|
3949 |
RMmCustomAPI::TSetAlwaysOnMode aMode )
|
|
3950 |
{
|
|
3951 |
TFLOGSTRING2("TSY: CMmPacketServiceTsy::SetAlwaysOn Mode = %d", aMode );
|
|
3952 |
TFLOGSTRING2( "TSY: CMmPacketServiceTsy::CompleteSetAlwaysOn ReqHandle %d", aTsyReqHandle );
|
|
3953 |
TInt ret( KErrServerBusy );
|
|
3954 |
|
|
3955 |
//Check if request is allready pending
|
|
3956 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
3957 |
EMultimodePacketSetAlwaysOn );
|
|
3958 |
|
|
3959 |
if( EMultimodePacketServiceReqHandleUnknown == reqHandle )
|
|
3960 |
{
|
|
3961 |
//Pack
|
|
3962 |
CMmDataPackage data;
|
|
3963 |
data.PackData( &aMode );
|
|
3964 |
|
|
3965 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
3966 |
EMultimodePacketSetAlwaysOn, aTsyReqHandle );
|
|
3967 |
|
|
3968 |
ret = iMessageManager->HandleRequestL( ECustomSetAlwaysOnMode, &data );
|
|
3969 |
|
|
3970 |
if ( KErrNone != ret)
|
|
3971 |
{
|
|
3972 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePacketSetAlwaysOn );
|
|
3973 |
}
|
|
3974 |
}
|
|
3975 |
|
|
3976 |
return ret;
|
|
3977 |
}
|
|
3978 |
|
|
3979 |
//-----------------------------------------------------------------------------
|
|
3980 |
// TInt CMmPacketServiceTsy::CompleteSetAlwaysOn
|
|
3981 |
// Completes Set Always On request
|
|
3982 |
//-----------------------------------------------------------------------------
|
|
3983 |
//
|
|
3984 |
void CMmPacketServiceTsy::CompleteSetAlwaysOn(
|
|
3985 |
TInt aError )
|
|
3986 |
{
|
|
3987 |
TFLOGSTRING2( "TSY: CMmPacketServiceTsy::CompleteSetAlwaysOn Error %d", aError );
|
|
3988 |
|
|
3989 |
const TTsyReqHandle reqHandle( iTsyReqHandleStore->ResetTsyReqHandle(
|
|
3990 |
EMultimodePacketSetAlwaysOn ) );
|
|
3991 |
|
|
3992 |
TFLOGSTRING2( "TSY: CMmPacketServiceTsy::CompleteSetAlwaysOn ReqHandle %d", reqHandle );
|
|
3993 |
|
|
3994 |
if ( EMultimodePacketServiceReqHandleUnknown != reqHandle )
|
|
3995 |
{
|
|
3996 |
CMmCustomTsy* customTsy = CMmPacketServiceTsy::CustomTsy();
|
|
3997 |
|
|
3998 |
if ( NULL != customTsy )
|
|
3999 |
{
|
|
4000 |
CMmPacketTsy* packetTsy = customTsy->PacketTsy();
|
|
4001 |
|
|
4002 |
if ( NULL != packetTsy )
|
|
4003 |
{
|
|
4004 |
packetTsy->CompleteSetAlwaysOn( reqHandle, aError );
|
|
4005 |
}
|
|
4006 |
}
|
|
4007 |
}
|
|
4008 |
}
|
|
4009 |
|
|
4010 |
//-----------------------------------------------------------------------------
|
|
4011 |
// TInt CMmPacketServiceTsy::CancelSetAlwaysOn
|
|
4012 |
// Cancels Set Always On request
|
|
4013 |
//-----------------------------------------------------------------------------
|
|
4014 |
//
|
|
4015 |
void CMmPacketServiceTsy::CancelSetAlwaysOn(
|
|
4016 |
TTsyReqHandle aTsyReqHandle )
|
|
4017 |
{
|
|
4018 |
TFLOGSTRING2( "TSY: CMmPacketServiceTsy::CancelSetAlwaysOn ReqHandle %d", aTsyReqHandle );
|
|
4019 |
|
|
4020 |
if ( aTsyReqHandle != EMultimodePacketServiceReqHandleUnknown )
|
|
4021 |
{
|
|
4022 |
// Reset tsy request handle
|
|
4023 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePacketSetAlwaysOn );
|
|
4024 |
|
|
4025 |
// Complete request to client with KErrCancel
|
|
4026 |
ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
4027 |
}
|
|
4028 |
}
|
|
4029 |
|
|
4030 |
//-----------------------------------------------------------------------------
|
|
4031 |
// TInt CMmPacketServiceTsy::EnumerateActiveServiceList
|
|
4032 |
// Enumerates all active services
|
|
4033 |
//-----------------------------------------------------------------------------
|
|
4034 |
//
|
|
4035 |
TInt CMmPacketServiceTsy::EnumerateMbmsActiveServiceList( TInt &aCount, TInt &aMaxAllowed )
|
|
4036 |
{
|
|
4037 |
TFLOGSTRING2( "TSY: CMmPacketServiceTsy::EnumerateMbmsActiveServiceList. max: %d", aMaxAllowed );
|
|
4038 |
|
|
4039 |
aCount = EnumerateMbmsActiveServices();
|
|
4040 |
aMaxAllowed = iMaxActiveServices;
|
|
4041 |
|
|
4042 |
TFLOGSTRING3( "TSY: CMmPacketServiceTsy::EnumerateActiveServiceList Count: %d, Max allowed %d", aCount, aMaxAllowed );
|
|
4043 |
// Complete the request with KErrNone
|
|
4044 |
CMmPacketServiceTsy::ReqCompleted( iTsyReqHandle, KErrNone );
|
|
4045 |
return KErrNone;
|
|
4046 |
}
|
|
4047 |
|
|
4048 |
//-----------------------------------------------------------------------------
|
|
4049 |
// TInt CMmPacketServiceTsy::EnumerateMbmsActiveServices
|
|
4050 |
// Enumerates all active services
|
|
4051 |
//-----------------------------------------------------------------------------
|
|
4052 |
//
|
|
4053 |
TInt CMmPacketServiceTsy::EnumerateMbmsActiveServices()
|
|
4054 |
{
|
|
4055 |
TFLOGSTRING2( "TSY: CMmPacketServiceTsy::EnumerateMbmsActiveService. max: %d", iMaxActiveServices );
|
|
4056 |
TInt ret( 0 );
|
|
4057 |
|
|
4058 |
for( TInt i = 0; i< iMBMSContextList->NumberOfContexts(); i++ )
|
|
4059 |
{
|
|
4060 |
CMmMBMSContextTsy* context = iMBMSContextList->ContextByIndex( i );
|
|
4061 |
|
|
4062 |
if( RPacketContext::EStatusActive == context->ContextStatus() ||
|
|
4063 |
RPacketContext::EStatusReceiving == context->ContextStatus() ||
|
|
4064 |
RPacketContext::EStatusSuspended == context->ContextStatus() ||
|
|
4065 |
RPacketContext::EStatusDeactivating == context->ContextStatus() )
|
|
4066 |
{
|
|
4067 |
TInt count = context->SessionCount();
|
|
4068 |
if( 0 == count)
|
|
4069 |
{
|
|
4070 |
ret +=1;
|
|
4071 |
}
|
|
4072 |
else
|
|
4073 |
{
|
|
4074 |
ret += count;
|
|
4075 |
}
|
|
4076 |
|
|
4077 |
}
|
|
4078 |
}
|
|
4079 |
|
|
4080 |
return ret;
|
|
4081 |
}
|
|
4082 |
|
|
4083 |
//-----------------------------------------------------------------------------
|
|
4084 |
// TInt CMmPacketServiceTsy::CompleteEnumerateMbmsActiveServiceList
|
|
4085 |
// Saves the maximum value for active services
|
|
4086 |
//-----------------------------------------------------------------------------
|
|
4087 |
//
|
|
4088 |
void CMmPacketServiceTsy::CompleteEnumerateMbmsActiveServiceList(
|
|
4089 |
CMmDataPackage* aDataPackage,
|
|
4090 |
const TInt aResult)
|
|
4091 |
{
|
|
4092 |
TFLOGSTRING2( "TSY: CMmPacketServiceTsy::CompleteEnumerateMbmsActiveServiceList. Error: %d", aResult );
|
|
4093 |
|
|
4094 |
if( KErrNone == aResult && NULL != aDataPackage )
|
|
4095 |
{
|
|
4096 |
aDataPackage->UnPackData( iMaxActiveServices );
|
|
4097 |
}
|
|
4098 |
}
|
|
4099 |
|
|
4100 |
//-----------------------------------------------------------------------------
|
|
4101 |
// TInt CMmPacketServiceTsy::MaximumActiveServices
|
|
4102 |
// Maximum number of active services
|
|
4103 |
//-----------------------------------------------------------------------------
|
|
4104 |
//
|
|
4105 |
TInt CMmPacketServiceTsy::MaximumActiveServices()
|
|
4106 |
{
|
|
4107 |
return iMaxActiveServices;
|
|
4108 |
}
|
|
4109 |
|
|
4110 |
// End of File
|
|
4111 |
|