telephonyprotocols/pdplayer/umts/spudtel/src/cpdpconfigchangenotifier.cpp
changeset 42 3adadc800673
parent 0 3553901f7fa8
child 66 07a122eea281
child 69 b982c3e940f3
equal deleted inserted replaced
31:8ab6687fb94c 42:3adadc800673
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2004-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".
    18 /**
    18 /**
    19  @file 
    19  @file 
    20  @internalComponent
    20  @internalComponent
    21 */
    21 */
    22 
    22 
       
    23 
       
    24 
       
    25 #include "OstTraceDefinitions.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "cpdpconfigchangenotifierTraces.h"
       
    28 #endif
       
    29 
    23 #include <e32base.h>
    30 #include <e32base.h>
    24 #include <pcktcs.h>
    31 #include <pcktcs.h>
    25 
    32 
    26 #include "cpdpconfigchangenotifier.h"
    33 #include "cpdpconfigchangenotifier.h"
    27 #include "PDPFSM.h"
    34 #include "PDPFSM.h"
    28 #include "spudteldebuglogger.h"
       
    29 #include "pdpfsmnmspace.h"
    35 #include "pdpfsmnmspace.h"
    30 
    36 
    31 /**
    37 /**
    32 @param aId - pdp context id
    38 @param aId - pdp context id
    33 @param aPacketContext - reference to etel packet context
    39 @param aPacketContext - reference to etel packet context
   117 /** stops notification */	
   123 /** stops notification */	
   118 void CPdpConfigChangeNotifier::DoCancel()
   124 void CPdpConfigChangeNotifier::DoCancel()
   119 	{
   125 	{
   120 	if(IsActive())
   126 	if(IsActive())
   121 		{ 
   127 		{ 
   122 		SPUDTELVERBOSE_INFO_LOG(
   128 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONFIGCHANGENOTIFIER_DOCANCEL_1, "CPdpConfigChangeNotifier::DoCancel EPacketContextNotifyConfigChanged");
   123 			_L("CPdpConfigChangeNotifier::DoCancel EPacketContextNotifyConfigChanged"));
       
   124 		iPacketContext.CancelAsyncRequest(EPacketContextNotifyConfigChanged); 
   129 		iPacketContext.CancelAsyncRequest(EPacketContextNotifyConfigChanged); 
   125 		}
   130 		}
   126 	}
   131 	}
   127 
   132 
   128 /** notifies pdp fsm 
   133 /** notifies pdp fsm 
   131 */
   136 */
   132 void CPdpConfigChangeNotifier::Notify(const TRequestStatus& aStatus)
   137 void CPdpConfigChangeNotifier::Notify(const TRequestStatus& aStatus)
   133 	{
   138 	{
   134 	if(aStatus == KErrNone)
   139 	if(aStatus == KErrNone)
   135 		{
   140 		{
   136 		SPUDTELVERBOSE_INFO_LOG(_L("FSM set ConfigGPRS"));
   141 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONFIGCHANGENOTIFIER_NOTIFY_1, "FSM set ConfigGPRS");
   137 		iPdpFsmInterface.Set(iId, GetScratchContextAs<TPacketDataConfigBase>());
   142 		iPdpFsmInterface.Set(iId, GetScratchContextAs<TPacketDataConfigBase>());
   138 		SPUDTELVERBOSE_INFO_LOG(_L("FSM input EConfigGPRSChangeNetwork"));
   143 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONFIGCHANGENOTIFIER_NOTIFY_2, "FSM input EConfigGPRSChangeNetwork");
   139 		iPdpFsmInterface.Input(iId, PdpFsm::EConfigGPRSChangeNetwork);
   144 		iPdpFsmInterface.Input(iId, PdpFsm::EConfigGPRSChangeNetwork);
   140 		}
   145 		}
   141 	else
   146 	else
   142 		{ 
   147 		{ 
   143 		SPUDTEL_ERROR_LOG(_L("CPdpConfigChangeNotifier::Notify(), error: %d"), 
   148 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPCONFIGCHANGENOTIFIER_NOTIFY_3, "CPdpConfigChangeNotifier::Notify(), error: %d", aStatus.Int());
   144 						aStatus.Int());
       
   145 		// Not all TSYs support RPacketContext::NotifyConfigChanged so we handle
   149 		// Not all TSYs support RPacketContext::NotifyConfigChanged so we handle
   146 		// KErrNotSupported silently (PDEF118981).
   150 		// KErrNotSupported silently (PDEF118981).
   147 		ASSERT((aStatus == KErrCancel) || (aStatus == KErrNotSupported));
   151 		ASSERT((aStatus == KErrCancel) || (aStatus == KErrNotSupported));
   148 		}
   152 		}
   149 	}
   153 	}
   184 /** stops notification */	
   188 /** stops notification */	
   185 void CMbmsPdpConfigChangeNotifier::DoCancel()
   189 void CMbmsPdpConfigChangeNotifier::DoCancel()
   186 	{
   190 	{
   187 	if(IsActive())
   191 	if(IsActive())
   188 		{ 
   192 		{ 
   189 		SPUDTELVERBOSE_INFO_LOG(
   193 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSPDPCONFIGCHANGENOTIFIER_DOCANCEL_1, "CMbmsPdpConfigChangeNotifier::DoCancel EPacketContextNotifyConfigChanged");
   190 			_L("CMbmsPdpConfigChangeNotifier::DoCancel EPacketContextNotifyConfigChanged"));
       
   191 		iMbmsPacketContext.CancelAsyncRequest(EPacketContextNotifyConfigChanged); 
   194 		iMbmsPacketContext.CancelAsyncRequest(EPacketContextNotifyConfigChanged); 
   192 		}
   195 		}
   193 	}
   196 	}
   194 
   197 
   195 /** notifies pdp fsm 
   198 /** notifies pdp fsm 
   198 */
   201 */
   199 void CMbmsPdpConfigChangeNotifier::Notify(const TRequestStatus& aStatus)
   202 void CMbmsPdpConfigChangeNotifier::Notify(const TRequestStatus& aStatus)
   200 	{
   203 	{
   201 	if(aStatus == KErrNone)
   204 	if(aStatus == KErrNone)
   202 		{
   205 		{
   203 		SPUDTELVERBOSE_INFO_LOG(_L("FSM set ConfigMbms"));
   206 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSPDPCONFIGCHANGENOTIFIER_NOTIFY_1, "FSM set ConfigMbms");
   204 		iPdpFsmInterface.Set(iId, iConfigMbms);
   207 		iPdpFsmInterface.Set(iId, iConfigMbms);
   205 		SPUDTELVERBOSE_INFO_LOG(_L("FSM input EConfigMbmsChangeNetwork"));
   208 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSPDPCONFIGCHANGENOTIFIER_NOTIFY_2, "FSM input EConfigMbmsChangeNetwork");
   206 		iPdpFsmInterface.Input(iId, PdpFsm::EConfigGPRSChangeNetwork,SpudMan::EMbms);
   209 		iPdpFsmInterface.Input(iId, PdpFsm::EConfigGPRSChangeNetwork,SpudMan::EMbms);
   207 		//to be discussed...
   210 		//to be discussed...
   208 		
   211 		
   209 		}
   212 		}
   210 	else
   213 	else
   211 		{ 
   214 		{ 
   212 		SPUDTEL_ERROR_LOG(_L("CMbmsPdpConfigChangeNotifier::Notify(), error: %d"), 
   215 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMBMSPDPCONFIGCHANGENOTIFIER_NOTIFY_3, "CMbmsPdpConfigChangeNotifier::Notify(), error: %d", aStatus.Int());
   213 						aStatus.Int());
       
   214 		// Not all TSYs support RPacketContext::NotifyConfigChanged so we handle
   216 		// Not all TSYs support RPacketContext::NotifyConfigChanged so we handle
   215 		// KErrNotSupported silently (PDEF118981).
   217 		// KErrNotSupported silently (PDEF118981).
   216 		ASSERT((aStatus == KErrCancel) || (aStatus == KErrNotSupported));
   218 		ASSERT((aStatus == KErrCancel) || (aStatus == KErrNotSupported));
   217 		}
   219 		}
   218 	}
   220 	}