telephonyprotocols/pdplayer/umts/spudtel/src/eteldriverstrategies.cpp
branchRCL_3
changeset 29 cca59d85ca31
parent 15 fc69e1e37771
child 65 630d2f34d719
equal deleted inserted replaced
27:4284d6390a82 29:cca59d85ca31
     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".
   452 			aContext.PacketQoS().CancelAsyncRequest(EPacketQoSSetProfileParams);
   452 			aContext.PacketQoS().CancelAsyncRequest(EPacketQoSSetProfileParams);
   453 			break;
   453 			break;
   454 			}
   454 			}
   455 			
   455 			
   456 		case EInitialiseContextStep:
   456 		case EInitialiseContextStep:
   457 		    SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketContextActivate"));
   457 		    SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketContextInitialiseContext"));
   458 		    aContext.PacketContext().CancelAsyncRequest(EPacketContextActivateCancel);
   458 		    aContext.PacketContext().CancelAsyncRequest(EPacketContextInitialiseContext);
   459 		    break;
   459 		    break;
   460 			
   460 			
   461 		default:
   461 		default:
   462 			// there're NO outstanding async requests
   462 			// there're NO outstanding async requests
   463 			SPUDTEL_ERROR_LOG0(_L("ERROR: Incorrect case"));
   463 			SPUDTEL_ERROR_LOG0(_L("ERROR: Incorrect case"));
  1093 	
  1093 	
  1094 	switch(aContext.StrategyStep())
  1094 	switch(aContext.StrategyStep())
  1095 		{
  1095 		{
  1096 		case EStartStep:
  1096 		case EStartStep:
  1097 			{
  1097 			{
       
  1098 			SPUDTEL_INFO_LOG(_L("RPacketContext::Activate()"));
  1098 			aContext.PacketContext().Activate(*aStatus);
  1099 			aContext.PacketContext().Activate(*aStatus);
  1099 			aContext.SetStrategyStep (EActivateStep);
  1100 			aContext.SetStrategyStep (EActivateStep);
  1100 			break;
  1101 			break;
  1101 			}
  1102 			}
  1102 		
  1103 		
  1103 		case EActivateStep:
  1104 		case EActivateStep:
  1104 			{
  1105 		case ENotifyStatusChange:
       
  1106 			{
       
  1107             SPUDTEL_INFO_LOG(_L("RPacketContext::GetStatus()"));
  1105             if (aContext.PacketContext().GetStatus(aContext.ContextStatus()) != KErrNone)
  1108             if (aContext.PacketContext().GetStatus(aContext.ContextStatus()) != KErrNone)
  1106                 {
  1109                 {
  1107                 aContext.ContextStatus() = RPacketContext::EStatusInactive;
  1110                 aContext.ContextStatus() = RPacketContext::EStatusInactive;
  1108                 }
  1111                 }
  1109             
  1112             
  1110             switch (aContext.ContextStatus())
  1113             switch (aContext.ContextStatus())
  1111             	{
  1114             	{
  1112             	case RPacketContext::EStatusActive:
  1115             	case RPacketContext::EStatusActive:
  1113                 	// Context is now active
  1116                 	// Context is now active
  1114     	            aContext.PdpFsmInterface().Get (aContext.Id(), aContext.ContextPacketDataConfigBase());
  1117     	            aContext.PdpFsmInterface().Get (aContext.Id(), aContext.ContextPacketDataConfigBase());
       
  1118     	            SPUDTEL_INFO_LOG(_L("RPacketContext::GetConfig()"));
  1115     				aContext.PacketContext().GetConfig (*aStatus, aContext.ContextConfig());
  1119     				aContext.PacketContext().GetConfig (*aStatus, aContext.ContextConfig());
  1116     				aContext.SetStrategyStep (EGetConfigStep);
  1120     				aContext.SetStrategyStep (EGetConfigStep);
  1117     				break;
  1121     				break;
  1118 
  1122 
  1119             	case RPacketContext::EStatusInactive:
  1123             	case RPacketContext::EStatusInactive:
  1150                     break;
  1154                     break;
  1151                     }
  1155                     }
  1152             	
  1156             	
  1153             	default:
  1157             	default:
  1154             		// Not active, not inactive. Re-request the status and try again
  1158             		// Not active, not inactive. Re-request the status and try again
       
  1159             	    SPUDTEL_INFO_LOG(_L("RPacketContext::NotifyStatusChange()"));
  1155                     aContext.PacketContext().NotifyStatusChange(*aStatus, aContext.ContextStatus());
  1160                     aContext.PacketContext().NotifyStatusChange(*aStatus, aContext.ContextStatus());
  1156                     aContext.SetStrategyStep (EActivateStep);
  1161                     aContext.SetStrategyStep (ENotifyStatusChange);
  1157                     break;
  1162                     break;
  1158                 }
  1163                 }
  1159 			break;
  1164 			break;
  1160 			}
  1165 			}
  1161 			
  1166 			
  1251 	{
  1256 	{
  1252 	switch(aContext.StrategyStep())
  1257 	switch(aContext.StrategyStep())
  1253 		{
  1258 		{
  1254 		case EActivateStep:
  1259 		case EActivateStep:
  1255 			{
  1260 			{
       
  1261             SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketContextActivate"));
  1256 			aContext.PacketContext().CancelAsyncRequest(EPacketContextActivate);
  1262 			aContext.PacketContext().CancelAsyncRequest(EPacketContextActivate);
  1257 			SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketContextActivate"));
       
  1258 			break;
  1263 			break;
  1259 			}
  1264 			}
  1260 			
  1265 			
  1261 		case EGetConfigStep:
  1266 		case EGetConfigStep:
  1262 			{
  1267 			{
  1263 			aContext.PacketContext().CancelAsyncRequest(EGetConfigStep);
  1268 	        SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketContextGetConfig"));
  1264 			SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EGetConfigStep"));
  1269 			aContext.PacketContext().CancelAsyncRequest(EPacketContextGetConfig);
  1265 			break;
  1270 			break;
  1266 			}
  1271 			}
  1267 		
  1272 					
  1268 		case EInitialiseContextStep:
  1273 		case ENotifyStatusChange:
  1269 			{
  1274 		    {
  1270 			aContext.PacketContext().CancelAsyncRequest(EPacketContextInitialiseContext);	
  1275             SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketContextNotifyStatusChange"));
  1271 			SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketContextInitialiseContext"));
  1276             aContext.PacketContext().CancelAsyncRequest(EPacketContextNotifyStatusChange);
  1272 			break;
  1277             break;
  1273 			}
  1278 		    }
  1274 			
  1279 		    
  1275 		case EGetProfileParamsStep:
  1280 		case EGetProfileParamsStep:
  1276 			{
  1281 			{
  1277 			if(KPrimaryContextId == aContext.Id())
  1282 			if(KPrimaryContextId == aContext.Id())
  1278 				{
  1283 				{
       
  1284                 SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketQoSGetProfileParams"));
  1279 				aContext.PacketContext().CancelAsyncRequest(EPacketQoSGetProfileParams);	
  1285 				aContext.PacketContext().CancelAsyncRequest(EPacketQoSGetProfileParams);	
  1280 				SPUDTEL_INFO_LOG(_L("Cancel PacketContext::EPacketQoSGetProfileParams"));
       
  1281 				break;
  1286 				break;
  1282 				}
  1287 				}
  1283 			}
  1288 			}
  1284 			
  1289 			
  1285 		default:
  1290 		default:
  1743 			break;
  1748 			break;
  1744 			}
  1749 			}
  1745 		
  1750 		
  1746 		case EGetConfigStep:
  1751 		case EGetConfigStep:
  1747 			{
  1752 			{
  1748 			aContext.MbmsPacketContext().CancelAsyncRequest(EGetConfigStep);
  1753 			aContext.MbmsPacketContext().CancelAsyncRequest(EPacketContextGetConfig);
  1749 			SPUDTEL_INFO_LOG(_L("Cancel MbmsPacketContext::EGetConfigStep"));
  1754 			SPUDTEL_INFO_LOG(_L("Cancel MbmsPacketContext::EPacketContextGetConfig"));
  1750 			break;
  1755 			break;
  1751 			}
  1756 			}
  1752 		
  1757 		
  1753 		case EInitialiseContextStep:
  1758 		case EInitialiseContextStep:
  1754 			{
  1759 			{