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". |
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() |