telephonyserverplugins/simtsy/src/CSimPacketContext.cpp
changeset 19 1f776524b15c
parent 0 3553901f7fa8
child 24 6638e7f4bd8f
child 42 3adadc800673
equal deleted inserted replaced
0:3553901f7fa8 19:1f776524b15c
    97 CSimPacketContext::CSimPacketContext(CSimPhone* aPhone, CSimPacketService* aPacketService, const TName& aContextName)
    97 CSimPacketContext::CSimPacketContext(CSimPhone* aPhone, CSimPacketService* aPacketService, const TName& aContextName)
    98 	: iPhone(aPhone), iDeleted(EFalse),iIsActive(EFalse),iPacketService(aPacketService),iContextName(aContextName),
    98 	: iPhone(aPhone), iDeleted(EFalse),iIsActive(EFalse),iPacketService(aPacketService),iContextName(aContextName),
    99 	  iTFTCreated(EFalse), iNumTFTsCreated(-1), iNumFiltersAdded(0),
    99 	  iTFTCreated(EFalse), iNumTFTsCreated(-1), iNumFiltersAdded(0),
   100       iContextConfigParamsIndex(0), iCommPortLoaned(EFalse),iQoSObjectCount(0),
   100       iContextConfigParamsIndex(0), iCommPortLoaned(EFalse),iQoSObjectCount(0),
   101       iNotifyContextConfigChangeArray(NULL), iSetConfigData(NULL), iSetConfigCallCount(0), iTFTChangeBool(0),
   101       iNotifyContextConfigChangeArray(NULL), iSetConfigData(NULL), iSetConfigCallCount(0), iTFTChangeBool(0),
   102       iNotifyContextStatusChangeIndex(0),iState(RPacketContext::EStatusInactive)
   102       iNotifyContextStatusChangeIndex(0),iState(RPacketContext::EStatusInactive), iLastError(KErrNone), iErrorCodeForGetLastErrorCause(KErrNone)
   103 	  
   103 	  
   104 /**
   104 /**
   105 * Trivial Constructor.  Initialises all the data members
   105 * Trivial Constructor.  Initialises all the data members
   106 *
   106 *
   107 * @param aPacketService Pointer to the Packet Service object (CSimPacketService)
   107 * @param aPacketService Pointer to the Packet Service object (CSimPacketService)
  2474 	{
  2474 	{
  2475 	LOGPACKET1("CSimPacketContext::NotifyDataTransferredCancel called");
  2475 	LOGPACKET1("CSimPacketContext::NotifyDataTransferredCancel called");
  2476 	return KErrNone;
  2476 	return KErrNone;
  2477 	}
  2477 	}
  2478 
  2478 
  2479 TInt CSimPacketContext::GetLastErrorCause(const TTsyReqHandle aTsyReqHandle,TInt* /*aError*/)
  2479 TInt CSimPacketContext::GetLastErrorCause(const TTsyReqHandle aTsyReqHandle, TInt* aError)
  2480 /**
  2480 /**
  2481 * This method is not supported in this TSY
  2481 * This method is not supported in this TSY
  2482 *
  2482 *
  2483 * @param aTsyReqHandle Tsy Request handle for the client request
  2483 * @param aTsyReqHandle Tsy Request handle for the client request
  2484 * @param aError pointer to the last error cause
  2484 * @param aError pointer to the last error cause
  2485 * @return KerrNone
  2485 * @return KerrNone
  2486 */
  2486 */
  2487 	{
  2487 	{
  2488 	LOGPACKET1("CSimPacketContext::GetLastErrorCause called");
  2488 	LOGPACKET1("CSimPacketContext::GetLastErrorCause called");
  2489 	ReqCompleted(aTsyReqHandle,KErrNotSupported);
  2489 	*aError = iLastError;
       
  2490 	ReqCompleted(aTsyReqHandle,iErrorCodeForGetLastErrorCause);
       
  2491 	iErrorCodeForGetLastErrorCause = KErrNone;
  2490 	return KErrNone;
  2492 	return KErrNone;
  2491 	}
  2493 	}
  2492 
  2494 
  2493 void CSimPacketContext::TimerCallBack(TInt aId)
  2495 void CSimPacketContext::TimerCallBack(TInt aId)
  2494 /**
  2496 /**
  2835 					{
  2837 					{
  2836 						TInt activateValue;
  2838 						TInt activateValue;
  2837 						if (found)
  2839 						if (found)
  2838 							activateValue = iContextConfigsRel99->At(i).iActivateErrorCode;
  2840 							activateValue = iContextConfigsRel99->At(i).iActivateErrorCode;
  2839 						else
  2841 						else
  2840 							activateValue = iActivateFail;				
  2842 							activateValue = iActivateFail;	
  2841 
  2843 						if(activateValue == KContextGoToInactiveWithErrorWhenTryingToGetLastErrorCode)
       
  2844 						    {
       
  2845 						    //this will allow context activation move to the next state but with context being inactive 
       
  2846 						    ret=ChangeState(RPacketContext::EStatusInactive);
       
  2847 						    iCurrentEvent=EContextEventNone;
       
  2848 						    iLastError = activateValue;
       
  2849 						    iErrorCodeForGetLastErrorCause=KErrGeneral;
       
  2850 						    
       
  2851 						    iContextConfigsRel99->At(i).iActivateErrorCode = iLastError;
       
  2852 						    ReqCompleted(iActivateRequestHandle, KErrNone);
       
  2853 						    
       
  2854 						    break;
       
  2855 						    }
       
  2856 						if(activateValue <= KContextGoToInactiveWithExtendedErrorCode && activateValue > KContextGoToInactiveWithNormalErrorCode)
       
  2857                             {
       
  2858                             //this will allow context activation move to the next state but with context being inactive     
       
  2859                             //tsy extended error case
       
  2860                             ret=ChangeState(RPacketContext::EStatusInactive);
       
  2861                             iCurrentEvent=EContextEventNone;
       
  2862                             iLastError = activateValue - KContextGoToInactiveWithExtendedErrorCode;
       
  2863                             //move the error code to the higher 16 bit.
       
  2864                             iLastError<<=16;
       
  2865                             
       
  2866                             iContextConfigsRel99->At(i).iActivateErrorCode = iLastError;
       
  2867                             ReqCompleted(iActivateRequestHandle, KErrNone);
       
  2868                             
       
  2869                             break;
       
  2870                             }
       
  2871 						if(activateValue <= KContextGoToInactiveWithNormalErrorCode && activateValue > KLimitForErrorCodeForContextGoToInactive)
       
  2872 						    {
       
  2873 						    //this will allow context activation move to the next state but with context being inactive
       
  2874 						    //normal error case
       
  2875 						    ret=ChangeState(RPacketContext::EStatusInactive);
       
  2876 						    iCurrentEvent=EContextEventNone;
       
  2877 						    iLastError = activateValue - KContextGoToInactiveWithNormalErrorCode;
       
  2878 						    
       
  2879 						    iContextConfigsRel99->At(i).iActivateErrorCode = iLastError;
       
  2880 						    ReqCompleted(iActivateRequestHandle, KErrNone);
       
  2881 						    
       
  2882 						    break;
       
  2883 						    }
       
  2884 						else
  2842 						if(activateValue != KErrNone)
  2885 						if(activateValue != KErrNone)
  2843 							{
  2886 							{
  2844 							ReqCompleted(iActivateRequestHandle,activateValue);
  2887 							ReqCompleted(iActivateRequestHandle,activateValue);
  2845 							ret=ChangeState(RPacketContext::EStatusInactive);
  2888 							ret=ChangeState(RPacketContext::EStatusInactive);
  2846 							iCurrentEvent=EContextEventNone;
  2889 							iCurrentEvent=EContextEventNone;