syncmlfw/ds/syncagent/src/nsmldsagent.cpp
changeset 32 5d0ec111abfc
parent 0 b497e44ab2fc
child 44 39aa16f3fdc2
equal deleted inserted replaced
27:2c8580950a26 32:5d0ec111abfc
    20 #include <SyncMLHistory.h>
    20 #include <SyncMLHistory.h>
    21 #include <e32property.h>
    21 #include <e32property.h>
    22 #include <DataSyncInternalPSKeys.h>
    22 #include <DataSyncInternalPSKeys.h>
    23 #include <nsmlconstants.h>
    23 #include <nsmlconstants.h>
    24 #include <nsmldebug.h>
    24 #include <nsmldebug.h>
       
    25 #include <cmpluginwlandef.h>
       
    26 #include <cmmanager.h>
       
    27 #include <cmconnectionmethod.h>
    25 
    28 
    26 // common includes with DM
    29 // common includes with DM
    27 #include "nsmlagenttestdefines.h"
    30 #include "nsmlagenttestdefines.h"
    28 #include "nsmlcliagconstants.h"
    31 #include "nsmlcliagconstants.h"
    29 #include "NSmlAgentBase.h" 
    32 #include "NSmlAgentBase.h" 
  1886 		{
  1889 		{
  1887 			//Read the IAPID from the Cenrep
  1890 			//Read the IAPID from the Cenrep
  1888 			profileUtil->AccessPointIdL(LastUsedIAPId);
  1891 			profileUtil->AccessPointIdL(LastUsedIAPId);
  1889 			if(LastUsedIAPId > 0)
  1892 			if(LastUsedIAPId > 0)
  1890 			{
  1893 			{
  1891 				//Check Whether the IAPID still exists
  1894                 //Check Whether the IAPID still exists
  1892 		    	TApBearerType bearertype = CheckAPBearerTypeL(LastUsedIAPId);
  1895                 RCmManager  cmmanager;
  1893 		    	if(bearertype != TApBearerType(-1))
  1896                 cmmanager.OpenL();
  1894 		    	{
  1897                 CleanupClosePushL(cmmanager);
  1895 		    		iIAPId = LastUsedIAPId;    	
  1898                 RCmConnectionMethod cm;
  1896 		    		DBG_FILE_CODE(iIAPId , _S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID Replaced from the CenRep:"));                
  1899                 TRAPD(err, cm = cmmanager.ConnectionMethodL( LastUsedIAPId ));
  1897 		    	}
  1900                 CleanupClosePushL( cm );
  1898 		    	else
  1901                 TUint32 bearer = 0;
  1899 		    	{
  1902                 if( err == KErrNone )
  1900 		    		//Stop the DS Sync Session
  1903                 {
  1901 		    		DBG_FILE(_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid so stopping the session"));
  1904                     bearer = cm.GetIntAttributeL( CMManager::ECmBearerType );        
  1902 		    		iPacketDataUnAvailable = ETrue;
  1905                     DBG_FILE_CODE( bearer ,_S8("CNSmlDSAgent::ReadSettingsL, BearerType"));
  1903 		    		StopDSSession();
  1906                     if ( bearer == KUidWlanBearerType )
  1904 		    	}	
  1907                     {
  1905 			}
  1908                         DBG_FILE(_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid WLAN"));
  1906 		}
  1909                         iPacketDataUnAvailable = ETrue;
  1907 		
  1910                         StopDSSession();
       
  1911                     }
       
  1912                     else
       
  1913                     {
       
  1914                         iIAPId = LastUsedIAPId;      
       
  1915                         DBG_FILE_CODE(iIAPId , _S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID Replaced from the CenRep:"));
       
  1916                     }
       
  1917                 }
       
  1918                 else
       
  1919                 {
       
  1920                     DBG_FILE_CODE( err ,_S8("CNSmlDSAgent::ReadSettingsL, The Access Point ID is invalid"));
       
  1921                     iPacketDataUnAvailable = ETrue;
       
  1922                     StopDSSession();
       
  1923                 }              
       
  1924                 CleanupStack::PopAndDestroy( 2 ); //cmmanagerext,cm			
       
  1925 			}
       
  1926 		}		
  1908 		CleanupStack::PopAndDestroy(profileUtil);
  1927 		CleanupStack::PopAndDestroy(profileUtil);
  1909 	}
  1928 	}
  1910 }
  1929 }
  1911 
  1930 
  1912 // ---------------------------------------------------------
  1931 // ---------------------------------------------------------