bluetoothengine/bteng/src/btengsrvbbconnectionmgr.cpp
changeset 17 f05641c183ff
parent 0 f63038272f30
child 19 43824b19ee35
equal deleted inserted replaced
15:00f9ee97d895 17:f05641c183ff
    20 
    20 
    21 #include <wlaninternalpskeys.h>
    21 #include <wlaninternalpskeys.h>
    22 #include <featmgr.h>
    22 #include <featmgr.h>
    23 
    23 
    24 #include "btengsrvbbconnectionmgr.h"
    24 #include "btengsrvbbconnectionmgr.h"
       
    25 #include "btengserver.h"
       
    26 #include "btengsrvsettingsmgr.h"
    25 #include "debug.h"
    27 #include "debug.h"
    26 
    28 
    27 /**  ?description */
    29 /**  ?description */
    28 const TInt KBTEngSrvBBConnId = 11;
    30 const TInt KBTEngSrvBBConnId = 11;
    29 /**  ?description */
    31 /**  ?description */
    36 
    38 
    37 // ---------------------------------------------------------------------------
    39 // ---------------------------------------------------------------------------
    38 // C++ default constructor
    40 // C++ default constructor
    39 // ---------------------------------------------------------------------------
    41 // ---------------------------------------------------------------------------
    40 //
    42 //
    41 CBTEngSrvBBConnMgr::CBTEngSrvBBConnMgr(RSocketServ& aSockServ)
    43 CBTEngSrvBBConnMgr::CBTEngSrvBBConnMgr(CBTEngServer* aServer, RSocketServ& aSockServ)
    42     : iSockServ(aSockServ)
    44     : iSockServ(aSockServ), iServer(aServer)
    43     {
    45     {
    44     }
    46     }
    45 
    47 
    46 
    48 
    47 // ---------------------------------------------------------------------------
    49 // ---------------------------------------------------------------------------
    71 
    73 
    72 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
    73 // NewL
    75 // NewL
    74 // ---------------------------------------------------------------------------
    76 // ---------------------------------------------------------------------------
    75 //
    77 //
    76 CBTEngSrvBBConnMgr* CBTEngSrvBBConnMgr::NewL(RSocketServ& aSockServ)
    78 CBTEngSrvBBConnMgr* CBTEngSrvBBConnMgr::NewL(CBTEngServer* aServer,
    77     {
    79                                              RSocketServ& aSockServ)
    78     CBTEngSrvBBConnMgr* self = new( ELeave ) CBTEngSrvBBConnMgr(aSockServ);
    80     {
       
    81     CBTEngSrvBBConnMgr* self = new( ELeave ) CBTEngSrvBBConnMgr(aServer, aSockServ);
    79     CleanupStack::PushL( self );
    82     CleanupStack::PushL( self );
    80     self->ConstructL();
    83     self->ConstructL();
    81     CleanupStack::Pop( self );
    84     CleanupStack::Pop( self );
    82     return self;
    85     return self;
    83     }
    86     }
   264         HandleDisconnectAllCompleteL( err );
   267         HandleDisconnectAllCompleteL( err );
   265         }
   268         }
   266     TRACE_FUNC_EXIT
   269     TRACE_FUNC_EXIT
   267     }
   270     }
   268 
   271 
       
   272 // ---------------------------------------------------------------------------
       
   273 // Request to disconnect all Bluetooth baseband connections with Power off reason code.
       
   274 // ---------------------------------------------------------------------------
       
   275 //
       
   276 void CBTEngSrvBBConnMgr::DisconnectAllLinksForPowerOffL( TCallBack& aCallBack )
       
   277     {
       
   278     TRACE_FUNC_ENTRY
       
   279     iCallBack = aCallBack;
       
   280     RBTDevAddrArray addrArray;
       
   281     GetConnectedAddressesL( addrArray );
       
   282     TInt err = KErrNone;
       
   283     if( addrArray.Count() > 0 )
       
   284         {
       
   285         err = iPhyLinks->DisconnectAll();
       
   286         // @todo Once fix is in stack, call this API instead
       
   287         // err = iPhyLinks->DisconnectAllForPowerOff();
       
   288         }
       
   289     else
       
   290         {
       
   291         err = KErrNotFound;
       
   292         }
       
   293     addrArray.Close();
       
   294     if( err && err != KErrInUse )
       
   295         {
       
   296             // No connections, or something went wrong; just clean up 
       
   297             // and inform our client.
       
   298         HandleDisconnectAllCompleteL( err );
       
   299         }
       
   300     TRACE_FUNC_EXIT
       
   301     }
       
   302 
   269 
   303 
   270 // ---------------------------------------------------------------------------
   304 // ---------------------------------------------------------------------------
   271 // Request to disconnect all Bluetooth baseband connections.
   305 // Request to disconnect all Bluetooth baseband connections.
   272 // ---------------------------------------------------------------------------
   306 // ---------------------------------------------------------------------------
   273 //
   307 //
   343             // First subscribe again, so that we don't miss any updates.
   377             // First subscribe again, so that we don't miss any updates.
   344             Subscribe();
   378             Subscribe();
   345         }
   379         }
   346     (void) ManageTopology( EFalse );    // Ignore result; nothing to do 
   380     (void) ManageTopology( EFalse );    // Ignore result; nothing to do 
   347                                         // about it here.
   381                                         // about it here.
       
   382     if( aId == KBTEngSrvBBConnId )
       
   383         {
       
   384         TRACE_INFO( ( _L( "[BTENG] PHY count key changed, update UI connection status" ) ) )
       
   385         iServer->SettingsManager()->SetUiIndicatorsL();
       
   386         }    
   348     TRACE_FUNC_EXIT
   387     TRACE_FUNC_EXIT
   349     }
   388     }
   350 
   389 
   351 
   390 
   352 // ---------------------------------------------------------------------------
   391 // ---------------------------------------------------------------------------