1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
16 /** |
16 /** |
17 @file |
17 @file |
18 @internalComponent |
18 @internalComponent |
19 */ |
19 */ |
20 |
20 |
|
21 |
|
22 #include "OstTraceDefinitions.h" |
|
23 #ifdef OST_TRACE_COMPILER_IN_USE |
|
24 #include "pdpservicesTraces.h" |
|
25 #endif |
|
26 |
21 #include <comms-infras/ss_log.h> |
27 #include <comms-infras/ss_log.h> |
22 #include <comms-infras/ss_corepractivities.h> // TODO is this needed? |
28 #include <comms-infras/ss_corepractivities.h> // TODO is this needed? |
23 #include <comms-infras/coretiermanagerstates.h> // TODO is this needed? |
29 #include <comms-infras/coretiermanagerstates.h> // TODO is this needed? |
24 #include <comms-infras/coretiermanageractivities.h> // TODO is this needed? |
30 #include <comms-infras/coretiermanageractivities.h> // TODO is this needed? |
25 #include "pdpservices.h" |
31 #include "pdpservices.h" |
26 #include "pdptiermanager.h" |
32 #include "pdptiermanager.h" |
27 #include <pcktcs.h> |
33 #include <pcktcs.h> |
28 #include <comms-infras/es_connectionserv.h> |
34 #include <comms-infras/es_connectionserv.h> |
29 |
|
30 #ifdef __CFLOG_ACTIVE |
|
31 #define KPDPTierMgrTag KESockMetaConnectionTag |
|
32 _LIT8(KMBMSObjectTag, "MBMSObject"); |
|
33 #endif |
|
34 |
35 |
35 using namespace Messages; |
36 using namespace Messages; |
36 using namespace MeshMachine; // TODO is this needed? |
37 using namespace MeshMachine; // TODO is this needed? |
37 using namespace ESock; |
38 using namespace ESock; |
38 using namespace NetStateMachine; // TODO is this needed? |
39 using namespace NetStateMachine; // TODO is this needed? |
117 @param aError const TInt |
118 @param aError const TInt |
118 @return void |
119 @return void |
119 */ |
120 */ |
120 void CMBMSServiceRequest::CancelMessage(const TInt aError) |
121 void CMBMSServiceRequest::CancelMessage(const TInt aError) |
121 { |
122 { |
122 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::CancelMessage(%d)"), this, aError)); |
123 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_CANCELMESSAGE_1, "CMBMSServiceRequest[%08x]::CancelMessage(%d)", (TUint)this, aError); |
123 if (iRequestType == TCFTierStatusProvider::TTierNotificationRegistration::Id()) |
124 if (iRequestType == TCFTierStatusProvider::TTierNotificationRegistration::Id()) |
124 { |
125 { |
125 iRequestOriginator.PostMessage( |
126 iRequestOriginator.PostMessage( |
126 iMBMSTMCommsId, |
127 iMBMSTMCommsId, |
127 TEBase::TError(TCFTierStatusProvider::TTierNotificationRegistration::Id(), aError).CRef() |
128 TEBase::TError(TCFTierStatusProvider::TTierNotificationRegistration::Id(), aError).CRef() |
195 @param None |
196 @param None |
196 @return TInt |
197 @return TInt |
197 */ |
198 */ |
198 TInt CMBMSServiceRequest::RunError(TInt aError) |
199 TInt CMBMSServiceRequest::RunError(TInt aError) |
199 { |
200 { |
200 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::RunError(%d)"), this, aError)); |
201 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNERROR_1, "CMBMSServiceRequest[%08x]::RunError(%d)", (TUint)this, aError); |
201 |
202 |
202 // Stop the ScanEngine components |
203 // Stop the ScanEngine components |
203 Cancel(); |
204 Cancel(); |
204 |
205 |
205 if (iRequestType == TCFTierStatusProvider::TTierNotificationRegistration::Id()) |
206 if (iRequestType == TCFTierStatusProvider::TTierNotificationRegistration::Id()) |
223 if (iStatus == KErrNone) |
224 if (iStatus == KErrNone) |
224 { |
225 { |
225 switch(iScanEngineState) |
226 switch(iScanEngineState) |
226 { |
227 { |
227 case EChecking: |
228 case EChecking: |
228 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In EChecking State"), this)); |
229 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_1, "CMBMSServiceRequest[%08x]::In EChecking State", (TUint)this); |
229 User::LeaveIfError(iMBMSEngine.GetRPacketService().GetStatus(iPsdStatus)); // get initial status |
230 User::LeaveIfError(iMBMSEngine.GetRPacketService().GetStatus(iPsdStatus)); // get initial status |
230 |
231 |
231 //check the query type |
232 //check the query type |
232 if(iQueryType == XMBMSServiceQuerySet::EBearerAvailability) |
233 if(iQueryType == XMBMSServiceQuerySet::EBearerAvailability) |
233 iScanEngineState = EBearerAvailable; |
234 iScanEngineState = EBearerAvailable; |
246 User::RequestComplete(status, KErrNone); |
247 User::RequestComplete(status, KErrNone); |
247 break; |
248 break; |
248 |
249 |
249 case EBearerAvailable: |
250 case EBearerAvailable: |
250 //get MBMS bearer availability. |
251 //get MBMS bearer availability. |
251 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In EBearerAvailable State"), this)); |
252 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_2, "CMBMSServiceRequest[%08x]::In EBearerAvailable State", (TUint)this); |
252 iMBMSEngine.GetRPacketService().GetMbmsNetworkServiceStatus(iStatus,ETrue,iNetworkServiceStatus); |
253 iMBMSEngine.GetRPacketService().GetMbmsNetworkServiceStatus(iStatus,ETrue,iNetworkServiceStatus); |
253 iScanEngineState = ERetrieveBearerAvailability; |
254 iScanEngineState = ERetrieveBearerAvailability; |
254 SetActive(); |
255 SetActive(); |
255 break; |
256 break; |
256 |
257 |
257 case ERetrieveBearerAvailability: |
258 case ERetrieveBearerAvailability: |
258 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In ERetrieveBearerAvailability State"), this)); |
259 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_3, "CMBMSServiceRequest[%08x]::In ERetrieveBearerAvailability State", (TUint)this); |
259 //create a parameter bundle and send the results to the client. |
260 //create a parameter bundle and send the results to the client. |
260 SendResultBundleL(); |
261 SendResultBundleL(); |
261 |
262 |
262 iScanEngineState = EBearerAvailable; |
263 iScanEngineState = EBearerAvailable; |
263 SetActive(); |
264 SetActive(); |
301 } |
302 } |
302 break; |
303 break; |
303 |
304 |
304 case EGetCountMonitorList: |
305 case EGetCountMonitorList: |
305 { |
306 { |
306 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In ECountActiveServiceList State"), this)); |
307 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_4, "CMBMSServiceRequest[%08x]::In ECountActiveServiceList State", (TUint)this); |
307 iMBMSEngine.GetRPacketService().EnumerateMbmsMonitorServiceList(iStatus,iCount,iMaxCount); |
308 iMBMSEngine.GetRPacketService().EnumerateMbmsMonitorServiceList(iStatus,iCount,iMaxCount); |
308 |
309 |
309 SetActive(); |
310 SetActive(); |
310 iScanEngineState = EResultCount; |
311 iScanEngineState = EResultCount; |
311 } |
312 } |
312 break; |
313 break; |
313 |
314 |
314 case EGetCountServiceList: |
315 case EGetCountServiceList: |
315 { |
316 { |
316 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In ECountActiveServiceList State"), this)); |
317 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_5, "CMBMSServiceRequest[%08x]::In ECountActiveServiceList State", (TUint)this); |
317 iMBMSEngine.GetRPacketService().EnumerateMbmsActiveServiceList(iStatus,iCount,iMaxCount); |
318 iMBMSEngine.GetRPacketService().EnumerateMbmsActiveServiceList(iStatus,iCount,iMaxCount); |
318 |
319 |
319 SetActive(); |
320 SetActive(); |
320 iScanEngineState = EResultCount; |
321 iScanEngineState = EResultCount; |
321 } |
322 } |
325 SendResultBundleL(); |
326 SendResultBundleL(); |
326 break; |
327 break; |
327 |
328 |
328 case ENotifyService: |
329 case ENotifyService: |
329 //notify for MBMS Services. |
330 //notify for MBMS Services. |
330 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In ENotifyService State"), this)); |
331 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_6, "CMBMSServiceRequest[%08x]::In ENotifyService State", (TUint)this); |
331 iMBMSEngine.GetRPacketService().NotifyMbmsServiceAvailabilityChange(iStatus); |
332 iMBMSEngine.GetRPacketService().NotifyMbmsServiceAvailabilityChange(iStatus); |
332 SetActive(); |
333 SetActive(); |
333 iScanEngineState = EStartMonitor; |
334 iScanEngineState = EStartMonitor; |
334 break; |
335 break; |
335 |
336 |
336 case EStartMonitor: |
337 case EStartMonitor: |
337 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In EStartMonitor State"), this)); |
338 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_7, "CMBMSServiceRequest[%08x]::In EStartMonitor State", (TUint)this); |
338 iRetrievePcktMbms = CRetrievePcktMbmsMonitoredServices::NewL(iMBMSEngine.GetRPacketService()); |
339 iRetrievePcktMbms = CRetrievePcktMbmsMonitoredServices::NewL(iMBMSEngine.GetRPacketService()); |
339 iRetrievePcktMbms->Start(iStatus); |
340 iRetrievePcktMbms->Start(iStatus); |
340 |
341 |
341 SetActive(); |
342 SetActive(); |
342 iScanEngineState = EGetMonitorList; |
343 iScanEngineState = EGetMonitorList; |
352 |
353 |
353 } |
354 } |
354 } |
355 } |
355 else if(((iStatus.Int() == KErrMbmsImpreciseServiceEntries))||((iStatus.Int() == KErrNotFound))) |
356 else if(((iStatus.Int() == KErrMbmsImpreciseServiceEntries))||((iStatus.Int() == KErrNotFound))) |
356 { |
357 { |
357 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::RunL() KErrMbmsImpreciseServiceEntries || KErrNotFound"), this)); |
358 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_8, "CMBMSServiceRequest[%08x]::RunL() KErrMbmsImpreciseServiceEntries || KErrNotFound", (TUint)this); |
358 CancelMessage(iStatus.Int()); |
359 CancelMessage(iStatus.Int()); |
359 iMBMSEngine.RemoveFromRequestListL(GetClientId()); |
360 iMBMSEngine.RemoveFromRequestListL(GetClientId()); |
360 } |
361 } |
361 else |
362 else |
362 { |
363 { |
363 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::RunL() ERROR: Incorrect status, Aborting"), this)); |
364 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_RUNL_9, "CMBMSServiceRequest[%08x]::RunL() ERROR: Incorrect status, Aborting", (TUint)this); |
364 User::Leave(iStatus.Int()); |
365 User::Leave(iStatus.Int()); |
365 } |
366 } |
366 |
367 |
367 } |
368 } |
368 |
369 |
371 @param None |
372 @param None |
372 @return Void |
373 @return Void |
373 */ |
374 */ |
374 CPcktMbmsMonitoredServiceList* CMBMSServiceRequest::UpdateMonitorServiceListL() |
375 CPcktMbmsMonitoredServiceList* CMBMSServiceRequest::UpdateMonitorServiceListL() |
375 { |
376 { |
376 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In UpdateMonitorServiceListL()"), this)); |
377 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_UPDATEMONITORSERVICELISTL_1, "CMBMSServiceRequest[%08x]::In UpdateMonitorServiceListL()", (TUint)this); |
377 |
378 |
378 //Read the entries in the parameter bundle and pass them to Etel. |
379 //Read the entries in the parameter bundle and pass them to Etel. |
379 CPcktMbmsMonitoredServiceList* serviceList= CPcktMbmsMonitoredServiceList::NewL(); |
380 CPcktMbmsMonitoredServiceList* serviceList= CPcktMbmsMonitoredServiceList::NewL(); |
380 CleanupStack::PushL(serviceList); |
381 CleanupStack::PushL(serviceList); |
381 |
382 |
445 CConnectionServParameterBundle* CMBMSServiceRequest::PrepareMonitorResultBundleL() const |
446 CConnectionServParameterBundle* CMBMSServiceRequest::PrepareMonitorResultBundleL() const |
446 { |
447 { |
447 CConnectionServParameterBundle* returnBundle = CConnectionServParameterBundle::NewL(); |
448 CConnectionServParameterBundle* returnBundle = CConnectionServParameterBundle::NewL(); |
448 CleanupStack::PushL(returnBundle); |
449 CleanupStack::PushL(returnBundle); |
449 |
450 |
450 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In PrepareMonitorResultBundleL function"), this)); |
451 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_PREPAREMONITORRESULTBUNDLEL_1, "CMBMSServiceRequest[%08x]::In PrepareMonitorResultBundleL function", (TUint)this); |
451 //read the MBMS Service list from Etel after receiving the MBMS Service Availability Notification. |
452 //read the MBMS Service list from Etel after receiving the MBMS Service Availability Notification. |
452 |
453 |
453 CPcktMbmsMonitoredServiceList* serviceList = iRetrievePcktMbms->RetrieveListL(); |
454 CPcktMbmsMonitoredServiceList* serviceList = iRetrievePcktMbms->RetrieveListL(); |
454 TInt count = serviceList->Enumerate(); |
455 TInt count = serviceList->Enumerate(); |
455 CleanupStack::PushL(serviceList); |
456 CleanupStack::PushL(serviceList); |
490 @param None |
491 @param None |
491 @return CConnectionServParameterBundle* |
492 @return CConnectionServParameterBundle* |
492 */ |
493 */ |
493 CConnectionServParameterBundle* CMBMSServiceRequest::PrepareBearerResultBundleL() const |
494 CConnectionServParameterBundle* CMBMSServiceRequest::PrepareBearerResultBundleL() const |
494 { |
495 { |
495 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In PrepareBearerResultBundleL function"), this)); |
496 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_PREPAREBEARERRESULTBUNDLEL_1, "CMBMSServiceRequest[%08x]::In PrepareBearerResultBundleL function", (TUint)this); |
496 |
497 |
497 CConnectionServParameterBundle* returnBundle = CConnectionServParameterBundle::NewL(); |
498 CConnectionServParameterBundle* returnBundle = CConnectionServParameterBundle::NewL(); |
498 CleanupStack::PushL(returnBundle); |
499 CleanupStack::PushL(returnBundle); |
499 |
500 |
500 CParameterSetContainer* returnPSC = CParameterSetContainer::NewL(*returnBundle); |
501 CParameterSetContainer* returnPSC = CParameterSetContainer::NewL(*returnBundle); |
515 @param None |
516 @param None |
516 @return CConnectionServParameterBundle* |
517 @return CConnectionServParameterBundle* |
517 */ |
518 */ |
518 CConnectionServParameterBundle* CMBMSServiceRequest::PrepareCountBundleL() const |
519 CConnectionServParameterBundle* CMBMSServiceRequest::PrepareCountBundleL() const |
519 { |
520 { |
520 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In PrepareCountBundleL function"), this)); |
521 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_PREPARECOUNTBUNDLEL_1, "CMBMSServiceRequest[%08x]::In PrepareCountBundleL function", (TUint)this); |
521 |
522 |
522 CConnectionServParameterBundle* returnBundle = CConnectionServParameterBundle::NewL(); |
523 CConnectionServParameterBundle* returnBundle = CConnectionServParameterBundle::NewL(); |
523 CleanupStack::PushL(returnBundle); |
524 CleanupStack::PushL(returnBundle); |
524 |
525 |
525 CParameterSetContainer* returnPSC = CParameterSetContainer::NewL(*returnBundle); |
526 CParameterSetContainer* returnPSC = CParameterSetContainer::NewL(*returnBundle); |
541 @return CConnectionServParameterBundle* |
542 @return CConnectionServParameterBundle* |
542 */ |
543 */ |
543 CConnectionServParameterBundle* CMBMSServiceRequest::PrepareRemoveAllBundleL() const |
544 CConnectionServParameterBundle* CMBMSServiceRequest::PrepareRemoveAllBundleL() const |
544 { |
545 { |
545 //pass empty bundle |
546 //pass empty bundle |
546 __CFLOG_VAR((KPDPTierMgrTag, KMBMSObjectTag, _L8("CMBMSServiceRequest[%08x]::In PrepareRemoveAllBundleL function"), this)); |
547 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSSERVICEREQUEST_PREPAREREMOVEALLBUNDLEL_1, "CMBMSServiceRequest[%08x]::In PrepareRemoveAllBundleL function", (TUint)this); |
547 |
548 |
548 CConnectionServParameterBundle* returnBundle = CConnectionServParameterBundle::NewL(); |
549 CConnectionServParameterBundle* returnBundle = CConnectionServParameterBundle::NewL(); |
549 return returnBundle; |
550 return returnBundle; |
550 } |
551 } |