bearermanagement/mpm/src/mpmserver.cpp
branchRCL_3
changeset 26 0a9e01492035
parent 19 22c3c67e5001
child 36 04408506c6e0
equal deleted inserted replaced
24:c45d4fe2ff0a 26:0a9e01492035
   299 // CMPMServer::~CMPMServer
   299 // CMPMServer::~CMPMServer
   300 // -----------------------------------------------------------------------------
   300 // -----------------------------------------------------------------------------
   301 //
   301 //
   302 CMPMServer::~CMPMServer()
   302 CMPMServer::~CMPMServer()
   303     {
   303     {
       
   304 	if ( iRoamingToWlanPeriodic )
       
   305         {
       
   306         iRoamingToWlanPeriodic->Cancel();
       
   307 		delete iRoamingToWlanPeriodic;
       
   308         }
   304     if ( iDisconnectQueue )
   309     if ( iDisconnectQueue )
   305         {
   310         {
   306         iDisconnectQueue->ResetAndDestroy();
   311         iDisconnectQueue->ResetAndDestroy();
   307         }
   312         }
   308     delete iDisconnectQueue;
   313     delete iDisconnectQueue;
   982 
   987 
   983     // Start possible forced roaming
   988     // Start possible forced roaming
   984     TCmUsageOfWlan usageOfWlan = CommsDatAccess()->ForcedRoamingL();
   989     TCmUsageOfWlan usageOfWlan = CommsDatAccess()->ForcedRoamingL();
   985     if ( usageOfWlan == ECmUsageOfWlanKnown || usageOfWlan == ECmUsageOfWlanKnownAndNew )
   990     if ( usageOfWlan == ECmUsageOfWlanKnown || usageOfWlan == ECmUsageOfWlanKnownAndNew )
   986         {
   991         {
   987         StartForcedRoamingToWlanL( iapInfo );
   992         if ( IsWlanConnectionStartedL( CommsDatAccess() ) )
       
   993             {
       
   994             iConnMonIapInfo = aIapInfo;
       
   995                 
       
   996             if ( iRoamingToWlanPeriodic )
       
   997                 {
       
   998                 iRoamingToWlanPeriodic->Cancel();
       
   999                 }
       
  1000             else
       
  1001                 {
       
  1002                 iRoamingToWlanPeriodic = CPeriodic::NewL( 
       
  1003                                                    CActive::EPriorityStandard );
       
  1004                 }
       
  1005             // start periodic object that calls StartForcedRoamingToWlanL after 10s. 
       
  1006             // this handles the case when new wlan connection is 
       
  1007             // started from e.g. wlan sniffer but IAP is not yet in Internet SNAP 
       
  1008             iRoamingToWlanPeriodic->Start( 
       
  1009                    TTimeIntervalMicroSeconds32( KRoamingToWlanUpdateInterval ), 
       
  1010                    TTimeIntervalMicroSeconds32( KRoamingToWlanUpdateInterval ), 
       
  1011                    TCallBack( StartForcedRoamingToConnectedWlanL, this ) );
       
  1012             }
       
  1013         else
       
  1014             {
       
  1015             StartForcedRoamingToWlanL( iapInfo );
       
  1016             }
       
  1017 
   988         StartForcedRoamingFromWlanL( iapInfo );
  1018         StartForcedRoamingFromWlanL( iapInfo );
   989         }
  1019         }
   990     
  1020     
   991     MPMLOGSTRING2(
  1021     MPMLOGSTRING2(
   992     "CMPMServer::NotifyBMPrefIapL - Send notifications for %d sessions", 
  1022     "CMPMServer::NotifyBMPrefIapL - Send notifications for %d sessions", 
  1802 // -----------------------------------------------------------------------------
  1832 // -----------------------------------------------------------------------------
  1803 //
  1833 //
  1804 void CMPMServer::StartForcedRoamingToWlanL( const TConnMonIapInfo& aIapInfo )
  1834 void CMPMServer::StartForcedRoamingToWlanL( const TConnMonIapInfo& aIapInfo )
  1805     {
  1835     {
  1806     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToWlan" )
  1836     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToWlan" )
  1807 
  1837     
  1808     // First check that there is no active wlan connection
  1838     // cancel the periodic object
  1809     if ( IsWlanConnectionStartedL( CommsDatAccess() ) )
  1839     if ( iRoamingToWlanPeriodic != NULL )
  1810         {
  1840         {
  1811         // Wlan already active can't roam to it
  1841         iRoamingToWlanPeriodic->Cancel();
  1812         return;
       
  1813         }
  1842         }
  1814 
  1843 
  1815     // Copy all available wlan iap ids to own array
  1844     // Copy all available wlan iap ids to own array
  1816     RArray<TUint32> wlanIapIds;
  1845     RArray<TUint32> wlanIapIds;
  1817     CleanupClosePushL( wlanIapIds );
  1846     CleanupClosePushL( wlanIapIds );
  1866             }
  1895             }
  1867         }
  1896         }
  1868     CleanupStack::PopAndDestroy( &iapList );
  1897     CleanupStack::PopAndDestroy( &iapList );
  1869     CleanupStack::PopAndDestroy( &wlanIapIds );
  1898     CleanupStack::PopAndDestroy( &wlanIapIds );
  1870     }
  1899     }
       
  1900 
       
  1901 
       
  1902 // ---------------------------------------------------------------------------
       
  1903 // CMPMServer::StartForcedRoamingToConnectedWlanL
       
  1904 // ---------------------------------------------------------------------------
       
  1905 //    
       
  1906 TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
       
  1907     {
       
  1908     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" );
       
  1909     static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingToWlanL( 
       
  1910             static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo );
       
  1911     return 0;
       
  1912     }
       
  1913 
  1871 
  1914 
  1872 // -----------------------------------------------------------------------------
  1915 // -----------------------------------------------------------------------------
  1873 // CMPMServer::StartForcedRoamingFromWlanL
  1916 // CMPMServer::StartForcedRoamingFromWlanL
  1874 // -----------------------------------------------------------------------------
  1917 // -----------------------------------------------------------------------------
  1875 //
  1918 //