networkcontrol/iptransportlayer/src/ipcpr_states.cpp
branchRCL_3
changeset 58 8d540f55e491
parent 57 abbed5a4b42a
--- a/networkcontrol/iptransportlayer/src/ipcpr_states.cpp	Tue Aug 31 16:45:15 2010 +0300
+++ b/networkcontrol/iptransportlayer/src/ipcpr_states.cpp	Wed Sep 01 12:33:58 2010 +0100
@@ -25,6 +25,7 @@
 #include "IPCpr.h"
 #include "ipcpr_states.h"
 #include "IPMessages.h"
+#include <gsmerror.h>
 #include <comms-infras/ss_nodemessages.h>
 #include <comms-infras/ss_nodemessages_internal_esock.h>
 #include <comms-infras/ss_datamonitoringprovider.h>
@@ -189,6 +190,26 @@
 
 #endif  //SYMBIAN_NETWORKING_UPS
 
+
+DEFINE_SMELEMENT( TAwaitingSpecialGoneDown, NetStateMachine::MState, IpCprStates::TContext)
+TBool IpCprStates::TAwaitingSpecialGoneDown::Accept()
+	{
+    TCFControlClient::TGoneDown* pGoneDown = message_cast<TCFControlClient::TGoneDown>(&iContext.iMessage);
+        if(pGoneDown && //If this is a TCFControlClient::TGoneDown message AND
+        iContext.Node().CountClients<TDefaultClientMatchPolicy>(
+                        TClientType(TCFClientType::ECtrl, TCFClientType::EAttach)) && //the local node is an attached ipcpr AND
+        ((pGoneDown->iValue1 == KErrGprsInsufficientResources) || //the error value suggests the contention management
+         (pGoneDown->iValue1 == KErrPacketDataTsyMaxPdpContextsReached) ||
+         (pGoneDown->iValue1 == KErrUmtsMaxNumOfContextExceededByNetwork) ||     
+         (pGoneDown->iValue1 == KErrUmtsMaxNumOfContextExceededByPhone))
+         )
+          {
+          return ETrue;
+          }
+        return EFalse;
+	}
+
+
 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
 /*
 Constructor for the new parameter set to be sent in parameter bundle while requesting for bearer type.