bearermanagement/mpm/src/mpmserver.cpp
changeset 71 9f263f780e41
parent 59 2709c04a4af5
child 72 0c32cf868819
equal deleted inserted replaced
70:ac5daea24fb0 71:9f263f780e41
   903                                    const TPrefIAPNotifCaller aCaller )
   903                                    const TPrefIAPNotifCaller aCaller )
   904     {
   904     {
   905     MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIapL - IAPs count: %d", 
   905     MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIapL - IAPs count: %d", 
   906         aIapInfo.iCount)
   906         aIapInfo.iCount)
   907     TConnMonIapInfo iapInfo = aIapInfo;
   907     TConnMonIapInfo iapInfo = aIapInfo;
       
   908     iCaller = aCaller;
   908     
   909     
   909 #ifdef _DEBUG
   910 #ifdef _DEBUG
   910     for (TUint i = 0; i < iapInfo.Count(); i++)
   911     for (TUint i = 0; i < iapInfo.Count(); i++)
   911         {
   912         {
   912         MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIap - IAP: %d", 
   913         MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIap - IAP: %d", 
   945             }
   946             }
   946 
   947 
   947         StartForcedRoamingFromWlanL( iapInfo );
   948         StartForcedRoamingFromWlanL( iapInfo );
   948         }
   949         }
   949     
   950     
   950     MPMLOGSTRING2(
   951     // Send notifications for all sessions
   951     "CMPMServer::NotifyBMPrefIapL - Send notifications for %d sessions", 
   952       SendPrefIAPNotificationL();
   952         iSessions.Count() )
       
   953 
       
   954     for ( TInt i = 0; i < iSessions.Count(); i++ )
       
   955         {
       
   956         iapInfo = iSessions[i]->GetAvailableIAPs( );
       
   957         iSessions[i]->PrefIAPNotificationL( iapInfo, aCaller );
       
   958         }
       
   959     }
   953     }
   960 
   954 
   961 
   955 
   962 // -----------------------------------------------------------------------------
   956 // -----------------------------------------------------------------------------
   963 // CMPMServer::HandleServerBlackListIap
   957 // CMPMServer::HandleServerBlackListIap
  1552 // ---------------------------------------------------------------------------
  1546 // ---------------------------------------------------------------------------
  1553 //    
  1547 //    
  1554 TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
  1548 TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
  1555     {
  1549     {
  1556     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" );
  1550     MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" );
  1557     TRAPD( error, static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingToWlanL( 
  1551     CMPMServer* self = static_cast<CMPMServer*>( aUpdater );
  1558            static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo ) )
  1552     
       
  1553     // If IAP availability change was received when connection
       
  1554     // was in starting state, then roaming to WLAN didnot happen
       
  1555     // at that stage. So, send preferred IAP notification again 
       
  1556     // after WLAN is connected. 
       
  1557     //
       
  1558     TRAPD( err, self->SendPrefIAPNotificationL() );
       
  1559     if ( err )
       
  1560         {           
       
  1561         MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error = %d, ", err )
       
  1562         return 0;
       
  1563         }
       
  1564     
       
  1565     TRAPD( error, self->StartForcedRoamingToWlanL( self->iConnMonIapInfo ) )
  1559     if ( error )
  1566     if ( error )
  1560         {        	
  1567         {        	
  1561         MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error1 = %d, ", error )
  1568         MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error1 = %d, ", error )
  1562         return 0;
  1569         return 0;
  1563         }
  1570         }
  1564 
  1571 
  1565     // Added also execution of policy based roaming logic because
  1572     // Added also execution of policy based roaming logic because
  1566     // connections that are in EStarting state, when WLAN signal
  1573     // connections that are in EStarting state, when WLAN signal
  1567     // gets weak, would remain in WLAN as long as signal is weak. 
  1574     // gets weak, would remain in WLAN as long as signal is weak. 
  1568     TRAP( error, static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingFromWlanL(
  1575     TRAP( error, self->StartForcedRoamingFromWlanL( self->iConnMonIapInfo ) )
  1569           static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo ) )
       
  1570     if ( error )
  1576     if ( error )
  1571         {        	
  1577         {        	
  1572         MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error2 = %d, ", error )
  1578         MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error2 = %d, ", error )
  1573         }
  1579         }
  1574 
  1580 
  1575     return 0;
  1581     return 0;
  1576     }
  1582     }
  1577 
  1583 
       
  1584 // ---------------------------------------------------------------------------
       
  1585 // CMPMServer::SendPrefIAPNotificationL
       
  1586 // ---------------------------------------------------------------------------
       
  1587 //    
       
  1588 
       
  1589 void CMPMServer::SendPrefIAPNotificationL()
       
  1590     {
       
  1591     MPMLOGSTRING( "CMPMServer::SendPrefIAPNotificationL" )
       
  1592             
       
  1593     MPMLOGSTRING2(
       
  1594      "CMPMServer::SendPrefIAPNotificationL - Send notifications for %d sessions", 
       
  1595          iSessions.Count() )
       
  1596     
       
  1597      for ( TInt i = 0; i < iSessions.Count(); i++ )
       
  1598          {
       
  1599          TConnMonIapInfo iapInfo = iSessions[i]->GetAvailableIAPs( );
       
  1600          iSessions[i]->PrefIAPNotificationL( iapInfo, iCaller );
       
  1601          }
       
  1602     }
  1578 
  1603 
  1579 // -----------------------------------------------------------------------------
  1604 // -----------------------------------------------------------------------------
  1580 // CMPMServer::StartForcedRoamingFromWlanL
  1605 // CMPMServer::StartForcedRoamingFromWlanL
  1581 // -----------------------------------------------------------------------------
  1606 // -----------------------------------------------------------------------------
  1582 //
  1607 //