bluetoothengine/bteng/src/btengsrvbbconnectionmgr.cpp
branchRCL_3
changeset 55 613943a21004
parent 16 b23265fb36da
child 56 9386f31cc85b
equal deleted inserted replaced
54:0ba996a9b75d 55:613943a21004
    90 // Destructor
    90 // Destructor
    91 // ---------------------------------------------------------------------------
    91 // ---------------------------------------------------------------------------
    92 //
    92 //
    93 CBTEngSrvBBConnMgr::~CBTEngSrvBBConnMgr()
    93 CBTEngSrvBBConnMgr::~CBTEngSrvBBConnMgr()
    94     {
    94     {
    95     Unsubscribe();
    95 	delete iLinkCountWatcher;
       
    96 	delete iWlanWatcher;    
    96 	iLinkCountProperty.Close();
    97 	iLinkCountProperty.Close();
    97     iWlanStatusProperty.Close();
    98     iWlanStatusProperty.Close();
    98 	delete iLinkCountWatcher;
       
    99 	delete iWlanWatcher;
       
   100 	delete iPhyLinks;
    99 	delete iPhyLinks;
   101     }
   100     }
   102 
       
   103 
   101 
   104 // ---------------------------------------------------------------------------
   102 // ---------------------------------------------------------------------------
   105 // Start listening to the relevant properties.
   103 // Start listening to the relevant properties.
   106 // ---------------------------------------------------------------------------
   104 // ---------------------------------------------------------------------------
   107 //
   105 //
   124 // Stop listening to the subscribed properties.
   122 // Stop listening to the subscribed properties.
   125 // ---------------------------------------------------------------------------
   123 // ---------------------------------------------------------------------------
   126 //
   124 //
   127 void CBTEngSrvBBConnMgr::Unsubscribe()
   125 void CBTEngSrvBBConnMgr::Unsubscribe()
   128     {
   126     {
   129     if( iLinkCountWatcher->IsActive() )
   127     iLinkCountWatcher->Cancel();
   130         {
   128     iWlanWatcher->Cancel();
   131         iLinkCountProperty.Cancel();
   129     }
   132         iLinkCountWatcher->CancelRequest();
       
   133         }
       
   134 	if( iWlanWatcher && iWlanWatcher->IsActive() )
       
   135 	    {
       
   136 	    iWlanStatusProperty.Cancel();
       
   137 	    iWlanWatcher->CancelRequest();
       
   138 	    }
       
   139     }
       
   140 
       
   141 
   130 
   142 // ---------------------------------------------------------------------------
   131 // ---------------------------------------------------------------------------
   143 // ?implementation_description
   132 // ?implementation_description
   144 // ---------------------------------------------------------------------------
   133 // ---------------------------------------------------------------------------
   145 //
   134 //
   362 // ---------------------------------------------------------------------------
   351 // ---------------------------------------------------------------------------
   363 // From class MBTEngActiveObserver.
   352 // From class MBTEngActiveObserver.
   364 // ?implementation_description
   353 // ?implementation_description
   365 // ---------------------------------------------------------------------------
   354 // ---------------------------------------------------------------------------
   366 //
   355 //
   367 void CBTEngSrvBBConnMgr::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
   356 void CBTEngSrvBBConnMgr::RequestCompletedL( CBTEngActive* aActive,
   368     TInt aStatus )
   357     TInt aStatus )
   369     {
   358     {
   370     TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aId, aStatus ) )
   359     TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aActive->RequestId(), aStatus ) )
   371     ASSERT( aId == KBTEngSrvBBConnId || aId == KBTEngSrvWlanStatusId );
   360     ASSERT( aActive->RequestId() == KBTEngSrvBBConnId || aActive->RequestId() == KBTEngSrvWlanStatusId );
   372     (void) aActive;
       
   373     (void) aId;
       
   374     if( aStatus != KErrPermissionDenied )
   361     if( aStatus != KErrPermissionDenied )
   375         {
   362         {
   376             // Ignore any other errors.
   363         // Ignore any other errors.
   377             // First subscribe again, so that we don't miss any updates.
   364         // First subscribe again, so that we don't miss any updates.
   378             Subscribe();
   365         Subscribe();
   379         }
   366         }
   380     (void) ManageTopology( EFalse );    // Ignore result; nothing to do 
   367     (void) ManageTopology( EFalse );    // Ignore result; nothing to do 
   381                                         // about it here.
   368                                         // about it here.
   382     if( aId == KBTEngSrvBBConnId )
   369     if( aActive->RequestId() == KBTEngSrvBBConnId )
   383         {
   370         {
   384         TRACE_INFO( ( _L( "[BTENG] PHY count key changed, update UI connection status" ) ) )
   371         TRACE_INFO( ( _L( "[BTENG] PHY count key changed, update UI connection status" ) ) )
   385         iServer->SettingsManager()->SetUiIndicatorsL();
   372         iServer->SettingsManager()->SetUiIndicatorsL();
   386         }    
   373         }    
   387     TRACE_FUNC_EXIT
   374     TRACE_FUNC_EXIT
   388     }
   375     }
   389 
   376 
       
   377 // ---------------------------------------------------------------------------
       
   378 // From class MBTEngActiveObserver.
       
   379 // Handles cancelation of an outstanding request
       
   380 // ---------------------------------------------------------------------------
       
   381 //
       
   382 void CBTEngSrvBBConnMgr::CancelRequest( TInt aRequestId )
       
   383     {
       
   384     TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) );
       
   385     if ( aRequestId == KBTEngSrvBBConnId )
       
   386         {
       
   387         iLinkCountProperty.Cancel();
       
   388         }
       
   389     else if ( aRequestId == KBTEngSrvWlanStatusId )
       
   390         {
       
   391         iWlanStatusProperty.Cancel();
       
   392         }
       
   393     TRACE_FUNC_EXIT
       
   394     }
   390 
   395 
   391 // ---------------------------------------------------------------------------
   396 // ---------------------------------------------------------------------------
   392 // From class MBTEngActiveObserver.
   397 // From class MBTEngActiveObserver.
   393 // Handles an error in RunL( i.e. RequestCompletedL). Does nothing, since our
   398 // Handles an error in RunL( i.e. RequestCompletedL). Does nothing, since our
   394 // RunL cannot actually leave.
   399 // RunL cannot actually leave.
   395 // ---------------------------------------------------------------------------
   400 // ---------------------------------------------------------------------------
   396 //
   401 //
   397 void CBTEngSrvBBConnMgr::HandleError( CBTEngActive* aActive, TInt aId, 
   402 void CBTEngSrvBBConnMgr::HandleError( CBTEngActive* aActive,  
   398     TInt aError )
   403     TInt aError )
   399     {
   404     {
   400     TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aId, aError ) )
   405     TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aActive->RequestId(), aError ) )
   401     (void) aActive;
   406     (void) aActive;
   402     (void) aId;
       
   403     (void) aError;
   407     (void) aError;
   404     }
   408     }
   405 
   409 
   406 
   410 
   407 // ---------------------------------------------------------------------------
   411 // ---------------------------------------------------------------------------