telephonyprotocols/pdplayer/src/PDPCPR.cpp
changeset 49 f50f4094acd7
parent 0 3553901f7fa8
child 64 b34bb05ac869
--- a/telephonyprotocols/pdplayer/src/PDPCPR.cpp	Wed Jun 23 19:32:14 2010 +0300
+++ b/telephonyprotocols/pdplayer/src/PDPCPR.cpp	Tue Jul 06 15:36:38 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -31,16 +31,21 @@
 #include <etelmm.h>
 #include <etelpckt.h>
 #include <comms-infras/ss_metaconnprov.h>
-#include "pdpprovision.h"
+#include "PDPProvision.h"
 #include <etel.h>
-#include <networking/cfbearers.h>
 #include "pdpcpravailabilitylistener.h"
 #include <comms-infras/ss_nodemessages.h>
-#include <networking/ipcpr_states.h>
 #include <comms-infras/linkmessages.h>
 #include <elements/nm_interfaces.h>
+
+
+
+#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
+#include <networking/cfbearers.h>
+#include <networking/ipcpr_states.h>
 #include <cs_genevent.h>
 #include <networking/etelbearers.h>
+#endif
 
 using namespace ESock;
 
@@ -57,6 +62,7 @@
 static const TUint KMaxPreallocatedActivitySize = sizeof(MeshMachine::CNodeRetryParallelActivity) + sizeof(MeshMachine::APreallocatedOriginators<4>);
 static const TUint KPDPCPRPreallocatedActivityBufferSize = KDefaultMaxPreallocatedActivityCount * KMaxPreallocatedActivitySize;
 
+#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
 namespace PDPCprLinkCharacteristicActivity
 {
 DECLARE_DEFINE_NODEACTIVITY(ECFActivityParamRequest, PDPCprLinkCharacteristic, TCFScpr::TGetParamsRequest)
@@ -74,16 +80,18 @@
     LAST_NODEACTIVITY_ENTRY(CoreNetStates::KNonDefault, MeshMachine::TDoNothing)    
 NODEACTIVITY_END()
 }
+#endif
 
 namespace PDPCprActivities
 {
 DEFINE_ACTIVITY_MAP(activityMap)
+#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
     ACTIVITY_MAP_ENTRY(PDPDataClientGoneDownActivity, PDPScprGoneDown)
 	ACTIVITY_MAP_ENTRY(PDPCprLinkCharacteristicActivity, PDPCprLinkCharacteristic)
+#endif
 ACTIVITY_MAP_END_BASE(CprActivities, coreCprActivities)
 }
 
-
 CPDPConnectionProvider* CPDPConnectionProvider::NewL(ESock::CConnectionProviderFactoryBase& aFactory)
     {
     CPDPConnectionProvider* provider = new (ELeave) CPDPConnectionProvider(aFactory);
@@ -93,18 +101,6 @@
 	return provider;
     }        
 
-
-void CPDPConnectionProvider::StartListener()
-/**
- * Start listening for dynamic caps or network mode changes.
- * @param None
- * @return void
- */
-	{
-	iDynamicCapsEventListener->NotifyDynamicCapsChange(this);
-	iNetworkModeEventListener->NotifyNetworkModeChange(this);
-	}
-
 void CPDPConnectionProvider::ConstructL()
 /**
  * PDP Connection Provider Second Phase Constructor
@@ -115,23 +111,13 @@
 	CCoreConnectionProvider::ConstructL(KPDPCPRPreallocatedActivityBufferSize);
 	}
 
-void CPDPConnectionProvider::StopListener()
-/**
- * Start listening for dynamic caps or network mode changes.
- */
-	{
-	if(iDynamicCapsEventListener)
-		{
-		iDynamicCapsEventListener->Cancel();
-		}
-	if(iNetworkModeEventListener)
-		{
-		iNetworkModeEventListener->Cancel();
-		}
-	}
-
 CPDPConnectionProvider::CPDPConnectionProvider(ESock::CConnectionProviderFactoryBase& aFactory)
-	: CCoreConnectionProvider(aFactory, PDPCprActivities::activityMap::Self())
+	: CCoreConnectionProvider(aFactory, PDPCprActivities::activityMap::Self()),
+	  iDynamicCapsEventListener(NULL),
+	  iNetworkModeEventListener(NULL),
+	  iBearerType(0),
+	  iBearerSet(EFalse)
+	  
 /**
  * Construct PDP connection provider.
  */	
@@ -145,7 +131,9 @@
  */
     {    
     LOG_NODE_DESTROY(KESockConnectionTag, CPDPConnectionProvider);
+#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
     StopListener();
+#endif
 	delete iDynamicCapsEventListener;
 	delete iNetworkModeEventListener;
     }
@@ -165,6 +153,7 @@
  * all the control client.
  */
 	{
+#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
 	//Update bearers.
 	UpdateBearer();
 	
@@ -195,10 +184,35 @@
 		msg.iRefCountOwnedNotification->Open();
 		ctl->PostMessage(this->NodeId(), msg);
 		}
-
+#endif
 	}
 
+#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
+void CPDPConnectionProvider::StartListener()
+/**
+ * Start listening for dynamic caps or network mode changes.
+ * @param None
+ * @return void
+ */
+    {
+    iDynamicCapsEventListener->NotifyDynamicCapsChange(this);
+    iNetworkModeEventListener->NotifyNetworkModeChange(this);
+    }
 
+void CPDPConnectionProvider::StopListener()
+/**
+ * Start listening for dynamic caps or network mode changes.
+ */
+    {
+    if(iDynamicCapsEventListener)
+        {
+        iDynamicCapsEventListener->Cancel();
+        }
+    if(iNetworkModeEventListener)
+        {
+        iNetworkModeEventListener->Cancel();
+        }
+    }
 void CPDPConnectionProvider::UpdateBearer()
 /**
  * Update bearer type based on the change of the dynamic caps or network mode.
@@ -214,7 +228,6 @@
 	iBearerSet = ETrue;
 	}
 
-
 TUint32 CPDPConnectionProvider::Bearer(TUint aDynamicCaps, RMobilePhone::TMobilePhoneNetworkMode& aNetworkMode)
 /**
  * Determine bearer based on dynamic caps and network mode.
@@ -224,7 +237,6 @@
  *
  */
 	{
-	
 	if ((aDynamicCaps & RPacketService::KCapsHSUPA) || (aDynamicCaps & RPacketService::KCapsHSDPA))
 		{
 		return KHsdpaBearer;
@@ -250,7 +262,6 @@
 		}
 	}
 
-
 DEFINE_SMELEMENT(PDPCprStates::TUpdateBundle, NetStateMachine::MStateTransition, PDPCprStates::TContext)
 void PDPCprStates::TUpdateBundle::DoL()
 /**
@@ -299,5 +310,6 @@
 		iContext.Node().StartListener();
 		}
 	}
+#endif