1 /* |
|
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of CWsfEngine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // EXTERNAL INCLUDES |
|
21 #include <commsdattypesv1_1.h> |
|
22 #include <commsdat.h> |
|
23 #include <cmconnectionmethodext.h> |
|
24 #include <cmpluginwlandef.h> |
|
25 |
|
26 // CLASS HEADER |
|
27 #include "wsfengine.h" |
|
28 |
|
29 |
|
30 // INTERNAL INCLUDES |
|
31 #include "wsfwlanscanner.h" |
|
32 #include "wsfwlansettingsaccessor.h" |
|
33 #include "wsfwlanbearerconnectionmonitor.h" |
|
34 #include "wsfengineobserver.h" |
|
35 #include "wsfservercloseradapter.h" |
|
36 #include "wsfactivewaiter.h" |
|
37 |
|
38 #include "wsflogger.h" |
|
39 |
|
40 |
|
41 |
|
42 // LOCAL DEFINITIONS |
|
43 using namespace CommsDat; |
|
44 |
|
45 |
|
46 /** |
|
47 * Maximum number of retries when trying to delete a temporary IAP but |
|
48 * the connection is locking it |
|
49 */ |
|
50 static const TInt KMaxIapDeletionRetries = 10; |
|
51 |
|
52 |
|
53 /** |
|
54 * Time to wait betweed two IAP deletion retries, in microseconds |
|
55 */ |
|
56 static const TUint KDelayBetweenDeletionRetries = 500 * 1000; |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 // CONSTRUCTION AND DESTRUCTION |
|
63 |
|
64 // ---------------------------------------------------------------------------- |
|
65 // CWsfEngine::NewL |
|
66 // ---------------------------------------------------------------------------- |
|
67 // |
|
68 CWsfEngine* CWsfEngine::NewL( MWsfServerCloserAdapter& aServerCloser ) |
|
69 { |
|
70 CWsfEngine* self = CWsfEngine::NewLC( aServerCloser ); |
|
71 CleanupStack::Pop( self ); |
|
72 return self; |
|
73 } |
|
74 |
|
75 |
|
76 // ---------------------------------------------------------------------------- |
|
77 // CWsfEngine::NewLC |
|
78 // ---------------------------------------------------------------------------- |
|
79 // |
|
80 CWsfEngine* CWsfEngine::NewLC( MWsfServerCloserAdapter& aServerCloser ) |
|
81 { |
|
82 CWsfEngine* self = new ( ELeave ) CWsfEngine( aServerCloser ); |
|
83 CleanupStack::PushL( self ); |
|
84 self->ConstructL(); |
|
85 return self; |
|
86 } |
|
87 |
|
88 |
|
89 // ---------------------------------------------------------------------------- |
|
90 // CWsfEngine::~CWsfEngine |
|
91 // ---------------------------------------------------------------------------- |
|
92 // |
|
93 CWsfEngine::~CWsfEngine() |
|
94 { |
|
95 LOG_ENTERFN( "CWsfEngine::~CWsfEngine" ); |
|
96 |
|
97 delete iWlanBearerMonitor; |
|
98 delete iScanner; |
|
99 delete iDbSession; |
|
100 iObservers.Reset(); |
|
101 |
|
102 if ( iMonitoredIap && |
|
103 ( iIapPersistence == EIapExpireOnDisconnect || |
|
104 iIapPersistence == EIapNestedExpireOnDisconnect || |
|
105 iIapPersistence == EIapExpireOnBrowserExit || |
|
106 iIapPersistence == EIapExpireOnShutdown ) ) |
|
107 { |
|
108 TRAP_IGNORE( DeleteIapL( iMonitoredIap ) ); |
|
109 } |
|
110 } |
|
111 |
|
112 |
|
113 // ---------------------------------------------------------------------------- |
|
114 // CWsfEngine::CWsfEngine |
|
115 // ---------------------------------------------------------------------------- |
|
116 // |
|
117 CWsfEngine::CWsfEngine( MWsfServerCloserAdapter& aServerCloser ): |
|
118 iServerCloser( aServerCloser ), |
|
119 iEnableScanning( 0 ), |
|
120 iIapPersistence( EIapDeleted ) |
|
121 { |
|
122 } |
|
123 |
|
124 |
|
125 // ---------------------------------------------------------------------------- |
|
126 // CWsfEngine::ConstructL |
|
127 // ---------------------------------------------------------------------------- |
|
128 // |
|
129 void CWsfEngine::ConstructL() |
|
130 { |
|
131 LOG_CREATE; |
|
132 LOG_ENTERFN( "CWsfEngine::ConstructL" ); |
|
133 iDbSession = CMDBSession::NewL( CMDBSession::LatestVersion() ); |
|
134 iScanner = CWsfWlanScanner::NewL( *iDbSession ); |
|
135 |
|
136 iScanner->SetObserver( *this ); |
|
137 |
|
138 iWlanBearerMonitor = CWsfWlanBearerConnectionMonitor::NewL( iServerCloser ); |
|
139 iScanner->SetConnectionDetailProvider( *iWlanBearerMonitor ); |
|
140 |
|
141 iWlanBearerMonitor->StartMonitoringL( this ); |
|
142 |
|
143 if ( iWlanBearerMonitor->GetWlanBearerNameL() != KNullDesC() ) |
|
144 { |
|
145 HBufC* name = ConnectedWlanSsidL(); |
|
146 CleanupStack::PushL( name ); |
|
147 iScanner->ConnectionEstablishedL( *name ); |
|
148 CleanupStack::PopAndDestroy( name ); |
|
149 } |
|
150 } |
|
151 |
|
152 |
|
153 // ---------------------------------------------------------------------------- |
|
154 // CWsfEngine::AttachL |
|
155 // ---------------------------------------------------------------------------- |
|
156 // |
|
157 void CWsfEngine::AttachL( MWsfEngineObserver* aObserver ) |
|
158 { |
|
159 LOG_ENTERFN( "CWsfEngine::AttachL" ); |
|
160 |
|
161 iObservers.AppendL( aObserver ); |
|
162 } |
|
163 |
|
164 |
|
165 // ---------------------------------------------------------------------------- |
|
166 // CWsfEngine::Detach |
|
167 // ---------------------------------------------------------------------------- |
|
168 // |
|
169 void CWsfEngine::Detach( MWsfEngineObserver* aObserver ) |
|
170 { |
|
171 LOG_ENTERFN( "CWsfEngine::Detach" ); |
|
172 TInt index = iObservers.Find( aObserver ); |
|
173 if ( index != KErrNotFound ) |
|
174 { |
|
175 iObservers.Remove( index ); |
|
176 } |
|
177 } |
|
178 |
|
179 |
|
180 // ---------------------------------------------------------------------------- |
|
181 // CWsfEngine::GetScanResults |
|
182 // ---------------------------------------------------------------------------- |
|
183 // |
|
184 HBufC8* CWsfEngine::GetScanResults() |
|
185 { |
|
186 LOG_ENTERFN( "CWsfEngine::GetScanResults" ); |
|
187 return iScanner->ScanResults(); |
|
188 } |
|
189 |
|
190 |
|
191 // ---------------------------------------------------------------------------- |
|
192 // CWsfEngine::EnableScanningL |
|
193 // ---------------------------------------------------------------------------- |
|
194 // |
|
195 void CWsfEngine::EnableScanningL() |
|
196 { |
|
197 LOG_ENTERFN( "CWsfEngine::EnableScanningL" ); |
|
198 |
|
199 iEnableScanning++; |
|
200 LOG_WRITEF( "++iEnableScanning = %d", iEnableScanning ); |
|
201 |
|
202 if ( iEnableScanning == 1 ) |
|
203 { |
|
204 LOG_WRITE( "CWsfEngine::EnableScanningL - start scanner" ); |
|
205 if ( !iScanner->IsActive() ) |
|
206 { |
|
207 iScanner->StartScanningL(); |
|
208 } |
|
209 LOG_WRITE( "CWsfEngine::EnableScanningL start scanner done" ); |
|
210 for ( TInt i( 0 ); i< iObservers.Count(); ++i ) |
|
211 { |
|
212 (iObservers[i])->ScanEnabledL(); |
|
213 } |
|
214 } |
|
215 else |
|
216 { |
|
217 // the scanning is already active - stop and reactivate to complete the |
|
218 // new monitor in sensible time |
|
219 if ( iScanner->IsActive() ) |
|
220 { |
|
221 iScanner->StopScanning(); |
|
222 } |
|
223 iScanner->StartScanningL(); |
|
224 } |
|
225 } |
|
226 |
|
227 |
|
228 // ---------------------------------------------------------------------------- |
|
229 // CWsfEngine::IsScanning |
|
230 // ---------------------------------------------------------------------------- |
|
231 // |
|
232 TBool CWsfEngine::IsScanning() |
|
233 { |
|
234 return iEnableScanning; |
|
235 } |
|
236 |
|
237 |
|
238 // ---------------------------------------------------------------------------- |
|
239 // CWsfEngine::RefreshScanResults |
|
240 // ---------------------------------------------------------------------------- |
|
241 // |
|
242 TBool CWsfEngine::RefreshScanResults() |
|
243 { |
|
244 LOG_ENTERFN( "CWsfEngine::RefreshScanResults" ); |
|
245 return iScanner->RestartScanning(); |
|
246 } |
|
247 |
|
248 |
|
249 // ---------------------------------------------------------------------------- |
|
250 // CWsfEngine::MonitorAccessPointL |
|
251 // ---------------------------------------------------------------------------- |
|
252 // |
|
253 void CWsfEngine::MonitorAccessPointL( TUint32 aIapId ) |
|
254 { |
|
255 LOG_ENTERFN( "CWsfEngine::MonitorAccessPointL" ); |
|
256 |
|
257 iMonitoredIap = aIapId; |
|
258 |
|
259 if ( iIapPersistence == EIapExpireOnShutdown ) |
|
260 { |
|
261 // web browsing with a temporary IAP |
|
262 LOG_WRITE( "EIapExpireOnShutdown => EIapExpireOnBrowserExit" ); |
|
263 SetIapPersistenceL( EIapExpireOnBrowserExit ); |
|
264 iServerCloser.WaitForBrowserExit( ETrue ); |
|
265 |
|
266 // semaphore to keep the order of calls |
|
267 iSuppressIapDeletion = ETrue; |
|
268 } |
|
269 else if ( iIapPersistence == EIapExpireOnDisconnect ) |
|
270 { |
|
271 LOG_WRITE( "EIapExpireOnDisconnect => EIapNestedExpireOnDisconnect" ); |
|
272 SetIapPersistenceL( EIapNestedExpireOnDisconnect ); |
|
273 } |
|
274 |
|
275 |
|
276 LOG_WRITEF( "iMonitoredIap = %d", iMonitoredIap ); |
|
277 } |
|
278 |
|
279 |
|
280 // ---------------------------------------------------------------------------- |
|
281 // CWsfEngine::DisableScanningL |
|
282 // ---------------------------------------------------------------------------- |
|
283 // |
|
284 void CWsfEngine::DisableScanningL() |
|
285 { |
|
286 LOG_ENTERFN( "CWsfEngine::DisableScanningL" ); |
|
287 |
|
288 iEnableScanning--; |
|
289 LOG_WRITEF( "--iEnableScanning = %d", iEnableScanning ); |
|
290 |
|
291 if ( !iEnableScanning ) |
|
292 { |
|
293 LOG_WRITE( "CWsfEngine::DisableScanning stop scanner" ); |
|
294 |
|
295 iScanner->StopScanning(); |
|
296 LOG_WRITE( "CWsfEngine::DisableScanning stopped scanner" ); |
|
297 |
|
298 for ( TInt i( 0 ); i < iObservers.Count(); ++i ) |
|
299 { |
|
300 (iObservers[i])->ScanDisabledL(); |
|
301 } |
|
302 } |
|
303 } |
|
304 |
|
305 |
|
306 // ---------------------------------------------------------------------------- |
|
307 // CWsfEngine::ConnectedWlanSsidL |
|
308 // ---------------------------------------------------------------------------- |
|
309 // |
|
310 HBufC* CWsfEngine::ConnectedWlanSsidL() |
|
311 { |
|
312 LOG_ENTERFN( "CWsfEngine::ConnectedWlanIapNameL" ); |
|
313 return iWlanBearerMonitor->GetWlanBearerNameL().AllocL(); |
|
314 } |
|
315 |
|
316 |
|
317 // ---------------------------------------------------------------------------- |
|
318 // CWsfEngine::ConnectedWlanConnectionDetailsL |
|
319 // ---------------------------------------------------------------------------- |
|
320 // |
|
321 TBool CWsfEngine::ConnectedWlanConnectionDetailsL( TWsfWlanInfo& aWlanInfo ) |
|
322 { |
|
323 LOG_ENTERFN( "CWsfEngine::ConnectedWlanConnectionDetailsL" ); |
|
324 return iWlanBearerMonitor->ConnectedWlanConnectionDetailsL( &aWlanInfo ); |
|
325 } |
|
326 |
|
327 |
|
328 // ---------------------------------------------------------------------------- |
|
329 // CWsfEngine::WlanScanCompleteL |
|
330 // ---------------------------------------------------------------------------- |
|
331 // |
|
332 void CWsfEngine::WlanScanCompleteL() |
|
333 { |
|
334 LOG_ENTERFN( "CWsfEngine::WlanScanCompleteL" ); |
|
335 |
|
336 for ( TInt i( 0 ); i < iObservers.Count(); ++i ) |
|
337 { |
|
338 (iObservers[i])->WlanListChangedL(); |
|
339 } |
|
340 } |
|
341 |
|
342 |
|
343 // ---------------------------------------------------------------------------- |
|
344 // CWsfEngine::WlanScanStarted |
|
345 // ---------------------------------------------------------------------------- |
|
346 // |
|
347 void CWsfEngine::WlanScanStarted() |
|
348 { |
|
349 LOG_ENTERFN( "CWsfEngine::WlanScanStarted" ); |
|
350 } |
|
351 |
|
352 |
|
353 // ---------------------------------------------------------------------------- |
|
354 // CWsfEngine::NotifyError |
|
355 // ---------------------------------------------------------------------------- |
|
356 // |
|
357 void CWsfEngine::NotifyError( TInt aError ) |
|
358 { |
|
359 LOG_ENTERFN( "CWsfEngine::NotifyError" ); |
|
360 |
|
361 for ( TInt i( 0 ); i < iObservers.Count(); ++i ) |
|
362 { |
|
363 TRAP_IGNORE( (iObservers)[i]->NotifyErrorL( aError ) ); |
|
364 } |
|
365 } |
|
366 |
|
367 |
|
368 // ---------------------------------------------------------------------------- |
|
369 // CWsfEngine::ConnectionEstablishedL |
|
370 // ---------------------------------------------------------------------------- |
|
371 // |
|
372 void CWsfEngine::ConnectionEstablishedL( const TDesC& aConnectionName ) |
|
373 { |
|
374 LOG_ENTERFN( "CWsfEngine::ConnectionEstablishedL" ); |
|
375 // set the scanner to check connected accounts |
|
376 iScanner->ConnectionEstablishedL( aConnectionName ); |
|
377 |
|
378 iScanner->RestartScanning(); |
|
379 |
|
380 // notify the observers |
|
381 for ( TInt i( 0 ); i < iObservers.Count(); ++i ) |
|
382 { |
|
383 (iObservers)[i]->ConnectedL(); |
|
384 } |
|
385 } |
|
386 |
|
387 |
|
388 // ---------------------------------------------------------------------------- |
|
389 // CWsfEngine::ConnectionLostL |
|
390 // ---------------------------------------------------------------------------- |
|
391 // |
|
392 void CWsfEngine::ConnectionLostL() |
|
393 { |
|
394 LOG_ENTERFN( "CWsfEngine::ConnectionLostL" ); |
|
395 |
|
396 // check temporarity here as well since it is not guaranteed that |
|
397 // the connection was owned and ConnectedIapReleasedL was called |
|
398 if ( iSuppressIapDeletion ) |
|
399 { |
|
400 // web browsing with a temporary IAP |
|
401 LOG_WRITE( "IAP deletion suppressed" ); |
|
402 iSuppressIapDeletion = EFalse; |
|
403 } |
|
404 else if ( iMonitoredIap ) |
|
405 { |
|
406 if ( iIapPersistence == EIapExpireOnDisconnect || |
|
407 iIapPersistence == EIapExpireOnBrowserExit ) |
|
408 { |
|
409 DeleteIapL( iMonitoredIap ); |
|
410 iIapPersistence = EIapDeleted; |
|
411 iMonitoredIap = 0; |
|
412 } |
|
413 else if ( iIapPersistence == EIapNestedExpireOnDisconnect ) |
|
414 { |
|
415 iIapPersistence = EIapExpireOnBrowserExit; |
|
416 } |
|
417 } |
|
418 |
|
419 iScanner->ConnectionLostL(); |
|
420 iScanner->RestartScanning(); |
|
421 |
|
422 // notify the observers |
|
423 for ( TInt i( 0 ); i < iObservers.Count(); ++i ) |
|
424 { |
|
425 (iObservers)[i]->DisconnectedL(); |
|
426 } |
|
427 } |
|
428 |
|
429 |
|
430 // ---------------------------------------------------------------------------- |
|
431 // CWsfEngine::ConnectingFailedL |
|
432 // ---------------------------------------------------------------------------- |
|
433 // |
|
434 void CWsfEngine::ConnectingFailedL( TInt aError ) |
|
435 { |
|
436 LOG_ENTERFN( "CWsfEngine::ConnectingFailedL" ); |
|
437 |
|
438 for ( TInt i( 0 ); i < iObservers.Count(); ++i ) |
|
439 { |
|
440 (iObservers)[i]->ConnectingFailedL( aError ); |
|
441 } |
|
442 } |
|
443 |
|
444 |
|
445 // ---------------------------------------------------------------------------- |
|
446 // CWsfEngine::ConnectedIapReleasedL |
|
447 // ---------------------------------------------------------------------------- |
|
448 // |
|
449 void CWsfEngine::ConnectedIapReleasedL() |
|
450 { |
|
451 LOG_ENTERFN( "CWsfEngine::ConnectedIapReleasedL" ); |
|
452 |
|
453 // deleting temporary IAP if necessary |
|
454 if ( !iSuppressIapDeletion && iMonitoredIap ) |
|
455 { |
|
456 if ( iIapPersistence == EIapExpireOnDisconnect || |
|
457 iIapPersistence == EIapExpireOnBrowserExit ) |
|
458 { |
|
459 DeleteIapL( iMonitoredIap ); |
|
460 iIapPersistence = EIapDeleted; |
|
461 iMonitoredIap = 0; |
|
462 } |
|
463 else if ( iIapPersistence == EIapNestedExpireOnDisconnect ) |
|
464 { |
|
465 iIapPersistence = EIapExpireOnBrowserExit; |
|
466 iSuppressIapDeletion = ETrue; |
|
467 } |
|
468 } |
|
469 } |
|
470 |
|
471 |
|
472 // ---------------------------------------------------------------------------- |
|
473 // CWsfEngine::DeleteIapL |
|
474 // ---------------------------------------------------------------------------- |
|
475 // |
|
476 void CWsfEngine::DeleteIapL( TUint32 aIapId ) |
|
477 { |
|
478 LOG_ENTERFN( "CWsfEngine::DeleteIapL" ); |
|
479 |
|
480 LOG_WRITEF( "deleting temporary IAP id = %d", aIapId ); |
|
481 RCmManagerExt cmMgr; |
|
482 cmMgr.OpenLC(); |
|
483 |
|
484 RCmConnectionMethodExt ictCm = cmMgr.ConnectionMethodL( aIapId ); |
|
485 CleanupClosePushL( ictCm ); |
|
486 |
|
487 CWsfActiveWaiter* waiter = CWsfActiveWaiter::NewLC(); |
|
488 |
|
489 RTimer timer; |
|
490 timer.CreateLocal(); |
|
491 |
|
492 // trying to delete the temporary IAP |
|
493 // sometimes the RConnection is still locking the IAP when |
|
494 // we want to delete it, so we might have to try a couple of times |
|
495 TInt counter( KMaxIapDeletionRetries ); |
|
496 TInt err( KErrNone ); |
|
497 |
|
498 while ( counter ) |
|
499 { |
|
500 LOG_WRITEF( "trying to delete (#%d)", |
|
501 KMaxIapDeletionRetries - counter ); |
|
502 |
|
503 TRAP( err, ictCm.DeleteL() ); |
|
504 |
|
505 if ( !err || err == KErrNotFound ) |
|
506 { |
|
507 // if success or the IAP was not found (strange but happens), break |
|
508 break; |
|
509 } |
|
510 |
|
511 --counter; |
|
512 if ( err && counter ) |
|
513 { |
|
514 LOG_WRITEF( "deletion failed with error = %d", err ); |
|
515 LOG_WRITE( "RConnection is still locking the IAP, waiting..." ); |
|
516 |
|
517 timer.After( waiter->iStatus, TTimeIntervalMicroSeconds32( |
|
518 KDelayBetweenDeletionRetries ) ); |
|
519 waiter->WaitForRequest(); |
|
520 } |
|
521 } |
|
522 |
|
523 |
|
524 timer.Close(); |
|
525 CleanupStack::PopAndDestroy( waiter ); |
|
526 |
|
527 if ( !err ) |
|
528 { |
|
529 LOG_WRITE( "IAP deleted." ); |
|
530 } |
|
531 else |
|
532 { |
|
533 LOG_WRITE( "IAP couldn't be deleted!" ); |
|
534 } |
|
535 |
|
536 CleanupStack::PopAndDestroy( &ictCm ); |
|
537 CleanupStack::PopAndDestroy( &cmMgr ); |
|
538 } |
|
539 |
|
540 |
|
541 // ---------------------------------------------------------------------------- |
|
542 // CWsfEngine::ConnectWlanL |
|
543 // ---------------------------------------------------------------------------- |
|
544 // |
|
545 TInt CWsfEngine::ConnectWlanL( TUint32 aIapId, |
|
546 TWsfIapPersistence aPersistence ) |
|
547 { |
|
548 LOG_ENTERFN( "CWsfEngine::ConnectWlanL" ); |
|
549 LOG_WRITEF( "iapId = %d, persistence = %d", aIapId, aPersistence ); |
|
550 |
|
551 // if we have already been monitoring an IAP (different from the |
|
552 // new one), clean that one up properly |
|
553 if ( iMonitoredIap && iIapPersistence == EIapExpireOnBrowserExit ) |
|
554 { |
|
555 // user switched back from browser to sniffer and issued connect |
|
556 if ( iMonitoredIap != aIapId ) |
|
557 { |
|
558 // selected network is different, so we must clean up the old one |
|
559 DeleteIapL( iMonitoredIap ); |
|
560 iIapPersistence = EIapDeleted; |
|
561 iMonitoredIap = 0; |
|
562 } |
|
563 else if ( iMonitoredIap == aIapId ) |
|
564 { |
|
565 // selected networks are the same |
|
566 aPersistence = EIapNestedExpireOnDisconnect; |
|
567 } |
|
568 iSuppressIapDeletion = EFalse; |
|
569 } |
|
570 |
|
571 TInt ret = iWlanBearerMonitor->ConnectBearer( aIapId ); |
|
572 |
|
573 if ( !ret ) |
|
574 { |
|
575 // successfully initiated connection |
|
576 LOG_WRITE( "connection init succeded" ); |
|
577 iMonitoredIap = aIapId; |
|
578 SetIapPersistenceL( aPersistence ); |
|
579 } |
|
580 |
|
581 return ret; |
|
582 } |
|
583 |
|
584 |
|
585 // ---------------------------------------------------------------------------- |
|
586 // CWsfEngine::DisconnectWlan |
|
587 // ---------------------------------------------------------------------------- |
|
588 // |
|
589 TBool CWsfEngine::DisconnectWlan() |
|
590 { |
|
591 LOG_ENTERFN( "CWsfEngine::DisconnectWlan" ); |
|
592 return iWlanBearerMonitor->DisconnectBearer(); |
|
593 } |
|
594 |
|
595 |
|
596 // ---------------------------------------------------------------------------- |
|
597 // CWsfEngine::IsConnected |
|
598 // ---------------------------------------------------------------------------- |
|
599 // |
|
600 TBool CWsfEngine::IsConnected() |
|
601 { |
|
602 return iWlanBearerMonitor->IsConnected(); |
|
603 } |
|
604 |
|
605 |
|
606 // --------------------------------------------------------------------------- |
|
607 // CWsfEngine::AbortConnectingL |
|
608 // --------------------------------------------------------------------------- |
|
609 // |
|
610 void CWsfEngine::AbortConnectingL() |
|
611 { |
|
612 LOG_ENTERFN("CWsfEngine::AbortConnectingL"); |
|
613 |
|
614 iWlanBearerMonitor->AbortConnecting(); |
|
615 |
|
616 if ( iMonitoredIap ) |
|
617 { |
|
618 if ( iIapPersistence == EIapExpireOnDisconnect ) |
|
619 { |
|
620 LOG_WRITE( "EIapNestedExpireOnDisconnect => EIapDeleted" ); |
|
621 DeleteIapL( iMonitoredIap ); |
|
622 iIapPersistence = EIapDeleted; |
|
623 iMonitoredIap = 0; |
|
624 } |
|
625 else if ( iIapPersistence == EIapNestedExpireOnDisconnect ) |
|
626 { |
|
627 LOG_WRITE( "EIapNestedExpireOnDisconnect => " |
|
628 L"EIapExpireOnBrowserExit" ); |
|
629 iIapPersistence = EIapExpireOnBrowserExit; |
|
630 } |
|
631 } |
|
632 } |
|
633 |
|
634 |
|
635 // --------------------------------------------------------------------------- |
|
636 // CWsfEngine::AbortScanning |
|
637 // --------------------------------------------------------------------------- |
|
638 // |
|
639 void CWsfEngine::AbortScanning() |
|
640 { |
|
641 LOG_ENTERFN("CWsfEngine::AbortScanning"); |
|
642 |
|
643 iScanner->AbortScanning(); |
|
644 } |
|
645 |
|
646 |
|
647 // --------------------------------------------------------------------------- |
|
648 // CWsfEngine::SetIapPersistenceL |
|
649 // --------------------------------------------------------------------------- |
|
650 // |
|
651 TBool CWsfEngine::SetIapPersistenceL( TWsfIapPersistence aPersistence ) |
|
652 { |
|
653 LOG_ENTERFN("CWsfEngine::SetIapPersistenceL"); |
|
654 if ( aPersistence == EIapForcedExpiry ) |
|
655 { |
|
656 if ( iMonitoredIap && |
|
657 ( iIapPersistence == EIapExpireOnBrowserExit || |
|
658 iIapPersistence == EIapExpireOnShutdown ) ) |
|
659 { |
|
660 LOG_WRITE( "forced IAP expiry" ); |
|
661 DeleteIapL( iMonitoredIap ); |
|
662 iIapPersistence = EIapDeleted; |
|
663 iMonitoredIap = 0; |
|
664 } |
|
665 else if ( iIapPersistence == EIapNestedExpireOnDisconnect ) |
|
666 { |
|
667 LOG_WRITE( "reverting to EIapExpireOnDisconnect" ); |
|
668 iIapPersistence = EIapExpireOnDisconnect; |
|
669 } |
|
670 |
|
671 iServerCloser.WaitForBrowserExit( EFalse ); |
|
672 } |
|
673 else |
|
674 { |
|
675 LOG_WRITEF( "persistence = %d", aPersistence ); |
|
676 iIapPersistence = aPersistence; |
|
677 } |
|
678 |
|
679 return ( iMonitoredIap ); |
|
680 } |
|
681 |
|
682 |
|
683 // --------------------------------------------------------------------------- |
|
684 // CWsfEngine::ControlDisconnectTimer |
|
685 // --------------------------------------------------------------------------- |
|
686 // |
|
687 TBool CWsfEngine::ControlDisconnectTimer( TUint aAdcCommand ) |
|
688 { |
|
689 LOG_ENTERFN("CWsfEngine::ControlDisconnectTimer"); |
|
690 |
|
691 return iWlanBearerMonitor->ControlDisconnectTimer( aAdcCommand ); |
|
692 } |
|
693 |
|
694 // --------------------------------------------------------------------------- |
|
695 // CWsfEngine::ResetSuppressIapDeletion |
|
696 // --------------------------------------------------------------------------- |
|
697 // |
|
698 void CWsfEngine::ResetSuppressIapDeletion() |
|
699 { |
|
700 LOG_ENTERFN( "CWsfEngine::ResetSuppresIapDeletion" ); |
|
701 |
|
702 iSuppressIapDeletion = EFalse; |
|
703 } |
|
704 |
|
705 // End of file |
|