bluetoothmgmt/bluetoothclientlib/btlib/btbaseband.cpp
changeset 33 4e80e1b997a8
parent 0 29b1cd4cb562
--- a/bluetoothmgmt/bluetoothclientlib/btlib/btbaseband.cpp	Mon May 03 13:34:38 2010 +0300
+++ b/bluetoothmgmt/bluetoothclientlib/btlib/btbaseband.cpp	Mon Jul 12 07:03:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,6 +18,7 @@
 #include <bt_sock.h>
 #include <bluetooth/hci/hcierrors.h>
 #include <bluetooth/aclsockaddr.h>
+#include <bluetooth/hci/aclpacketconsts.h>
 #include "btsocketpanic.h"
 
 //.................................
@@ -529,14 +530,7 @@
 		}	
 	}
 
-void RBTBaseband::TerminateAllPhysicalLinks(TInt aReason)
-	{
-	TRequestStatus stat;
-	TerminateAllPhysicalLinks(aReason, stat);
-	User::WaitForRequest(stat);
-	}
-
-void RBTBaseband::TerminateAllPhysicalLinks(TInt /*aReason*/, TRequestStatus& aStatus)
+void RBTBaseband::TerminateAllPhysicalLinks(TRequestStatus& aStatus)
 	{
 	if (!SubSessionHandle())
 		{
@@ -549,6 +543,20 @@
 		}
 	}
 
+void RBTBaseband::TerminateAllPhysicalLinksForPowerOff(TRequestStatus& aStatus)
+	{
+	if (!SubSessionHandle())
+		{
+		LocalComplete(aStatus, KErrNotReady);
+		}
+	else
+		{
+		TBuf8<1> dummy;
+		iSocket.Shutdown(RSocket::ENormal, KDisconnectAllPhysicalLinksForPowerOff, dummy, aStatus); // this *means* detach now
+		}
+	}
+
+
 TInt RBTBaseband::Enumerate(RBTDevAddrArray& aBTDevAddrArray, TUint aMaxNumber)
 	{
 	if (!SubSessionHandle())