bearermanagement/mpm/src/mpmserver.cpp
changeset 64 84c6623982f6
parent 60 a9c709db68db
equal deleted inserted replaced
60:a9c709db68db 64:84c6623982f6
   730         // Check if IAP Id matches
   730         // Check if IAP Id matches
   731         // 
   731         // 
   732         if ( iActiveBMConns[i].iConnInfo.iState == EStarting ||
   732         if ( iActiveBMConns[i].iConnInfo.iState == EStarting ||
   733              iActiveBMConns[i].iConnInfo.iState == EStarted )
   733              iActiveBMConns[i].iConnInfo.iState == EStarted )
   734             {
   734             {
   735             if ( aCdbAccess->CheckWlanL( iActiveBMConns[i].iConnInfo.iIapId ) != ENotWlanIap )
   735             TWlanIapType iapType( ENotWlanIap );             	
       
   736             TRAPD ( leave, iapType = aCdbAccess->CheckWlanL( iActiveBMConns[i].iConnInfo.iIapId ) )             	
       
   737             if ( ( leave == KErrNone ) && ( iapType != ENotWlanIap ) )
   736                 {
   738                 {
   737                 stopLoop = ETrue;
   739                 stopLoop = ETrue;
   738                 iapId = iActiveBMConns[i].iConnInfo.iIapId;
   740                 iapId = iActiveBMConns[i].iConnInfo.iIapId;
   739                 MPMLOGSTRING2( "CMPMServer::IsWlanConnectionStartedL, found wlan iap %d", iapId )
   741                 MPMLOGSTRING2( "CMPMServer::IsWlanConnectionStartedL, found wlan iap %d", iapId )
   740                 }
   742                 }
  1491     RAvailableIAPList iapList;
  1493     RAvailableIAPList iapList;
  1492     CleanupClosePushL( iapList );
  1494     CleanupClosePushL( iapList );
  1493 
  1495 
  1494     for ( TUint index = 0; index < aIapInfo.iCount; index++ )
  1496     for ( TUint index = 0; index < aIapInfo.iCount; index++ )
  1495         {
  1497         {
  1496         if ( CommsDatAccess()->CheckWlanL( aIapInfo.iIap[index].iIapId ) != ENotWlanIap )
  1498         TWlanIapType iapType ( ENotWlanIap );
       
  1499         TRAPD (leave, iapType = CommsDatAccess()->CheckWlanL( aIapInfo.iIap[index].iIapId ) );
       
  1500         if ( ( iapType != ENotWlanIap ) && ( leave == KErrNone ) )
  1497             {
  1501             {
  1498             // Accept only wlan iaps in internet snap
  1502             // Accept only wlan iaps in internet snap
  1499             if ( iCommsDatAccess->IsInternetSnapL( aIapInfo.iIap[index].iIapId, 0 ) )
  1503             if ( iCommsDatAccess->IsInternetSnapL( aIapInfo.iIap[index].iIapId, 0 ) )
  1500                 {
  1504                 {
  1501                 wlanIapIds.AppendL( aIapInfo.iIap[index].iIapId );
  1505                 wlanIapIds.AppendL( aIapInfo.iIap[index].iIapId );
  1548 // ---------------------------------------------------------------------------
  1552 // ---------------------------------------------------------------------------
  1549 //    
  1553 //    
  1550 TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
  1554 TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
  1551     {
  1555     {
  1552     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" );
  1556     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" );
  1553     static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingToWlanL( 
  1557     TRAPD( error, static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingToWlanL( 
  1554             static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo );
  1558            static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo ) )
       
  1559     if ( error )
       
  1560         {        	
       
  1561         MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error1 = %d, ", error )
       
  1562         return 0;
       
  1563         }
       
  1564 
  1555     // Added also execution of policy based roaming logic because
  1565     // Added also execution of policy based roaming logic because
  1556     // connections that are in EStarting state, when WLAN signal
  1566     // connections that are in EStarting state, when WLAN signal
  1557     // gets weak, would remain in WLAN as long as signal is weak. 
  1567     // gets weak, would remain in WLAN as long as signal is weak. 
  1558     static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingFromWlanL(
  1568     TRAP( error, static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingFromWlanL(
  1559             static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo );
  1569           static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo ) )
       
  1570     if ( error )
       
  1571         {        	
       
  1572         MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error2 = %d, ", error )
       
  1573         }
       
  1574 
  1560     return 0;
  1575     return 0;
  1561     }
  1576     }
  1562 
  1577 
  1563 
  1578 
  1564 // -----------------------------------------------------------------------------
  1579 // -----------------------------------------------------------------------------
  1595     
  1610     
  1596     // Go through all active connections and start roaming for the ones connected
  1611     // Go through all active connections and start roaming for the ones connected
  1597     // to a wlan not anymore listed in available iaps and not using mobility api
  1612     // to a wlan not anymore listed in available iaps and not using mobility api
  1598     for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
  1613     for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
  1599         {
  1614         {
  1600         if ( iCommsDatAccess->CheckWlanL( iActiveBMConns[index].iConnInfo.iIapId )
  1615         TWlanIapType iapType( ENotWlanIap );
  1601             == EWlanIap )
  1616         TRAPD( leave, iapType = iCommsDatAccess->CheckWlanL( iActiveBMConns[index].iConnInfo.iIapId ) )        	
       
  1617         if ( ( leave == KErrNone ) && ( iapType == EWlanIap ) )
  1602             {
  1618             {
  1603             // Check if used WLAN is still available
  1619             // Check if used WLAN is still available
  1604             TBool currentWlanIapAvailable = EFalse;
  1620             TBool currentWlanIapAvailable = EFalse;
  1605             for ( TUint iapIndex = 0; iapIndex < aIapInfo.iCount; iapIndex++ )
  1621             for ( TUint iapIndex = 0; iapIndex < aIapInfo.iCount; iapIndex++ )
  1606                 {
  1622                 {