bluetooth/btstack/linkmgr/ProxySAP.cpp
changeset 33 4e80e1b997a8
parent 0 29b1cd4cb562
equal deleted inserted replaced
19:4b81101308c6 33:4e80e1b997a8
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    24 #include "Basebandmodel.h"
    24 #include "Basebandmodel.h"
    25 #include "BTSec.h"
    25 #include "BTSec.h"
    26 #include "linkmgr.h"
    26 #include "linkmgr.h"
    27 
    27 
    28 #include <bluetooth/hci/aclpacketconsts.h>
    28 #include <bluetooth/hci/aclpacketconsts.h>
       
    29 #include <bluetooth/hci/hciconsts.h>
    29 
    30 
    30 #ifdef __FLOG_ACTIVE
    31 #ifdef __FLOG_ACTIVE
    31 _LIT8(KLogComponent, LOG_COMPONENT_LINKMGR);
    32 _LIT8(KLogComponent, LOG_COMPONENT_LINKMGR);
    32 #endif
    33 #endif
    33 
    34 
   550 					{
   551 					{
   551 					rerr = KErrArgument;
   552 					rerr = KErrArgument;
   552 					}
   553 					}
   553 				else
   554 				else
   554 					{
   555 					{
   555 					iRequestedActiveMode = option ? ETrue : EFalse;
   556 					iRequestedActiveMode = option;
   556 					if(iRequestedActiveMode)
   557 					if(iRequestedActiveMode)
   557 						{
   558 						{
   558 						localPriority = ETrue;
   559 						localPriority = ETrue;
   559 						}
   560 						}
   560 					}
   561 					}
   764 			if(iSocket)
   765 			if(iSocket)
   765 				iSocket->Error(rerr, MSocketNotify::EErrorClose);
   766 				iSocket->Error(rerr, MSocketNotify::EErrorClose);
   766 			return;
   767 			return;
   767 			}										
   768 			}										
   768 
   769 
   769 		if (aDisconnectOption == KDisconnectAllPhysicalLinks)
   770 		if (aDisconnectOption == KDisconnectAllPhysicalLinks || aDisconnectOption == KDisconnectAllPhysicalLinksForPowerOff)
   770 			{
   771 			{
   771 			// Disconnecting All BT Physical Links
   772 			// Disconnecting All BT Physical Links
   772 			// Only support link *termination*, this is done as normal cos esock weirdness
   773 			// Only support link *termination*, this is done as normal cos esock weirdness
   773 			__ASSERT_ALWAYS(aCloseType == CServProviderBase::ENormal, Panic(EBTProxySAPInvalidTerminate));
   774 			__ASSERT_ALWAYS(aCloseType == CServProviderBase::ENormal, Panic(EBTProxySAPInvalidTerminate));
   774 			rerr = iLinksMan.TerminateAllPhysicalLinks(this);
   775 			rerr = iLinksMan.TerminateAllPhysicalLinks(this, aDisconnectOption == KDisconnectAllPhysicalLinksForPowerOff ? ERemoteAboutToPowerOff : ERemoteUserEndedConnection);
   775 			LOG2(_L("Proxy SAP 0x%08x -- Terminating all PHY Links, error: %d"), this, rerr);
   776 			LOG2(_L("Proxy SAP 0x%08x -- Terminating all PHY Links, error: %d"), this, rerr);
   776 			
   777 			
   777 			// If there was an error terminating any of the physical links then we can 
   778 			// If there was an error terminating any of the physical links then we can 
   778 			// call CanClose straight away, otherwise this is done when iLinksMan calls
   779 			// call CanClose straight away, otherwise this is done when iLinksMan calls
   779 			// TerminatePhysicalLinksComplete()
   780 			// TerminatePhysicalLinksComplete()