telephonyprotocols/pdplayer/src/PDPCPR.cpp
changeset 73 70d75957b98f
parent 69 b982c3e940f3
equal deleted inserted replaced
69:b982c3e940f3 73:70d75957b98f
    17 
    17 
    18 /**
    18 /**
    19  @file
    19  @file
    20  @internalComponent
    20  @internalComponent
    21 */
    21 */
       
    22 
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "PDPCPRTraces.h"
       
    26 #endif
    22 
    27 
    23 #include "PDPCPR.h"
    28 #include "PDPCPR.h"
    24 #include <comms-infras/ss_log.h>
    29 #include <comms-infras/ss_log.h>
    25 #include <comms-infras/ss_msgintercept.h>
    30 #include <comms-infras/ss_msgintercept.h>
    26 #include <comms-infras/corecpractivities.h>
    31 #include <comms-infras/corecpractivities.h>
   112 	  iBearerSet(EFalse)
   117 	  iBearerSet(EFalse)
   113 	  
   118 	  
   114 /**
   119 /**
   115  * Construct PDP connection provider.
   120  * Construct PDP connection provider.
   116  */	
   121  */	
   117     {        
   122     {
   118     LOG_NODE_CREATE(KESockConnectionTag, CPDPConnectionProvider);
   123     LOG_NODE_CREATE(KESockConnectionTag, CPDPConnectionProvider);
       
   124     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONNECTIONPROVIDER_CONSTRUCTOR_1, "Constructor");
   119     }
   125     }
   120 
   126 
   121 CPDPConnectionProvider::~CPDPConnectionProvider()
   127 CPDPConnectionProvider::~CPDPConnectionProvider()
   122 /**
   128 /**
   123  * Destroy PDP connection provider.
   129  * Destroy PDP connection provider.
   124  */
   130  */
   125     {    
   131     {    
   126     LOG_NODE_DESTROY(KESockConnectionTag, CPDPConnectionProvider);
   132     LOG_NODE_DESTROY(KESockConnectionTag, CPDPConnectionProvider);
       
   133     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONNECTIONPROVIDER_DESTRUCTOR_1, "Destructor");
   127 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
   134 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
   128     StopListener();
   135     StopListener();
   129 #endif
   136 #endif
   130 	delete iDynamicCapsEventListener;
   137 	delete iDynamicCapsEventListener;
   131 	delete iNetworkModeEventListener;
   138 	delete iNetworkModeEventListener;
   132     }
   139     }
   133     
   140 
   134 void CPDPConnectionProvider::ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage)
   141 void CPDPConnectionProvider::ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage)
   135 	{
   142 	{
       
   143     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONNECTIONPROVIDER_RECEIVEDL_1, "Realm Id [%u] Message Id [%u]", aMessage.MessageId().Realm(), aMessage.MessageId().MessageId());
       
   144 
   136 	//ESOCK_DEBUG_MESSAGE_INTERCEPT(aSender, aMessage, aRecipient);
   145 	//ESOCK_DEBUG_MESSAGE_INTERCEPT(aSender, aMessage, aRecipient);
   137 	MeshMachine::TNodeContext<CPDPConnectionProvider> ctx(*this, aMessage, aSender, aRecipient);
   146 	MeshMachine::TNodeContext<CPDPConnectionProvider> ctx(*this, aMessage, aSender, aRecipient);
   138 	CCoreConnectionProvider::Received(ctx);
   147 	CCoreConnectionProvider::Received(ctx);
   139 	User::LeaveIfError(ctx.iReturn);
   148 	User::LeaveIfError(ctx.iReturn);
   140 	}
   149 	}
   141 	
       
   142 
   150 
   143 void CPDPConnectionProvider::BearerChangeDetectedL()
   151 void CPDPConnectionProvider::BearerChangeDetectedL()
   144 /**
   152 /**
   145  * Update the parmeter set in case of modulation change and send TPlaneNotification message to
   153  * Update the parmeter set in case of modulation change and send TPlaneNotification message to
   146  * all the control client.
   154  * all the control client.
   147  */
   155  */
   148 	{
   156 	{
   149 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
   157 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
       
   158     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONNECTIONPROVIDER_BEARERCHANGEDETECTEDL_1, "BearerChangeDetectedL()");
   150 	//Update bearers.
   159 	//Update bearers.
   151 	UpdateBearer();
   160 	UpdateBearer();
   152 	
   161 	
   153 	//Send msg to all control clients
   162 	//Send msg to all control clients
   154 	CEventParamsChanged* eventChanged = CEventParamsChanged::NewL(KBearerInfo);
   163 	CEventParamsChanged* eventChanged = CEventParamsChanged::NewL(KBearerInfo);
   186  * Start listening for dynamic caps or network mode changes.
   195  * Start listening for dynamic caps or network mode changes.
   187  * @param None
   196  * @param None
   188  * @return void
   197  * @return void
   189  */
   198  */
   190     {
   199     {
       
   200     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONNECTIONPROVIDER_STARTLISTENER_1, "Starting Notifier Objects");
   191     iDynamicCapsEventListener->NotifyDynamicCapsChange(this);
   201     iDynamicCapsEventListener->NotifyDynamicCapsChange(this);
   192     iNetworkModeEventListener->NotifyNetworkModeChange(this);
   202     iNetworkModeEventListener->NotifyNetworkModeChange(this);
   193     }
   203     }
   194 
   204 
   195 void CPDPConnectionProvider::StopListener()
   205 void CPDPConnectionProvider::StopListener()
   196 /**
   206 /**
   197  * Start listening for dynamic caps or network mode changes.
   207  * Stop listening for dynamic caps or network mode changes.
   198  */
   208  */
   199     {
   209     {
       
   210     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONNECTIONPROVIDER_STOPLISTENER_1, "Stoping Notifier Objects");
   200     if(iDynamicCapsEventListener)
   211     if(iDynamicCapsEventListener)
   201         {
   212         {
   202         iDynamicCapsEventListener->Cancel();
   213         iDynamicCapsEventListener->Cancel();
   203         }
   214         }
   204     if(iNetworkModeEventListener)
   215     if(iNetworkModeEventListener)
   205         {
   216         {
   206         iNetworkModeEventListener->Cancel();
   217         iNetworkModeEventListener->Cancel();
   207         }
   218         }
   208     }
   219     }
       
   220 
   209 void CPDPConnectionProvider::UpdateBearer()
   221 void CPDPConnectionProvider::UpdateBearer()
   210 /**
   222 /**
   211  * Update bearer type based on the change of the dynamic caps or network mode.
   223  * Update bearer type based on the change of the dynamic caps or network mode.
   212  */
   224  */
   213 	{
   225 	{
   216 	//Get network mode
   228 	//Get network mode
   217 	RMobilePhone::TMobilePhoneNetworkMode networkMode = iNetworkModeEventListener->NetworkMode();
   229 	RMobilePhone::TMobilePhoneNetworkMode networkMode = iNetworkModeEventListener->NetworkMode();
   218 	
   230 	
   219 	//Resolve the bearer based on both dynamic caps and network mode
   231 	//Resolve the bearer based on both dynamic caps and network mode
   220 	iBearerType = Bearer(dynamicCaps, networkMode);
   232 	iBearerType = Bearer(dynamicCaps, networkMode);
       
   233 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONNECTIONPROVIDER_UPDATEBEARER_1, "Bearer Type [%d]", iBearerType);
   221 	iBearerSet = ETrue;
   234 	iBearerSet = ETrue;
   222 	}
   235 	}
   223 
   236 
   224 TUint32 CPDPConnectionProvider::Bearer(TUint aDynamicCaps, RMobilePhone::TMobilePhoneNetworkMode& aNetworkMode)
   237 TUint32 CPDPConnectionProvider::Bearer(TUint aDynamicCaps, RMobilePhone::TMobilePhoneNetworkMode& aNetworkMode)
   225 /**
   238 /**
   259 void PDPCprStates::TUpdateBundle::DoL()
   272 void PDPCprStates::TUpdateBundle::DoL()
   260 /**
   273 /**
   261  * Process TGetParamsRequest
   274  * Process TGetParamsRequest
   262  */
   275  */
   263 	{
   276 	{
       
   277     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCPRSTATES_TUPDATEBUNDLE_DOL_1, "Bearer Type Request");
   264 	// Node receives TGetParamsRequest msg containing the bundle.
   278 	// Node receives TGetParamsRequest msg containing the bundle.
   265 	// Determine current network type - GPRS/EDGE/UMTS/HSDPA and update the bundle.
   279 	// Determine current network type - GPRS/EDGE/UMTS/HSDPA and update the bundle.
   266 	const CTSYProvision& tsyProvision = static_cast<const CTSYProvision&>(iContext.Node().AccessPointConfig().FindExtensionL(
   280 	const CTSYProvision& tsyProvision = static_cast<const CTSYProvision&>(iContext.Node().AccessPointConfig().FindExtensionL(
   267 	        STypeId::CreateSTypeId(CTSYProvision::EUid, CTSYProvision::ETypeId)));
   281 	        STypeId::CreateSTypeId(CTSYProvision::EUid, CTSYProvision::ETypeId)));
   268 	if(!iContext.Node().iDynamicCapsEventListener)
   282 	if(!iContext.Node().iDynamicCapsEventListener)