supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp
branchRCL_3
changeset 16 6fcbaa43369c
parent 4 42de37ce7ce4
child 24 9c303455e256
equal deleted inserted replaced
13:19bff11d6c18 16:6fcbaa43369c
    88 #include "epos_comasupldialogtimer.h"
    88 #include "epos_comasupldialogtimer.h"
    89 #include "epos_tomasuplposmethod.h"
    89 #include "epos_tomasuplposmethod.h"
    90 #include "epos_omasuplconfigurationkeys.h"
    90 #include "epos_omasuplconfigurationkeys.h"
    91 #include "epos_csuplsettingparams.h"
    91 #include "epos_csuplsettingparams.h"
    92 #include "epos_comasuplasnbase.h"
    92 #include "epos_comasuplasnbase.h"
       
    93 #include "epos_csuplsettingsconstants.h"
    93 
    94 
    94 
    95 
    95 _LIT(KTraceFileName,"SUPL_OMA_SESSION::EPos_COMASuplSession2.cpp");
    96 _LIT(KTraceFileName,"SUPL_OMA_SESSION::EPos_COMASuplSession2.cpp");
    96 
    97 
    97 //Multiplying factor for conversion of ellipsoid to circle
    98 //Multiplying factor for conversion of ellipsoid to circle
  1716 
  1717 
  1717     TPosition posInfo;
  1718     TPosition posInfo;
  1718     TOMASuplUtcTime UtcTime;
  1719     TOMASuplUtcTime UtcTime;
  1719     TOMASuplPositionEstimate PosEstimate;
  1720     TOMASuplPositionEstimate PosEstimate;
  1720     TDateTime TimeStamp;
  1721     TDateTime TimeStamp;
  1721     TInt ZoneCode,Zone,altitude,AltitudeUncertainty, HorizontalAccuracy;
  1722     TInt ZoneCode,Zone,altitude, HorizontalAccuracy;
       
  1723 	TInt AltitudeUncertainty = 0;
  1722     TOMASuplAltitudeInfo AltitudeInfo;
  1724     TOMASuplAltitudeInfo AltitudeInfo;
  1723     TInt latitude,longitude;
  1725     TInt latitude,longitude;
  1724     TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
  1726     TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
  1725     TOMASuplAltitudeInfo::TOMASuplAltitudeDirection altitudeDirection;
  1727     TOMASuplAltitudeInfo::TOMASuplAltitudeDirection altitudeDirection;
  1726     TOMASuplUncertainty Uncertainty;
  1728     TOMASuplUncertainty Uncertainty;
  1900 
  1902 
  1901     TPosition posInfo;
  1903     TPosition posInfo;
  1902     TOMASuplUtcTime UtcTime;
  1904     TOMASuplUtcTime UtcTime;
  1903     TOMASuplPositionEstimate PosEstimate;
  1905     TOMASuplPositionEstimate PosEstimate;
  1904     TDateTime TimeStamp;
  1906     TDateTime TimeStamp;
  1905     TInt ZoneCode,Zone,altitude,AltitudeUncertainty, HorizontalAccuracy;
  1907     TInt ZoneCode,Zone,altitude, HorizontalAccuracy;
       
  1908 	TInt AltitudeUncertainty = 0;
  1906     TOMASuplAltitudeInfo AltitudeInfo;
  1909     TOMASuplAltitudeInfo AltitudeInfo;
  1907     TInt latitude,longitude;
  1910     TInt latitude,longitude;
  1908     TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
  1911     TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
  1909     TOMASuplAltitudeInfo::TOMASuplAltitudeDirection AltitudeDirection;
  1912     TOMASuplAltitudeInfo::TOMASuplAltitudeDirection AltitudeDirection;
  1910     TOMASuplUncertainty Uncertainty;
  1913     TOMASuplUncertainty Uncertainty;
  2220                 hslpAdress->Des().Copy(iHSLPAddress);
  2223                 hslpAdress->Des().Copy(iHSLPAddress);
  2221                 }
  2224                 }
  2222 
  2225 
  2223             else if(len ==0)
  2226             else if(len ==0)
  2224                 {
  2227                 {
  2225                 iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
  2228                 CServerParams* serverParams = CServerParams::NewL();
  2226                 hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
  2229                 CleanupStack::PushL(serverParams);
  2227                 CleanupStack::PushL(hslpAdress);
  2230     
  2228                 hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
  2231                 if (iSuplStorageSettings->GetDefaultServer(serverParams) == KErrNotFound )
  2229                 CleanupStack::Pop(hslpAdress);						
  2232                     {
  2230                 }
  2233                     iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
       
  2234                     hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
       
  2235                     hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
       
  2236                     }
       
  2237                 else
       
  2238                     {
       
  2239                     iTrace->Trace(_L("Sending End with ver for Default HSLP"), KTraceFileName, __LINE__);
       
  2240                     TInt64 slpId;
       
  2241                     TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
       
  2242                     HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
       
  2243                     HBufC* iapName = HBufC::NewL(KMaxIAPLen);
       
  2244                     CleanupStack::PushL(serverAddr);
       
  2245                     CleanupStack::PushL(iapName);
       
  2246                     serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
       
  2247                     hslpAdress = HBufC8::NewL(serverAddr->Length());
       
  2248                     hslpAdress->Des().Copy(*serverAddr);
       
  2249     
       
  2250                     CleanupStack::PopAndDestroy(iapName);
       
  2251                     CleanupStack::PopAndDestroy(serverAddr);
       
  2252                     }
       
  2253                 CleanupStack::PopAndDestroy(serverParams);
       
  2254                 }
       
  2255             delete iSuplState;
       
  2256             iSuplState=NULL;
  2231             CleanupStack::PushL(hslpAdress);
  2257             CleanupStack::PushL(hslpAdress);
  2232             iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
  2258             iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
  2233             CleanupStack::PopAndDestroy(hslpAdress);
  2259             CleanupStack::PopAndDestroy(hslpAdress);
  2234             }
  2260             }
  2235         else
  2261         else
  3855         hslpAdress->Des().Copy(iHSLPAddress);
  3881         hslpAdress->Des().Copy(iHSLPAddress);
  3856         }
  3882         }
  3857 
  3883 
  3858     else if(len ==0)
  3884     else if(len ==0)
  3859         {
  3885         {
  3860         iTrace->Trace(_L("HSLP generated frm IMSI"), KTraceFileName, __LINE__);
  3886 		CServerParams* serverParams = CServerParams::NewL();
  3861         hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
  3887 		CleanupStack::PushL(serverParams);
  3862         CleanupStack::PushL(hslpAdress);
  3888 		
  3863         hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());
  3889 		if (iSuplStorageSettings->GetDefaultServer(serverParams) == KErrNotFound )
  3864         CleanupStack::Pop(hslpAdress);	
  3890 			{
       
  3891 	        iTrace->Trace(_L("HSLP generated frm IMSI"), KTraceFileName, __LINE__);
       
  3892 	        hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
       
  3893 	        CleanupStack::PushL(hslpAdress);
       
  3894 	        hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());
       
  3895 	        CleanupStack::Pop(hslpAdress);	
       
  3896 			}
       
  3897 		else
       
  3898 			{
       
  3899 			iTrace->Trace(_L("Default HSLP"), KTraceFileName, __LINE__);
       
  3900 			TInt64 slpId;
       
  3901 			TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
       
  3902 			HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
       
  3903 			HBufC* iapName = HBufC::NewL(KMaxIAPLen);
       
  3904 			CleanupStack::PushL(serverAddr);
       
  3905 			CleanupStack::PushL(iapName);
       
  3906 			serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
       
  3907 			hslpAdress = HBufC8::NewL(serverAddr->Length());
       
  3908 			hslpAdress->Des().Copy(*serverAddr);
       
  3909 		
       
  3910 			CleanupStack::PopAndDestroy(iapName);
       
  3911 			CleanupStack::PopAndDestroy(serverAddr);
       
  3912 			}
       
  3913 		CleanupStack::PopAndDestroy(serverParams);
  3865 
  3914 
  3866         }
  3915         }
  3867     CleanupStack::PushL(hslpAdress);
  3916     CleanupStack::PushL(hslpAdress);
  3868 
  3917 
  3869     delete iSuplState;
  3918     delete iSuplState;
  4388                     	hslpAdress = HBufC8::NewL(iHSLPAddress.Length());
  4437                     	hslpAdress = HBufC8::NewL(iHSLPAddress.Length());
  4389                     	hslpAdress->Des().Copy(iHSLPAddress);
  4438                     	hslpAdress->Des().Copy(iHSLPAddress);
  4390                     	}
  4439                     	}
  4391                 	else if(len ==0)
  4440                 	else if(len ==0)
  4392                     	{
  4441                     	{
  4393                     	iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
  4442 						CServerParams* serverParams = CServerParams::NewL();
  4394                     	hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
  4443 						CleanupStack::PushL(serverParams);
  4395                     	CleanupStack::PushL(hslpAdress);
  4444 					
  4396                     	hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
  4445 						if (iSuplStorageSettings->GetDefaultServer(serverParams) == KErrNotFound )
  4397                     	CleanupStack::Pop(hslpAdress);
  4446 							{
       
  4447 	                    	iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
       
  4448 	                    	hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
       
  4449 	                    	hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
       
  4450 							}
       
  4451 							else
       
  4452 							{
       
  4453 							iTrace->Trace(_L("Sending End with ver for Default HSLP"), KTraceFileName, __LINE__);
       
  4454 							TInt64 slpId;
       
  4455             				TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
       
  4456 							HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
       
  4457 							HBufC* iapName = HBufC::NewL(KMaxIAPLen);
       
  4458 							CleanupStack::PushL(serverAddr);
       
  4459 							CleanupStack::PushL(iapName);
       
  4460 							serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
       
  4461 							hslpAdress = HBufC8::NewL(serverAddr->Length());
       
  4462 							hslpAdress->Des().Copy(*serverAddr);
       
  4463 			
       
  4464 							CleanupStack::PopAndDestroy(iapName);
       
  4465 							CleanupStack::PopAndDestroy(serverAddr);
       
  4466 							}
       
  4467 						CleanupStack::PopAndDestroy(serverParams);
  4398                     	}
  4468                     	}
  4399 
  4469 
       
  4470 			    delete iSuplState;
       
  4471 			    iSuplState = NULL;
  4400                 CleanupStack::PushL(hslpAdress);
  4472                 CleanupStack::PushL(hslpAdress);
  4401                 ServerAddressCheckForSuplInitL();
  4473                 ServerAddressCheckForSuplInitL();
  4402                 iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
  4474                 iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
  4403                 CleanupStack::PopAndDestroy(hslpAdress);
  4475                 CleanupStack::PopAndDestroy(hslpAdress);
  4404 
  4476