--- a/bearermanagement/mpm/src/mpmserver.cpp Fri May 14 16:15:46 2010 +0300
+++ b/bearermanagement/mpm/src/mpmserver.cpp Thu May 27 13:17:01 2010 +0300
@@ -230,6 +230,11 @@
//
CMPMServer::~CMPMServer()
{
+ if ( iRoamingToWlanPeriodic )
+ {
+ iRoamingToWlanPeriodic->Cancel();
+ delete iRoamingToWlanPeriodic;
+ }
if ( iDisconnectQueue )
{
iDisconnectQueue->ResetAndDestroy();
@@ -881,7 +886,32 @@
TCmUsageOfWlan usageOfWlan = CommsDatAccess()->ForcedRoamingL();
if ( usageOfWlan == ECmUsageOfWlanKnown || usageOfWlan == ECmUsageOfWlanKnownAndNew )
{
- StartForcedRoamingToWlanL( iapInfo );
+ if ( IsWlanConnectionStartedL( CommsDatAccess() ) )
+ {
+ iConnMonIapInfo = aIapInfo;
+
+ if ( iRoamingToWlanPeriodic )
+ {
+ iRoamingToWlanPeriodic->Cancel();
+ }
+ else
+ {
+ iRoamingToWlanPeriodic = CPeriodic::NewL(
+ CActive::EPriorityStandard );
+ }
+ // start periodic object that calls StartForcedRoamingToWlanL after 10s.
+ // this handles the case when new wlan connection is
+ // started from e.g. wlan sniffer but IAP is not yet in Internet SNAP
+ iRoamingToWlanPeriodic->Start(
+ TTimeIntervalMicroSeconds32( KRoamingToWlanUpdateInterval ),
+ TTimeIntervalMicroSeconds32( KRoamingToWlanUpdateInterval ),
+ TCallBack( StartForcedRoamingToConnectedWlanL, this ) );
+ }
+ else
+ {
+ StartForcedRoamingToWlanL( iapInfo );
+ }
+
StartForcedRoamingFromWlanL( iapInfo );
}
@@ -1446,12 +1476,11 @@
void CMPMServer::StartForcedRoamingToWlanL( const TConnMonIapInfo& aIapInfo )
{
MPMLOGSTRING( "CMPMServer::StartForcedRoamingToWlan" )
-
- // First check that there is no active wlan connection
- if ( IsWlanConnectionStartedL( CommsDatAccess() ) )
+
+ // cancel the periodic object
+ if ( iRoamingToWlanPeriodic != NULL )
{
- // Wlan already active can't roam to it
- return;
+ iRoamingToWlanPeriodic->Cancel();
}
// Copy all available wlan iap ids to own array
@@ -1511,6 +1540,20 @@
CleanupStack::PopAndDestroy( &wlanIapIds );
}
+
+// ---------------------------------------------------------------------------
+// CMPMServer::StartForcedRoamingToConnectedWlanL
+// ---------------------------------------------------------------------------
+//
+TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
+ {
+ MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" );
+ static_cast<CMPMServer*>( aUpdater )->StartForcedRoamingToWlanL(
+ static_cast<CMPMServer*>( aUpdater )->iConnMonIapInfo );
+ return 0;
+ }
+
+
// -----------------------------------------------------------------------------
// CMPMServer::StartForcedRoamingFromWlanL
// -----------------------------------------------------------------------------